本文整理汇总了Python中Configurables.DecayTreeTuple.addBranches方法的典型用法代码示例。如果您正苦于以下问题:Python DecayTreeTuple.addBranches方法的具体用法?Python DecayTreeTuple.addBranches怎么用?Python DecayTreeTuple.addBranches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurables.DecayTreeTuple
的用法示例。
在下文中一共展示了DecayTreeTuple.addBranches方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
#.........这里部分代码省略.........
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",
})
elif tupleDecay == "kpipios":
dttuple.Decay = "[D+ "+a+" ^pi- ^pi+ ^K+]CC"
dttuple.addBranches ({
"D": "[D+ "+a+" pi- pi+ K+]CC",
"x1": "[D+ "+a+" ^pi- pi+ K+]CC",
"x2": "[D+ "+a+" pi- ^pi+ K+]CC",
"x3": "[D+ "+a+" pi- pi+ ^K+]CC",
})
elif tupleDecay == "ds2phipi":
dttuple.Decay = "[D+ "+a+" ^mu+ ^mu- ^pi+]CC"
dttuple.addBranches ({
"D": "[D+ "+a+" mu+ mu- pi+]CC",
"x1": "[D+ "+a+" ^mu+ mu- pi+]CC",
"x2": "[D+ "+a+" mu+ ^mu- pi+]CC",
"x3": "[D+ "+a+" mu+ mu- ^pi+]CC",
})
#if tupleDecay == "eta":
#dttuple.Decay = "[(D+ "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi+),(D- "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi-)]"
#dttuple.addBranches ({
#"D": "[(D+ "+a+" (eta "+a+" pi+ pi-) pi+),(D- "+a+" (eta "+a+" pi+ pi-) pi-)]",
#"eta": "[(D+ "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi+),(D- "+a+" ^(eta "+a+" ^pi+ ^pi-) ^pi-)]",
#"pip": "[(D+ "+a+" (eta "+a+" ^pi+ pi-) pi+),(D- "+a+" (eta "+a+" ^pi+ pi-) pi-)]",
#"pim": "[(D+ "+a+" (eta "+a+" pi+ ^pi-) pi+),(D- "+a+" (eta "+a+" pi+ ^pi-) pi-)]",
#"pi": "[(D+ "+a+" (eta "+a+" pi+ pi-) ^pi+),(D- "+a+" (eta "+a+" pi+ pi-) ^pi-)]",
#})
示例2:
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
if IsMC:
tuple.addTool(TupleToolTrackIsolation, name="TupleToolTrackIsolation")
tuple.TupleToolTrackIsolation.Verbose = True
tuple.ToolList+=["TupleToolTrackIsolation/TupleToolTrackIsolation"]
tuple.Decay = "[B0 -> ^(phi(1020) -> ^K+ ^K-) ^(rho(770)0 -> ^pi+ ^pi-)]CC"
if myDecayType == 1:
tuple.Decay = "[B_s0 -> ^(phi(1020) -> ^K+ ^K-) ^(rho(770)0 -> ^pi+ ^pi-)]CC"
elif myDecayType ==2 :
tuple.Decay = "[B_s0 -> ^(phi(1020) -> ^K+ ^K-) ^(f_0(980) -> ^pi+ ^pi-)]CC"
elif myDecayType == 3:
tuple.Decay = "[B_s0 -> ^(phi(1020) -> ^K+ ^K-) ^(phi(1020) -> ^K+ ^K-)]CC"
if myDecayType == 1:
tuple.addBranches({
"Bs" : "^([B_s0 -> (phi(1020) -> K+ K-) (rho(770)0 -> pi+ pi-)]CC)",
"f0" : " [B_s0 -> (phi(1020) -> K+ K-) ^(rho(770)0 -> pi+ pi-)]CC "
})
elif myDecayType == 2:
tuple.addBranches({
"Bs" : "^([B_s0 -> (phi(1020) -> K+ K-) (f_0(980) -> pi+ pi-)]CC)",
"f0" : " [B_s0 -> (phi(1020) -> K+ K-) ^(f_0(980) -> pi+ pi-)]CC "
})
elif myDecayType == 3:
tuple.addBranches({
"Bs" : "^([B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> K+ K-)]CC)",
"f0" : " [B_s0 -> (phi(1020) -> K+ K-) ^(phi(1020) -> K+ K-)]CC ",
"piplus" : " [B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> ^K+ K-)]CC ",
"piminus" : " [B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> K+ ^K-)]CC "
})
else:
tuple.addBranches({
示例3: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
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()"
}
LoKi_muplus = tuple.muplus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_muplus")
LoKi_muplus.Variables = {
'PIDmu' : "PIDmu",
示例4: TurboConf
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
TurboConf().PersistReco = True
pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles')
ks0 = CombineParticles('Ks0Topipi',
DecayDescriptors=['[KS0 -> pi+ pi+]cc'],
CombinationCut=("AM < 320*MeV"), #parent
MotherCut="ALL")
ks0_sel = Selection(
'Sel_Ks0Topipi',
Algorithm=ks0,
RequiredSelections=[pions]
)
ks0_selseq = SelectionSequence(
'SelSeq_Ks0Topipi',
TopSelection=ks0_sel
)
dtt_ks0 = DecayTreeTuple('TupleKs0Topipi')
dtt_ks0.Inputs = ks0_selseq.outputLocations()
dtt_ks0.Decay = '[KS0 -> ^pi+ ^pi+]CC'
dtt_ks0.addBranches({
'Ks0': '[KS0 -> pi+ pi+]CC',
'pi1': '[KS0 -> ^pi+ pi+]CC',
'pi2': '[KS0 -> pi+ ^pi+]CC'
})
DaVinci().UserAlgorithms = [ks0_selseq.sequence(), dtt_ks0]
DaVinci().DataType = '2016'
DaVinci().EvtMax = 1000
DaVinci().TupleFile = 'PersistRecoTuple_ks0_pipi.root'
示例5: out
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
# Tell DecayTreeTuple the structure of your decay, you must put ^ in front
# of particles that you want to write out (apart from head). J/psi->mu+mu-
# is a CP eigenstate so we don't need []CC here.
tuple.Decay = "[J/psi(1S) -> ^(KS0 -> ^pi+ ^pi-) ^(KS0 -> ^pi+ ^pi-)]CC"
tuple.Branches = {
"JPsi": "[J/psi(1S) -> (KS0 -> pi+ pi-) (KS0 -> pi+ pi-)]CC",
"Ks1": "[J/psi(1S) -> ^(KS0 -> pi+ pi-) (KS0 -> pi+ pi-)CC",
"Ks2": "[J/psi(1S) -> (KS0 -> pi+ pi-) ^(KS0 -> pi+ pi-)]CC",
"pi1": "[J/psi(1S) -> (KS0 -> ^pi+ pi-) (KS0 -> pi+ pi-)]CC",
"pi2": "[J/psi(1S) -> (KS0 -> pi+ ^pi-) (KS0 -> pi+ pi-)]CC",
"pi3": "[J/psi(1S) -> (KS0 -> pi+ pi-) (KS0 -> ^pi+ pi-)]CC",
"pi4": "[J/psi(1S) -> (KS0 -> pi+ pi-) (KS0 -> pi+ ^pi-)]CC",
}
tuple.addBranches(tuple.Branches)
tuple.JPsi.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_JPsi")
tuple.JPsi.LoKi_JPsi.Variables = {
"DOCAMAX": "DOCAMAX",
"MassDiff_JPsi": "DMASS('J/psi(1S)')",
"BPVDIRA": "BPVDIRA",
"IPS_JPsi": "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, 'KS0' )",
"DTF_NDOF_PV": "DTF_NDOF( True, 'KS0' )",
示例6: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
tuple = DecayTreeTuple("Jpsi_Tuple")
tuple.Inputs = ["/Event/Leptonic/Phys/Bu2LLK_eeLine/Particles"]
tuple.ToolList = [
"TupleToolKinematic"
, "TupleToolEventInfo"
, "TupleToolRecoStats"
, "TupleBuKmmFit"
]
tuple.addBranches ({
"Bplus" : "[B+ -> K+ ( J/psi(1S) -> e+ e-)]CC",
"Kplus" : "[B+ -> ^K+ ( J/psi(1S) -> e+ e-)]CC",
"Jpsi" : "[B+ -> K+ (^J/psi(1S) -> e+ e-)]CC",
"muplus" : "[B+ -> K+ ( J/psi(1S) -> ^e+ e-)]CC",
"muminus" : "[B+ -> K+ ( J/psi(1S) -> e+ ^e-)]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()"
}
LoKi_Jpsi = tuple.Jpsi.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_Jpsi")
LoKi_Jpsi.Variables = {
"q_PV_constr_B_constr" : "DTF_FUN ( M , True , 'B+' )" ,
示例7: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
stream = "AllStreams"
line = "D2hhCompleteEventPromptDst2D2RSLine"
# Create an ntuple to capture D*+ decays from the StrippingLine line
dtt = DecayTreeTuple("TupleDstToD0pi_D0ToKpi")
dtt.Inputs = ["/Event/{0}/Phys/{1}/Particles".format(stream, line)]
dtt.Decay = "[D*(2010)+ -> (D0 -> K- pi+) pi+]CC"
track_tool = dtt.addTupleTool("TupleToolTrackInfo")
track_tool.Verbose = True
dtt.addTupleTool("TupleToolPrimaries")
dtt.addBranches(
{
"Dstar": "[D*(2010)+ -> (D0 -> K- pi+) pi+]CC",
"D0": "[D*(2010)+ -> ^(D0 -> K- pi+) pi+]CC",
"Kminus": "[D*(2010)+ -> (D0 -> ^K- pi+) pi+]CC",
"piplus": "[D*(2010)+ -> (D0 -> K- ^pi+) pi+]CC",
"pisoft": "[D*(2010)+ -> (D0 -> K- pi+) ^pi+]CC",
}
)
dtt.D0.addTupleTool("TupleToolPropertime")
# Configure DaVinci
DaVinci().UserAlgorithms += [dtt]
DaVinci().InputType = "DST"
DaVinci().TupleFile = "DVntuple.root"
DaVinci().PrintFreq = 1000
DaVinci().DataType = "2012"
DaVinci().Simulation = True
# Only ask for luminosity information when not using simulated data
示例8: makeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [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
]
# Other event infos
tuple.addTupleTool("LoKi::Hybrid::EvtTupleTool/LoKi_Evt")
if dataSample.isMC:
tuple.LoKi_Evt.VOID_Variables = {
# "nSPDHits" : " CONTAINS('Raw/Spd/Digits') " ,
"nTracks": "TrSOURCE('Rec/Track/Best') >> TrSIZE",
"nPVs": "CONTAINS('Rec/Vertex/Primary')",
}
else:
tuple.LoKi_Evt.VOID_Variables = {
# "nSPDHits" : " CONTAINS('Raw/Spd/Digits') " ,
"nTracks": "CONTAINS('/Event/Charm/Rec/Track/Best')",
"nPVs": "CONTAINS('/Event/Charm/Rec/Vertex/Primary')",
}
# # 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_CTAU_Ks1": "DTF_CTAU(1, True, strings('KS0') )",
"DTF_CTAU_Ks2": "DTF_CTAU(2, True, strings('KS0') )",
"DTF_DT": "DTF_CTAU(1, True, strings('KS0') )- DTF_CTAU(2, True, strings('KS0') )",
"DTF_ADT": "abs(DTF_CTAU(1, True, strings('KS0') )- DTF_CTAU(2, True, strings('KS0') ))",
}
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)
#.........这里部分代码省略.........
示例9: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
def execute_option_file(path):
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]
#Create DecayTreeTuple -> Fills information about particles, vertices and daughters
data = DecayTreeTuple('Bu2LLK_meLine')
#Set root "folder" for MDST - better don't do this as it most likely causes a crash
#Instead set RootInTES for the particular Tool (e.g. TupleToolTrackHits that needs it)
#if DaVinci().InputType == 'MDST':
# data.RootInTES = "/Event/Leptonic"
if DaVinci().Simulation is True: # for MC
data.Inputs = ["/Event/AllStreams/Phys/Bu2LLK_meLine/Particles"]
elif DaVinci().Simulation is False: # for Tuple
data.Inputs = ["/Event/Leptonic/Phys/Bu2LLK_meLine/Particles"]
else:
raise Exception(" `DaVinci().Simulation` not set.")
data.Decay = "[B+ -> ^[J/psi(1S) -> ^mu+ ^e-]CC ^K+]CC"
data.addBranches({
"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"
})
data.TupleName = "DecayTree"
#TupleTools
#Tools added to the ToolList can not be modified i.e. no other options than the defaults can be used
data.ToolList = [
]
#Settings for TupleToolTrackHits (some only are necessary for MDST-files because of other locations of the clusters)
if(True): #Change this value if you don't want to use this tool
from Configurables import TupleToolTrackHits, STOfflinePosition
trackhits = data.addTupleTool("TupleToolTrackHits")
if DaVinci().InputType == 'MDST':
from Configurables import MeasurementProvider
data.addTool(MeasurementProvider('MeasProvider'))
data.MeasProvider.RootInTES = "/Event/Leptonic/" #Change Leptonic for your stream-name in case of MDST
trackhits.MeasurementProvider = data.MeasProvider
itClusterPosition = STOfflinePosition('ToolSvc.ITClusterPosition') #avoid crashes from missing IT channels
itClusterPosition.DetType = 'IT'
MySequencer.Members.append(data)
################################
### DaVinci configuration ####
################################
DaVinci().UserAlgorithms = [MySequencer]
DaVinci().MoniSequence += [data]
DaVinci().EvtMax = 5000
DaVinci().Lumi = True
DaVinci().SkipEvents = 0
示例10: DstConf
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
DstConf().Turbo = True
#Do not line below when data from 2015
TurboConf().PersistReco=True
turbo_loc = '/Event/Turbo/{0}/Particles'
dz_line = 'Hlt2CharmHadD02KmPipTurbo'
dtt = DecayTreeTuple('TupleD0ToKpi')
dtt.Inputs = [turbo_loc.format(dz_line)]
dtt.Decay = '[D0 -> K- pi+]CC'
dtt.addBranches({
'D0': '[D0 -> K- pi+]CC'
})
dz=DataOnDemand(turbo_loc.format(dz_line))
pions = DataOnDemand('Phys/StdAllNoPIDsPions/Particles')
dst = CombineParticles('DstToD0pi',
DecayDescriptors=['[D*(2010)+ -> D0 pi+]cc'],
CombinationCut=("AM - ACHILD(M,1) < 800*MeV"),
MotherCut="(VFASPF(VCHI2/VDOF) < 6)")
dst_sel = Selection(
'Sel_DstToD0pi',
Algorithm=dst,
RequiredSelections=[dz, pions]
示例11: DaVinci
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
dttuple.Inputs = [ stripOutputLoc ]
print "tuple input :",dttuple.Inputs
print "number of events:", DaVinci().EvtMax
a = "->"
dttuple.Decay = "[D+ "+a+" ^pi- ^pi+ ^pi+]CC"
branch_definitions = {
"D" : "[D+ "+a+" pi- pi+ pi+]CC",
"pi1": "[D+ "+a+" ^pi- pi+ pi+]CC",
"pi2": "[D+ "+a+" pi- ^pi+ pi+]CC",
"pi3": "[D+ "+a+" pi- pi+ ^pi+]CC",
}
dttuple.addBranches(branch_definitions)
dttuple.TupleName = "DPiPiPi_NTuple"
dttuple.addTool(TupleToolTISTOS())
dttuple.TupleToolTISTOS.VerboseL0 = True
dttuple.TupleToolTISTOS.VerboseHlt1 = True
dttuple.TupleToolTISTOS.VerboseHlt2 = True
dttuple.TupleToolTISTOS.Verbose = True
ttmhk = TupleToolMassHypo("KaonHypo")
ttmhk.PIDReplacements = { "pi+" : "K+"}
#ttmhk.CC = True
dttuple.D.addTool(ttmhk)
dttuple.D.ToolList += ["TupleToolMassHypo/KaonHypo"]
示例12: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [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"
}
#Tools added to the ToolList can not be modified i.e. no other options than the defaults can be used
#use data.addTupleTool('<tool>') in the corresponding section below if you also want to modify the specific tool
toollist = [
"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 (i.e. angle in mothers frame, name: CosTheta)
#, "TupleToolTrigger" #Saves trigger decision (I prefer to use TupleToolTISTOS)
, "TupleToolTISTOS" #Trigger on/independent of signal
, "TupleToolTrackInfo" #GhostProb of track and track type (TYPE) - 0 = unknown, 1 = velo track...
, "TupleToolPrimaries" #Number and coordinates of all primary vertices
, "TupleToolDira" #Angle between secondary minus primary vertex and the mother momentum
#, "TupleToolTrackPosition" #Extrapolate track to given z-position (option .Z, default=2500. which is TT)
, "TupleToolRecoStats" #Fills reconstruction information like nTracks, nSPDHits, nMuonTracks from RecSummary
, "TupleToolBremInfo" #Bremsstrahlung information
]
# ================= 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)
ntuple.ToolList = toollist
if DaVinci().InputType != 'MDST':
ntuple.ToolList += ["TupleToolTrackIsolation"]
if DaVinci().Simulation is True:
ntuple.ToolList +=["TupleToolMCBackgroundInfo"] #Sets the background category
MCTruth=ntuple.addTupleTool("TupleToolMCTruth") #Saves information of MC particle associated to the current particle (you can add tools to it itself!)
MCTruth.addTupleTool("MCTupleToolHierarchy") #True IDs of mother and grandmother particles
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"
MySequencer.Members.append(ntuple)
# ================= END DO NOT EDIT HERE =======================
#.........这里部分代码省略.........
示例13: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [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
#.........这里部分代码省略.........
示例14:
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
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()",
'IP_OWNPV' : "BPVIP()"
}
LoKi_muplus=tuple.muplus.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_muplus")
LoKi_muplus.Variables = {
'PIDmu' : "PIDmu",
'ghost' : "TRGHP",
'TRACK_CHI2' : "TRCHI2DOF",
示例15:
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addBranches [as 别名]
tuple.Lambda_b0.NoPVFit.Verbose=True
tuple.Lambda_b0.NoPVFit.constrainToOriginVertex=False
tuple.Lambda_b0.NoPVFit.daughtersToConstrain = ["eta","p+","K-"]
#========================================REFIT WITH NOTHING CONSTRAINED========================================
tuple.Lambda_b0.addTupleTool('TupleToolDecayTreeFitter/Consnothing')
tuple.Lambda_b0.Consnothing.Verbose=True
tuple.Lambda_b0.Consnothing.constrainToOriginVertex=False
#========================================LOKI FUBNCTOR VARIABLES========================================
tuple.addBranches({
'proton' : '[Lambda_b0 -> ^p+ K- (eta -> pi+ pi- (pi0 -> gamma gamma))]CC',
'Kminus' : '[Lambda_b0 -> p+ ^K- (eta -> pi+ pi- (pi0 -> gamma gamma))]CC',
'eta' : '[Lambda_b0 -> p+ K- ^(eta -> pi+ pi- (pi0 -> gamma gamma))]CC',
'piplus':'[Lambda_b0 -> p+ K- (eta -> ^pi+ pi- (pi0 -> gamma gamma))]CC',
'piminus':'[Lambda_b0 -> p+ K- (eta -> pi+ ^pi- (pi0 -> gamma gamma))]CC',
'pi0':'[Lambda_b0 -> p+ K- (eta -> pi+ pi- ^(pi0 -> gamma gamma))]CC',
'gamma':'[Lambda_b0 -> p+ K- (eta -> pi+ pi- (pi0 -> ^gamma gamma))]CC',
'gamma0':'[Lambda_b0 -> p+ K- (eta -> pi+ pi- (pi0 -> gamma ^gamma))]CC',
})
from LoKiPhys.decorators import MAXTREE,MINTREE,ISBASIC,HASTRACK,SUMTREE,PT,ABSID,NINTREE,ETA,TRPCHI2
Lambda_b0_hybrid=tuple.Lambda_b0.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Lambda_b0')
proton_hybrid=tuple.proton.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_proton')
Kminus_hybrid=tuple.Kminus.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Kminus')
eta_hybrid=tuple.eta.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_eta')
piminus_hybrid=tuple.piminus.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_piminus')
piplus_hybrid=tuple.piplus.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_piplus')
gamma_hybrid=tuple.gamma.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_gamma')
gamma0_hybrid=tuple.gamma0.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_gamma0')