Skip to content
Snippets Groups Projects

Test for DecayTreeFitterAlg

Merged Patrick Koppenburg requested to merge pkoppenb-DecayTreeFitterAlg into master
All threads resolved!
1 file
+ 16
14
Compare changes
  • Side-by-side
  • Inline
@@ -14,7 +14,8 @@ Example of a typical DaVinci job:
- tuple of the selected candidates
This example is meant to be run with
$ ./run davinci run-mc --simplejob --inputfiledb Upgrade_Bd2KstarMuMu --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-DTF-run-mc:main
$ setenv DAVINCIROOT Phys/DaVinci/
$ ./run davinci run-mc --inputfiledb Upgrade_Bd2KstarMuMu_ldst $DAVINCIROOT/options/DaVinciDB-Example.yaml --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-DTF-run-mc:main
"""
__author__ = "P. Koppenburg"
@@ -28,9 +29,19 @@ from FunTuple import FunTuple_Particles as Funtuple
from FunTuple.NewTupleTools import Kinematics
from PyConf.Algorithms import PrintDecayTree
from PyConf.Algorithms import DecayTreeFitterAlg
from Configurables import PrintDecayTreeTool
# Prepare the node with the selection
dimuons = make_detached_mumu()
#
# DecayTreeFitter Algorithm
#
DTF = DecayTreeFitterAlg(Input=dimuons, MassConstraints=["J/psi(1S)"], PrintTree=False)
#
# Let's print them
#
pdtDM = PrintDecayTree(name="PrintDiMuon", Input=dimuons)
pdtDTF = PrintDecayTree(name="PrintDTF", Input=DTF)
#FunTuple: Jpsi info
branches = {}
@@ -44,6 +55,7 @@ print('Variables in ALL branch', variables_all)
#associate FunctorCollection to branch name
variables = {}
variables['ALL'] = variables_all #adds variables to all branches
# variables['Jpsi'] = { 'DTF_M' : F.DTF_M(DTF.Particles) }
#FunTuple: define list of preambles for loki
loki_preamble = ['TRACK_MAX_PT = MAXTREE(ISBASIC & HASTRACK, PT, -1)']
@@ -57,17 +69,6 @@ tuple_dimuons = Funtuple(
loki_preamble=loki_preamble,
inputs=dimuons)
#
# DecayTreeFitter Algorithm
#
DTF = DecayTreeFitterAlg(
Input=dimuons, MassConstraints=["J/psi(1S)"], PrintTree=True)
#
# Let's print them
#
pdtDM = PrintDecayTree(name="PrintDiMuon", Input=dimuons)
def main():
from DaVinci import options
@@ -76,11 +77,12 @@ def main():
options.histo_file = 'DV-example-tupling-DTF-his.root'
options.input_raw_format = 4.3
options.lumi = False
options.print_freq = 1
tools = []
algs = {
"Reco": upfront_reconstruction(),
"DiMuons":
upfront_reconstruction() + [dimuons, pdtDM, DTF, tuple_dimuons],
"DiMuons":
upfront_reconstruction() + [dimuons, pdtDM, DTF, pdtDTF, tuple_dimuons],
}
return algs, tools
Loading