12This module defines wrapper functions around the arich modules.
15from basf2
import register_module
19def arichVariablesToNtuple(decayString, variables, arichSelector, treename='variables', filename='ntuple.root', path=None):
21 Creates and fills a flat ntuple
with the specified variables
from the VariableManager.
22 If a decayString
is provided, then there will be one entry per candidate (
for particle
in list of candidates).
23 If an empty decayString
is provided, there will be one entry per event (useful
for trigger studies, etc).
26 decayString (str): specifies type of Particles
and determines the name of the ParticleList
27 variables (list(str)): the list of variables (which must be registered
in the VariableManager)
28 arichSelector (str): decay string that marks the particles to which arich info should be appended
29 treename (str): name of the ntuple tree
30 filename (str): which
is used to store the variables
31 path (basf2.Path): the basf2 path where the analysis
is processed
34 arich_vars = vu.create_aliases_for_selected(['arich'],
35 decay_string=arichSelector)
37 output = register_module(
'arichToNtuple')
38 output.set_name(
'arichToNtuple_' + decayString)
39 output.param(
'particleList', decayString)
40 output.param(
'variables', variables)
41 output.param(
'arichVariables', arich_vars)
42 output.param(
'arichSelector', arichSelector)
43 output.param(
'fileName', filename)
44 output.param(
'treeName', treename)
45 path.add_module(output)