Belle II Software development
Filter.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/Filter.dcl.h>
11
12#include <tracking/trackFindingCDC/numerics/Weight.h>
13
14#include <string>
15#include <cmath>
16
17namespace Belle2 {
22 class ModuleParamList;
24}
25
26namespace Belle2 {
31 namespace TrackFindingCDC {
32
33 template<class AObject>
34 Filter<AObject>::Filter() = default;
35
36 template<class AObject>
37 Filter<AObject>::~Filter() = default;
38
39 template <class AObject>
41 {
42 return false;
43 }
44
45 template <class AObject>
46 Weight Filter<AObject>::operator()(const Object& obj __attribute__((unused)))
47 {
48 return 1;
49 }
50
51 template <class AObject>
53 {
54 return obj ? operator()(*obj) : NAN;
55 }
56
57 template <class AObject>
58 std::vector<float> Filter<AObject>::operator()(const std::vector <Object*>& objs)
59 {
60 std::vector<float> out;
61 for (const auto& obj : objs) {
62 out.push_back(operator()(obj));
63 }
64 return out;
65 }
66 }
68}
AObject Object
Type of the object to be analysed.
Definition: Filter.dcl.h:35
virtual Weight operator()(const Object &obj)
Function to evaluate the object.
Definition: Filter.icc.h:46
Filter()
Default constructor.
virtual bool needsTruthInformation()
Indicates if the filter requires Monte Carlo information.
Definition: Filter.icc.h:40
virtual ~Filter()
Make destructor of interface class virtual.
Abstract base class for different kinds of events.