Belle II Software  release-06-00-14
SoftwareTriggerVariableManager.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 <hlt/softwaretrigger/core/SoftwareTriggerObject.h>
11 
12 #include <memory>
13 
14 namespace Belle2 {
19  namespace SoftwareTrigger {
37  private:
50  public:
56  double function(const SoftwareTriggerObject* mapOfValues) const
57  {
58  return mapOfValues->at(name);
59  }
60 
62  std::string name = "";
63 
64  private:
66  explicit SoftwareTriggerVariable(const std::string& theName) : name(theName) { }
67 
70 
73 
76 
79  };
80 
81  public:
83  typedef SoftwareTriggerObject Object;
89 
96 
105  SoftwareTriggerVariable* getVariable(const std::string& variableName);
106 
107  private:
110 
113 
116 
118  std::map<std::string, std::shared_ptr<SoftwareTriggerVariable>> m_variableNameToVariable;
119  };
120  }
122 }
Class which represents an abstract variable in the SoftwareTriggerVariableManager.
SoftwareTriggerVariable(SoftwareTriggerVariable &&)=default
Make the object move constructable.
SoftwareTriggerVariable(const SoftwareTriggerVariable &rhs)=delete
Do not copy a variable.
SoftwareTriggerVariable(const std::string &theName)
Private constructor. Should only be called by the SoftwareTriggerVariableManager.
SoftwareTriggerVariable & operator=(const SoftwareTriggerVariable &rhs)=delete
Do not copy a variable.
std::map< std::string, std::shared_ptr< SoftwareTriggerVariable > > m_variableNameToVariable
Internal storage of the variables with their name.
SoftwareTriggerVariableManager & operator=(SoftwareTriggerVariableManager &rhs)=delete
Delete the assignment operator: only use this class as a singleton.
SoftwareTriggerObject Object
As an object handed in for every cut to be checked, use a map of variable name -> precompiled value.
static SoftwareTriggerVariableManager & Instance()
Make this variable manager a singleton and get the only single instance of the manager.
SoftwareTriggerVariableManager()
Make the constructor private: only use this class as a singleton.
SoftwareTriggerVariableManager(const SoftwareTriggerVariableManager &)=delete
Delete the copy constructor: only use this class as a singleton.
SoftwareTriggerVariable * getVariable(const std::string &variableName)
Get the variable with the given name.
SoftwareTriggerVariable Var
Use a very slim object for the variables: only draw out the corresponding value from the precompiled ...
Abstract base class for different kinds of events.