FunTuple event-by-event
Example for tupling on and event-by-event basis via the FunTuple_Event
helper.
This algorithm takes no input and is configured with “void” functors, i.e. functors that expect no input.
This is is contrast to FunTuple_(MC)Particles
, which take as input the TES location of (MC)Particles
and are configured with functors that operate on a single Particle/MCParticle.
from FunTuple import FunTuple_Event as Funtuple
import FunTuple.functorcollections as FC
from DaVinci import make_config, Options
def main(options: Options):
# get RecSummary object that holds information about nPVs, nTracks, nFTClusters
# Note more information can be added to the RecSummary object
# (see MRs: https://gitlab.cern.ch/lhcb/Moore/-/merge_requests/1649)
evt_vars = FC.EventInfo()
evt_vars += FC.RecSummary()
# define tupling algorithm
my_tuple = Funtuple(name="Tuple", tuple_name="EventInfo", variables=evt_vars)
return make_config(options, [my_tuple])
To run the example:
lbexec DaVinciExamples.tupling.option_davinci_tupling_FunTupleEvent:main $DAVINCIEXAMPLESROOT/example_data/Upgrade_LbToLcmunu.yaml
For reference, these are the options of this example
testfiledb_key: upgrade_LbToLcmunu
input_manifest_file: root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/Upgrade_LbToLcmunu.tck.json
input_raw_format: 0.5
ntuple_file: 'mytuple.root'
print_freq: 1
input_process: Hlt2
input_stream: default
evt_max: 7
persistreco_version: 0.0
lumi: False
write_fsr: False