10#include <tracking/vxdHoughTracking/findlets/LimitedOnHitApplier.dcl.h>
11#include <tracking/trackFindingCDC/utilities/Functional.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <framework/core/ModuleParamList.templateDetails.h>
22 namespace vxdHoughTracking {
24 template <
class AHit,
class AFilter>
27 this->addProcessingSignalListener(&m_filter);
30 template <
class AHit,
class AFilter>
33 m_filter.exposeParameters(moduleParamList, prefix);
35 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"useNBestHits"), m_useNHits,
"Only use the best N hits",
39 template <
class AHit,
class AFilter>
43 Super::apply(currentPath, childHits);
45 if (m_useNHits > 0 and childHits.size() >
static_cast<unsigned int>(m_useNHits)) {
47 childHits.erase(childHits.begin() + m_useNHits, childHits.end());
51 template <
class AHit,
class AFilter>
54 return m_filter(
object);
The Module parameter list class.
A mixin class to attach a weight to an object.
typename Super::Object Object
The object to filer.
void apply(const std::vector< TrackFindingCDC::WithWeight< const AHit * > > ¤tPath, std::vector< TrackFindingCDC::WithWeight< AHit * > > &childHits) override
Apply the filter to each pair of hits and current path and let only pass the best N hits.
TrackFindingCDC::Weight operator()(const Object &object) override
Copy the filter operator to this method.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the subfindlet.
LimitedOnHitApplier()
Constructor adding the findlet as a listener.
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.
Functor factory turning a binary functor and two functors into a new functor which executes the binar...