Belle II Software  release-08-01-10
ObserverFilter< AFilter > Class Template Reference

Observer listening to the number of yes and no answers from the filter. More...

#include <ObserverFilter.dcl.h>

Inheritance diagram for ObserverFilter< AFilter >:
Collaboration diagram for ObserverFilter< AFilter >:

Public Types

using Object = typename AFilter::Object
 Object type to be filtered.
 

Public Member Functions

void terminate () override
 Terminate the filter after event processing.
 
Weight operator() (const Object &object) override
 Function to evaluate the object. More...
 

Private Types

using Super = AFilter
 Type of the filter base class.
 

Private Attributes

unsigned int m_yesAnswers = 0
 Number of counted yes answers.
 
unsigned int m_noAnswers = 0
 Number of counted no answers.
 

Detailed Description

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

Observer listening to the number of yes and no answers from the filter.

Definition at line 21 of file ObserverFilter.dcl.h.

Member Function Documentation

◆ operator()()

Weight operator() ( const Object object)
override

Function to evaluate the object.

Base implementation rejects all objects.

Parameters
objectThe object to be accepted or rejected.
Returns
A finit float value if the object is accepted. NAN if the object is rejected.

Definition at line 33 of file ObserverFilter.icc.h.

34  {
35  Weight result = Super::operator()(object);
36  if (std::isnan(result)) {
37  m_noAnswers += 1;
38  } else {
39  m_yesAnswers += 1;
40  }
41 
42  return result;
43  }
unsigned int m_yesAnswers
Number of counted yes answers.
unsigned int m_noAnswers
Number of counted no answers.

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