LDMX Software
hcal::HcalTriggerGeometryProvider Class Reference

Public Member Functions

 HcalTriggerGeometryProvider (const std::string &name, const std::string &tagname, const framework::config::Parameters &parameters, framework::Process &process)
 Class constructor.
 
virtual ~HcalTriggerGeometryProvider ()
 Destructor.
 
virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOVgetCondition (const ldmx::EventHeader &context)
 Provides access to the HcalGeometry or HcalTriggerGeometry.
 
virtual void releaseConditionsObject (const framework::ConditionsObject *co)
 Take no action on release, as the object is permanently owned by the Provider.
 
- Public Member Functions inherited from framework::ConditionsObjectProvider
 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
 
 ConditionsObjectProvider (const std::string &objname, const std::string &tagname, const framework::config::Parameters &parameters, Process &process)
 Class constructor.
 
virtual ~ConditionsObjectProvider ()=default
 Class destructor.
 
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.
 

Private Attributes

HcalTriggerGeometryhcal_trigger_geometry_
 

Additional Inherited Members

- Protected Member Functions inherited from framework::ConditionsObjectProvider
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 inherited from framework::ConditionsObjectProvider
logging::logger the_log_
 The logger for this ConditionsObjectProvider.
 

Detailed Description

Definition at line 63 of file HcalTriggerGeometry.cxx.

Constructor & Destructor Documentation

◆ HcalTriggerGeometryProvider()

hcal::HcalTriggerGeometryProvider::HcalTriggerGeometryProvider ( const std::string & name,
const std::string & tagname,
const framework::config::Parameters & parameters,
framework::Process & process )
inline

Class constructor.

Definition at line 68 of file HcalTriggerGeometry.cxx.

72 : ConditionsObjectProvider(HcalTriggerGeometry::CONDITIONS_OBJECT_NAME,
73 tagname, parameters, process),
74 hcal_trigger_geometry_{nullptr} {}
const Process & process() const
Get the process handle.
ConditionsObjectProvider(const std::string &objname, const std::string &tagname, const framework::config::Parameters &parameters, Process &process)
Class constructor.

◆ ~HcalTriggerGeometryProvider()

virtual hcal::HcalTriggerGeometryProvider::~HcalTriggerGeometryProvider ( )
inlinevirtual

Destructor.

Definition at line 77 of file HcalTriggerGeometry.cxx.

77 {
78 if (hcal_trigger_geometry_ != nullptr) delete hcal_trigger_geometry_;
79 hcal_trigger_geometry_ = nullptr;
80 }

Member Function Documentation

◆ getCondition()

virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOV > hcal::HcalTriggerGeometryProvider::getCondition ( const ldmx::EventHeader & context)
inlinevirtual

Provides access to the HcalGeometry or HcalTriggerGeometry.

Note
Currently, these are assumed to be valid for all time, but this behavior could be changed. Users should not cache the pointer between events

Implements framework::ConditionsObjectProvider.

Definition at line 90 of file HcalTriggerGeometry.cxx.

90 {
91 if (hcal_trigger_geometry_ == nullptr) {
92 std::pair<const framework::ConditionsObject*, framework::ConditionsIOV>
93 cond_hcal_geom = requestParentCondition(
95 const ldmx::HcalGeometry* hcalgeom =
96 dynamic_cast<const ldmx::HcalGeometry*>(cond_hcal_geom.first);
97 hcal_trigger_geometry_ = new HcalTriggerGeometry(hcalgeom);
98 }
99 return std::make_pair(hcal_trigger_geometry_,
101 context.getRun(), context.getRun(), true, true));
102 }
Class which defines the run/event/type range for which a given condition is valid,...
std::pair< const ConditionsObject *, ConditionsIOV > requestParentCondition(const std::string &name, const ldmx::EventHeader &context)
Request another condition needed to construct this condition.
int getRun() const
Return the run number.
Definition EventHeader.h:84
Implementation of HCal strip readout.
static constexpr const char * CONDITIONS_OBJECT_NAME
Conditions object: The name of the python configuration calling this class (Hcal/python/HcalGeometry....

References ldmx::HcalGeometry::CONDITIONS_OBJECT_NAME, and ldmx::EventHeader::getRun().

◆ releaseConditionsObject()

virtual void hcal::HcalTriggerGeometryProvider::releaseConditionsObject ( const framework::ConditionsObject * co)
inlinevirtual

Take no action on release, as the object is permanently owned by the Provider.

Reimplemented from framework::ConditionsObjectProvider.

Definition at line 108 of file HcalTriggerGeometry.cxx.

108{}

Member Data Documentation

◆ hcal_trigger_geometry_

HcalTriggerGeometry* hcal::HcalTriggerGeometryProvider::hcal_trigger_geometry_
private

Definition at line 111 of file HcalTriggerGeometry.cxx.


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