 |
Belle II Software
release-05-02-19
|
11 #include <framework/modules/gearbox/GearboxModule.h>
12 #include <framework/gearbox/Gearbox.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/dataobjects/EventMetaData.h>
16 #include <framework/core/ModuleParam.templateDetails.h>
30 GearboxModule::GearboxModule() :
Module()
33 setDescription(
"Loads the Belle II detector parameters from an XML document.");
41 "data. A backend can also contain a search path after ':'. (If none "
42 "is given, '/data' will be used.)",
m_backends);
44 string(
"geometry/Belle2.xml"));
46 "file. This should be a list of tuples containing an xpath "
47 "expression, a value and a unit (which can be empty). The xpath "
48 "expression must resolve to exactly one node in the XML tree which "
49 "does not contain any children except text. The supplied value and "
50 "unit will be set for this node. See "
53 "xpath expression may evaluate to more than one node in which case "
54 "all occurances are set to the supplied value and unit",
57 "prepended to all overrides. Beware that '//' has a special meaning "
58 "meaning in xpath so be careful with leading and trailing slashes "
59 "in the overrides and the prefix respectively", std::string(
"/Detector"));
71 poverride.
value = std::get<1>(unit);
72 poverride.
unit = std::get<2>(unit);
73 gearbox.addOverride(poverride);
78 poverride.
value = std::get<1>(multiple);
79 poverride.
unit = std::get<2>(multiple);
81 gearbox.addOverride(poverride);
void beginRun() override
Load the (possibly rundependent) parameters from the chosen backends.
std::string value
New value.
void setDescription(const std::string &description)
Sets the description of the module.
static Gearbox & getInstance()
Return reference to the Gearbox instance.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
std::string m_overridePrefix
common prefix for all value overrides
bool multiple
if true, override all nodes when more than one node matches the XPath expression, bail otherwise
void initialize() override
Define backends.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Struct to override a path in the XML file with a custom value.
Abstract base class for different kinds of events.
std::vector< std::tuple< std::string, std::string, std::string > > m_multipleOverrides
overrides to override the value and unit of many parameters
Type-safe access to single objects in the data store.
Singleton class responsible for loading detector parameters from an XML file.
std::string path
XPath expression of the path to override.
std::vector< std::string > m_backends
The backend specifier.
std::vector< std::tuple< std::string, std::string, std::string > > m_unitOverrides
overrides to override the value and unit of a parameter
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
std::string m_fileName
The toplevel filename for the parameters.