LDMX Software
|
Container and cache for conditions and conditions providers. More...
#include <Conditions.h>
Classes | |
struct | CacheEntry |
An entry to store an already loaded conditions object. More... | |
Public Member Functions | |
Conditions (Process &) | |
Constructor. | |
~Conditions () | |
Class destructor. | |
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), the cached object will be returned. | |
template<class T > | |
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), the cached object will be returned. | |
ConditionsIOV | getConditionIOV (const std::string &condition_name) const |
Access the IOV for the given condition. | |
void | onProcessStart () |
Calls onProcessStart for all ConditionsObjectProviders. | |
void | onProcessEnd () |
Calls onProcessEnd 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 ¶ms) |
Create a ConditionsObjectProvider given the information. | |
Private Attributes | |
Process & | process_ |
Handle to the Process. | |
std::map< std::string, ConditionsObjectProvider * > | providerMap_ |
Map of who provides which condition. | |
std::map< std::string, CacheEntry > | cache_ |
Conditions cache. | |
Container and cache for conditions and conditions providers.
Definition at line 43 of file Conditions.h.
framework::Conditions::Conditions | ( | Process & | p | ) |
|
inline |
void framework::Conditions::createConditionsObjectProvider | ( | const std::string & | classname, |
const std::string & | instancename, | ||
const std::string & | tagname, | ||
const framework::config::Parameters & | params | ||
) |
Create a ConditionsObjectProvider given the information.
Definition at line 12 of file Conditions.cxx.
References framework::PluginFactory::createConditionsObjectProvider(), framework::ConditionsObjectProvider::getConditionObjectName(), framework::PluginFactory::getInstance(), process_, and providerMap_.
Referenced by framework::Process::Process().
|
inline |
Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned.
If it is not in the cache, or is out of date, the ConditionsObjectProvider::getCondition method will be called to provide the object.
T | type to cast condition object to |
[in] | condition_name | name of condition to retrieve |
Definition at line 83 of file Conditions.h.
References getConditionPtr().
Referenced by framework::EventProcessor::getCondition().
ConditionsIOV framework::Conditions::getConditionIOV | ( | const std::string & | condition_name | ) | const |
Access the IOV for the given condition.
[in] | condition_name | name of condition to get IOV for |
Definition at line 46 of file Conditions.cxx.
References cache_.
Referenced by framework::ConditionsObjectProvider::requestParentCondition().
const ConditionsObject * framework::Conditions::getConditionPtr | ( | const std::string & | condition_name | ) |
Primary request action for a conditions object If the object is in the cache and still valid (IOV), the cached object will be returned.
If it is not in the cache, or is out of date, the ConditionsObjectProvider::getCondition method will be called to provide the object.
Exception | if condition object or provider for that object is not found. |
[in] | condition_name | name of condition to retrieve |
if still valid, we return what we have
Definition at line 55 of file Conditions.cxx.
References cache_, framework::Process::getEventHeader(), ldmx::EventHeader::getEventNumber(), ldmx::EventHeader::getRun(), framework::Conditions::CacheEntry::iov, ldmx::EventHeader::isRealData(), framework::Conditions::CacheEntry::obj, process_, framework::Conditions::CacheEntry::provider, and providerMap_.
Referenced by getCondition(), and framework::ConditionsObjectProvider::requestParentCondition().
void framework::Conditions::onNewRun | ( | ldmx::RunHeader & | rh | ) |
Calls onNewRun for all ConditionsObjectProviders.
Definition at line 42 of file Conditions.cxx.
References providerMap_.
Referenced by framework::Process::newRun().
void framework::Conditions::onProcessEnd | ( | ) |
Calls onProcessEnd for all ConditionsObjectProviders.
Definition at line 38 of file Conditions.cxx.
References providerMap_.
void framework::Conditions::onProcessStart | ( | ) |
Calls onProcessStart for all ConditionsObjectProviders.
Definition at line 34 of file Conditions.cxx.
References providerMap_.
Referenced by framework::Process::run().
|
private |
Conditions cache.
Definition at line 137 of file Conditions.h.
Referenced by getConditionIOV(), and getConditionPtr().
|
private |
Handle to the Process.
Definition at line 119 of file Conditions.h.
Referenced by createConditionsObjectProvider(), and getConditionPtr().
|
private |
Map of who provides which condition.
Definition at line 122 of file Conditions.h.
Referenced by createConditionsObjectProvider(), getConditionPtr(), onNewRun(), onProcessEnd(), and onProcessStart().