Skip to content
Snippets Groups Projects
Commit 5a9e413f authored by Davide Fazzini's avatar Davide Fazzini
Browse files

update dtfdict QMtest

parent 272f2084
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!405DV tests update
Pipeline #1721107 passed
......@@ -14,7 +14,7 @@
Test of the DFTDict module
"""
__author__ = "Alessio PIUCCI alessio.piucci@cern.ch"
__author__ = "Davide Fazzini davide.fazzini@cern.ch"
from Configurables import DaVinci
......@@ -29,13 +29,14 @@ from PhysSelPython.Wrappers import DataOnDemand
from Configurables import TupleToolDecayTreeFitter, TupleToolDecay, TupleToolKinematic
from Configurables import LoKi__Hybrid__DictOfFunctors, LoKi__Hybrid__Dict2Tuple
from Configurables import LoKi__Hybrid__DTFDict as DTFDict
from Configurables import CondDB
def get_selection_sequence(name):
"""Get the selection from stripping stream"""
alg = FilterDesktop('SelFilterFor{}B2D'.format(name))
alg.Code = 'ALL'
reqSels = [DataOnDemand(Location = 'Phys/Lb2LcDD2HHHPIDBeauty2CharmLine/Particles')]
reqSels = [DataOnDemand(Location = '/Phys/BetaSBd2JpsiKstarDetachedLine/Particles')]
sel = Selection('Sel' + name, Algorithm=alg, RequiredSelections=reqSels)
return SelectionSequence('SelSeq' + name, TopSelection=sel)
......@@ -43,50 +44,59 @@ def get_selection_sequence(name):
####################
# some options
DaVinci().Simulation = False
DaVinci().Lumi = True
DaVinci().DataType = '2012'
DaVinci().EvtMax = -1 # Number of events
DaVinci().PrintFreq = 10 # Events to skip
DaVinci().DataType = "Upgrade" # Must be given
DaVinci().Simulation = True
DaVinci().InputType = 'LDST'
DaVinci().Lumi = False
CondDB().Upgrade = True
DaVinci().CondDBtag = "sim-20171127-vc-md100"
DaVinci().DDDBtag = "dddb-20171126"
from Configurables import L0Conf
L0Conf().EnsureKnownTCK=False
#for MDST
DaVinci(StrippingStream = 'Bhadron', InputType = 'MDST')
DaVinci(StrippingStream = 'AllStreams', InputType = 'LDST')
DaVinci().EvtMax = 1000
DaVinci().TupleFile = 'test_DFTDict.root'
# define the sequence
seq = GaudiSequencer('MyLb2LcDsDTTupleSeq')
seq = GaudiSequencer('MyBd2KstMuMuDTTupleSeq')
sel = get_selection_sequence('Lb2LcDs')
sel = get_selection_sequence('Bd2JpsiKstarSel')
seq.Members += [sel.sequence()]
tuple_input = sel.outputLocation()
print "sequence test: passed"
# make a tuple
tpl = DecayTreeTuple('Lb2LcDsDTTuple')
tpl = DecayTreeTuple("Bd2JpsiKstar")
tpl.Inputs = [tuple_input]
tpl.ToolList = ['TupleToolKinematic']
tpl.Decay = '[Lambda_b0 -> ^(Lambda_c+ -> ^p+ ^K- ^pi+) ^(D- -> ^K+ ^K- ^pi-)]CC'
tpl.Decay = "[B0 -> ^(J/psi(1S) -> ^mu+ ^mu-) ^(K*(892)0 -> ^K+ ^pi-)]CC"
# add a branch
tpl.addBranches({"Lb" : "[Lambda_b0 -> Lambda_c+ D-]CC"})
tpl.addBranches({"B0" : "[B0 -> J/psi(1S) K*(892)0]CC"})
tpl.Lb.ToolList = ["TupleToolDecayTreeFitter/Cons"] # fit with mass constraint
tpl.Lb.addTool(TupleToolDecayTreeFitter("Cons"))
tpl.B0.ToolList = ["TupleToolDecayTreeFitter/Cons"] # fit with mass constraint
tpl.B0.addTool(TupleToolDecayTreeFitter("Cons"))
DictTuple = tpl.Lb.addTupleTool(LoKi__Hybrid__Dict2Tuple, "DTFTuple")
DictTuple = tpl.B0.addTupleTool(LoKi__Hybrid__Dict2Tuple, "DTFTuple")
DictTuple.addTool(DTFDict, "Cons")
DictTuple.Source = "LoKi::Hybrid::DTFDict/Cons"
DictTuple.NumVar = 100
DictTuple.Cons.constrainToOriginVertex = True
DictTuple.Cons.daughtersToConstrain = ["Lambda_c+","D_s-"]
DictTuple.Cons.daughtersToConstrain = ["J/psi(1S)", "K*(892)0"]
DictTuple.Cons.Substitutions = {
'Lambda_b0 -> Lambda_c+ ^D-' : 'D_s-',
'Lambda_b~0 -> Lambda_c~- ^D+' : 'D_s+',
'J/psi(1S) -> ^mu+ mu-' : 'e+',
'J/psi(1S) -> mu+ ^mu-' : 'e-',
}
print "LoKi__Hybrid__Dict2Tuple test: passed"
......
......@@ -15,6 +15,9 @@
<argument name="args"><set>
<text>../options/dtfdict.py</text>
<text>--option</text>
<text>from PRConfig import TestFileDB; from Configurables import DaVinci; TestFileDB.test_file_db['R14S20-bhadron.mdst'].run(configurable=DaVinci())</text>
<text>from PRConfig import TestFileDB; from Configurables import DaVinci; TestFileDB.test_file_db['Upgrade_Bd2KstarMuMu'].run(configurable=DaVinci())</text>
</set></argument>
<argument name="validator"><text>
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment