Belle II Software  release-05-02-19
SoftwareTriggerVariableManager.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - 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 <hlt/softwaretrigger/core/SoftwareTriggerObject.h>
13 
14 #include <memory>
15 
16 namespace Belle2 {
21  namespace SoftwareTrigger {
38  class SoftwareTriggerVariableManager {
39  private:
51  class SoftwareTriggerVariable {
52  public:
58  double function(const SoftwareTriggerObject* mapOfValues) const
59  {
60  return mapOfValues->at(name);
61  }
62 
64  std::string name = "";
65 
66  private:
68  explicit SoftwareTriggerVariable(const std::string& theName) : name(theName) { }
69 
72 
75 
78 
80  friend class SoftwareTriggerVariableManager;
81  };
82 
83  public:
85  typedef SoftwareTriggerObject Object;
91 
98 
107  SoftwareTriggerVariable* getVariable(const std::string& variableName);
108 
109  private:
112 
115 
118 
120  std::map<std::string, std::shared_ptr<SoftwareTriggerVariable>> m_variableNameToVariable;
121  };
122  }
124 }
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::SoftwareTriggerVariable::operator=
SoftwareTriggerVariable & operator=(const SoftwareTriggerVariable &rhs)=delete
Do not copy a variable.
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::m_variableNameToVariable
std::map< std::string, std::shared_ptr< SoftwareTriggerVariable > > m_variableNameToVariable
Internal storage of the variables with their name.
Definition: SoftwareTriggerVariableManager.h:128
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::operator=
SoftwareTriggerVariableManager & operator=(SoftwareTriggerVariableManager &rhs)=delete
Delete the assignment operator: only use this class as a singleton.
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::Var
SoftwareTriggerVariable Var
Use a very slim object for the variables: only draw out the corresponding value from the precompiled ...
Definition: SoftwareTriggerVariableManager.h:98
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::SoftwareTriggerVariable::SoftwareTriggerVariable
SoftwareTriggerVariable(const std::string &theName)
Private constructor. Should only be called by the SoftwareTriggerVariableManager.
Definition: SoftwareTriggerVariableManager.h:76
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::SoftwareTriggerVariableManager
SoftwareTriggerVariableManager()
Make the constructor private: only use this class as a singleton.
Definition: SoftwareTriggerVariableManager.h:119
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::Object
SoftwareTriggerObject Object
As an object handed in for every cut to be checked, use a map of variable name -> precompiled value.
Definition: SoftwareTriggerVariableManager.h:93
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::Instance
static SoftwareTriggerVariableManager & Instance()
Make this variable manager a singleton and get the only single instance of the manager.
Definition: SoftwareTriggerVariableManager.cc:28
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::getVariable
SoftwareTriggerVariable * getVariable(const std::string &variableName)
Get the variable with the given name.
Definition: SoftwareTriggerVariableManager.cc:34
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager
Variable Manager for the software trigger cuts.
Definition: SoftwareTriggerVariableManager.h:46
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::SoftwareTriggerVariable
Class which represents an abstract variable in the SoftwareTriggerVariableManager.
Definition: SoftwareTriggerVariableManager.h:59
Belle2::SoftwareTrigger::SoftwareTriggerVariableManager::SoftwareTriggerVariable::name
std::string name
Name of this particular variable.
Definition: SoftwareTriggerVariableManager.h:72