本文整理汇总了Python中Configurables.DecayTreeTuple.addTupleTool方法的典型用法代码示例。如果您正苦于以下问题:Python DecayTreeTuple.addTupleTool方法的具体用法?Python DecayTreeTuple.addTupleTool怎么用?Python DecayTreeTuple.addTupleTool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurables.DecayTreeTuple
的用法示例。
在下文中一共展示了DecayTreeTuple.addTupleTool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: out
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
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')",
}
# Other variables
tuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKi_All")
tuple.LoKi_All.Variables = {"Eta": "ETA", "Phi": "PHI"}
# 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"
示例2: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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"
#, "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)
# ================= END DO NOT EDIT HERE =======================
if DaVinci().Simulation is True:
from Configurables import BackgroundCategory
backgroundinfo = ntuple.addTupleTool("TupleToolMCBackgroundInfo") #Fills the background category
backgroundinfo.addTool(BackgroundCategory('BackgroundCategory'))
#.........这里部分代码省略.........
示例3: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
from GaudiConf import IOHelper
from Configurables import DaVinci, DecayTreeTuple
from DecayTreeTuple.Configuration import *
# Stream and stripping line we want to use
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"
示例4: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
from GaudiConf import IOHelper
from Configurables import DaVinci, DecayTreeTuple
from DecayTreeTuple.Configuration import *
# Stream and stripping line we want to use
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)]
# Note that we mark all particles, otherwise the branches won't work
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'
示例5: DataOnDemand
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
_mainpions = DataOnDemand(Location='Phys/StdMCPions/Particles')
#
# MC matching
#
matchD2KKPi = "(mcMatch('D_s+ ==> K- K+ pi+'))"
#matchKaons = "(mcMatch('[K+]cc'))"
#matchPions = "(mcMatch('[pi+]cc'))"
_maind2kkpi = CombineParticles("d2kkpiMain")
_maind2kkpi.DecayDescriptor = "D_s+ -> K+ K- pi+"
#_d2kkpi.DaughtersCuts = { "pi+" : matchPions, "K+" : matchKaons}
_maind2kkpi.MotherCut = matchD2KKPi
_maind2kkpi.Preambulo = [
"from LoKiPhysMC.decorators import *",
"from PartProp.Nodes import CC" ]
selD2KKPiMain = Selection( "DsPlusCandidates",
Algorithm = _maind2kkpi,
RequiredSelections=[_mainkaons, _mainpions])
seqD2KKPiMain = SelectionSequence('MCFilterMain',TopSelection = selD2KKPiMain)
maintuple = DecayTreeTuple("out")
maintuple.Decay = "[D_s+ -> K- K+ pi+]CC"
maintuple.Inputs = [seqD2KKPiMain.outputLocation()]
mcTruth = maintuple.addTupleTool("TupleToolMCTruth")
maintuple.addTupleTool("TupleToolPropertime")
示例6:
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
#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')"
}
# Other variables
tuple.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_All')
tuple.LoKi_All.Variables = {
'Eta' : 'ETA',
'Phi' : 'PHI',
}
#Tell DecayTreeTuple the structure of your decay, you must put ^ in front
示例7: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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
示例8: addTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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
#.........这里部分代码省略.........
示例9: ACHILD
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
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]
)
dst_selseq = SelectionSequence(
'SelSeq_DstToD0pi',
TopSelection=dst_sel
)
dtt_dst = DecayTreeTuple('TupleDstToD0pi_D0ToKpi_PersistReco')
dtt_dst.addTupleTool('TupleToolTrackInfo')
dtt_dst.Inputs = dst_selseq.outputLocations()
dtt_dst.Decay = '[D*(2010)+ -> ^(D0 -> ^K- ^pi+) ^pi+]CC'
dtt_dst.addBranches({
'Dst': '[D*(2010)+ -> (D0 -> K- pi+) pi+]CC',
'Dst_pi': '[D*(2010)+ -> (D0 -> K- pi+) ^pi+]CC',
'D0': '[D*(2010)+ -> ^(D0 -> K- pi+) pi+]CC',
'D0_K': '[D*(2010)+ -> (D0 -> ^K- pi+) pi+]CC',
'D0_pi': '[D*(2010)+ -> (D0 -> K- ^pi+) pi+]CC',
})
dstar_hybrid = dtt_dst.Dst.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_Dstar')
dstar_hybrid.Variables = {
'dstar_delta_mass': 'M - CHILD(M,1)',
}
示例10: makeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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)
#.........这里部分代码省略.........
示例11: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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 =======================
#.........这里部分代码省略.........
示例12: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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
}
#.........这里部分代码省略.........
示例13: Selection
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [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")
示例14:
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
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",
'ghost' : "TRGHP",
'TRACK_CHI2' : "TRCHI2DOF",
'NNK' : "PPINFO(PROBNNK)",
'NNpi' : "PPINFO(PROBNNpi)",
'NNmu' : "PPINFO(PROBNNmu)"
示例15: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import addTupleTool [as 别名]
tuple = DecayTreeTuple() # I can put as an argument a name if I use more than a DecayTreeTuple
tuple.Inputs = [ tau_sequence.outputLocation() ]
tuple.Decay = dec
tuple.ToolList = ['TupleToolKinematic',
'TupleToolEventInfo',
'TupleToolTrackInfo',
'TupleToolPid',
'TupleToolGeometry',
'TupleToolAngles', # Helicity angle
#'TupleToolP2VV', # various angles, not useful in my analysis because only default values
'TupleToolPropertime', #proper time TAU of reco particles
#'TupleToolPrimaries', #num primary vertices and coords
]
# Track isolation
tuple.addTupleTool('TupleToolTrackIsolation/TrackIsolation')
tuple.TrackIsolation.MinConeAngle = 0.5
tuple.TrackIsolation.MaxConeAngle = 1.
tuple.TrackIsolation.StepSize = 0.1
# Other event infos
tuple.addTupleTool('LoKi::Hybrid::EvtTupleTool/LoKi_Evt')
tuple.LoKi_Evt.VOID_Variables = {
"nSPDHits" : " CONTAINS('Raw/Spd/Digits') " ,
'nTracks' : " CONTAINS ('Rec/Track/Best') " ,
}
# Other variables
tuple.addTupleTool('LoKi::Hybrid::TupleTool/LoKi_All')
tuple.LoKi_All.Variables = {
'BPVIPCHI2' : 'BPVIPCHI2()',