LDMX Software
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
framework::ConditionsObjectProvider Class Referenceabstract

Base class for all providers of conditions objects. More...

#include <ConditionsObjectProvider.h>

Public Member Functions

 ConditionsObjectProvider (const std::string &objname, const std::string &tagname, const framework::config::Parameters &parameters, Process &process)
 Class constructor.
 
virtual ~ConditionsObjectProvider ()
 Class destructor.
 
virtual std::pair< const ConditionsObject *, ConditionsIOVgetCondition (const ldmx::EventHeader &context)=0
 Pure virtual getCondition function.
 
virtual void releaseConditionsObject (const ConditionsObject *co)
 Called by conditions system when done with a conditions object, appropriate point for cleanup.
 
virtual void onProcessStart ()
 Callback for the ConditionsObjectProvider to take any necessary action when the processing of events starts.
 
virtual void onProcessEnd ()
 Callback for the ConditionsObjectProvider to take any necessary action when the processing of events finishes, such as closing database connections.
 
virtual void onNewRun (ldmx::RunHeader &)
 Callback for the ConditionsObjectProvider to take any necessary action when the processing of events starts for a given run.
 
const std::string & getConditionObjectName () const
 Get the list of conditions objects available from this provider.
 
const std::string & getTagName () const
 Access the tag name.
 

Static Public Member Functions

static void declare (const std::string &classname, ConditionsObjectProviderMaker *)
 Internal function which is part of the PluginFactory machinery.
 

Static Public Attributes

static const int CLASSTYPE {10}
 Constant used to types by the PluginFactory.
 

Protected Member Functions

std::pair< const ConditionsObject *, ConditionsIOVrequestParentCondition (const std::string &name, const ldmx::EventHeader &context)
 Request another condition needed to construct this condition.
 
const Processprocess () const
 Get the process handle.
 

Protected Attributes

logging::logger theLog_
 The logger for this ConditionsObjectProvider.
 

Private Attributes

Processprocess_
 Handle to the Process.
 
std::string objectName_
 The name of the object provided by this provider.
 
std::string tagname_
 The tag name for the ConditionsObjectProvider.
 

Detailed Description

Base class for all providers of conditions objects.

Definition at line 48 of file ConditionsObjectProvider.h.

Constructor & Destructor Documentation

◆ ConditionsObjectProvider()

ConditionsObjectProvider::ConditionsObjectProvider ( const std::string &  objname,
const std::string &  tagname,
const framework::config::Parameters parameters,
Process process 
)

Class constructor.

Parameters
nameName for this instance of the class.
tagNameThe tag for the database entry (should not include whitespace)
processThe Process class associated with ConditionsObjectProvider, provided by the framework.
Note
The name provided to this function should not be the class name, but rather a logical label for this instance of the class, as more than one copy of a given class can be loaded into a Process with different parameters. Names should not include whitespace or special characters.

Definition at line 9 of file ConditionsObjectProvider.cxx.

12 : theLog_{logging::makeLogger(objname)},
14 objectName_{objname},
15 tagname_{tagname} {}
logging::logger theLog_
The logger for this ConditionsObjectProvider.
std::string objectName_
The name of the object provided by this provider.
const Process & process() const
Get the process handle.
std::string tagname_
The tag name for the ConditionsObjectProvider.
Process & process_
Handle to the Process.

◆ ~ConditionsObjectProvider()

virtual framework::ConditionsObjectProvider::~ConditionsObjectProvider ( )
inlinevirtual

Class destructor.

Definition at line 75 of file ConditionsObjectProvider.h.

75{ ; }

Member Function Documentation

◆ declare()

void ConditionsObjectProvider::declare ( const std::string &  classname,
ConditionsObjectProviderMaker maker 
)
static

Internal function which is part of the PluginFactory machinery.

Parameters
classnameThe class name of the processor.

Definition at line 25 of file ConditionsObjectProvider.cxx.

26 {
28 classname, CLASSTYPE, maker);
29}
static const int CLASSTYPE
Constant used to types by the PluginFactory.
void registerConditionsObjectProvider(const std::string &classname, int classtype, ConditionsObjectProviderMaker *maker)
Register a conditions object provider.
static PluginFactory & getInstance()
Get the factory instance.

References CLASSTYPE, framework::PluginFactory::getInstance(), and framework::PluginFactory::registerConditionsObjectProvider().

◆ getCondition()

virtual std::pair< const ConditionsObject *, ConditionsIOV > framework::ConditionsObjectProvider::getCondition ( const ldmx::EventHeader context)
pure virtual

◆ getConditionObjectName()

const std::string & framework::ConditionsObjectProvider::getConditionObjectName ( ) const
inline

Get the list of conditions objects available from this provider.

Definition at line 115 of file ConditionsObjectProvider.h.

115{ return objectName_; }

References objectName_.

Referenced by framework::Conditions::createConditionsObjectProvider().

◆ getTagName()

const std::string & framework::ConditionsObjectProvider::getTagName ( ) const
inline

Access the tag name.

Definition at line 127 of file ConditionsObjectProvider.h.

127{ return tagname_; }

References tagname_.

◆ onNewRun()

virtual void framework::ConditionsObjectProvider::onNewRun ( ldmx::RunHeader )
inlinevirtual

Callback for the ConditionsObjectProvider to take any necessary action when the processing of events starts for a given run.

Reimplemented in framework::RandomNumberSeedService, ecal::EcalGeometryProvider, and hcal::HcalGeometryProvider.

Definition at line 110 of file ConditionsObjectProvider.h.

110{}

◆ onProcessEnd()

virtual void framework::ConditionsObjectProvider::onProcessEnd ( )
inlinevirtual

Callback for the ConditionsObjectProvider to take any necessary action when the processing of events finishes, such as closing database connections.

Definition at line 104 of file ConditionsObjectProvider.h.

104{}

◆ onProcessStart()

virtual void framework::ConditionsObjectProvider::onProcessStart ( )
inlinevirtual

Callback for the ConditionsObjectProvider to take any necessary action when the processing of events starts.

Definition at line 97 of file ConditionsObjectProvider.h.

97{}

◆ process()

const Process & framework::ConditionsObjectProvider::process ( ) const
inlineprotected

Get the process handle.

Definition at line 138 of file ConditionsObjectProvider.h.

138{ return process_; }

References process_.

Referenced by framework::RandomNumberSeedService::onNewRun().

◆ releaseConditionsObject()

virtual void framework::ConditionsObjectProvider::releaseConditionsObject ( const ConditionsObject co)
inlinevirtual

Called by conditions system when done with a conditions object, appropriate point for cleanup.

Note
Default behavior is to delete the object!

Reimplemented in framework::RandomNumberSeedService, ecal::EcalDetectorMapLoader, ecal::EcalGeometryProvider, ecal::EcalTriggerGeometryProvider, hcal::HcalDetectorMapLoader, hcal::HcalGeometryProvider, and hcal::HcalTriggerGeometryProvider.

Definition at line 89 of file ConditionsObjectProvider.h.

89 {
90 delete co;
91 }

◆ requestParentCondition()

std::pair< const ConditionsObject *, ConditionsIOV > ConditionsObjectProvider::requestParentCondition ( const std::string &  name,
const ldmx::EventHeader context 
)
protected

Request another condition needed to construct this condition.

Definition at line 18 of file ConditionsObjectProvider.cxx.

19 {
20 const ConditionsObject* obj = process_.getConditions().getConditionPtr(name);
21 ConditionsIOV iov = process_.getConditions().getConditionIOV(name);
22 return std::make_pair(obj, iov);
23}
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),...
ConditionsIOV getConditionIOV(const std::string &condition_name) const
Access the IOV for the given condition.
Conditions & getConditions()
Get a reference to the conditions system.
Definition Process.h:78

References framework::Conditions::getConditionIOV(), framework::Conditions::getConditionPtr(), framework::Process::getConditions(), and process_.

Referenced by ecal::EcalTriggerGeometryProvider::getCondition(), hcal::HcalReconConditionsProvider::getCondition(), and tracking::geo::TrackersTrackingGeometryProvider::getCondition().

Member Data Documentation

◆ CLASSTYPE

const int framework::ConditionsObjectProvider::CLASSTYPE {10}
static

Constant used to types by the PluginFactory.

Definition at line 51 of file ConditionsObjectProvider.h.

51{10};

Referenced by declare().

◆ objectName_

std::string framework::ConditionsObjectProvider::objectName_
private

The name of the object provided by this provider.

Definition at line 145 of file ConditionsObjectProvider.h.

Referenced by getConditionObjectName().

◆ process_

Process& framework::ConditionsObjectProvider::process_
private

Handle to the Process.

Definition at line 142 of file ConditionsObjectProvider.h.

Referenced by process(), and requestParentCondition().

◆ tagname_

std::string framework::ConditionsObjectProvider::tagname_
private

The tag name for the ConditionsObjectProvider.

Definition at line 148 of file ConditionsObjectProvider.h.

Referenced by getTagName().

◆ theLog_

logging::logger framework::ConditionsObjectProvider::theLog_
protected

The logger for this ConditionsObjectProvider.

Definition at line 135 of file ConditionsObjectProvider.h.


The documentation for this class was generated from the following files: