LDMX Software
Conditions.h
Go to the documentation of this file.
1
7#ifndef FRAMEWORK_CONDITIONS_H_
8#define FRAMEWORK_CONDITIONS_H_
9
10/*~~~~~~~~~~~*/
11/* Event */
12/*~~~~~~~~~~~*/
14#include "Framework/Exception/Exception.h"
15
16/*~~~~~~~~~~~~~~~*/
17/* Framework */
18/*~~~~~~~~~~~~~~~*/
20#include "Framework/Configure/Parameters.h"
21#include "Framework/Logger.h"
22
23/*~~~~~~~~~~~~~~~~*/
24/* C++ StdLib */
25/*~~~~~~~~~~~~~~~~*/
26#include <any>
27#include <map>
28
29namespace ldmx {
30class RunHeader;
31}
32
33namespace framework {
34
35class Process;
37class ConditionsObject;
38
44 public:
49
54
68 const ConditionsObject* getConditionPtr(const std::string& condition_name);
69
82 template <class T>
83 const T& getCondition(const std::string& condition_name) {
84 return dynamic_cast<const T&>(*getConditionPtr(condition_name));
85 }
86
93 ConditionsIOV getConditionIOV(const std::string& condition_name) const;
94
98 void onProcessStart();
99
103 void onProcessEnd();
104
109
114 const std::string& classname, const std::string& instancename,
115 const std::string& tagname, const framework::config::Parameters& params);
116
117 private:
120
122 std::map<std::string, ConditionsObjectProvider*> providerMap_;
123
135
137 std::map<std::string, CacheEntry> cache_;
138};
139
140} // namespace framework
141
142#endif
Interval-of-validity object for conditions information.
Class that provides header information about an event such as event number and timestamp.
be configured to load conditions objects from CSV files.
Class which defines the run/event/type range for which a given condition is valid,...
Base class for all providers of conditions objects.
Base class for all conditions objects, very simple.
Container and cache for conditions and conditions providers.
Definition Conditions.h:43
const T & getCondition(const std::string &condition_name)
Primary request action for a conditions object If the object is in the cache and still valid (IOV),...
Definition Conditions.h:83
Process & process_
Handle to the Process.
Definition Conditions.h:119
std::map< std::string, CacheEntry > cache_
Conditions cache.
Definition Conditions.h:137
std::map< std::string, ConditionsObjectProvider * > providerMap_
Map of who provides which condition.
Definition Conditions.h:122
const ConditionsObject * getConditionPtr(const std::string &condition_name)
Primary request action for a conditions object If the object is in the cache and still valid (IOV),...
void onProcessEnd()
Calls onProcessEnd for all ConditionsObjectProviders.
ConditionsIOV getConditionIOV(const std::string &condition_name) const
Access the IOV for the given condition.
~Conditions()
Class destructor.
Definition Conditions.h:53
void onProcessStart()
Calls onProcessStart for all ConditionsObjectProviders.
void onNewRun(ldmx::RunHeader &)
Calls onNewRun for all ConditionsObjectProviders.
void createConditionsObjectProvider(const std::string &classname, const std::string &instancename, const std::string &tagname, const framework::config::Parameters &params)
Create a ConditionsObjectProvider given the information.
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45
An entry to store an already loaded conditions object.
Definition Conditions.h:127
ConditionsObjectProvider * provider
Provider that gave us the conditions object.
Definition Conditions.h:131
const ConditionsObject * obj
Const pointer to the retrieved conditions object.
Definition Conditions.h:133
ConditionsIOV iov
Interval Of Validity for this entry in the cache.
Definition Conditions.h:129