![]() |
Belle II Software
release-06-01-15
|
Variable Manager for the software trigger cuts. More...
#include <SoftwareTriggerVariableManager.h>
Classes | |
class | SoftwareTriggerVariable |
Class which represents an abstract variable in the SoftwareTriggerVariableManager. More... | |
Public Types | |
typedef SoftwareTriggerObject | Object |
As an object handed in for every cut to be checked, use a map of variable name -> precompiled value. | |
typedef SoftwareTriggerVariable | Var |
Use a very slim object for the variables: only draw out the corresponding value from the precompiled map of values. | |
Public Member Functions | |
SoftwareTriggerVariable * | getVariable (const std::string &variableName) |
Get the variable with the given name. More... | |
Static Public Member Functions | |
static SoftwareTriggerVariableManager & | Instance () |
Make this variable manager a singleton and get the only single instance of the manager. More... | |
Private Member Functions | |
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. | |
SoftwareTriggerVariableManager & | operator= (SoftwareTriggerVariableManager &rhs)=delete |
Delete the assignment operator: only use this class as a singleton. | |
Private Attributes | |
std::map< std::string, std::shared_ptr< SoftwareTriggerVariable > > | m_variableNameToVariable |
Internal storage of the variables with their name. | |
Variable Manager for the software trigger cuts.
This class fulfills all the requirement of a variable manager, as stated in the GeneralCut class and can (and should) therefore be used together with it, which is done in the SoftwareTriggerCut.
The idea behind it is as follows: The SoftwareTriggerVariableManager itself does not know on how to calculate your needed variables, but you as the user of the SoftwareTriggerCut has to know. This gives you the opportunity to calculate them differently before or after the full reconstruction (because you may not have all information at hand at all time) or use temporary shared calculation objects when compiling the numbers. Whenever a SoftwareTriggerCut has a variable it it and the check function asks the variable manager for its value, the variable manager will collect this value from the SoftwareTriggerObject (a map from std::string to double) with the given variable name. So you as the user has to make sure that the needed variables can be found in the SoftwareTriggerObject, that you hand in to the checkPreScaled function of the SoftwareTriggerCut.
Definition at line 36 of file SoftwareTriggerVariableManager.h.
SoftwareTriggerVariableManager::SoftwareTriggerVariable * getVariable | ( | const std::string & | variableName | ) |
Get the variable with the given name.
If it is not already present in the internal map of variables, create a new one. Please note, that this function will never mark a variable as undefined, so there is no registration process as in the analysis variable manager. If a variable is defined or not depends only on the SoftwareTriggerObject that is used when checking the cut (and if there is an entry with the same name as the variable in this object).
Definition at line 24 of file SoftwareTriggerVariableManager.cc.
|
static |
Make this variable manager a singleton and get the only single instance of the manager.
You can still use it multiple times in different modules, as it depends on the map of values you hand in when checking the cut if the variable is defined or not.
Definition at line 18 of file SoftwareTriggerVariableManager.cc.