10#include <tracking/trackFindingCDC/filters/base/ChooseableFilter.dcl.h>
12#include <tracking/trackFindingCDC/filters/base/FilterFactory.icc.h>
14#include <framework/core/ModuleParamList.templateDetails.h>
16#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
26 namespace TrackFindingCDC {
28 template <
class AFilter>
34 B2ASSERT(
"Constructing a chooseable filter with no factory",
m_filterFactory);
37 template <
class AFilter>
39 const std::string& filterName)
44 B2ASSERT(
"Constructing a chooseable filter with no factory",
m_filterFactory);
47 template <
class AFilter>
50 Super::exposeParameters(moduleParamList, prefix);
53 moduleParamList->
addParameter(prefixed(prefix,
"filter"),
58 moduleParamList->
addParameter(prefixed(prefix,
"filter"),
64 m_param_filterParameters.addParameter(moduleParamList,
65 prefixed(prefix,
"filterParameters"),
66 m_filterFactory->createFiltersParametersDescription());
69 template <
class AFilter>
80 const std::string prefix =
"";
81 m_filter->exposeParameters(&filterModuleParamList, prefix);
82 m_param_filterParameters.assignTo(&filterModuleParamList);
83 this->addProcessingSignalListener(m_filter.get());
87 template <
class AFilter>
90 return m_filter->needsTruthInformation();
93 template <
class AFilter>
99 template <
class AFilter>
105 template <
class AFilter>
111 template <
class AFilterFactory>
113 :
Super(
std::make_unique<AFilterFactory>())
117 template <
class AFilterFactory>
119 :
Super(
std::make_unique<AFilterFactory>(), filterName)
The Module parameter list class.
ChooseableFilter()
Constructor of the chooseable filter.
Chooseable< typename AFilterFactory::CreatedFilter > Super
Type of the super class.
Chooseable(std::unique_ptr< FilterFactory< AFilter > > filterFactory)
Setup the chooseable filter with available choices from the factory.
void initialize() override
Initialize before event processing.
std::unique_ptr< FilterFactory< AFilter > > m_filterFactory
Filter factor to construct a chosen filter.
bool needsTruthInformation() override
Indicates if the filter requires Monte Carlo information.
std::unique_ptr< AFilter > m_filter
Chosen filter.
std::string m_param_filterName
Parameters : Name of the selected filter.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the set of parameters of the filter to the module parameter list.
typename AFilter::Object Object
Type of the object to be analysed.
Weight operator()(const Object &object) final
Function to evaluate the object.
FilterParamMap m_param_filterParameters
Parameter: Parameter keys and values to be forwarded to the chosen filter.
Factory that can create appropriate filter instances from a name.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.