Selection wrappers: improve/optimize MergedSelection & TupleSelection
Improve/optimize selection wrappers:
- MergedSelection is rewritten to generate much more optimal structure of algorithms/sequences. It makes it much more efficient, since
the merging/filtering algorithm is invoked only when it is really needed. - TupleSelection is a class now, that allows more decorations to be used, in particular it exposes the most important methods/properties of underlying algorithm, that makes configuration easier
my_selection = ...
from PhysConf.Selections import TupleSelection
my_tuple = TupleSelection(
'TUPLE' , ## unique name
my_selection , ## input selection
Decay = "[Lambda_b0 -> ^(Lambda_c+ -> ^p+ ^K- ^pi+) ^pi-]CC" ,
Branches = {
"Lb":"[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) pi-]CC",
"Lc":"[Lambda_b0 -> ^(Lambda_c+ -> p+ K- pi+) pi-]CC",
} ,
MoreTools = [
'TupleToolKinematic' ,
'TupleToolPid' ,
'TupleToolANNPID' ,
'TupleToolGeometry' ,
"TupleToolPropertime" ,
]
)
## update tool list
my_tuple.ToolList += [
"TupleToolTrackInfo" ,
"TupleToolTrigger" ,
"TupleToolPrimaries"
]
from Configurables import ( TupleToolTISTOS ,
TupleToolDecay ,
TupleToolPrimaries ,
TupleToolDecayTreeFitter )
## update tool list
my_tuple.ToolList+=[ "TupleToolTISTOS" ]
## access the tool by name
tool = Lb_tuple.TupleToolTISTOS
tool.Verbose=True
tool.VerboseHlt1=True
tool.TriggerList = [
"L0MuonDecision", "L0DiMuonDecision", "L0HadronDecision",
"Hlt1TrackMVADecision" , "Hlt1TrackMVALooseDecision",
"Hlt1TwoTrackMVADecision", "Hlt1TwoTrackMVALooseDecision",
]
## access the branch:
Lb = Lb_tuple.Lb
Lb.ToolList += ["TupleToolDecayTreeFitter/PVFit"]
Lb.addTool(TupleToolDecayTreeFitter("PVFit"))
Lb.PVFit.Verbose = True
Lb.PVFit.UpdateDaughters = True