Belle II Software  release-08-01-10
ObserverFilter.icc.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/trackFindingCDC/filters/base/OberverFilter.dcl.h>
11 
12 #include <tracking/trackFindingCDC/numerics/Weight.h>
13 
14 #include <framework/logging/Logger.h>
15 
16 #include <cmath>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24 
25  template<class AFilter>
27  {
28  B2INFO("Filter said " << m_yesAnswers << " times yes and " << m_noAnswers << " times no.");
29  Super::terminate();
30  }
31 
32  template<class AFilter>
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  }
44  }
46 }
Weight operator()(const Object &object) override
Function to evaluate the object.
void terminate() override
Terminate the filter after event processing.
typename AFilter::Object Object
Object type to be filtered.
Abstract base class for different kinds of events.