Belle II Software  release-05-02-19
ChoosableFromVarSetFilter.dcl.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/FilterOnVarSet.dcl.h>
13 
14 #include <tracking/trackFindingCDC/varsets/BaseVarSet.h>
15 
16 #include <RtypesCore.h>
17 
18 #include <string>
19 #include <memory>
20 
21 namespace Belle2 {
26  class ModuleParamList;
27  namespace TrackFindingCDC {
28 
33  template <class AFilter>
34  class ChoosableFromVarSet : public OnVarSet<AFilter> {
35 
36  private:
38  using Super = OnVarSet<AFilter>;
39 
40  public:
42  using Object = typename AFilter::Object;
43 
44  private:
47 
48  public:
53  ChoosableFromVarSet(std::unique_ptr<AVarSet> varSet, std::string varName = "");
54 
57 
59  void exposeParameters(ModuleParamList* parameterList, const std::string& prefix) override;
60 
62  void initialize() override;
63 
65  Weight operator()(const Object& object) override;
66 
67  private:
69  std::string m_param_varName;
70 
72  Float_t* m_variable = nullptr;
73  };
74 
76  template <class ATruthVarSet>
78  : public ChoosableFromVarSet<Filter<typename ATruthVarSet::Object>> {
79 
80  private:
83 
84  public:
86  using Object = typename ATruthVarSet::Object;
87 
88  public:
90  ChoosableFromVarSetFilter(const std::string& varName = "");
91 
94  };
95  }
97 }
Belle2::TrackFindingCDC::ChoosableFromVarSet::Object
typename AFilter::Object Object
Type of the filtered object.
Definition: ChoosableFromVarSetFilter.dcl.h:50
Belle2::TrackFindingCDC::ChoosableFromVarSet::exposeParameters
void exposeParameters(ModuleParamList *parameterList, const std::string &prefix) override
Add the parameters of this filter to the given parameter list.
Definition: ChoosableFromVarSetFilter.icc.h:50
Belle2::TrackFindingCDC::ChoosableFromVarSet
Filter adapter to make a filter work on a set of variables and return on variable as the result of th...
Definition: ChoosableFromVarSetFilter.dcl.h:42
Belle2::TrackFindingCDC::ChoosableFromVarSet::~ChoosableFromVarSet
~ChoosableFromVarSet()
Default destructor.
Belle2::TrackFindingCDC::ChoosableFromVarSetFilter
Convience template to create a filter returning on variable from a set of variables.
Definition: ChoosableFromVarSetFilter.dcl.h:85
Belle2::TrackFindingCDC::ProcessingSignalListener
Interface for an algorithm part that needs to receive the module processing signals.
Definition: ProcessingSignalListener.h:30
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::ChoosableFromVarSet::m_variable
Float_t * m_variable
Reference to the location of the value in the variable set to be returned.
Definition: ChoosableFromVarSetFilter.dcl.h:80
Belle2::TrackFindingCDC::ChoosableFromVarSet::ChoosableFromVarSet
ChoosableFromVarSet(std::unique_ptr< AVarSet > varSet, std::string varName="")
Constructor taking the variable set the filter should work on and the default name of the variable to...
Definition: ChoosableFromVarSetFilter.icc.h:39
Belle2::TrackFindingCDC::ChoosableFromVarSetFilter::ChoosableFromVarSetFilter
ChoosableFromVarSetFilter(const std::string &varName="")
Constructor.
Definition: ChoosableFromVarSetFilter.icc.h:104
Belle2::TrackFindingCDC::ChoosableFromVarSet::operator()
Weight operator()(const Object &object) override
Returns the variable with the set requested name from the variable set.
Definition: ChoosableFromVarSetFilter.icc.h:89
Belle2::TrackFindingCDC::ChoosableFromVarSetFilter::~ChoosableFromVarSetFilter
~ChoosableFromVarSetFilter()
Default destructor.
Belle2::TrackFindingCDC::ChoosableFromVarSet::initialize
void initialize() override
Initialisation method sets up a reference to the value in the variable set to be returned.
Definition: ChoosableFromVarSetFilter.icc.h:72
Belle2::ModuleParamList
The Module parameter list class.
Definition: ModuleParamList.h:46
Belle2::TrackFindingCDC::BaseVarSet< Object >
Belle2::TrackFindingCDC::ChoosableFromVarSet::m_param_varName
std::string m_param_varName
Memory for the name of the variable selected as the return value of the filter.
Definition: ChoosableFromVarSetFilter.dcl.h:77
Belle2::TrackFindingCDC::ChoosableFromVarSet::Super
OnVarSet< AFilter > Super
Type of the super class.
Definition: ChoosableFromVarSetFilter.dcl.h:46