"from PartProp.Nodes import CC" ] _selPions2 = Selection("SelFilterPions2", Algorithm = _filter2, RequiredSelections = [_pions2]) _seqPions2 = SelectionSequence("SeqFilterPions2", TopSelection = _selPions2) ####################################################################### # # Decay Tree tuple # from Configurables import DecayTreeTuple decaytuple = DecayTreeTuple("OriginalPionsTuple") decaytuple.InputLocations = [_seqPions.outputLocation() ] decaytuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolTrackInfo" , "TupleToolPid" ] decaytuple.Decay = "[pi+]cc" decaytuple2 = DecayTreeTuple("SmearedPionsTuple") decaytuple2.InputLocations = [_seqPions2.outputLocation() ] decaytuple2.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolTrackInfo" , "TupleToolPid"
_muons2 = DataOnDemand(Location='Phys/SmrdLooseMuons') _filtermuons2 = FilterDesktop("filterMuons2", Code = "TRCHI2DOF<4") _selMuons2 = Selection("SelFilterMuons2", Algorithm = _filtermuons, RequiredSelections = [_muons]) _seqMuons2 = SelectionSequence("SeqFilterMuons2", TopSelection = _selMuons2) ####################################################################### # # Decay Tree tuple # from Configurables import DecayTreeTuple decaytuple = DecayTreeTuple("OriginalPionsTuple") decaytuple.InputLocations = [_seqPions.outputLocation() ] decaytuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolTrackInfo" , "TupleToolPid" ] decaytuple.Decay = "[pi+]cc" from Configurables import TupleToolTrigger decaytuple.addTool( TupleToolTrigger, name='TupleToolTrigger' ) decaytuple.TupleToolTrigger.Verbose = True decaytuple.TupleToolTrigger.UseAutomaticTriggerList = False decaytuple.TupleToolTrigger.TriggerList =[ "Hlt1MBNoBiasDecision", "Hlt1MBMicroBiasRZVeloDecision", "Hlt1MBMicroBiasTStationDecision",
SelSeqJPsi = SelectionSequence("SeqJPsi", TopSelection=jPsiNBSel) SelSeqMuMu = SelectionSequence("SeqMuMu", TopSelection=mumuNBSel) SelSeqMuMuAll = SelectionSequence("SeqMuMuAll", TopSelection=mumuSel) SeqJPsi = SelSeqJPsi.sequence() SeqMuMu = SelSeqMuMu.sequence() SeqMuMuAll = SelSeqMuMuAll.sequence() ######################################################################## # # NTupling # from Configurables import DecayTreeTuple tupleMuMu = DecayTreeTuple("tupleMuMu") tupleMuMu.InputLocations = [SelSeqMuMu.outputLocation()] tupleMuMu.Decay = "J/psi(1S) -> ^mu+ ^mu-" tupleMuMu.ToolList += [ "TupleToolGeometry", "TupleToolKinematic", "TupleToolPrimaries", "TupleToolTrackInfo", "TupleToolPid", "TupleToolEventInfo", "TupleToolPropertime", "LoKi::Hybrid::TupleTool/LoKiTupleMuMu" ] from Configurables import LoKi__Hybrid__TupleTool LoKiTupleMuMu = LoKi__Hybrid__TupleTool("LoKiTupleMuMu") LoKiTupleMuMu.Variables = { "Charge": "Q", "DOCA": "DOCA(1,2)", "DOCAMAX": "DOCAMAX", "NetOut": "INFO(LHCb.Particle.LastGlobal+1, -999)", "NetProb": "INFO(LHCb.Particle.LastGlobal+2, -999)"
noPIDsKaons = DataOnDemand(Location = 'Phys/StdNoPIDsKaons') BhhSel = Selection("BhhSel" , Algorithm = Bhh , RequiredSelections = [noPIDsKaons]) BhhNBSel = Selection("BhhNBSel" , Algorithm = BhhNB , RequiredSelections = [ BhhSel ] ) SelSeqBhh = SelectionSequence("SeqBhh" , TopSelection = BhhNBSel) SeqBhh = SelSeqBhh.sequence() ######################################################################## # # NTupling # from Configurables import DecayTreeTuple tupleBhh = DecayTreeTuple("tupleBhh") tupleBhh.InputLocations = [SelSeqBhh.outputLocation()] tupleBhh.Decay = "B_s0 -> K+ K-" tupleBhh.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolTrackInfo" , "TupleToolPid" , "TupleToolEventInfo" , "TupleToolPropertime" ,"LoKi::Hybrid::TupleTool/LoKiTupleBhh" ] from Configurables import LoKi__Hybrid__TupleTool LoKiTupleBhh = LoKi__Hybrid__TupleTool("LoKiTupleBhh") LoKiTupleBhh.Variables = { "Charge" : "Q" ,
"MCTupleToolKinematic", "TupleToolEventInfo", "MCTupleToolReconstructed", "MCTupleToolAngles" ] #mcTuple.OutputLevel = 1 ######################################################################## # # The reconstructed tuple # from Configurables import DecayTreeTuple tuple = DecayTreeTuple("Tuple") tuple.ToolList += [ "TupleToolMCTruth", "TupleToolMCBackgroundInfo", "TupleToolAngles", "TupleToolPrimaries", "TupleToolGeometry", "TupleToolKinematic", "TupleToolEventInfo", "TupleToolTrackInfo" ] tuple.InputLocations = ["StdLooseKsLL", "StdLooseKsDD"] tuple.Decay = "[KS0 -> ^pi+ ^pi-]cc" ######################################################################## # # DaVinci # from Configurables import DaVinci DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100 DaVinci().SkipEvents = 0 DaVinci().DataType = "2008" # Default is "DC06" DaVinci().Simulation = True DaVinci().TupleFile = "test.root" # Ntuple DaVinci().UserAlgorithms = [] DaVinci().MoniSequence = [mcTuple, tuple]
def disableLFC(): COOLConfSvc(UseLFCReplicaSvc = False) appendPostConfigAction(disableLFC) LoKiTool = LoKi__Hybrid__TupleTool('LoKiTool') preseltuple = DecayTreeTuple("TuplePreSelB2HH") preseltuple.InputLocations = [ "/Event/Bhadron/Phys/PreselB2Charged2Body" ] preseltuple.ToolList += [ "TupleToolKinematic" ,"TupleToolGeometry" ,"TupleToolPid" ,"TupleToolPrimaries" ,"TupleToolPropertime" ,"TupleToolTrackInfo" ,"TupleToolEventInfo"
def ConfigureTuples(): from JetAccessoriesMC.ConfigurationHelpers import ConfigureDoD tables = ConfigureDoD() from Configurables import TupleToolJetRelations, DecayTreeTuple HepMCAllJetTuple = DecayTreeTuple("HepMCAllJetTuple") HepMCAllJetTuple.InputLocations = ['Phys/StdHepMCAllJets/Particles'] HepMCAllJetTuple.Decay = "CELLjet" HepMCAllJetTuple.ToolList = [ 'TupleToolKinematic', 'TupleToolEventInfo', 'LoKi__Hybrid__TupleTool/LoKiTool' ] from JetAccessoriesMC.ConfigurationHelpers import addRelationTuple addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJetsPartonic'], InvertTable=True, ReverseMatching=True) addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJetsPartonic'], InvertTable=True, ReverseMatching=False) addRelationTuple(HepMCAllJetTuple, tables['StdHepMCJets2StdJetsDeltaR'], InvertTable=False, ReverseMatching=True, extraName='DeltaR') addRelationTuple(HepMCAllJetTuple, tables['StdHepMCJets2StdJetsDeltaR'], InvertTable=False, ReverseMatching=False, extraName='DeltaR') addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJets2StdJetsmeasured'], InvertTable=False, ReverseMatching=True) addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJets2StdJetsmeasured'], InvertTable=False, ReverseMatching=False) addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJets2StdJetsMCtrue'], InvertTable=False, ReverseMatching=True) addRelationTuple(HepMCAllJetTuple, tables['StdHepMCAllJets2StdJetsMCtrue'], InvertTable=False, ReverseMatching=False) from Configurables import LoKi__Hybrid__TupleTool LoKiTool = LoKi__Hybrid__TupleTool('LoKiTool') LoKiTool.Variables = {"ETA": "ETA", "PHI": "PHI", "Y": "Y"} HepMCAllJetTuple.addTool(LoKiTool) DaVinci().UserAlgorithms += [HepMCAllJetTuple] HepMCJetTuple = DecayTreeTuple("HepMCJetTuple") #,OutputLevel = VERBOSE) HepMCJetTuple.InputLocations = ['Phys/StdHepMCJets/Particles'] HepMCJetTuple.Decay = "CELLjet" HepMCJetTuple.ToolList = [ 'TupleToolKinematic', 'TupleToolEventInfo', 'LoKi__Hybrid__TupleTool/LoKiTool' ] addRelationTuple(HepMCJetTuple, tables['StdHepMCJets2StdJetsmeasured'], InvertTable=False, ReverseMatching=True, extraName='Measured') HepMCJetTuple.StdHepMCJets2StdJetsRevMeasured.ExtraWeights = { 'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable, 'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable } addRelationTuple(HepMCJetTuple, tables['StdHepMCJets2StdJetsMCtrue'], InvertTable=False, ReverseMatching=True, extraName='MCtrue') HepMCJetTuple.StdHepMCJets2StdJetsRevMCtrue.ExtraWeights = { 'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable, 'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable } addRelationTuple(HepMCJetTuple, tables['StdHepMCJets2StdJetsDeltaR'], InvertTable=False, ReverseMatching=False, extraName='DeltaR') HepMCJetTuple.StdHepMCJets2StdJetsDeltaR.ExtraWeights = { 'OverlapMeasured': tables['StdHepMCJets2StdJetsmeasured'].OutputTable, 'OverlapMCtrue': tables['StdHepMCJets2StdJetsMCtrue'].OutputTable } HepMCJetTuple.addTool(LoKiTool) DaVinci().UserAlgorithms += [HepMCJetTuple]
import GaudiKernel.SystemOfUnits as Units ############################################ from Configurables import OdinTimeDecoder, EventClockSvc #################################### # import predefined sequences as options file importOptions("$STDOPTS/PreloadUnits.opts") importOptions("$STDOPTS/LHCbApplication.opts") ############################################################# from MicroDSTExample.Selections import SeqBs2Jpsi2MuMuPhi2KK selSequence = SeqBs2Jpsi2MuMuPhi2KK.SeqBs2Jpsi2MuMuPhi2KK location = selSequence.outputLocation() from Configurables import DecayTreeTuple tuple = DecayTreeTuple("MyDTT") tuple.InputLocations = [location] tuple.ToolList += [ "TupleToolMCTruth", "TupleToolGeometry", "TupleToolKinematic", "TupleToolPropertime", "TupleToolPrimaries", "TupleToolEventInfo", "TupleToolTrackInfo", "TupleToolTagging" ] tuple.Decay = "[B_s0 -> (^J/psi(1S) => ^mu+ ^mu-) (^phi(1020) -> ^K+ ^K-)]cc" # need to configure TupleMCTruth's MC association tool from Configurables import TupleToolMCTruth tuple.addTool(TupleToolMCTruth) from Configurables import MCMatchObjP2MCRelator tuple.TupleToolMCTruth.IP2MCPAssociatorType = 'MCMatchObjP2MCRelator' tuple.TupleToolMCTruth.addTool(MCMatchObjP2MCRelator, name="IP2MCPAssociatorType") tuple.TupleToolMCTruth.IP2MCPAssociatorType.RelTableLocations = [ location + '/P2MCPRelations'