LDMX Software
ConditionsObjectProvider.h
Go to the documentation of this file.
1
8#ifndef FRAMEWORK_CONDITIONSOBJECTPROVIDER_H_
9#define FRAMEWORK_CONDITIONSOBJECTPROVIDER_H_
10
11/*~~~~~~~~~~~*/
12/* Event */
13/*~~~~~~~~~~~*/
14
15/*~~~~~~~~~~~~~~~*/
16/* Framework */
17/*~~~~~~~~~~~~~~~*/
20#include "Framework/Configure/Parameters.h"
21#include "Framework/Factory.h"
22#include "Framework/Logger.h"
23
24/*~~~~~~~~~~~~~~~~*/
25/* C++ StdLib */
26/*~~~~~~~~~~~~~~~~*/
27
28namespace ldmx {
29class EventHeader;
30class RunHeader;
31} // namespace ldmx
32
33namespace framework {
34
35class Process;
37
43 public:
46 std::shared_ptr<ConditionsObjectProvider>, const std::string&,
47 const std::string&, const framework::config::Parameters&,
48 Process&);
49
64 ConditionsObjectProvider(const std::string& objname,
65 const std::string& tagname,
66 const framework::config::Parameters& parameters,
68
72 virtual ~ConditionsObjectProvider() = default;
73
78 virtual std::pair<const ConditionsObject*, ConditionsIOV> getCondition(
79 const ldmx::EventHeader& context) = 0;
80
86 virtual void releaseConditionsObject(const ConditionsObject* co) {
87 delete co;
88 }
89
94 virtual void onProcessStart() {}
95
101 virtual void onProcessEnd() {}
102
107 virtual void onNewRun(ldmx::RunHeader&) {}
108
112 const std::string& getConditionObjectName() const { return object_name_; }
113
117 const std::string& getTagName() const { return tagname_; }
118
119 protected:
121 std::pair<const ConditionsObject*, ConditionsIOV> requestParentCondition(
122 const std::string& name, const ldmx::EventHeader& context);
123
125 logging::logger the_log_;
126
128 const Process& process() const { return process_; }
129
130 private:
133
135 std::string object_name_;
136
138 std::string tagname_;
139};
140
141} // namespace framework
142
155#define DECLARE_CONDITIONS_PROVIDER(CLASS) \
156 FACTORY_REGISTRATION(framework::ConditionsObjectProvider, CLASS)
157
158#endif
Interval-of-validity object for conditions information.
Base class for conditions information like pedestals, gains, electronics maps, etc.
Header holding Factory class and supporting macros.
be configured to load conditions objects from CSV files.
Base class for all providers of conditions objects.
std::string object_name_
The name of the object provided by this provider.
virtual void onProcessStart()
Callback for the ConditionsObjectProvider to take any necessary action when the processing of events ...
std::pair< const ConditionsObject *, ConditionsIOV > requestParentCondition(const std::string &name, const ldmx::EventHeader &context)
Request another condition needed to construct this condition.
virtual void onNewRun(ldmx::RunHeader &)
Callback for the ConditionsObjectProvider to take any necessary action when the processing of events ...
const Process & process() const
Get the process handle.
DECLARE_FACTORY(ConditionsObjectProvider, std::shared_ptr< ConditionsObjectProvider >, const std::string &, const std::string &, const framework::config::Parameters &, Process &)
declare that we have a factory for these types of classes
std::string tagname_
The tag name for the ConditionsObjectProvider.
virtual void onProcessEnd()
Callback for the ConditionsObjectProvider to take any necessary action when the processing of events ...
virtual std::pair< const ConditionsObject *, ConditionsIOV > getCondition(const ldmx::EventHeader &context)=0
Pure virtual getCondition function.
ConditionsObjectProvider(const std::string &objname, const std::string &tagname, const framework::config::Parameters &parameters, Process &process)
Class constructor.
const std::string & getTagName() const
Access the tag name.
virtual void releaseConditionsObject(const ConditionsObject *co)
Called by conditions system when done with a conditions object, appropriate point for cleanup.
logging::logger the_log_
The logger for this ConditionsObjectProvider.
virtual ~ConditionsObjectProvider()=default
Class destructor.
Process & process_
Handle to the Process.
const std::string & getConditionObjectName() const
Get the list of conditions objects available from this provider.
Base class for all conditions objects, very simple.
Class which represents the process under execution.
Definition Process.h:34
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Provides header information an event such as event number and timestamp.
Definition EventHeader.h:44
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:68
All classes in the ldmx-sw project use this namespace.