Skip to content

Add functorcollections module to FunTuple framework

Eduardo Rodrigues requested to merge erodrigu-funtuple-colls into master

Module to provide Functor collections for the FunTuple framework.

It should eventually replace the present NewTupleTools module as it contains some improvements. In particular, it ensures a dynamic construction of the module docstring, as help(functorcollections) shows something like

Help on module functorcollections:

NAME
    functorcollections - Functor collections for the FunTuple framework.

DESCRIPTION
    A typical usage is the following:

    .. code-block:: python

        coll_of_predefined_variables = FunctorCollection(Kinematics)

    List of available collections (with contents):

    Kinematics:
       THOR_MASS      : ::Functors::Composite::Mass{}
       THOR_P         : ::Functors::Track::Momentum{}
       THOR_PT        : ::Functors::Track::TransverseMomentum{}
       THOR_PX        : ::Functors::Track::Px{}
       THOR_PY        : ::Functors::Track::Py{}
       THOR_PZ        : ::Functors::Track::Pz{}
       THOR_E         : ::Functors::Track::Energy{}


DATA
    Kinematics = {'THOR_MASS': ('::Functors::Composite::Mass{}', ['Functor...
    __all__ = ('Kinematics',)

FILE
    /afs/cern.ch/work/e/erodrigu/LHCb/software/Analysis/Phys/FunTuple/python/FunTuple/functorcollections.py

I did not adapt NewTupleTools itself because (1) I do not want to cause disruptions as there's a lot of WIP on the FunTuple framework, (2) a new module allows parallel checks and (3) I find functorcollections a better name :D.

Work on DPA master task https://gitlab.cern.ch/lhcb-dpa/project/-/issues/121. Relates also to https://gitlab.cern.ch/lhcb-dpa/project/-/issues/178.

Edited by Eduardo Rodrigues

Merge request reports