Belle II Software  release-08-01-10
TruthVarFilter.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/TruthVarFilter.dcl.h>
11 
12 #include <tracking/trackFindingCDC/filters/base/ChoosableFromVarSetFilter.icc.h>
13 
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
15 
16 #include <cmath>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24 
25  template <class ATruthVarSet>
27  : Super("truth")
28  {
29  }
30 
31  template <class ATruthVarSet>
33 
34  template<class ATruthVarSet>
35  auto TruthVarFilter<ATruthVarSet>::operator()(const Object& object) -> Weight {
36  Weight value = Super::operator()(object);
37  if (std::isnan(value) or value == 0) return NAN;
38  return 1.0;
39  }
40  }
42 }
typename ATruthVarSet::Object Object
Type of the filtered object.
Filter adapter to make a filter work on a set of variables and return on variable as the result of th...
Weight operator()(const Object &object) override
Reject an item if the truth variable is 0, else accept it.
Abstract base class for different kinds of events.