Belle II Software development
NotFilter< AFilter > Class Template Reference

Filter adapter type that inverts the acceptance criterion for cross checks. More...

#include <NotFilter.dcl.h>

Inheritance diagram for NotFilter< AFilter >:

Public Types

using Object = typename AFilter::Object
 Type of the object to be filtered.
 

Public Member Functions

 NotFilter (std::unique_ptr< AFilter > filter)
 Constructor from filter to be inverted.
 
 ~NotFilter ()
 Default destructor.
 
void exposeParameters (ModuleParamList *moduleParamList, const std::string &prefix) final
 Expose the parameters to a module.
 
Weight operator() (const typename AFilter::Object &obj) final
 Accept inverse.
 

Private Types

using Super = AFilter
 Type of the base class.
 

Private Attributes

std::unique_ptr< AFilter > m_filter
 Filter to be inverted.
 

Detailed Description

template<class AFilter>
class Belle2::TrackFindingCDC::NotFilter< AFilter >

Filter adapter type that inverts the acceptance criterion for cross checks.

Definition at line 24 of file NotFilter.dcl.h.

Member Typedef Documentation

◆ Object

using Object = typename AFilter::Object

Type of the object to be filtered.

Definition at line 32 of file NotFilter.dcl.h.

◆ Super

using Super = AFilter
private

Type of the base class.

Definition at line 28 of file NotFilter.dcl.h.

Constructor & Destructor Documentation

◆ NotFilter()

NotFilter ( std::unique_ptr< AFilter >  filter)
explicit

Constructor from filter to be inverted.

Definition at line 25 of file NotFilter.icc.h.

26 : m_filter(std::move(filter))
27 {
28 this->addProcessingSignalListener(m_filter.get());
29 }
std::unique_ptr< AFilter > m_filter
Filter to be inverted.
Definition: NotFilter.dcl.h:49
std::map< ExpRun, std::pair< double, double > > filter(const std::map< ExpRun, std::pair< double, double > > &runs, double cut, std::map< ExpRun, std::pair< double, double > > &runsRemoved)
filter events to remove runs shorter than cut, it stores removed runs in runsRemoved
Definition: Splitter.cc:38

Member Function Documentation

◆ exposeParameters()

void exposeParameters ( ModuleParamList moduleParamList,
const std::string &  prefix 
)
final

Expose the parameters to a module.

Definition at line 35 of file NotFilter.icc.h.

37 {
38 if (m_filter) m_filter->exposeParameters(moduleParamList, prefix);
39 }

◆ operator()()

Weight operator() ( const typename AFilter::Object &  obj)
final

Accept inverse.

Definition at line 42 of file NotFilter.icc.h.

43 {
44 Weight result = (*m_filter)(obj);
45 if (std::isnan(result)) {
46 return 1;
47 } else {
48 return NAN;
49 }
50 }

Member Data Documentation

◆ m_filter

std::unique_ptr<AFilter> m_filter
private

Filter to be inverted.

Definition at line 49 of file NotFilter.dcl.h.


The documentation for this class was generated from the following files: