本文整理汇总了Python中Configurables.DecayTreeTuple.ToolList方法的典型用法代码示例。如果您正苦于以下问题:Python DecayTreeTuple.ToolList方法的具体用法?Python DecayTreeTuple.ToolList怎么用?Python DecayTreeTuple.ToolList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurables.DecayTreeTuple
的用法示例。
在下文中一共展示了DecayTreeTuple.ToolList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeDecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
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
示例2: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
tupleB = DecayTreeTuple("bae-muon-data")
tupleB.Inputs = [SeqB.outputLocation()]
tupleB.Decay = "[B+ -> ^K+ ^(J/psi(1S) -> ^mu+ ^mu-)]CC"
tupleB.ToolList = [
"TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolRecoStats"
, "TupleToolTrigger",
"TupleToolPid",
"TupleToolPrimaries",
"TupleToolAngles",
"TupleToolEventInfo",
"TupleToolGeometry",
"TupleToolKinematic",
"TupleToolPropertime",
"TupleToolRecoStats",
"TupleToolTrackInfo",
"TupleToolTISTOS",
"TupleToolBremInfo",
"TupleToolPhotonInfo"#,
,"TupleToolTrackIsolation"
, "TupleToolANNPID"
# , "TupleBuKmmFit"
] # Probably need to add many more Tools.
tupleB.addBranches ({
"Kplus" : "[B+ -> ^K+ (J/psi(1S) -> mu+ mu-)]CC",
"Jpsi" : "[B+ -> K+ ^(J/psi(1S) -> mu+ mu-)]CC",
示例3: Selection
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
_otherd2kkpi.Preambulo = [
"from LoKiPhysMC.decorators import *",
"from PartProp.Nodes import CC" ]
selD2KKPiOther = Selection("DsMinusCandidates",
Algorithm = _otherd2kkpi,
RequiredSelections=[_otherKaons, _otherPions],
OutputBranch="NewEvent/Phys")
#selD2KKPiOther.OutputLevel = 1
seqD2KKPiOther = SelectionSequence('MCFilterOther', TopSelection = selD2KKPiOther)
othertuple = DecayTreeTuple("Ds2KKPiTuple", RootInTES='/Event/NewEvent')
othertuple.Decay = "[D_s+ -> K- K+ pi+]CC"
#othertuple.Inputs = [seqD2KKPi.outputLocation()]
othertuple.Inputs = ['Phys/SelD2KKPiOther/Particles']
othertuple.ToolList = []
from Configurables import MCMatchObjP2MCRelator
othertuple.addTupleTool('TupleToolKinematic')
othertuple.addTupleTool('TupleToolPropertime')
mcTruth = othertuple.addTupleTool("TupleToolMCTruth")
mcTruth.IP2MCPAssociatorTypes = ['MCMatchObjP2MCRelator/MyMCMatcher']
mcTruth.addTool(MCMatchObjP2MCRelator, name='MCMatchObjP2MCRelator')
mcTruth.MCMatchObjP2MCRelator.RelTableLocations = ['/Event/NewEvent/Relations/NewEvent/Rec/ProtoP/Charged']
#tuple.addTupleTool("TupleToolPropertime")
示例4: addTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
def addTuple(name="", decay="", addendum="", head="/Event/Phys/", dtf=True, resonant=True, shortname="", verbose=[] ):
from Configurables import DecayTreeTuple, PrintDecayTree, FilterDesktop, GaudiSequencer, PrintHeader, TESCheck
if shortname == "": shortname = name
shortname = shortname+"_Tuple"+addendum
shortname = shortname.replace("MCMC","MC")
seq = GaudiSequencer("Seq"+shortname)
if ( not "/"==head[-1] ): head = head+'/'
location = head+name+"/Particles"
from Configurables import LoKi__HDRFilter
if ( "/Event/Phys/" == head ):
filter = TESCheck("Check"+shortname,Inputs = [ location ], Stop = False)
else : # I am not running the selection, hence the stripping decision must be here
filter = LoKi__HDRFilter( "Check"+shortname,
Code = "HLT_PASS('Stripping"+name+"Decision')",
Location="/Event/Strip/Phys/DecReports" )
#filter.OutputLevel = 1
seq.Members += [ filter ] # PrintHeader(),
tuple = DecayTreeTuple(shortname)
isMDST = (addendum.upper()=="MDST")
if (isMDST):
RIT = head.replace("/Phys","")
print "RootInTES set to", RIT
tuple.RootInTES = RIT
tuple.Inputs = [ "Phys/"+name+"/Particles" ]
else :
tuple.Inputs = [ location ]
# tuple.OutputLevel = 1
tuple.ToolList = []
tuple.Decay = decay
tg = tuple.addTupleTool("TupleToolGeometry")
if not isMDST: tg.FillMultiPV = True
tlist = []
if ("e+" in decay):
tlist = electronLines()
elif ("mu+" in decay):
tlist = muonLines()
if ( False ):
tlist = allLines()
print tlist
if ( Jpsi2MuMu != decay ): bpsi = (decay.replace("^","")).replace("(J/psi(1S)","^(J/psi(1S)")
else : bpsi = "^("+decay.replace("^","")+")"
print "J/psi branch is `` ", bpsi, "''"
tuple.Branches["Psi"] = bpsi
# sort out kstars
if "892" in decay:
bkstar = (decay.replace("^","")).replace("(K*(892)","^(K*(892)")
tuple.Branches["Kstar"] = bkstar
Kstar = tuple.addTupleTool("TupleToolDecay/Kstar")
from Configurables import TupleToolTISTOS
tistos = TupleToolTISTOS(TriggerList = tlist
, VerboseHlt1 = True, VerboseHlt2 = True, VerboseL0 = True)
Psi = tuple.addTupleTool("TupleToolDecay/Psi")
Psi.addTool(tistos)
Psi.ToolList += [ "TupleToolTISTOS" ]
# if (not isMDST):
# vi = tuple.Psi.addTupleTool("TupleToolVtxIsoln")
# vi.InputParticles = [ "/Event/Phys/MyGoodPions" ]
if ( Jpsi2MuMu == decay ):
if (dtf):
pvfit = tuple.Psi.addTupleTool("TupleToolDecayTreeFitter/PVFit") # fit with all constraints I can think of
pvfit.Verbose = True
pvfit.constrainToOriginVertex = True
else:
B = tuple.addTupleTool("TupleToolDecay/B")
if ( Bs2JpsiPhi==decay ):
p2vv = B.addTupleTool("TupleToolP2VV")
p2vv.Calculator = "Bs2JpsiPhiAngleCalculator"
elif ( "K*(892)0" in decay and not Bd2MuMuKstSS==decay ):
p2vv = B.addTupleTool("TupleToolP2VV")
p2vv.Calculator = "Bd2KstarMuMuAngleCalculator"
if (Lambdab2Jpsippi==decay ): B.addTupleTool("TupleToolDalitz")
if ('Xi_b-' in decay ): bh = 'Xi_b-'
elif ('Xi_b~+' in decay ): bh = 'Xi_b~+'
elif ('Lambda_b0' in decay ): bh = 'Lambda_b0'
elif ('B0' in decay): bh = 'B0'
elif ('B+' in decay ): bh = 'B+'
elif ('B_s0' in decay ): bh = 'B_s0'
if ('CC' in decay): bh = '['+bh+']cc'
print "Branch will be ``", bh+" : "+decay.replace("^",""), "''"
tuple.Branches["B"] = "^("+decay.replace("^","")+")"
# This is needed for ConstB
#.........这里部分代码省略.........
示例5: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
from Gaudi.Configuration import *
from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand
from Configurables import DecayTreeTuple, FitDecayTrees, TupleToolRecoStats, TupleToolTrigger, TupleToolTISTOS, CondDB
from DecayTreeTuple.Configuration import *
tuple = DecayTreeTuple("Jpsi_Tuple")
tuple.Inputs = ["/Event/Dimuon/Phys/B2XMuMu_Line/Particles"]
tuple.ToolList = [
"TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolRecoStats"
, "TupleBuKmmFit"
]
tuple.addBranches ({
"Bplus" : "[B+ -> K+ ( J/psi(1S) -> mu+ mu-)]CC",
"Kplus" : "[B+ -> ^K+ ( J/psi(1S) -> mu+ mu-)]CC",
"Jpsi" : "[B+ -> K+ ^( J/psi(1S) -> mu+ mu-)]CC",
"muplus" : "[B+ -> K+ ( J/psi(1S) -> ^mu+ mu-)]CC",
"muminus" : "[B+ -> K+ ( J/psi(1S) -> mu+ ^mu-)]CC",
})
LoKi_All = tuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All")
LoKi_All.Variables = {
'MINIPCHI2' : "MIPCHI2DV(PRIMARY)",
'MINIP' : "MIPDV(PRIMARY)",
'IPCHI2_OWNPV' : "BPVIPCHI2()",
'IP_OWNPV' : "BPVIP()"
示例6: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
from Gaudi.Configuration import *
#
# DecayTreeTuple
#
from Configurables import DecayTreeTuple, LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolTrigger, TupleToolTISTOS, TupleToolTagging
from Configurables import FitDecayTrees, TupleToolGeometry
tuple = DecayTreeTuple('Lb2JpsiLTree')
tuple.Inputs = [ 'Phys/Bs2Jpsif0' ]
tuple.TupleName = "mytree"
tuple.ToolList = [
"TupleToolGeometry",
"TupleToolKinematic",
"TupleToolEventInfo",
# "TupleToolTISTOS",
"TupleToolPid",
"TupleToolTrackInfo",
# "TupleToolTagging"
]
tistos = TupleToolTISTOS("tistos")
tistos.VerboseL0 = 1
tistos.VerboseHlt1 = 1
tistos.VerboseHlt2 = 1
tistos.TriggerList = [
'L0DiMuonDecision',
'L0HCALDecision',
'L0MuonDecision',
'L0MuonHighDecision',
'Hlt1SingleMuonNoIPL0Decision',
'Hlt1DiMuonHighMassDecision',
示例7: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
TupleToolRecoStats,
TupleToolMCTruth,
LoKi__Hybrid__TupleTool,
LoKi__Hybrid__EvtTupleTool,
)
tuple = DecayTreeTuple("TupleJPsi2KsKs")
# Give DecayTreeTuple the location of your stripped candidates
# If you apply a selection, this will be the output of a selection sequence object.
tuple.Inputs = [seq.outputLocation()]
tuple.ToolList = [
"TupleToolKinematic",
"TupleToolEventInfo",
"TupleToolTrackInfo",
"TupleToolPid",
"TupleToolGeometry",
"TupleToolAngles",
]
tuple.InputPrimaryVertices = "/Event/Charm/Rec/Vertex/Primary"
# # Other event infos
tuple.addTupleTool("LoKi::Hybrid::EvtTupleTool/LoKi_Evt")
tuple.LoKi_Evt.VOID_Variables = {
"nTracks": "CONTAINS('/Event/Charm/Rec/Track/Best')",
"nPVs": "CONTAINS('/Event/Charm/Rec/Vertex/Primary')",
}
示例8: LoKi_Filters
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
# fltrs = LoKi_Filters(
# STRIP_Code = "HLT_PASS('StrippingPhiToKSKS_PhiToKsKsLineDecision')")
from Configurables import FitDecayTrees, DecayTreeTuple, TupleToolDecayTreeFitter, TupleToolDecay, TupleToolTrigger, TupleToolTISTOS, TupleToolPropertime, PropertimeFitter, TupleToolKinematic, TupleToolGeometry, TupleToolEventInfo, TupleToolPrimaries, TupleToolPid, TupleToolTrackInfo, TupleToolRecoStats, TupleToolMCTruth, LoKi__Hybrid__TupleTool, LoKi__Hybrid__EvtTupleTool
from Configurables import LoKi__LifetimeFitter
tuple = DecayTreeTuple("TuplePhi2KsKs")
#Give DecayTreeTuple the location of your stripped candidates
#If you apply a selection, this will be the output of a selection sequence object.
tuple.Inputs = [Ds_sequence.outputLocation()]
tuple.ToolList = ['TupleToolKinematic',
'TupleToolEventInfo',
'TupleToolTrackInfo',
'TupleToolPid',
'TupleToolGeometry',
'TupleToolAngles',
]
tuple.InputPrimaryVertices = '/Event/Charm/Rec/Vertex/Primary'
# # Other event infos
tuple.addTupleTool('LoKi::Hybrid::EvtTupleTool/LoKi_Evt')
tuple.LoKi_Evt.VOID_Variables = {
"nTracks" : "CONTAINS('/Event/Charm/Rec/Track/Best')",
"nPVs" : "CONTAINS('/Event/Charm/Rec/Vertex/Primary')"
}
示例9: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
def execute_option_file():
Tuple = DecayTreeTuple('Bu2LLK_eeLine2')
Tuple.ToolList = [
"TupleToolGeometry"
, "TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolPropertime"
, "TupleToolTrigger"
, "TupleToolTISTOS"
, "TupleToolPid"
, "TupleToolTrackInfo"
, "TupleToolPrimaries"
, "TupleToolDira"
, "TupleToolTrackIsolation"
, "TupleToolTrackPosition"
, "TupleToolRecoStats"
]
if DaVinci().Simulation is True:
Tuple.ToolList +=[
"TupleToolMCBackgroundInfo"
, "TupleToolMCTruth"
]
L0Triggers = ["L0MuonDecision", "L0DiMuonDecision", "L0HadronDecision", "L0ElectronDecision", "L0PhotonDecision" ]
## ['Muon', 'DiMuon', ' Hadron', 'Electron', 'Photon','PhotonHi','ElectronHi']
Hlt1Triggers = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision" ,"Hlt1TrackPhotonDecision" ,"Hlt1DiMuonLowMassDecision" ,"Hlt1DiMuonHighMassDecision"]
Hlt2Triggers = [
## muon lines
"Hlt2SingleMuonDecision", "Hlt2SingleMuonLowPTDecision", "Hlt2SingleMuonHighPTDecision",
"Hlt2DiMuonDecision", "Hlt2DiMuonLowMassDecision",
"Hlt2DiMuonJPsiDecision", "Hlt2DiMuonJPsiHighPTDecision", "Hlt2DiMuonPsi2SDecision",
"Hlt2DiMuonDetachedDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonDetachedHeavyDecision", "Hlt2TriMuonTauDecision",
## hadron/Topo lines
"Hlt2B2HHDecision",
"Hlt2DiMuonBDecision", "Hlt2DiMuonZDecision",
"Hlt2TopoMu2BodyBBDTDecision", "Hlt2TopoMu3BodyBBDTDecision", "Hlt2TopoMu4BodyBBDTDecision",
"Hlt2Topo2BodyBBDTDecision", "Hlt2Topo3BodyBBDTDecision", "Hlt2Topo4BodyBBDTDecision",
##others
"Hlt2PassThroughDecision",
"Hlt2TransparentDecision",
## inclusive decisions
"Hlt2DiMuonDY.*Decision","Hlt2TopoE.*Decision", "Hlt2Topo.*Decision", "Hlt2Charm.*Decision", "Hlt2DiElectron.*Decision"
]
triggerList = L0Triggers + Hlt1Triggers + Hlt2Triggers
Tuple.addTool(TupleToolTISTOS)
Tuple.TupleToolTISTOS.VerboseL0 = True
Tuple.TupleToolTISTOS.VerboseHlt1 = True
Tuple.TupleToolTISTOS.VerboseHlt2 = True
Tuple.TupleToolTISTOS.FillL0 = True
Tuple.TupleToolTISTOS.FillHlt1 = True
Tuple.TupleToolTISTOS.FillHlt2 = True
Tuple.TupleToolTISTOS.OutputLevel = INFO
Tuple.TupleToolTISTOS.TriggerList = triggerList
if DaVinci().Simulation is True: # for MC
Tuple.Inputs = ["/Event/Leptonic/Phys/Bu2LLK_eeLine2/Particles"]
elif DaVinci().Simulation is False: # for Tuple
Tuple.Inputs = ["/Event/Leptonic/Phys/Bu2LLK_eeLine2/Particles"]
else:
raise Exception(" `DaVinci().Simulation` not set.")
Tuple.Decay = "[B+ -> ^(J/psi(1S) -> ^e+ ^e-) ^K+]CC"
Tuple.addBranches({
"B" : "[B+ -> (J/psi(1S) -> e+ e-) K+]CC",
"Psi" : "[B+ -> ^(J/psi(1S) -> e+ e-) K+]CC",
"eplus" : "[B+ -> (J/psi(1S) -> ^e+ e-) K+]CC",
"eminus" : "[B+ -> (J/psi(1S) -> e+ ^e-) K+]CC",
"Kplus" : "[B+ -> (J/psi(1S) -> e+ e-) ^K+]CC"
})
Tuple.TupleName = "DecayTree"
#DecayTreeFitter
fitter = Tuple.B.addTupleTool("TupleToolDecayTreeFitter/FIX_JPSI")
fitter.constrainToOriginVertex = False
fitter.daughtersToConstrain = [ "J/psi(1S)" ]
fitter.Verbose = True
#Isolation
Tuple.B.addTool(TupleToolApplyIsolation, name="TupleToolApplyIsolationHard")
Tuple.B.TupleToolApplyIsolationHard.OutputSuffix="_Hard"
Tuple.B.TupleToolApplyIsolationHard.WeightsFile="weightsHard.xml"
Tuple.B.ToolList+=["TupleToolApplyIsolation/TupleToolApplyIsolationHard"]
Tuple.B.addTool(TupleToolApplyIsolation, name="TupleToolApplyIsolationSoft")
Tuple.B.TupleToolApplyIsolationSoft.OutputSuffix="_Soft"
Tuple.B.TupleToolApplyIsolationSoft.WeightsFile="weightsSoft.xml"
Tuple.B.ToolList+=["TupleToolApplyIsolation/TupleToolApplyIsolationSoft"]
vtxiso = Tuple.B.addTupleTool("TupleToolVtxIsoln")
#Tuple.B.TupleToolApplyIsolationHard.OutputLevel = 3
#.........这里部分代码省略.........
示例10: StrippingConf
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
sc = StrippingConf( Streams = [ AllStreams ],
MaxCandidates = 2000
)
tuple = DecayTreeTuple("Jpsi_Tuple")
tuple.Inputs = ["Phys/B2XMuMu_InclDiMuHighQ2Line/Particles/"]
tuple.ToolList = [
"TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolRecoStats"
, "TupleToolMCTruth"
, "TupleToolMCBackgroundInfo"
# , "TupleBuKmmFit"
]
tuple.addBranches ({
"muplus" : "B0 -> ^mu+ mu-",
"muminus" : "B0 -> mu+ ^mu-",
"Dimuon" : "B0 : B0 -> mu+ mu-",
})
LoKi_All=tuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All")
LoKi_All.Variables = {
'MINIPCHI2' : "MIPCHI2DV(PRIMARY)",
'MINIP' : "MIPDV(PRIMARY)",
'IPCHI2_OWNPV' : "BPVIPCHI2()",
示例11: Selection
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
_B.DecayDescriptors = [ "[B+ -> J/psi(1S) K+]cc" ]
_BdecaySelection = Selection( "TurboB", Algorithm = _B, RequiredSelections = [subsel,kaons] )
SeqB = SelectionSequence('SeqB', TopSelection = _BdecaySelection)
# Here we just put the output candidates in an Tuple
tupleB = DecayTreeTuple("Bplus_Tuple")
tupleB.Inputs = [SeqB.outputLocation()]
tupleB.Decay = "[B+ -> ^K+ ^(J/psi(1S) -> ^mu+ ^mu-)]CC"
tupleB.ToolList = [
"TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolRecoStats"
# , "TupleBuKmmFit"
] # Probably need to add many more Tools.
tupleB.addBranches ({
"Kplus" : "[B+ -> ^K+ (J/psi(1S) -> mu+ mu-)]CC",
"Jpsi" : "[B+ -> K+ ^(J/psi(1S) -> mu+ mu-)]CC",
"muplus" : "[B+ -> K+ (J/psi(1S) -> ^mu+ mu-)]CC",
"muminus" : "[B+ -> K+ (J/psi(1S) -> mu+ ^mu-)]CC",
"Bplus" : "[B+ -> K+ J/psi(1S)]CC",
})
LoKi_All=tupleB.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All")
示例12: execute
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
#.........这里部分代码省略.........
a = "->"
DaVinci().DataType = "2012"
DaVinci().Simulation = False
#DaVinci().DDDBtag = "dddb-20130111"
#if mag == "up":
#DaVinci().CondDBtag = "cond-20130114"
#elif mag == "down":
#DaVinci().CondDBtag = "cond-20130114"
DaVinci().Lumi = True
elif dataType == "data2011":
a = "->"
DaVinci().DataType = "2011"
DaVinci().Simulation = False
#DaVinci().DDDBtag = "dddb-20130111"
#if mag == "up":
#DaVinci().CondDBtag = "cond-20130114"
#elif mag == "down":
#DaVinci().CondDBtag = "cond-20130114"
DaVinci().Lumi = True
elif dataType == "data":
sys.exit("correct the dataType to include the year")
from Configurables import DecayTreeTuple
from Configurables import TupleToolTISTOS
from Configurables import TupleToolMassHypo, TupleToolSubMass
if outputType in ["ntuple", "nt", "tuple", "root"]:
print "stripOutputLoc:",stripOutputLoc
dttuple = DecayTreeTuple( "DPiPiPi_NTuple" )
dttuple.ToolList = ["TupleToolGeometry",
"TupleToolEventInfo",
"TupleToolKinematic",
#"TupleToolPrimaries",
"TupleToolPropertime",
"TupleToolAngles",
"TupleToolPid",
#"TupleToolRICHPid",
"TupleToolDecay",
#"TupleToolTrigger",
#"TupleToolTrackPosition",
#"TupleToolTrackInfo",
#"TupleToolRecoStats",
"TupleToolDira",
"TupleToolDalitz",
"TupleToolSubMass",
]
dttuple.Inputs = [ stripOutputLoc ]
print "tuple input :",dttuple.Inputs
print "number of events:", DaVinci().EvtMax
#[D+ -> pi- pi+ pi+]CC
if tupleDecay == "pipipi":
dttuple.Decay = "[D+ "+a+" ^pi- ^pi+ ^pi+]CC"
dttuple.addBranches ({
"D": "[D+ "+a+" pi- pi+ pi+]CC",
"x1": "[D+ "+a+" ^pi- pi+ pi+]CC",
"x2": "[D+ "+a+" pi- ^pi+ pi+]CC",
"x3": "[D+ "+a+" pi- pi+ ^pi+]CC",
示例13: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
def execute_option_file(path):
# ================= BEGIN EDIT AREA =======================
tuplename = "Bu2LLK_meLine"
simulation_inputstring = "/Event/AllStreams/Phys/Bu2LLK_meLine/Particles"
data_inputstring = "/Event/Leptonic/Phys/Bu2LLK_meLine/Particles"
decaydescriptor = "[B+ -> ^[J/psi(1S) -> ^mu+ ^e-]CC ^K+]CC"
branches = { # Dictionary for the branches to write in the tuple
"B" : "[B+ -> [J/psi(1S) -> mu+ e-]CC K+]CC",
"Psi" : "[B+ -> ^[J/psi(1S) -> mu+ e-]CC K+]CC",
"muplus" : "[B+ -> [J/psi(1S) -> ^mu+ e-]CC K+]CC",
"eminus" : "[B+ -> [J/psi(1S) -> mu+ ^e-]CC K+]CC",
"Kplus" : "[B+ -> [J/psi(1S) -> mu+ mu-]CC ^K+]CC"
}
toollist = [
"TupleToolBremInfo" #Bremsstrahlung information
, "TupleToolGeometry" #geometry of vertex locations (ENDVERTEX, OWNPV, IP_OWNPV, FD_OWNPV, DIRA_OWNPV)
, "TupleToolKinematic" #kinematic variables (inv. mass MM, kin. mass M/sqrt(E^2-p^2), P, PX/Y/Z/E, PT)
, "TupleToolEventInfo" #Event information such as run number, polarity, GPS time etc.
, "TupleToolPropertime" #proper lifetime of reconstructed particles
, "TupleToolAngles" #decay angles of charged tracks
, "TupleToolTrigger"
, "TupleToolTrackInfo" #GhostProb of track and track type (TYPE) - 0 = unknown, 1 = velo track...
, "TupleToolPrimaries" #Number and coordinates of all primary vertices
, "TupleToolDira"
, "TupleToolTrackPosition" #Plot the X/Y position at a given Z (default: 2500 = TTstation)
, "TupleToolRecoStats"
, "TupleToolBremInfo" #Bremsstrahlung information
, "TupleToolIsolationTwoBody" #degree of isolation of two particles with common mother from Bsmumu
, "TupleToolANNPID" #V2,V3,... ProbNN variables
#, "TupleToolCaloHypo"
#, "TupleToolL0Calo"
]
# ================= END EDIT AREA =======================
# ================= BEGIN DO NOT EDIT HERE =======================
from Configurables import GaudiSequencer
MySequencer = GaudiSequencer('Sequence')
#Check whether it is a DST or MDST file
import os.path
extension = os.path.splitext(path)[1]
print extension
if extension.lower() == ".dst":
DaVinci().InputType = 'DST'
elif extension.lower() == ".mdst":
DaVinci().InputType = 'MDST'
else:
raise Exception("Extension {extension} of {path} does not match .mdst or .dst".format(extension, path))
#Kill some nodes if micro dst-file
if DaVinci().InputType == 'MDST':
from Configurables import EventNodeKiller
eventNodeKiller = EventNodeKiller('DAQkiller')
eventNodeKiller.Nodes = ['/Event/DAQ','/Event/pRec']
MySequencer.Members+=[eventNodeKiller]
#DecayTreeTuple -> Fills information about particles, vertices and daughters
ntuple = DecayTreeTuple(tuplename)
if DaVinci().Simulation is True: # for MC
ntuple.Inputs = [simulation_inputstring]
elif DaVinci().Simulation is False: # for Tuple
ntuple.Inputs = [data_inputstring]
else:
raise Exception(" `DaVinci().Simulation` not set.")
ntuple.Decay = decaydescriptor
ntuple.addBranches(branches)
ntuple.TupleName = "DecayTree"
#Tools added to the ToolList can not be modified i.e. no other options than the defaults can be used
ntuple.ToolList = toollist
MySequencer.Members.append(ntuple)
# ================= BEGIN EDIT TUPLETOOLS WITH OPTIONS ==================
# LOKI TupleTool
LoKi = ntuple.addTupleTool("LoKi::Hybrid::TupleTool")
LoKi.Variables = {
"ETA" : "ETA",
"PHI" : "PHI" #Azimuthal angle
}
#.........这里部分代码省略.........
示例14: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
def execute_option_file():
B2JpsiK = DecayTreeTuple('B2JpsiK')
B2JpsiK.ToolList = [
"TupleToolGeometry"
, "TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolPropertime"
, "TupleToolTrigger"
, "TupleToolTISTOS"
, "TupleToolPid"
, "TupleToolTrackInfo"
, "TupleToolPrimaries"
, "TupleToolDira"
, "TupleToolTrackIsolation"
, "TupleToolTrackPosition"
, "TupleToolRecoStats"
]
if DaVinci().Simulation is True:
B2JpsiK.ToolList +=[
"TupleToolMCBackgroundInfo"
, "TupleToolMCTruth"
]
L0Triggers = ["L0MuonDecision", "L0DiMuonDecision", "L0HadronDecision", "L0ElectronDecision", "L0PhotonDecision" ]
## ['Muon', 'DiMuon', ' Hadron', 'Electron', 'Photon','PhotonHi','ElectronHi']
Hlt1Triggers = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision" ,"Hlt1TrackPhotonDecision" ,"Hlt1DiMuonLowMassDecision" ,"Hlt1DiMuonHighMassDecision"]
Hlt2Triggers = [
## muon lines
"Hlt2SingleMuonDecision", "Hlt2SingleMuonLowPTDecision", "Hlt2SingleMuonHighPTDecision",
"Hlt2DiMuonDecision", "Hlt2DiMuonLowMassDecision",
"Hlt2DiMuonJPsiDecision", "Hlt2DiMuonJPsiHighPTDecision", "Hlt2DiMuonPsi2SDecision",
"Hlt2DiMuonDetachedDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonDetachedHeavyDecision", "Hlt2TriMuonTauDecision",
## hadron/Topo lines
"Hlt2B2HHDecision",
"Hlt2DiMuonBDecision", "Hlt2DiMuonZDecision",
"Hlt2TopoMu2BodyBBDTDecision", "Hlt2TopoMu3BodyBBDTDecision", "Hlt2TopoMu4BodyBBDTDecision",
"Hlt2Topo2BodyBBDTDecision", "Hlt2Topo3BodyBBDTDecision", "Hlt2Topo4BodyBBDTDecision",
##others
"Hlt2PassThroughDecision",
"Hlt2TransparentDecision",
## inclusive decisions
"Hlt2DiMuonDY.*Decision","Hlt2TopoE.*Decision", "Hlt2Topo.*Decision", "Hlt2Charm.*Decision", "Hlt2DiElectron.*Decision"
]
triggerList = L0Triggers + Hlt1Triggers + Hlt2Triggers
B2JpsiK.addTool(TupleToolTISTOS)
B2JpsiK.TupleToolTISTOS.VerboseL0 = True
B2JpsiK.TupleToolTISTOS.VerboseHlt1 = True
B2JpsiK.TupleToolTISTOS.VerboseHlt2 = True
B2JpsiK.TupleToolTISTOS.FillL0 = True
B2JpsiK.TupleToolTISTOS.FillHlt1 = True
B2JpsiK.TupleToolTISTOS.FillHlt2 = True
B2JpsiK.TupleToolTISTOS.OutputLevel = INFO
B2JpsiK.TupleToolTISTOS.TriggerList = triggerList
if DaVinci().Simulation is True: # for MC
B2JpsiK.Inputs = ["/Event/AllStreams/Phys/Bs2MuMuLinesBu2JPsiKLine/Particles"]
elif DaVinci().Simulation is False: # for Data
B2JpsiK.Inputs = ["/Event/Dimuon/Phys/Bs2MuMuLinesBu2JPsiKLine/Particles"]
else:
raise Exception(" `DaVinci().Simulation` not set.")
B2JpsiK.Decay = "[B+ -> ^(J/psi(1S) -> ^mu+ ^mu-) ^K+]CC"
B2JpsiK.addBranches({
"Bplus" : "[B+ -> (J/psi(1S) -> mu+ mu-) K+]CC",
"Jpsi" : "[B+ -> ^(J/psi(1S) -> mu+ mu-) K+]CC",
"muplus" : "[B+ -> (J/psi(1S) -> ^mu+ mu-) K+]CC",
"muminus" : "[B+ -> (J/psi(1S) -> mu+ ^mu-) K+]CC",
"Kplus" : "[B+ -> (J/psi(1S) -> mu+ mu-) ^K+]CC"
})
B2JpsiK.TupleName = "default"
fitter = B2JpsiK.Bplus.addTupleTool("TupleToolDecayTreeFitter/FIX_JPSI")
fitter.constrainToOriginVertex = False
fitter.daughtersToConstrain = [ "J/psi(1S)" ]
fitter.Verbose = True
################################
### DaVinci configuration ####
################################
DaVinci().InputType = 'DST'
DaVinci().UserAlgorithms = [B2JpsiK]
DaVinci().MoniSequence += [B2JpsiK]
DaVinci().EvtMax = -1
DaVinci().Lumi = True
示例15: makeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import ToolList [as 别名]
def makeTuple(self):
"""
Make tuple
"""
from Configurables import FitDecayTrees, DecayTreeTuple, TupleToolDecayTreeFitter, TupleToolDecay, TupleToolTrigger, TupleToolTISTOS, TupleToolPropertime, PropertimeFitter, TupleToolKinematic, TupleToolGeometry, TupleToolEventInfo, TupleToolPrimaries, TupleToolPid, TupleToolTrackInfo, TupleToolRecoStats, TupleToolMCTruth, LoKi__Hybrid__TupleTool, LoKi__Hybrid__EvtTupleTool
tuple = DecayTreeTuple('Tuple'+self.name) # I can put as an argument a name if I use more than a DecayTreeTuple
tuple.Inputs = [ self.sequence.outputLocation() ]
tuple.Decay = self.dec
tuple.ToolList = ['TupleToolKinematic',
'TupleToolEventInfo',
'TupleToolTrackInfo',
'TupleToolPid',
'TupleToolGeometry',
'TupleToolAngles', # Helicity angle
# 'TupleToolPropertime', #proper time TAU of reco particles
]
tuple.InputPrimaryVertices = '/Event/Charm/Rec/Vertex/Primary'
# Other event infos
tuple.addTupleTool('LoKi::Hybrid::EvtTupleTool/LoKi_Evt')
tuple.LoKi_Evt.VOID_Variables = {
#"nSPDHits" : " CONTAINS('Raw/Spd/Digits') " ,
'nTracks' : " CONTAINS ('Charm/Rec/Track/Best') " ,
}
# # Other variables
# tuple.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_All')
# tuple.LoKi_All.Variables = {
# 'BPVIPCHI2' : 'BPVIPCHI2()',
# 'BPVDIRA' : 'BPVDIRA',
# 'BPVLTFITCHI2' : 'BPVLTFITCHI2()',
# }
tuple.addBranches(self.branches)
tuple.phi.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_phi")
tuple.phi.LoKi_phi.Variables = {
'DOCAMAX' : 'DOCAMAX',
"MassDiff_Phi" : "DMASS('phi(1020)')",
"BPVDIRA" : "BPVDIRA",
"IPS_Phi" : "MIPCHI2DV(PRIMARY)",
"VFASPF_CHI2DOF" : "VFASPF(VCHI2/VDOF)",
"VFASPF_CHI2" : "VFASPF(VCHI2)",
"BPVIPCHI2" : "BPVIPCHI2()",
"ADOCA" : "DOCA(1,2)",
"ADOCACHI2" : "DOCACHI2(1,2)",
"DTF_CHI2_PV" : "DTF_CHI2( True, 'phi(1020)' )",
"DTF_NDOF_PV" : "DTF_NDOF( True, 'phi(1020)' )",
"DTF_M_PV" : "DTF_FUN ( M, True, 'phi(1020)' )",
"DTF_M_Ks1_PV" : "DTF_FUN ( CHILD(M,1), True, 'phi(1020)' )",
"DTF_M_Ks2_PV" : "DTF_FUN ( CHILD(M,2), True, 'phi(1020)' )",
# "DTF_CTAU_Ks1" : "DTF_CTAU(1, False, 'phi(1020)' )",
# "DTF_CTAU_Ks2" : "DTF_CTAU(2, False, 'phi(1020)' )",
}
def mySharedConf_Ks(branch):
atool=branch.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Ks')
atool.Variables = {
"BPVDIRA" : "BPVDIRA",
"VFASPF_CHI2DOF" : "VFASPF(VCHI2/VDOF)",
"VFASPF_CHI2" : "VFASPF(VCHI2)",
"BPVIPCHI2" : "BPVIPCHI2()",
"BPVVD" : "BPVVD",
"BPVVDCHI2" : "BPVVDCHI2",
"ADOCA" : "DOCA(1,2)",
"ADOCACHI2" : "DOCACHI2(1,2)",
'BPVLTIME' : 'BPVLTIME()',
}
PropertimeTool = branch.addTupleTool("TupleToolPropertime/Propertime_Ks")
mySharedConf_Ks(tuple.Ks1)
mySharedConf_Ks(tuple.Ks2)
def mySharedConf_pi(branch):
atool=branch.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_pi')
atool.Variables = {
'TRCHI2DOF' : 'TRCHI2DOF',
'TRGHOSTPROB' : 'TRGHOSTPROB',
}
mySharedConf_pi(tuple.pi1)
mySharedConf_pi(tuple.pi2)
mySharedConf_pi(tuple.pi3)
mySharedConf_pi(tuple.pi4)
# Triggers:
tuple.phi.addTupleTool('TupleToolTISTOS/TISTOS')
#.........这里部分代码省略.........