Skip to content
Snippets Groups Projects

DaVinci example to show how to get charged particles in a DaVinci script

Closed Guillaume Max Pietrzyk requested to merge guillaume_davinci_example into master
1 file
+ 41
0
Compare changes
  • Side-by-side
  • Inline
from FunTuple import FunTuple_Particles as Funtuple
from DaVinci import Options, make_config
from DaVinci.algorithms import add_filter
from Hlt2Conf.standard_particles import ( make_long_muons,
make_long_electrons_with_brem,
make_long_kaons,
make_long_pions,
)
import FunTuple.functorcollections as FC
"""
Very simple DaVinci option file.
The only purpose of this script is to show how to get the charged particles from the rest of the event within DaVinci.
Not using with reconstruction.bind(from_file=True, spruce=True) can make it look for protoparticles in /Event/pRec/ProtoP/Charged/, which most likely does not exist in your DST processed by Moore.
"""
def main(options: Options):
## Line definitions
process = 'HLT2'
line = 'Hlt2TrackEff_Velo2Long_B2JpsiK_MuonProbe_VELO' #Just an example
from RecoConf.reconstruction_objects import reconstruction, upfront_reconstruction
with reconstruction.bind(from_file=True, spruce=True):
long_muons = make_long_muons()
long_electrons = make_long_electrons_with_brem()
long_kaons = make_long_kaons()
long_pions = make_long_pions()
unpack_data = upfront_reconstruction()
filter_line = add_filter("HDRFilter_Bu2JpsiK",
f"HLT_PASS('{line}')")
algs = {
"B02JpsiK": [filter_line] + unpack_data + [long_muons, long_electrons, long_kaons, long_pions],
}
return make_config(options, algs)
Loading