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