本文整理汇总了Python中Configurables.DecayTreeTuple.TupleName方法的典型用法代码示例。如果您正苦于以下问题:Python DecayTreeTuple.TupleName方法的具体用法?Python DecayTreeTuple.TupleName怎么用?Python DecayTreeTuple.TupleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurables.DecayTreeTuple
的用法示例。
在下文中一共展示了DecayTreeTuple.TupleName方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeDecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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 TupleName [as 别名]
# J/psi n-tuple
#
# @author Bilas Pal
# @date 2010-11-01
######
########################################################################
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 = [
示例4: DecayTreeTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [as 别名]
# J/psi n-tuple
#
# @author Bilas Pal
# @date 2010-11-01
######
########################################################################
from Gaudi.Configuration import *
#
# DecayTreeTuple
#
from Configurables import DecayTreeTuple, LoKi__Hybrid__TupleTool, TupleToolDecay, TupleToolTrigger, TupleToolTISTOS, TupleToolTagging, MCDecayTreeTuple
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 = [
示例5: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [as 别名]
#.........这里部分代码省略.........
"Hlt2PassThroughDecision",
"Hlt2TransparentDecision",
## inclusive decisions
"Hlt2DiMuonDY.*Decision","Hlt2TopoE.*Decision", "Hlt2Topo.*Decision", "Hlt2Charm.*Decision", "Hlt2DiElectron.*Decision"
]
triggerList = L0Triggers + Hlt1Triggers + Hlt2Triggers
data.addTool(TupleToolTISTOS)
data.TupleToolTISTOS.VerboseL0 = True
data.TupleToolTISTOS.VerboseHlt1 = True
data.TupleToolTISTOS.VerboseHlt2 = True
data.TupleToolTISTOS.FillL0 = True
data.TupleToolTISTOS.FillHlt1 = True
data.TupleToolTISTOS.FillHlt2 = True
data.TupleToolTISTOS.OutputLevel = INFO
data.TupleToolTISTOS.TriggerList = triggerList
if DaVinci().Simulation is True: # for MC
data.Inputs = ["/Event/AllStreams/Phys/Bu2LLK_mmLine/Particles"]
elif DaVinci().Simulation is False: # for Tuple
data.Inputs = ["/Event/Leptonic/Phys/Bu2LLK_mmLine/Particles"]
else:
raise Exception(" `DaVinci().Simulation` not set.")
data.Decay = "[B+ -> ^(J/psi(1S) -> ^mu+ ^mu-) ^K+]CC"
data.addBranches({
"B" : "[B+ -> (J/psi(1S) -> mu+ mu-) K+]CC",
"Psi" : "[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"
})
data.TupleName = "DecayTree"
#DecayTreeFitter
fitter = data.B.addTupleTool("TupleToolDecayTreeFitter/FIX_JPSI")
fitter.constrainToOriginVertex = False
fitter.daughtersToConstrain = [ "J/psi(1S)" ]
fitter.Verbose = True
#Isolation
data.B.addTool(TupleToolApplyIsolation, name="TupleToolApplyIsolationHard")
data.B.TupleToolApplyIsolationHard.OutputSuffix="_Hard"
data.B.TupleToolApplyIsolationHard.WeightsFile="weightsHard.xml"
data.B.ToolList+=["TupleToolApplyIsolation/TupleToolApplyIsolationHard"]
data.B.addTool(TupleToolApplyIsolation, name="TupleToolApplyIsolationSoft")
data.B.TupleToolApplyIsolationSoft.OutputSuffix="_Soft"
data.B.TupleToolApplyIsolationSoft.WeightsFile="weightsSoft.xml"
data.B.ToolList+=["TupleToolApplyIsolation/TupleToolApplyIsolationSoft"]
vtxiso = data.B.addTupleTool("TupleToolVtxIsoln")
#data.B.TupleToolApplyIsolationHard.OutputLevel = 3
#data.B.TupleToolApplyIsolationSoft.OutputLevel = 3
MySequencer.Members.append(data)
#EventTuple for simulation
"""
if DaVinci().Simulation is True:
etuple = EventTuple()
etuple.ToolList=["TupleToolEventInfo"]
MySequencer.Members.append(etuple)
"""
#DDDB and CondDB-Tags for DATA (needs to be set for Simulation in runfile.py according to generation->see bookkeeping!)
#Always use the latest tags for the given datatype from (the newest are currently not in the database yet, therefore take the default ones!)
"""
if DaVinci().Simulation is False:
if DaVinci().DataType == '2012':
DaVinci().CondDBtag = "dddb-20150522-2"
DaVinci().DDDBtag = "cond-20150409-1"
elif DaVinci().DataType == '2011':
DaVinci().CondDBtag = "dddb-20150522-1"
DaVinci().DDDBtag = "cond-20150409"
"""
################################
### DaVinci configuration ####
################################
DaVinci().UserAlgorithms = [MySequencer]
DaVinci().MoniSequence += [data]
DaVinci().EvtMax = -1
DaVinci().Lumi = True
示例6: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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
示例7: EventTuple
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [as 别名]
,"MPPi": "WM('p+','pi-')"
,"MPiP": "WM('pi+','p~-')"
,"MPK": "WM('p+','K-')"
,"MKP": "WM('K+','p~-')"
}
preseltuple.Decay = "B0 -> ^pi+ ^pi-"
preseltuple.TupleName = "PreSelB2HH"
evttuple = EventTuple("EventInfo")
evttuple.ToolList += [ "TupleToolEventInfo"
,"TupleToolTrigger"
]
evttuple.addTool(TupleToolTrigger())
示例8: DaVinci
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [as 别名]
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"]
ttmhm = TupleToolMassHypo("MuonHypo")
ttmhm.PIDReplacements = { "pi+" : "mu+"}
示例9: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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 =======================
#.........这里部分代码省略.........
示例10: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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
#.........这里部分代码省略.........
示例11: execute
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [as 别名]
#.........这里部分代码省略.........
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-)]",
#})
dttuple.TupleName = "DPiPiPi_NTuple"
ttmhk = TupleToolMassHypo("KaonHypo")
ttmhk.PIDReplacements = { "pi+" : "K+"}
#ttmhk.CC = True
dttuple.D.addTool(ttmhk)
dttuple.D.ToolList += ["TupleToolMassHypo/KaonHypo"]
ttmhm = TupleToolMassHypo("MuonHypo")
ttmhm.PIDReplacements = { "pi+" : "mu+"}
#ttmhm.CC = True
dttuple.D.addTool(ttmhm)
dttuple.D.ToolList += ["TupleToolMassHypo/MuonHypo"]
dttuple.addTool(TupleToolTISTOS())
dttuple.TupleToolTISTOS.VerboseL0 = True
dttuple.TupleToolTISTOS.VerboseHlt1 = True
dttuple.TupleToolTISTOS.VerboseHlt2 = True
dttuple.TupleToolTISTOS.Verbose = True
dttuple.ToolList += ["TupleToolTISTOS"]
dttuple.TupleToolTISTOS.TriggerList = [
"L0CALODecision",
"L0ElectronDecision",
"L0PhotonDecision",
"L0HadronDecision",
"L0MuonDecision",
"Hlt1TrackMuonDecision",
"Hlt1TrackAllL0Decision",
"Hlt2Topo2BodyBBDTDecision",
示例12: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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: execute_option_file
# 需要导入模块: from Configurables import DecayTreeTuple [as 别名]
# 或者: from Configurables.DecayTreeTuple import TupleName [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