LDMX Software
Public Member Functions | Private Attributes | List of all members
hcal::HcalReconConditionsProvider Class Reference

a helpful interface for grabbing the parent conditions at once More...

Public Member Functions

 HcalReconConditionsProvider (const std::string &name, const std::string &tagname, const framework::config::Parameters &parameters, framework::Process &proc)
 Retrieve the name of the parent conditions from the configuration.
 
virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOVgetCondition (const ldmx::EventHeader &context) final override
 Get the wrapped condition.
 
- Public Member Functions inherited from framework::ConditionsObjectProvider
 ConditionsObjectProvider (const std::string &objname, const std::string &tagname, const framework::config::Parameters &parameters, Process &process)
 Class constructor.
 
virtual ~ConditionsObjectProvider ()
 Class destructor.
 
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.
 

Private Attributes

std::string adc_gain_
 name of condition object for hcal adc gains
 
std::string adc_ped_
 name of condition object for hcal adc pedestals
 
std::string tot_calib_
 name of condition object for hcal tot calibrations
 
std::string toa_calib_
 name of condition object for hcal toa calibrations
 

Additional Inherited Members

- Static Public Member Functions inherited from framework::ConditionsObjectProvider
static void declare (const std::string &classname, ConditionsObjectProviderMaker *)
 Internal function which is part of the PluginFactory machinery.
 
- Static Public Attributes inherited from framework::ConditionsObjectProvider
static const int CLASSTYPE {10}
 Constant used to types by the PluginFactory.
 
- 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 theLog_
 The logger for this ConditionsObjectProvider.
 

Detailed Description

a helpful interface for grabbing the parent conditions at once

the most complicated task it does is calculate the "minimum" IOV from the parent conditions to make sure that it is updated as soon as it needs to be updated.

@TODO Right now, no minimum IOV calculation is being done. We just have our IOV be one run at a time.

Definition at line 64 of file HcalReconConditions.cxx.

Constructor & Destructor Documentation

◆ HcalReconConditionsProvider()

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

Retrieve the name of the parent conditions from the configuration.

Exceptions
Exceptionif name is not what it should be
Parameters
[in]nameshould be HcalReconConditions::CONDITIONS_NAME
[in]tagname
[in]parameterspython configuration parameters
[in]prochandle to current process

Definition at line 85 of file HcalReconConditions.cxx.

90 tagname, parameters, proc) {
92 EXCEPTION_RAISE("BadConfig",
93 "The name provided to HcalReconConditionsProvider " +
94 name + " is not equal to the expected name " +
96 }
97 adc_gain_ = parameters.getParameter<std::string>("adc_gain");
98 adc_ped_ = parameters.getParameter<std::string>("adc_ped");
99 tot_calib_ = parameters.getParameter<std::string>("tot_calib");
100 toa_calib_ = parameters.getParameter<std::string>("toa_calib");
101 }
be configured to load conditions objects from CSV files.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
std::string adc_gain_
name of condition object for hcal adc gains
std::string adc_ped_
name of condition object for hcal adc pedestals
std::string tot_calib_
name of condition object for hcal tot calibrations
std::string toa_calib_
name of condition object for hcal toa calibrations
static const std::string CONDITIONS_NAME
the name of the HcalReconConditions table (must match python registration name)

References adc_gain_, adc_ped_, hcal::HcalReconConditions::CONDITIONS_NAME, framework::config::Parameters::getParameter(), toa_calib_, and tot_calib_.

Member Function Documentation

◆ getCondition()

virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOV > hcal::HcalReconConditionsProvider::getCondition ( const ldmx::EventHeader context)
inlinefinaloverridevirtual

Get the wrapped condition.

This is where we deduce the "minimum" IOV.

Note
Right now, we just have the IOV go one run at a time.
Expects the parent condition tables to all be conditions::DoubleTableCondition
See also
requestParentCondition for how we get the parent condition tables

Implements framework::ConditionsObjectProvider.

Definition at line 116 of file HcalReconConditions.cxx.

116 {
117 // requestParentCondition does check current context for validity
118 // to avoid extra constructions
119 auto [adc_gain_co, adc_gain_iov] =
121 auto [adc_ped_co, adc_ped_iov] = requestParentCondition(adc_ped_, context);
122 auto [tot_calib_co, tot_calib_iov] =
124 auto [toa_calib_co, toa_calib_iov] =
126
127 // deduce "minimum" IOV
128 // TODO: Framework #56 :
129 // https://github.com/LDMX-Software/Framework/issues/56
130 [[maybe_unused]] auto min_iov = adc_ped_iov;
131 // use std::move(min_iov) in return statement below
132
133 // wrap
135 dynamic_cast<const conditions::DoubleTableCondition&>(*adc_ped_co),
136 dynamic_cast<const conditions::DoubleTableCondition&>(*adc_gain_co),
137 dynamic_cast<const conditions::DoubleTableCondition&>(*tot_calib_co),
138 dynamic_cast<const conditions::DoubleTableCondition&>(*toa_calib_co));
139
140 return {co, framework::ConditionsIOV(context.getRun(), context.getRun())};
141 }
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.
Base class for all conditions objects, very simple.
Class to wrap around the various recon condition tables.
int getRun() const
Return the run number.
Definition EventHeader.h:84

References adc_gain_, adc_ped_, framework::ConditionsObjectProvider::requestParentCondition(), toa_calib_, and tot_calib_.

Member Data Documentation

◆ adc_gain_

std::string hcal::HcalReconConditionsProvider::adc_gain_
private

name of condition object for hcal adc gains

Definition at line 66 of file HcalReconConditions.cxx.

Referenced by getCondition(), and HcalReconConditionsProvider().

◆ adc_ped_

std::string hcal::HcalReconConditionsProvider::adc_ped_
private

name of condition object for hcal adc pedestals

Definition at line 68 of file HcalReconConditions.cxx.

Referenced by getCondition(), and HcalReconConditionsProvider().

◆ toa_calib_

std::string hcal::HcalReconConditionsProvider::toa_calib_
private

name of condition object for hcal toa calibrations

Definition at line 72 of file HcalReconConditions.cxx.

Referenced by getCondition(), and HcalReconConditionsProvider().

◆ tot_calib_

std::string hcal::HcalReconConditionsProvider::tot_calib_
private

name of condition object for hcal tot calibrations

Definition at line 70 of file HcalReconConditions.cxx.

Referenced by getCondition(), and HcalReconConditionsProvider().


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