def makeDecayTreeTuple( location, decay, alg_name, tuple_name ): tuple = DecayTreeTuple( alg_name ) dectype = alg_name[-2:] #triggerList = list(l0hlt1List) #if 'KK' == dectype: # for trigger in hlt2List_KK: # triggerList.append( trigger + 'Decision') #elif 'Pi' == dectype: # for trigger in hlt2List_Pi: # triggerList.append( trigger + 'Decision') #elif 'RS' == dectype or 'WS' == dectype: # for trigger in hlt2List_KPi: # triggerList.append( trigger + 'Decision') print alg_name, triggerList #tuple = DecayTreeTuple('TupleKK') tuple.ToolList = [ "TupleToolPropertime", "TupleToolKinematic", #"TupleToolPropertime/MyPropertimeTool", "TupleToolGeometry", "TupleToolEventInfo", "TupleToolPrimaries", "TupleToolTISTOS", #"TupleToolTrigger", "TupleToolPid", "TupleToolTrackInfo", "TupleToolRecoStats", #"TupleToolGeneration" ] #tuple.addTool( TupleToolPropertime( name="MyPropertimeTool" ) ) #tuple.MyPropertimeTool.ToolName = "PropertimeFitter/MyPropertimeFitter" #tuple.MyPropertimeTool.ExtraName = "MassConstraint" #tuple.MyPropertimeTool.addTool( PropertimeFitter( name = "MyPropertimeFitter" ) ) #tuple.MyPropertimeTool.MyPropertimeFitter.applyBMassConstraint = True tuple.Inputs = [ location ]#_strippingOutput] #tuple.InputLocations = [ location ]#_strippingOutput] tuple.Decay = decay #tuple.Decay = "[D0 -> ^K- ^pi+]CC" tuple.TupleName = tuple_name #tuple.TupleName = "D0KKTuple" tuple.addTool( TupleToolPropertime() ) tuple.TupleToolPropertime.FitToPV = True #tuple.addTool( TupleToolTrigger() ) #tuple.TupleToolTrigger.TriggerList = triggerList #tuple.TupleToolTrigger.VerboseL0 = True #tuple.TupleToolTrigger.VerboseHlt1 = True #tuple.TupleToolTrigger.VerboseHlt2 = True #tuple.TupleToolTrigger.Verbose = True tuple.addTool( TupleToolTISTOS() ) tuple.TupleToolTISTOS.VerboseL0 = True tuple.TupleToolTISTOS.VerboseHlt1 = True tuple.TupleToolTISTOS.VerboseHlt2 = True tuple.TupleToolTISTOS.Verbose = True tuple.TupleToolTISTOS.TriggerList = triggerList return tuple
"TupleToolAngles", "TupleToolANNPID", "TupleToolMCBackgroundInfo", "TupleToolMCTruth", "TupleToolTrigger", "TupleToolDira", "TupleToolEventInfo", "TupleToolPropertime", "TupleToolRecoStats", ] #Calc Related Info Variables: coneIso = tuple.addTupleTool("TupleToolTrackIsolation") tuple.addTool(TupleToolDecay, name = 'B') # gregs isolation from Configurables import TupleToolApplyIsolation tuple.B.addTupleTool(TupleToolApplyIsolation, name="TupleToolApplyIsolationHard") tuple.B.TupleToolApplyIsolationHard.OutputSuffix="_Hard" tuple.B.TupleToolApplyIsolationHard.WeightsFile="/afs/cern.ch/user/m/mboubdir/scratch1/tools/Analysisfiles/python_files/weights_110614_Lc_pX.xml" tuple.B.ToolList+=["TupleToolApplyIsolation/TupleToolApplyIsolationHard"] trigger_list = [ 'L0MuonDecision' ,'L0DiMuonDecision' ,'Hlt1TrackAllL0Decision' ,'Hlt1TrackMuonDecision' ,'Hlt2TopoMu2BodyBBDTDecision'
# # 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", ] decaytuple.ToolList += [ "TupleToolTrigger" ] decaytuple4 = DecayTreeTuple("OriginalKaonsTuple") decaytuple4.InputLocations = [_seqKaons.outputLocation() ] decaytuple4.ToolList += [ "TupleToolGeometry"
, "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTrigger" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolVtxIsoln" , "TupleToolTrackIsolation" , "TupleToolTrigger" , "TupleToolTISTOS" , "TupleToolEventInfo" , "TupleToolRecoStats" ] # Configure the TupleToolTISTOS (this controls how much trigger information goes into the ntuple) tuple.addTool(TupleToolTISTOS("TupleToolTISTOS")) tuple.TupleToolTISTOS.OutputLevel = 3 tuple.TupleToolTISTOS.VerboseL0 = 1 tuple.TupleToolTISTOS.VerboseHlt1 = 1 tuple.TupleToolTISTOS.VerboseHlt2 = 1 tuple.TupleToolTISTOS.TriggerList=[ #page 51 (and 97 for e) 'L0DiMuonDecision' ,'L0MuonDecision' ,'L0MuonHighDecision' ,'Hlt1DiMuonHighMassDecision' ,'Hlt1DiMuonLowMassDecision' ,'Hlt1SingleMuonHighPTDecision'
tuple.ToolList += [ "TupleToolEventInfo" , "TupleToolGeneration" , "TupleToolMCTruth" , "TupleToolMCBackgroundInfo" , "TupleToolPrimaries" , "TupleToolTrackInfo" , "TupleToolPid" , "TupleToolGeometry" , "TupleToolKinematic" # , "TupleToolMuonVariables" , "TupleToolPropertime" , "LoKi::Hybrid::TupleTool/LoKiTool" , "TupleToolMuonIso_LC" , "TupleToolEventInfo" ] tuple.addTool( TupleToolTrigger, name='TupleToolTrigger' ) tuple.TupleToolTrigger.Verbose = True tuple.TupleToolTrigger.TriggerList = trigger_list tuple.addTool( TupleToolTISTOS, name='TupleToolTISTOS' ) tuple.TupleToolTISTOS.Verbose = True tuple.TupleToolTISTOS.TriggerList = trigger_list tuple.ToolList += [ "TupleToolTISTOS" ] #######################################33333 ## Tuple for wrong sign
, "TupleToolPid" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTrigger" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolVtxIsoln" , "TupleToolTrackIsolation" , "TupleToolTrigger" , "TupleToolTISTOS" , "TupleToolEventInfo" , "TupleToolRecoStats" ] tuple.addTool(TupleToolTISTOS("TupleToolTISTOS")) tuple.TupleToolTISTOS.OutputLevel = 3 tuple.TupleToolTISTOS.VerboseL0 = 1 tuple.TupleToolTISTOS.VerboseHlt1 = 1 tuple.TupleToolTISTOS.VerboseHlt2 = 1 tuple.TupleToolTISTOS.TriggerList=[ # the list of triggers # page 51 (and 97 for e) 'L0DiMuonDecision' ,'L0MuonDecision' ,'L0MuonHighDecision' ,'Hlt1DiMuonHighMassDecision' ,'Hlt1DiMuonLowMassDecision'
tupleB.Jpsi.ToolList += [ "TupleToolTISTOS" ] tupleB.Jpsi.addTool( TupleToolTISTOS, name = "TupleToolTISTOS" ) tupleB.Jpsi.TupleToolTISTOS.Verbose = True tupleB.Jpsi.TupleToolTISTOS.TriggerList =TriggerListL0 tupleB.Jpsi.TupleToolTISTOS.TriggerList += TriggerListHlt tupleB.Jpsi.TupleToolTISTOS.Verbose = True tupleB.Jpsi.TupleToolTISTOS.VerboseL0= True tupleB.Jpsi.TupleToolTISTOS.VerboseHlt1= True tupleB.Jpsi.TupleToolTISTOS.VerboseHlt2= True tupleB.addTool(TupleToolTrackInfo, name = "TupleToolTrackInfo") tupleB.TupleToolTrackInfo.Verbose=True tupleB.addTool(TupleToolRICHPid, name="TupleToolRICHPid") tupleB.TupleToolRICHPid.Verbose=True tupleB.addTool(TupleToolRecoStats, name="TupleToolRecoStats") tupleB.TupleToolRecoStats.Verbose=True tupleB.addTool(TupleToolGeometry, name="TupleToolGeometry") tupleB.TupleToolGeometry.Verbose=True tupleB.addTool(TupleToolPid, name="TupleToolPid") tupleB.TupleToolPid.Verbose=True tupleB.addTool(TupleToolANNPID, name = "TupleToolANNPID") tupleB.TupleToolANNPID.ANNPIDTunes = ['MC12TuneV2', 'MC12TuneV3', "MC12TuneV4"] tupleB.Bplus.addTupleTool( 'TupleToolSubMass' )
tupleB.Bplus.TupleToolTISTOS.Verbose = True tupleB.Bplus.TupleToolTISTOS.VerboseL0 = True tupleB.Bplus.TupleToolTISTOS.VerboseHlt1 = True tupleB.Bplus.TupleToolTISTOS.VerboseHlt2 = True tupleB.Jpsi.ToolList += ["TupleToolTISTOS"] tupleB.Jpsi.addTool(TupleToolTISTOS, name="TupleToolTISTOS") tupleB.Jpsi.TupleToolTISTOS.Verbose = True tupleB.Jpsi.TupleToolTISTOS.TriggerList = list tupleB.Jpsi.TupleToolTISTOS.Verbose = True tupleB.Jpsi.TupleToolTISTOS.VerboseL0 = True tupleB.Jpsi.TupleToolTISTOS.VerboseHlt1 = True tupleB.Jpsi.TupleToolTISTOS.VerboseHlt2 = True tupleB.addTool(TupleToolTrackInfo, name="TupleToolTrackInfo") tupleB.TupleToolTrackInfo.Verbose = True tupleB.addTool(TupleToolRICHPid, name="TupleToolRICHPid") tupleB.TupleToolRICHPid.Verbose = True tupleB.addTool(TupleToolRecoStats, name="TupleToolRecoStats") tupleB.TupleToolRecoStats.Verbose = True tupleB.addTool(TupleToolGeometry, name="TupleToolGeometry") tupleB.TupleToolGeometry.Verbose = True tupleB.addTool(TupleToolPid, name="TupleToolPid") tupleB.TupleToolPid.Verbose = True tupleB.addTool(TupleToolANNPID, name="TupleToolANNPID") tupleB.TupleToolANNPID.ANNPIDTunes = ['MC12TuneV2', 'MC12TuneV3'] dstWriter = SelDSTWriter('BuKmumuDSTWriter', SelectionSequences=sc.activeStreams(),
TupleSeq = GaudiSequencer('TupleSeq') ################################################################################################ BuTuple = DecayTreeTuple("BuTuple") BuTuple.ToolList += [ "TupleToolTrigger", "TupleToolGeometry", "TupleToolKinematic", "TupleToolPropertime", "TupleToolPrimaries", "TupleToolTagging", "TupleToolEventInfo", "TupleToolTrackInfo", "TupleToolRecoStats", "TupleToolTrackPosition" ] BuTuple.Inputs = [BuPartVtxlocation] # BuTuple.Decay = Budecaydcr BuTuple.ReFitPVs = True TupleToolTrackPosition = TupleToolTrackPosition('TupleToolTrackPosition') TupleToolTrackPosition.Z = 7500. BuTuple.addTool(TupleToolTrackPosition) TupleToolRecoStats = TupleToolRecoStats('TupleToolRecoStats') TupleToolRecoStats.Verbose = True BuTuple.addTool(TupleToolRecoStats) LoKiVariables = LoKi__Hybrid__TupleTool('LoKiVariables') LoKiVariables.Variables = { "LOKI_ENERGY": "E", "LOKI_ETA": "ETA", "LOKI_PHI": "PHI", } BuTuple.addTool(LoKiVariables, name='LoKiVariables') BuTuple.ToolList += ['LoKi::Hybrid::TupleTool/LoKiVariables']
## input particles from selection: Inputs=[particlePath], ## Primary vertices from mDST P2PVInputLocations=[p2PVLocation], UseP2PVRelations=True, WriteP2PVRelations=False, ) dtt.Decay = "[D*(2010)+ -> (^D0 -> ^K- ^pi+) ^pi+]cc" if mDST: dtt.RootInTES = locationRoot from DecayTreeTuple.Configuration import * ## Add appropriate tools from Configurables import TupleToolDecay dtt.addTool(TupleToolDecay, name='D0') dtt.Branches = {"D0": "[D*(2010)+ -> (^D0 -> K- pi+) pi+]cc"} ttptime = dtt.D0.addTupleTool('TupleToolPropertime') ttptime.FitToPV = True ttsi = dtt.D0.addTupleTool('TupleToolSwimmingInfo/TriggerInfo') ttsis = dtt.D0.addTupleTool('TupleToolSwimmingInfo/StrippingInfo') ttsi.ReportsLocation = D0path + '/P2TPRelations' ttsis.ReportsLocation = D0path + '/P2TPRelations' ttsis.ReportStage = "Stripping" ttsi.OutputLevel = 1 ttsis.OutputLevel = 1 tttt = dtt.D0.addTupleTool('TupleToolTISTOS') tttt.TriggerList = [ 'Hlt1TrackAllL0Decision', 'Hlt1TrackMuonDecision',
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]
tlist = [ "L0HadronDecision", "L0MuonDecision", "L0DiMuonDecision", "L0ElectronDecision", "L0PhotonDecision", "Hlt1DiMuonHighMassDecision", "Hlt1DiMuonLowMassDecision", "Hlt1TrackMuonDecision", "Hlt1TrackAllL0Decision", "Hlt2DiMuonJPsiDecision", "Hlt2SingleMuonDecision", ] tuple.Decay = "J/psi(1S) -> mu- mu+" tuple.addTool(TupleToolTrigger, name="TupleToolTrigger") tuple.addTool(TupleToolTISTOS, name="TupleToolTISTOS") # Get trigger info tuple.TupleToolTrigger.Verbose = True tuple.TupleToolTrigger.TriggerList = tlist tuple.TupleToolTISTOS.Verbose = True tuple.TupleToolTISTOS.TriggerList = tlist #from TeslaTools import TeslaTruthUtils #seq = TeslaTruthUtils.associateSequence("Tesla",False) #relations = TeslaTruthUtils.getRelLoc("Tesla") #TeslaTruthUtils.makeTruth(tuple, relations, [ "MCTupleToolKinematic" , "MCTupleToolHierarchy" , "MCTupleToolPID" ]) # Necessary DaVinci parameters ################# DaVinci().Simulation = True DaVinci().SkipEvents = 0
from Gaudi.Configuration import * from GaudiKernel.SystemOfUnits import * ##################################################################### # # Define template tuple # ###################################################################### from Configurables import DecayTreeTuple TupTmp = DecayTreeTuple() ###################################################################### from Configurables import TupleToolDecay TupTmp.addTool( TupleToolDecay, name = "B" ) TupTmp.addTool( TupleToolDecay, name = "H" ) TupTmp.addTool( TupleToolDecay, name = "K" ) TupTmp.addTool( TupleToolDecay, name = "mu" ) TupTmp.addTool( TupleToolDecay, name = "tau" ) TupTmp.addTool( TupleToolDecay, name = "pi1" ) TupTmp.addTool( TupleToolDecay, name = "pi2" ) TupTmp.addTool( TupleToolDecay, name = "pi3" ) ###################################################################### TupTmp.ToolList += [ "TupleToolEventInfo", "TupleToolANNPID", "TupleToolAngles", #"TupleToolBremInfo", "TupleToolGeometry", "TupleToolKinematic", "TupleToolPid",
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' ] seq = GaudiSequencer("TupleSeq", Members=[tuple], RootInTES="/Event/MicroDST/") seq.OutputLevel = 1 dv = DaVinci() dv.EvtMax = -1 dv.DataType = "MC09" dv.HistogramFile = "DVHistos_DTT.root"
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)" } tupleMuMu.addTool(LoKiTupleMuMu) ######################################################################## # # DaVinci # from Configurables import CondDB CondDB().IgnoreHeartBeat = True #CondDB(UseOracle = True) #importOptions("$APPCONFIGOPTS/DisableLFC.py") # Remove the microbias and beam gas etc events before doing the tagging step regexp = "HLT_PASS_RE('Hlt1(?!ODIN)(?!L0)(?!Lumi)(?!Tell1)(?!MB)(?!NZS)(?!Velo)(?!BeamGas)(?!Incident).*Decision')" from Configurables import LoKi__HDRFilter
, "TupleToolTrackInfo" , "TupleToolPid" , "TupleToolEventInfo" , "TupleToolPropertime" ,"LoKi::Hybrid::TupleTool/LoKiTupleBhh" ] from Configurables import LoKi__Hybrid__TupleTool LoKiTupleBhh = LoKi__Hybrid__TupleTool("LoKiTupleBhh") LoKiTupleBhh.Variables = { "Charge" : "Q" , "DOCA" : "DOCA(1,2)", "DOCAMAX" : "DOCAMAX", "NetOut" : "INFO(LHCb.Particle.LastGlobal+1, -999)", "NetProb" : "INFO(LHCb.Particle.LastGlobal+2, -999)" } tupleBhh.addTool(LoKiTupleBhh) ######################################################################## # # DaVinci # from Configurables import CondDB CondDB().IgnoreHeartBeat = True #CondDB(UseOracle = True) #importOptions("$APPCONFIGOPTS/DisableLFC.py") # Remove the microbias and beam gas etc events before doing the tagging step regexp = "HLT_PASS_RE('Hlt1(?!ODIN)(?!L0)(?!Lumi)(?!Tell1)(?!MB)(?!NZS)(?!Velo)(?!BeamGas)(?!Incident).*Decision')" from Configurables import LoKi__HDRFilter
tupleB.Lb.addTool(TupleToolApplyIsolationMC, name="TupleToolApplyIsolationMC") tupleB.Lb.TupleToolApplyIsolationMC.WeightsFile = "weights.xml" tupleB.Lb.ToolList += ["TupleToolApplyIsolationMC/TupleToolApplyIsolationMC"] #************************************* #TupleTool for Lc lifetime #************************************* tupleB.Lc.ToolList += ["TupleToolPropertime"] #************************************* #TupleTool to save history of particles #************************************* #tupleB.TupleToolMCTruth.ToolList += ["MCTupleToolHierarchy","MCTupleToolHierarchy"] MCTruth = TupleToolMCTruth() MCTruth.ToolList += ["MCTupleToolHierarchy", "MCTupleToolKinematic"] tupleB.addTool(MCTruth) ############################################################ # Hlt1 Emulation ############################################################ from MVADictHelpers import addMatrixnetclassifierTuple branch = tupleB.Lb #branch = tupleB.Lc addMatrixnetclassifierTuple( branch, "$PARAMFILESROOT/../v8r27p1/data/Hlt1TwoTrackMVA.mx", getVars(1, 2), "HLt1TwoTrackMVAEmulations_1_2", True) addMatrixnetclassifierTuple( branch, "$PARAMFILESROOT/../v8r27p1/data/Hlt1TwoTrackMVA.mx", getVars(1, 3), "HLt1TwoTrackMVAEmulations_1_3", True) addMatrixnetclassifierTuple(
def __apply_configuration__(self): from Configurables import (GaudiSequencer, CombineParticles, OfflineVertexFitter) from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand seq = self.getProp("Sequencer") if seq == None: raise RuntimeError("ERROR : Sequence not set") if self.getProp("RunSelection"): # STD particles from StandardParticles import StdNoPIDsPions, StdNoPIDsKaons # phi -> K+ K- Phi2KKName = self.__sel_name__ + "_Phi2KK" Phi2KK = CombineParticles(Phi2KKName) Phi2KK.DecayDescriptor = "phi(1020) -> K+ K-" Phi2KK.CombinationCut = "(ADAMASS('phi(1020)')<75*MeV)" Phi2KK.MotherCut = "(ADMASS('phi(1020)')<50*MeV) & (BPVVDCHI2>60) & (MIPDV(PRIMARY)<0.5) & (VFASPF(VCHI2) < 20)" Phi2KK.DaughtersCuts = { "K+": "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) < 0.5) & (BPVIPCHI2() > 20)", "K-": "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) < 0.5) & (BPVIPCHI2() > 20)" } self.setOptions(Phi2KK) Phi2KKSel = Selection(Phi2KKName + 'Sel', Algorithm=Phi2KK, RequiredSelections=[StdNoPIDsKaons]) # Bs -> J/psi phi Ds2piPhiName = self.__sel_name__ Ds2piPhi = CombineParticles(Ds2piPhiName) Ds2piPhi.DecayDescriptor = "[D_s+ -> pi+ phi(1020)]cc" Ds2piPhi.addTool(OfflineVertexFitter) Ds2piPhi.ParticleCombiners.update({"": "OfflineVertexFitter"}) Ds2piPhi.OfflineVertexFitter.useResonanceVertex = True Ds2piPhi.CombinationCut = "(ADAMASS('D_s+')<75*MeV)" Ds2piPhi.MotherCut = "(ADMASS('D_s+')<50*MeV) & (BPVDIRA>0.9999) & (BPVVDCHI2>85) & (MIPDV(PRIMARY)<0.1) & (VFASPF(VCHI2) < 10)" Ds2piPhi.DaughtersCuts = { "pi+": "(PT>300*MeV) & (P>2*GeV) & (MIPDV(PRIMARY) >0.1) & (BPVIPCHI2() > 20)" } self.setOptions(Ds2piPhi) Ds2piPhiSel = Selection( Ds2piPhiName + 'Sel', Algorithm=Ds2piPhi, RequiredSelections=[Phi2KKSel, StdNoPIDsPions]) # Selection Sequence selSeq = SelectionSequence(self.__sel_name__ + 'Seq', TopSelection=Ds2piPhiSel) # Run the selection sequence. seq.Members += [selSeq.sequence()] # Particle Monitoring plots if self.getProp("RunMonitors"): from Configurables import ParticleMonitor plotter = ParticleMonitor(self.__sel_name__ + "Plots") if self.getProp("RunSelection"): plotter.Inputs = ['Phys/' + self.__sel_name__ + 'Sel'] else: plotter.Inputs = self.getProp("Candidates") plotter.PeakCut = "(ADMASS('D_s+')<100*MeV)" plotter.SideBandCut = "(ADMASS('D_s+')>100*MeV)" plotter.PlotTools = self.getProp("PlotTools") self.setOptions(plotter) seq.Members += [plotter] # Make a DST ? if self.getProp("MakeSelDST"): # Prescale from Configurables import DeterministicPrescaler scaler = DeterministicPrescaler( self.__sel_name__ + 'PreScale', AcceptFraction=self.getProp("DSTPreScaleFraction")) seq.Members += [scaler] # Write the DST MyDSTWriter = SelDSTWriter(self.__sel_name__ + "DST", SelectionSequences=[selSeq], OutputPrefix=self.__sel_name__) seq.Members += [MyDSTWriter.sequence()] # MC Performance checking ? if self.getProp("MCChecks"): from Configurables import ParticleEffPurMoni mcPerf = ParticleEffPurMoni(Ds2piPhiName + "MCPerf") mcPerf.Inputs = ['Phys/' + self.__sel_name__ + 'Sel'] self.setOptions(mcPerf) seq.Members += [mcPerf] # Ntuple ? if self.getProp("MakeNTuple"): outputLevel = INFO from Configurables import ( DecayTreeTuple, TupleToolDecay, TupleToolMCTruth, TupleToolMCBackgroundInfo, TupleToolGeometry, TupleToolKinematic, TupleToolPrimaries, TupleToolEventInfo, MCTupleToolHierarchy, MCTupleToolKinematic, TupleToolPid, TupleToolTrackInfo, TupleToolVtxIsoln, LoKi__Hybrid__TupleTool) Tuple = DecayTreeTuple(Ds2piPhiName + "Tuple") Tuple.Inputs = ["Phys/" + Ds2piPhiName] Tuple.Decay = "[D_s+ -> ^pi+ (^phi(1020) => ^K+ ^K-)]cc" Tuple.Branches = { "pion": "[D_s+ -> ^pi+ (phi(1020) => K+ K-)]cc", "kaonplus": "[D_s+ -> pi+ (phi(1020) => ^K+ K-)]cc", "kaonminus": "[D_s+ -> pi+ (phi(1020) => K+ ^K-)]cc", "phi": "[D_s+ -> pi+ (^phi(1020) => K+ K-)]cc", "D_s": "[D_s+]cc :[D_s+ -> pi+ (phi(1020) => K+ K-)]cc" } Tuple.addTool(TupleToolDecay, name='pion') Tuple.addTool(TupleToolDecay, name='phi') Tuple.addTool(TupleToolDecay, name='kaonplus') Tuple.addTool(TupleToolDecay, name='kaonminus') Tuple.addTool(TupleToolDecay, name='D_s') # k+ specific kaonplusLoKiTool = LoKi__Hybrid__TupleTool('kaonplusLoKiTool') kaonplusLoKiTool.Variables = { "LOKI_PIDK": "PIDK", "LOKI_PIDe": "PIDe", "LOKI_PIDpi": "PIDpi", "LOKI_PIDp": "PIDp", "LOKI_PIDmu": "PIDmu", "LOKI_PIDK_PIDpi": "PIDK-PIDpi", "LOKI_PIDK_PIDe": "PIDK-PIDe", "LOKI_PIDK_PIDmu": "PIDK-PIDmu", "LOKI_PIDK_PIDp": "PIDK-PIDp" } Tuple.kaonplus.addTool(kaonplusLoKiTool, name='kaonplusLoKiTool') Tuple.kaonplus.ToolList = [ 'LoKi::Hybrid::TupleTool/kaonplusLoKiTool' ] # k- specific kaonminusLoKiTool = LoKi__Hybrid__TupleTool('kaonminusLoKiTool') kaonminusLoKiTool.Variables = { "LOKI_PIDK": "PIDK", "LOKI_PIDe": "PIDe", "LOKI_PIDpi": "PIDpi", "LOKI_PIDp": "PIDp", "LOKI_PIDmu": "PIDmu", "LOKI_PIDK_PIDpi": "PIDK-PIDpi", "LOKI_PIDK_PIDe": "PIDK-PIDe", "LOKI_PIDK_PIDmu": "PIDK-PIDmu", "LOKI_PIDK_PIDp": "PIDK-PIDp" } Tuple.kaonminus.addTool(kaonminusLoKiTool, name='kaonminusLoKiTool') Tuple.kaonminus.ToolList = [ 'LoKi::Hybrid::TupleTool/kaonminusLoKiTool' ] # pi+ specific pionLoKiTool = LoKi__Hybrid__TupleTool('pionLoKiTool') pionLoKiTool.Variables = { "LOKI_PIDK": "PIDK", "LOKI_PIDe": "PIDe", "LOKI_PIDpi": "PIDpi", "LOKI_PIDp": "PIDp", "LOKI_PIDmu": "PIDmu", "LOKI_PIDpi_PIDK": "PIDpi-PIDK", "LOKI_PIDpi_PIDe": "PIDpi-PIDe", "LOKI_PIDpi_PIDmu": "PIDpi-PIDmu", "LOKI_PIDpi_PIDp": "PIDpi-PIDp" } Tuple.pion.addTool(pionLoKiTool, name='pionLoKiTool') Tuple.pion.ToolList = ['LoKi::Hybrid::TupleTool/pionLoKiTool'] # phi specific phiLoKiTool = LoKi__Hybrid__TupleTool('phiLoKiTool') phiLoKiTool.Variables = {} Tuple.phi.addTool(phiLoKiTool, name='phiLoKiTool') Tuple.phi.ToolList = ['LoKi::Hybrid::TupleTool/phiLoKiTool'] # D_s specific DsLoKiTool = LoKi__Hybrid__TupleTool('DsLoKiTool') DsLoKiTool.Variables = {} Tuple.D_s.addTool(DsLoKiTool, name='DsLoKiTool') Tuple.D_s.ToolList = ["LoKi::Hybrid::TupleTool/DsLoKiTool"] # Common to all particles LoKiTool = LoKi__Hybrid__TupleTool('LoKiTool') LoKiTool.Variables = { "LOKI_ABSID": "ABSID", "LOKI_BPVIPCHI2": "BPVIPCHI2()", "LOKI_BPVDIRA": "BPVDIRA", "LOKI_BPVLTFITCHI2": "BPVLTFITCHI2('PropertimeFitter/properTime:PUBLIC')", "LOKI_BPVLTCHI2": "BPVLTCHI2('PropertimeFitter/properTime:PUBLIC')", "LOKI_BPVLTIME": "BPVLTIME('PropertimeFitter/properTime:PUBLIC')", "LOKI_BPVVDCHI2": "BPVVDCHI2", "LOKI_ID": "ID", "LOKI_MIPDV_PRIMARY": "MIPDV(PRIMARY)", "LOKI_MIPCHI2DV_PRIMARY": "MIPCHI2DV(PRIMARY)", "LOKI_MM": "MM", "LOKI_M": "M", "LOKI_P": "P", "LOKI_PT": "PT", "LOKI_TRCHI2": "TRCHI2", "LOKI_TRCHI2DOF": "TRCHI2DOF", "LOKI_VFASPF_VCHI2": "VFASPF(VCHI2)", "LOKI_VFASPF_VDOF": "VFASPF(VDOF)" } Tuple.addTool(LoKiTool, name='LoKiTool') Tuple.ToolList = [ "LoKi::Hybrid::TupleTool/LoKiTool", "TupleToolEventInfo", "TupleToolGeometry", "TupleToolKinematic", "TupleToolMCBackgroundInfo", "TupleToolPid", "TupleToolPrimaries", "TupleToolTrackInfo", "TupleToolVtxIsoln", "TupleToolMCTruth" ] Tuple.addTool(TupleToolEventInfo) Tuple.TupleToolEventInfo.OutputLevel = outputLevel Tuple.addTool(TupleToolGeometry) Tuple.TupleToolGeometry.OutputLevel = outputLevel Tuple.addTool(TupleToolKinematic) Tuple.TupleToolKinematic.OutputLevel = outputLevel Tuple.addTool(TupleToolMCBackgroundInfo) Tuple.TupleToolMCBackgroundInfo.OutputLevel = outputLevel Tuple.addTool(MCTupleToolHierarchy) Tuple.MCTupleToolHierarchy.OutputLevel = outputLevel Tuple.addTool(TupleToolMCTruth) Tuple.TupleToolMCTruth.OutputLevel = outputLevel Tuple.TupleToolMCTruth.addTool(MCTupleToolKinematic()) Tuple.TupleToolMCTruth.addTool(MCTupleToolHierarchy()) Tuple.TupleToolMCTruth.ToolList = [ "MCTupleToolKinematic", "MCTupleToolHierarchy" ] Tuple.TupleToolMCTruth.MCTupleToolKinematic.StoreKineticInfo = True Tuple.TupleToolMCTruth.MCTupleToolKinematic.StoreVertexInfo = True Tuple.TupleToolMCTruth.MCTupleToolKinematic.StorePropertimeInfo = True Tuple.TupleToolMCTruth.MCTupleToolKinematic.OutputLevel = outputLevel Tuple.addTool(TupleToolPid) Tuple.TupleToolPid.OutputLevel = outputLevel Tuple.addTool(TupleToolPrimaries) Tuple.TupleToolPrimaries.OutputLevel = outputLevel Tuple.addTool(TupleToolTrackInfo) Tuple.TupleToolTrackInfo.OutputLevel = outputLevel Tuple.addTool(TupleToolVtxIsoln) Tuple.TupleToolVtxIsoln.OutputLevel = outputLevel seq.Members += [Tuple] Tuple.NTupleLUN = "DSPHIPI" from Configurables import NTupleSvc NTupleSvc().Output = [ "DSPHIPI DATAFILE='DsToPhiPi.root' TYP='ROOT' OPT='NEW'" ]
, "TupleToolPropertime" , "TupleToolPrimaries" , "TupleToolPid" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTrigger" , "TupleToolAngles" # , "TupleToolVtxIsoln" , "TupleToolTrackIsolation" , "TupleToolTrigger" , "TupleToolTISTOS" , "TupleToolEventInfo" , "TupleToolRecoStats" ] dtt.addTool(TupleToolTISTOS("TupleToolTISTOS")) dtt.TupleToolTISTOS.OutputLevel = 3 dtt.TupleToolTISTOS.VerboseL0 = 1 dtt.TupleToolTISTOS.VerboseHlt1 = 1 dtt.TupleToolTISTOS.VerboseHlt2 = 1 dtt.TupleToolTISTOS.TriggerList=[ 'L0DiMuonDecision' ,'L0MuonDecision' ,'L0MuonHighDecision' ,'Hlt1DiMuonHighMassDecision' ,'Hlt1DiMuonLowMassDecision' ,'Hlt1SingleMuonHighPTDecision' ,'Hlt1TrackMuonDecision' ,'Hlt1TrackAllL0Decision'
def __apply_configuration__(self) : from Configurables import ( GaudiSequencer, CombineParticles ) from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand if not self.isPropertySet("Sequencer") : raise RuntimeError("ERROR : Sequence not set") seq = self.getProp("Sequencer") if self.getProp("RunSelection") : # STD particles from StandardParticles import StdLooseMuons # J/psi -> mu mu JPsiMuMuName = self.__sel_name__ JPsiMuMu = CombineParticles(JPsiMuMuName) JPsiMuMu.DecayDescriptor = "J/psi(1S) -> mu+ mu- " JPsiMuMu.CombinationCut = "(ADAMASS('J/psi(1S)') < 150*MeV)" JPsiMuMu.MotherCut = "(ADMASS('J/psi(1S)') < 130*MeV) & (VFASPF(VCHI2/VDOF)<6) & (PT > 2500*MeV)" JPsiMuMu.DaughtersCuts = {"mu+" : "(PT>1400*MeV)"\ "& (P>5*GeV)"\ "& (TRCHI2DOF<2.0)"\ "& (PPINFO(LHCb.ProtoParticle.MuonBkgLL,-10000)<-2.5)"\ "& (PPINFO(LHCb.ProtoParticle.MuonMuLL,-10000)>-10)"} self.setOptions(JPsiMuMu) JPsiMuMuSel = Selection( JPsiMuMuName+'Sel', Algorithm = JPsiMuMu, RequiredSelections = [StdLooseMuons] ) # Selection Sequence selSeq = SelectionSequence( self.__sel_name__+'Seq', TopSelection = JPsiMuMuSel ) # Run the selection sequence. seq.Members += [selSeq.sequence()] # Particle Monitoring plots if self.getProp("RunMonitors") : from Configurables import ( ParticleMonitor ) plotter = ParticleMonitor(self.__sel_name__+"Plots") if self.getProp("RunSelection") : plotter.Inputs = [ 'Phys/'+self.__sel_name__+'Sel' ] else: musel = "(PT>1400*MeV) & (P>5*GeV) & (TRCHI2DOF<2.0) & "\ "(PPINFO(LHCb.ProtoParticle.MuonBkgLL,-10000)<-2.5) & "\ "(PPINFO(LHCb.ProtoParticle.MuonMuLL,-10000)>-10)" _code = "( ( INTREE( ('mu+'==ID) & "+musel+" ) ) | ( INTREE( ('mu-'==ID) & "+musel+" ) ) )" from Configurables import FilterDesktop filter = FilterDesktop( name = self.__sel_name__+"RICHFiltered", Code = _code, Inputs = self.getProp("Candidates") ) plotter.Inputs = [ 'Phys/'+filter.name() ] seq.Members += [filter] plotter.PeakCut = "(ADMASS('J/psi(1S)')<20*MeV)" # Considering sigma = 13 plotter.SideBandCut = "(ADMASS('J/psi(1S)')>20*MeV)" # Considering sigma = 13 plotter.PlotTools = self.getProp("PlotTools") self.setOptions(plotter) seq.Members += [plotter] # Make a DST ? if self.getProp("MakeSelDST"): # Prescale from Configurables import DeterministicPrescaler scaler = DeterministicPrescaler( self.__sel_name__+'PreScale', AcceptFraction = self.getProp("DSTPreScaleFraction") ) seq.Members += [scaler] # Write the DST MyDSTWriter = SelDSTWriter( self.__sel_name__+"DST", SelectionSequences = [ selSeq ], OutputPrefix = self.__sel_name__ ) seq.Members += [MyDSTWriter.sequence()] # MC Performance checking ? if self.getProp("MCChecks") : from Configurables import ParticleEffPurMoni mcPerf = ParticleEffPurMoni(JPsiMuMuName+"MCPerf") mcPerf.Inputs = ['Phys/'+self.__sel_name__+'Sel'] self.setOptions(mcPerf) seq.Members += [mcPerf] # Ntuple ? if self.getProp("MakeNTuple") : from Configurables import ( DecayTreeTuple, TupleToolDecay, LoKi__Hybrid__FilterCriterion, LoKi__Hybrid__TupleTool, TupleToolMCBackgroundInfo, BackgroundCategory, TupleToolTrigger, TupleToolMCTruth, MCTupleToolKinematic, MCTupleToolHierarchy, TupleToolVtxIsoln, TupleToolP2VV ) JPsiMuMuTree = DecayTreeTuple( JPsiMuMuName + 'Tuple') JPsiMuMuTree.Inputs = [ 'Phys/'+JPsiMuMuName] JPsiMuMuTree.Decay = 'J/psi(1S) -> ^mu+ ^mu- ' # set some names for ntuple branchs MyBranch_jpsi = "jpsi" MyBranch_mup = "mup" MyBranch_mum = "mum" # label the branches for the particle tools JPsiMuMuTree.Branches = { MyBranch_jpsi : "J/psi(1S) : J/psi(1S) -> mu+ mu- ", MyBranch_mup : "J/psi(1S) -> ^mu+ mu- ", MyBranch_mum : "J/psi(1S) -> mu+ ^mu- ", } JPsiMuMuTree.ToolList = [ "TupleToolEventInfo" , "TupleToolGeneration" , "TupleToolMCTruth" , "TupleToolMCBackgroundInfo" , "MCTupleToolKinematic" , "TupleToolPrimaries" , "TupleToolVtxIsoln" , "TupleToolTrackInfo" , "TupleToolPid" , "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPropertime" , "TupleToolPid" , "TupleToolPrimaries" , "TupleToolTrigger" ] JPsiMuMuTree.addTool(BackgroundCategory()) JPsiMuMuTree.BackgroundCategory.SoftPhotonCut = 2000 JPsiMuMuTree.OutputLevel = INFO JPsiMuMuTree.addTool(TupleToolTrigger()) JPsiMuMuTree.TupleToolTrigger.VerboseL0 = True JPsiMuMuTree.addTool(TupleToolMCTruth()) JPsiMuMuTree.TupleToolMCTruth.addTool(MCTupleToolKinematic()) JPsiMuMuTree.TupleToolMCTruth.addTool(MCTupleToolHierarchy()) JPsiMuMuTree.TupleToolMCTruth.ToolList = [ "MCTupleToolKinematic" , "MCTupleToolHierarchy" ] JPsiMuMuTree.TupleToolMCTruth.MCTupleToolKinematic.StoreKineticInfo = True JPsiMuMuTree.TupleToolMCTruth.MCTupleToolKinematic.StoreVertexInfo = True JPsiMuMuTree.TupleToolMCTruth.MCTupleToolKinematic.StorePropertimeInfo = False JPsiMuMuTree.addTool(TupleToolVtxIsoln( OutputLevel = 6 )) JPsiMuMuTree.TupleToolVtxIsoln.IP = 2.0 JPsiMuMuTree.TupleToolVtxIsoln.InputParticles = [ "Phys/StdLooseMuons"] seq.Members += [JPsiMuMuTree] JPsiMuMuTree.NTupleLUN = "JPSIMUMU" from Configurables import NTupleSvc NTupleSvc().Output = ["JPSIMUMU DATAFILE='JpsiMuMu_Presel.root' TYP='ROOT' OPT='NEW'"]
"/VtxIsoBDTInfo', 'VTXISOBDTSOFTSECONDVALUE', -1.)", "VTXISOBDTSOFTTHIRDVALUE": "RELINFO('" + relinfolocation + "/VtxIsoBDTInfo', 'VTXISOBDTSOFTTHIRDVALUE', -1.)" } #MC Information MCTruth = TupleToolMCTruth() MCTruth.addTool(MCTupleToolHierarchy()) MCTruth.addTool(MCTupleToolKinematic()) MCTruth.addTool(MCTupleToolReconstructed()) MCTruth.ToolList += [ "MCTupleToolHierarchy", "MCTupleToolKinematic", "MCTupleToolReconstructed" ] tuple.addTool(TupleToolDecay(), name="B") tuple.B.ToolList += ["PromptNeutrinoTupleTool"] #--------------------------- # Configure DaVinci #--------------------------- from Configurables import DaVinci DaVinci().UserAlgorithms = [tuple] DaVinci().InputType = 'MDST' DaVinci().DataType = '2016' DaVinci().Simulation = True DaVinci().Lumi = False DaVinci().PrintFreq = 10000
### Tuple part tuple = DecayTreeTuple() tuple.RootInTES = teslocation tuple.Inputs = ['Phys/BMassFilterSel/Particles'] #tuple.Inputs = [ '/Event/Bhadron/Phys/B02D0KPiD2HHBeauty2CharmLine/Particles' ] tuple.ToolList += [ "TupleToolGeometry", "TupleToolRecoStats", "TupleToolKinematic", "TupleToolPrimaries", "TupleToolEventInfo", "TupleToolTrackInfo", "TupleToolAngles", "TupleToolPid", "TupleToolPropertime", "TupleToolTrigger", "TupleToolRICHPid", "TupleToolMuonPid", "TupleToolProtoPData" ] tuple.addTool(TupleToolGeometry, name="TupleToolGeometry") tuple.TupleToolGeometry.Verbose = True tuple.addTool(TupleToolTrackInfo, name="TupleToolTrackInfo") tuple.TupleToolTrackInfo.Verbose = True tuple.addTool(TupleToolPid, name="TupleToolPid") tuple.TupleToolPid.Verbose = True #tuple.UseLabXSyntax = True #tuple.Decay = " [B0 -> ^[ D0 -> ^K- ^pi+ ]CC ^[ K*(892)0 -> ^K+ ^pi- ]CC]CC " #tuple.Decay = " [B0 -> ^(D0 -> ^K- ^pi+) ^(K*(892)0 -> ^K+ ^pi-) ]CC " tuple.Decay = "[B0 -> ^( D0 -> ^K+ ^K- ) ^( rho(770)0 -> ^pi+ ^pi- ) ]CC " tuple.addBranches({ "B":
"gamma": "[Lambda_b0 -> (chi_c1(1P) -> (J/psi(1S) -> mu+ mu-) ^gamma) p+ K-]CC", "muplus": "[Lambda_b0 -> (chi_c1(1P) -> (J/psi(1S) -> ^mu+ mu-) gamma) p+ K-]CC", "muminus": "[Lambda_b0 -> (chi_c1(1P) -> (J/psi(1S) -> mu+ ^mu-) gamma) p+ K-]CC", "proton": "[Lambda_b0 -> (chi_c1(1P) -> (J/psi(1S) -> mu+ mu-) gamma) ^p+ K-]CC", "kaon": "[Lambda_b0 -> (chi_c1(1P) -> (J/psi(1S) -> mu+ mu-) gamma) p+ ^K-]CC", } for particle in [ "Lambda_b0", "chi_c", "Jpsi", "gamma", "muplus", "muminus", "proton", "kaon" ]: tuple_B2Kmumu.addTool(TupleToolDecay, name=particle) # List of the reconstructed tuples tuples = [tuple_B2Kmumu] for tup in tuples: tup.ReFitPVs = True if MODE == "MC": tup.addTool(TupleToolMCTruth, name="TruthTool") tup.addTool(TupleToolMCBackgroundInfo, name="BackgroundInfo") tup.ToolList += ["TupleToolMCTruth/TruthTool"] tup.ToolList += ["TupleToolMCBackgroundInfo/BackgroundInfo"] tup.Lambda_b0.addTool(LoKi_B) tup.Lambda_b0.ToolList += ["LoKi::Hybrid::TupleTool/LoKi_B"] tup.muplus.addTool(LoKi_Mu)
"TupleToolGeometry", "TupleToolPrimaries", "TupleToolTrackInfo", "TupleToolEventInfo", "TupleToolRecoStats" #, ] tuple.Branches = { "B": "[B+ -> ( J/psi(1S) -> mu- mu+ ) pi+ ]CC", "Jpsi": "[B+ -> ^(J/psi(1S) -> mu- mu+) pi+]CC", "mu_prim": "[B+ -> (J/psi(1S) -> mu- ^mu+) pi+]CC", "mu_sec": "[B+ -> (J/psi(1S) -> ^mu- mu+) pi+]CC", "pi": "[B+ -> (J/psi(1S) -> mu- mu+) ^pi+]CC", } ######################################################################## from Configurables import TupleToolGeometry tuple.addTool(TupleToolGeometry, name="TupleToolGeometry") tuple.TupleToolGeometry.Verbose = True from Configurables import TupleToolRecoStats tuple.addTool(TupleToolRecoStats, name="TupleToolRecoStats") tuple.TupleToolRecoStats.Verbose = True from Configurables import TupleToolDecay tuple.addTool(TupleToolDecay, name='Bu') from Configurables import LoKi__Hybrid__TupleTool #tuple.Bu.ToolList = ["LoKi::Hybrid::TupleTool/LoKi_All0"] ################################################################### ''' LoKiTuple0 = LoKi__Hybrid__TupleTool("LoKi_All0") LoKiTuple0.Variables = { "M_DTF_PV":"DTF_FUN( M, True )"