10#include <tracking/trackFindingCDC/filters/base/FilterOnVarSet.dcl.h>
12#include <tracking/trackFindingCDC/utilities/Named.h>
14#include <framework/logging/Logger.h>
16#include <RtypesCore.h>
29 namespace TrackFindingCDC {
31 template <
class AFilter>
35 B2ASSERT(
"Varset initialised as nullptr",
m_varSet);
38 template <
class AFilter>
41 template <
class AFilter>
48 template <
class AFilter>
52 if (result)
return true;
54 const std::vector<Named<Float_t*>>& namedVariables =
m_varSet->getNamedVariables();
56 std::string name = namedVariable.getName();
58 if (name.find(
"truth") != std::string::npos) {
65 template <
class AFilter>
69 if (std::isnan(weight))
return NAN;
71 return extracted ? weight : NAN;
74 template <
class AFilter>
80 template <
class AFilter>
86 template <
class AFilter>
92 template <
class AFilter>
95 Super::exposeParameters(moduleParamList, prefix);
96 m_varSet->exposeParameters(moduleParamList, prefix);
99 template <
class AVarSet>
105 template <
class AVarSet>
The Module parameter list class.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
~FilterOnVarSet()
Default destructor.
OnVarSet< Filter< typename AVarSet::Object > > Super
Type of the super class.
FilterOnVarSet()
Constructor of the filter.
virtual Weight operator()(const Object &obj)
Function to evaluate the object.
virtual bool needsTruthInformation()
Indicates if the filter requires Monte Carlo information.
A mixin class to attach a name to an object.
void initialize() override
No reassignment of variable set possible for now.
bool needsTruthInformation() override
Checks if any variables need Monte Carlo information.
Weight operator()(const Object &obj) override
Function extracting the variables of the object into the variable set.
std::unique_ptr< AVarSet > m_varSet
Instance of the variable set to be used in the filter.
std::unique_ptr< AVarSet > releaseVarSet() &&
Steal the set of variables form this filter - filter becomes dysfunctional afterwards.
AVarSet & getVarSet() const
Getter for the set of variables.
typename AFilter::Object Object
Type of pbject to be filtered.
BaseVarSet< Object > AVarSet
Type of the variable set usedi in this filter.
void setVarSet(std::unique_ptr< AVarSet > varSet)
Setter for the set of variables.
OnVarSet(std::unique_ptr< AVarSet > varSet)
Constructor from the variable set the filter should use.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Forward prefixed parameters of this findlet to the module parameter list.
~OnVarSet()
Default destructor.
Abstract base class for different kinds of events.