Belle II Software development
ChoosableFromVarSetFilter.dcl.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/FilterOnVarSet.dcl.h>
11
12#include <tracking/trackFindingCDC/varsets/BaseVarSet.h>
13
14#include <RtypesCore.h>
15
16#include <string>
17#include <memory>
18
19namespace Belle2 {
24 class ModuleParamList;
25 namespace TrackFindingCDC {
26
31 template <class AFilter>
32 class ChoosableFromVarSet : public OnVarSet<AFilter> {
33
34 private:
37
38 public:
40 using Object = typename AFilter::Object;
41
42 private:
45
46 public:
51 ChoosableFromVarSet(std::unique_ptr<AVarSet> varSet, std::string varName = "");
52
55
57 void exposeParameters(ModuleParamList* parameterList, const std::string& prefix) override;
58
60 void initialize() override;
61
63 Weight operator()(const Object& object) override;
64
65 private:
67 std::string m_param_varName;
68
70 Float_t* m_variable = nullptr;
71 };
72
74 template <class ATruthVarSet>
76 : public ChoosableFromVarSet<Filter<typename ATruthVarSet::Object>> {
77
78 private:
81
82 public:
84 using Object = typename ATruthVarSet::Object;
85
86 public:
88 ChoosableFromVarSetFilter(const std::string& varName = "");
89
92 };
93 }
95}
The Module parameter list class.
Generic class that generates some named float values from a given object.
Definition BaseVarSet.h:34
typename ATruthVarSet::Object Object
Type of the filtered object.
ChoosableFromVarSetFilter(const std::string &varName="")
Constructor.
ChoosableFromVarSet< Filter< typename ATruthVarSet::Object > > Super
Type of the super class.
Weight operator()(const Object &object) override
Returns the variable with the set requested name from the variable set.
void exposeParameters(ModuleParamList *parameterList, const std::string &prefix) override
Add the parameters of this filter to the given parameter list.
void initialize() override
Initialisation method sets up a reference to the value in the variable set to be returned.
OnVarSet< AFilter > Super
Type of the super class.
typename AFilter::Object Object
Type of the filtered object.
BaseVarSet< Object > AVarSet
Type of the variable set.
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...
OnVarSet(std::unique_ptr< AVarSet > varSet)
Constructor from the variable set the filter should use.
Abstract base class for different kinds of events.