Belle II Software development
AndFilter< AFilter > Class Template Reference

Filter adapter type that joins two filter results in an and like fashion. More...

#include <AndFilter.dcl.h>

Inheritance diagram for AndFilter< AFilter >:

Public Member Functions

 AndFilter (std::unique_ptr< AFilter > lhsFilter, std::unique_ptr< AFilter > rhsFilter)
 Constructor from two filters to be joined.
 
 ~AndFilter ()
 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
 Return result of right hand side filter if left hand side filter acknowledges.
 

Private Types

using Super = AFilter
 Type of the base class.
 

Private Attributes

std::unique_ptr< AFilter > m_lhsFilter
 Left hand side filter.
 
std::unique_ptr< AFilter > m_rhsFilter
 Right hand side filter.
 

Detailed Description

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

Filter adapter type that joins two filter results in an and like fashion.

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

Member Typedef Documentation

◆ Super

using Super = AFilter
private

Type of the base class.

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

Constructor & Destructor Documentation

◆ AndFilter()

AndFilter ( std::unique_ptr< AFilter >  lhsFilter,
std::unique_ptr< AFilter >  rhsFilter 
)

Constructor from two filters to be joined.

Definition at line 24 of file AndFilter.icc.h.

26 : m_lhsFilter(std::move(lhsFilter))
27 , m_rhsFilter(std::move(rhsFilter))
28 {
29 this->addProcessingSignalListener(m_lhsFilter.get());
30 this->addProcessingSignalListener(m_rhsFilter.get());
31 }
std::unique_ptr< AFilter > m_rhsFilter
Right hand side filter.
Definition: AndFilter.dcl.h:48
std::unique_ptr< AFilter > m_lhsFilter
Left hand side filter.
Definition: AndFilter.dcl.h:45

Member Function Documentation

◆ exposeParameters()

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

Expose the parameters to a module.

Definition at line 37 of file AndFilter.icc.h.

39 {
40 if (m_lhsFilter) m_lhsFilter->exposeParameters(moduleParamList, prefix);
41 if (m_rhsFilter) m_rhsFilter->exposeParameters(moduleParamList, prefix);
42 }

◆ operator()()

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

Return result of right hand side filter if left hand side filter acknowledges.

Definition at line 45 of file AndFilter.icc.h.

46 {
47 Weight lhsResult = (*m_lhsFilter)(obj);
48
49 if (std::isnan(lhsResult)) {
50 return NAN;
51 } else {
52 Weight rhsResult = (*m_rhsFilter)(obj);
53 return rhsResult;
54 }
55 }

Member Data Documentation

◆ m_lhsFilter

std::unique_ptr<AFilter> m_lhsFilter
private

Left hand side filter.

Definition at line 45 of file AndFilter.dcl.h.

◆ m_rhsFilter

std::unique_ptr<AFilter> m_rhsFilter
private

Right hand side filter.

Definition at line 48 of file AndFilter.dcl.h.


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