LDMX Software
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ecal::EcalReconConditions Class Reference

Class to wrap around an double table of conditions. More...

#include <EcalReconConditions.h>

Public Member Functions

 EcalReconConditions (const conditions::DoubleTableCondition &table, bool validate=true)
 Constructor.
 
double adcPedestal (const ldmx::EcalID &id) const
 get the ADC pedestal
 
double adcGain (const ldmx::EcalID &id) const
 get the ADC gain
 
double totPedestal (const ldmx::EcalID &id) const
 get the TOT pedestal
 
double totGain (const ldmx::EcalID &id) const
 get the TOT gain
 

Static Public Attributes

static const std::string CONDITIONS_NAME = "EcalReconConditions"
 the name of the EcalReconConditions table (must match python registration name)
 
static const unsigned int IADC_PEDESTAL = 0
 column index for ADC pedestal
 
static const unsigned int IADC_GAIN = 1
 column index for ADC threshold
 
static const unsigned int ITOT_PEDESTAL = 2
 column index for TOT pedestal
 
static const unsigned int ITOT_GAIN = 3
 column index for TOT gain
 
static const std::vector< std::string > EXPECTED_COLUMNS
 expected order of column names matching the above indices (must match the indices above)
 

Private Attributes

const conditions::DoubleTableConditionthe_table_
 reference to the table of conditions storing the chip conditions
 

Detailed Description

Class to wrap around an double table of conditions.

This hardcodes the column numbers and checks that the hardcoded numbers match the imported columns during construction.

Definition at line 17 of file EcalReconConditions.h.

Constructor & Destructor Documentation

◆ EcalReconConditions()

ecal::EcalReconConditions::EcalReconConditions ( const conditions::DoubleTableCondition table,
bool  validate = true 
)

Constructor.

Assign the conditions table to use and (if validate is true), check if the hard-coded column indices correctly match the table that is passed.

@raises Exception if any of the column names from the passed table do not match the hardcoded indices.

Parameters
[in]tabledouble table of reconstruction conditions
[in]validatetrue if you want to check the columns

Definition at line 14 of file EcalReconConditions.cxx.

16 : the_table_{table} {
17 // leave early if we don't want to validate
18 if (!validate) return;
19
21 EXCEPTION_RAISE(
22 "ConditionsException",
23 "Inconsistent condition for EcalReconConditions :" + table.getName());
24 }
25
26 // not using fancy C++17 to shorten this because we want the error to
27 // tell us where the failure is
28 for (size_t i = 0; i < EXPECTED_COLUMNS.size(); i++) {
29 if (the_table_.getColumnNames().at(i) != EXPECTED_COLUMNS.at(i)) {
30 EXCEPTION_RAISE("ConditionsException",
31 "Expected column '" + EXPECTED_COLUMNS.at(i) +
32 "', got '" + the_table_.getColumnNames().at(i) + "'");
33 } // does name match?
34 } // loop through columns
35}
unsigned int getColumnCount() const
Get the number of columns.
const std::vector< std::string > & getColumnNames() const
Get the names of the columns.
const conditions::DoubleTableCondition & the_table_
reference to the table of conditions storing the chip conditions
static const std::vector< std::string > EXPECTED_COLUMNS
expected order of column names matching the above indices (must match the indices above)
std::string getName() const
Get the name of this object.

References EXPECTED_COLUMNS, conditions::BaseTableCondition::getColumnCount(), conditions::BaseTableCondition::getColumnNames(), framework::ConditionsObject::getName(), and the_table_.

Member Function Documentation

◆ adcGain()

double ecal::EcalReconConditions::adcGain ( const ldmx::EcalID id) const
inline

get the ADC gain

The ADC gain converts the ADC counts measuring a voltage amplitude into an estimated charge deposition [fC].

Parameters
[in]idraw ID for specific chip
Returns
the ADC threshold for that chip in fC/counts

Definition at line 70 of file EcalReconConditions.h.

70 {
71 return the_table_.get(id.raw(), IADC_GAIN);
72 }
T get(unsigned int id, unsigned int col) const
Get an entry by DetectorId and number.
static const unsigned int IADC_GAIN
column index for ADC threshold

References conditions::HomogenousTableCondition< T >::get(), IADC_GAIN, and the_table_.

Referenced by ecal::EcalRecProducer::produce().

◆ adcPedestal()

double ecal::EcalReconConditions::adcPedestal ( const ldmx::EcalID id) const
inline

get the ADC pedestal

Parameters
[in]idECal ID for specific chip
Returns
the ADC pedestal for that chip in counts

Definition at line 56 of file EcalReconConditions.h.

56 {
57 return the_table_.get(id.raw(), IADC_PEDESTAL);
58 }
static const unsigned int IADC_PEDESTAL
column index for ADC pedestal

References conditions::HomogenousTableCondition< T >::get(), IADC_PEDESTAL, and the_table_.

Referenced by ecal::EcalRecProducer::produce().

◆ totGain()

double ecal::EcalReconConditions::totGain ( const ldmx::EcalID id) const
inline

get the TOT gain

The TOT gain converts counts measuring time over threshold into an estimate for charge deposited in that cell [fC].

Parameters
[in]idECal ID for specific chip
Returns
the TOT gain for that chip in fC/counts

Definition at line 94 of file EcalReconConditions.h.

94 {
95 return the_table_.get(id.raw(), ITOT_GAIN);
96 }
static const unsigned int ITOT_GAIN
column index for TOT gain

References conditions::HomogenousTableCondition< T >::get(), ITOT_GAIN, and the_table_.

Referenced by ecal::EcalRecProducer::produce().

◆ totPedestal()

double ecal::EcalReconConditions::totPedestal ( const ldmx::EcalID id) const
inline

get the TOT pedestal

Parameters
[in]idECal ID for specific chip
Returns
the TOT pedestal for that chip in counts

Definition at line 80 of file EcalReconConditions.h.

80 {
81 return the_table_.get(id.raw(), ITOT_PEDESTAL);
82 }
static const unsigned int ITOT_PEDESTAL
column index for TOT pedestal

References conditions::HomogenousTableCondition< T >::get(), ITOT_PEDESTAL, and the_table_.

Referenced by ecal::EcalRecProducer::produce().

Member Data Documentation

◆ CONDITIONS_NAME

const std::string ecal::EcalReconConditions::CONDITIONS_NAME = "EcalReconConditions"
static

the name of the EcalReconConditions table (must match python registration name)

Definition at line 21 of file EcalReconConditions.h.

Referenced by ecal::EcalRecProducer::produce().

◆ EXPECTED_COLUMNS

const std::vector< std::string > ecal::EcalReconConditions::EXPECTED_COLUMNS
static
Initial value:
= {
"ADC_PEDESTAL", "ADC_GAIN", "TOT_PEDESTAL", "TOT_GAIN"}

expected order of column names matching the above indices (must match the indices above)

The order of these column names needs to match the indices listed in the header.

Definition at line 32 of file EcalReconConditions.h.

Referenced by EcalReconConditions().

◆ IADC_GAIN

const unsigned int ecal::EcalReconConditions::IADC_GAIN = 1
static

column index for ADC threshold

Definition at line 25 of file EcalReconConditions.h.

Referenced by adcGain().

◆ IADC_PEDESTAL

const unsigned int ecal::EcalReconConditions::IADC_PEDESTAL = 0
static

column index for ADC pedestal

Definition at line 23 of file EcalReconConditions.h.

Referenced by adcPedestal().

◆ ITOT_GAIN

const unsigned int ecal::EcalReconConditions::ITOT_GAIN = 3
static

column index for TOT gain

Definition at line 29 of file EcalReconConditions.h.

Referenced by totGain().

◆ ITOT_PEDESTAL

const unsigned int ecal::EcalReconConditions::ITOT_PEDESTAL = 2
static

column index for TOT pedestal

Definition at line 27 of file EcalReconConditions.h.

Referenced by totPedestal().

◆ the_table_

const conditions::DoubleTableCondition& ecal::EcalReconConditions::the_table_
private

reference to the table of conditions storing the chip conditions

Definition at line 100 of file EcalReconConditions.h.

Referenced by adcGain(), adcPedestal(), EcalReconConditions(), totGain(), and totPedestal().


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