Belle II Software  release-05-01-25
TruthVarFilter.icc.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/filters/base/TruthVarFilter.dcl.h>
13 
14 #include <tracking/trackFindingCDC/filters/base/ChoosableFromVarSetFilter.icc.h>
15 
16 #include <tracking/trackFindingCDC/numerics/Weight.h>
17 
18 #include <cmath>
19 
20 namespace Belle2 {
25  namespace TrackFindingCDC {
26 
27  template <class ATruthVarSet>
29  : Super("truth")
30  {
31  }
32 
33  template <class ATruthVarSet>
35 
36  template<class ATruthVarSet>
37  auto TruthVarFilter<ATruthVarSet>::operator()(const Object& object) -> Weight {
38  Weight value = Super::operator()(object);
39  if (std::isnan(value) or value == 0) return NAN;
40  return 1.0;
41  }
42  }
44 }
Belle2::TrackFindingCDC::TruthVarFilter::TruthVarFilter
TruthVarFilter()
Constructor.
Definition: TruthVarFilter.icc.h:36
Belle2::TrackFindingCDC::ChoosableFromVarSetFilter::Object
typename ATruthVarSet::Object Object
Type of the filtered object.
Definition: ChoosableFromVarSetFilter.dcl.h:94
Belle2::TrackFindingCDC::TruthVarFilter::~TruthVarFilter
~TruthVarFilter()
Default destructor.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::TruthVarFilter::operator()
Weight operator()(const Object &object) override
Reject an item if the truth variable is 0, else accept it.
Definition: TruthVarFilter.icc.h:45