Skip to content

Add functor boilerplate mixins, use header_map helper, functor simplifications

Olli Lupton requested to merge olupton_mixins into master

This goes with LHCb!2173 (merged), Brunel!901 (merged) and Moore!260 (merged).

"pure" functor changes:

  • Add explicit FILTER functor that adapts something that acts object-wise into something that acts container-wise. This removes some very awkward overload resolution ambiguities and allows several other improvements. In practice the outer FILTER(...) can be added automatically.
    • Remove CRTP Functor<> and Predicate<>, just use FunctorBase and PredicateBase, which are now named Functor and Predicate
  • Add rtype() to the type-erasing wrapper -- this returns the std::type_info of the wrapped functor return type before it's converted to the specified output type. This is useful for the dump-to-TTree functionality (where the specified output type can be std::any)
  • Fix the top-level prepare(), add a test for that
  • Try and fix ALL and NONE to return appropriate mask_v types from vector arguments
  • Add a workaround for what seems to be a Cling limitation (autoloading libraries based on functions)

functor "usage" changes:

  • Add ThOR::FunctorDesc::ALL default for use as a default property value
  • Remove deprecated part of Functors::IFactory interface, improve error-reporting
  • Add with_functors mixin for algorithms that want a fixed number of functors
  • Add with_functor_maps mixin for algorithms that want a fixed number of maps-of-functors

functor testing changes:

  • Add a new functor-testing algorithm and use it in test_functors.py
  • Optionally (off by default locally, on by default in the nightlies) generate a functor cache from this to catch more problems
  • Expand this to test ~all combinations of "track" inputs with ~all functors, plus some combination/composite cases

functor-using algorithm changes:

  • Use new utilities in CombineTracks to reduce copy/pasted boilerplate
    • Improve its dump-to-TTree functionality to support different types better
  • Use new utilities in VoidFilter to reduce copy/pasted boilerplate
  • Use new utilities in Pr::Filter to reduce copy/pasted boilerplate
    • Pr::SOAFilter is partially migrated but not fully -- not sure if this is a priority..

other changes:

  • Use new proxy-defining macros in IterableVertexRelations.h
  • Declare Pr::Selection<T> header
  • Declare Pr::Zip<...> header
Edited by Olli Lupton

Merge request reports