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

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

#include <HgcrocTriggerCalculations.h>

Public Member Functions

 HgcrocTriggerConditions (const conditions::IntegerTableCondition &, bool validate=true)
 Constructor.
 
int adcPedestal (unsigned int id) const
 get the ADC pedestal
 
int adcThreshold (unsigned int id) const
 get the ADC threshold
 
int totPedestal (unsigned int id) const
 get the TOT pedestal
 
int totThreshold (unsigned int id) const
 get the TOT threshold
 
int totGain (unsigned int id) const
 get the TOT gain
 

Static Public Attributes

static const unsigned int IADC_PEDESTAL = 0
 column index for ADC pedestal
 
static const unsigned int IADC_THRESHOLD = 1
 column index for ADC threshold
 
static const unsigned int ITOT_PEDESTAL = 2
 column index for TOT pedestal
 
static const unsigned int ITOT_THRESHOLD = 3
 column index for TOT threshold
 
static const unsigned int ITOT_GAIN = 4
 column index for TOT gain
 

Private Attributes

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

Detailed Description

Class to wrap around an integer table of conditions.

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

Definition at line 24 of file HgcrocTriggerCalculations.h.

Constructor & Destructor Documentation

◆ HgcrocTriggerConditions()

ldmx::HgcrocTriggerConditions::HgcrocTriggerConditions ( const conditions::IntegerTableCondition ict,
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.

Definition at line 9 of file HgcrocTriggerCalculations.cxx.

11 : ict_{ict} {
12 if (!validate) return;
13 if (ict_.getColumnCount() < 5) {
14 EXCEPTION_RAISE(
15 "ConditionsException",
16 "Inconsistent condition for HgcrocTriggerConditions :" + ict.getName());
17 }
18 std::vector<std::string> expected_colnames;
19 expected_colnames.push_back("ADC_PEDESTAL");
20 expected_colnames.push_back("ADC_THRESHOLD");
21 expected_colnames.push_back("TOT_PEDESTAL");
22 expected_colnames.push_back("TOT_THRESHOLD");
23 expected_colnames.push_back("TOT_GAIN");
24
25 for (size_t i = 0; i < 5; i++) {
26 if (ict_.getColumnNames()[i] != expected_colnames[i]) {
27 EXCEPTION_RAISE("ConditionsException",
28 "Expected column '" + expected_colnames[i] + "', got '" +
29 ict_.getColumnNames()[i] + "'");
30 }
31 }
32}
unsigned int getColumnCount() const
Get the number of columns.
const std::vector< std::string > & getColumnNames() const
Get the names of the columns.
std::string getName() const
Get the name of this object.
const conditions::IntegerTableCondition & ict_
reference to the table of conditions storing the chip conditions

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

Member Function Documentation

◆ adcPedestal()

int ldmx::HgcrocTriggerConditions::adcPedestal ( unsigned int  id) const
inline

get the ADC pedestal

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

Definition at line 56 of file HgcrocTriggerCalculations.h.

56{ return ict_.get(id, IADC_PEDESTAL); }
T get(unsigned int id, unsigned int col) const
Get an entry by DetectorId and number.
static const unsigned int IADC_PEDESTAL
column index for ADC pedestal

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

Referenced by ldmx::HgcrocTriggerCalculations::addDigi().

◆ adcThreshold()

int ldmx::HgcrocTriggerConditions::adcThreshold ( unsigned int  id) const
inline

get the ADC threshold

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

Definition at line 64 of file HgcrocTriggerCalculations.h.

64 {
65 return ict_.get(id, IADC_THRESHOLD);
66 }
static const unsigned int IADC_THRESHOLD
column index for ADC threshold

References conditions::HomogenousTableCondition< T >::get(), IADC_THRESHOLD, and ict_.

Referenced by ldmx::HgcrocTriggerCalculations::addDigi().

◆ totGain()

int ldmx::HgcrocTriggerConditions::totGain ( unsigned int  id) const
inline

get the TOT gain

Parameters
[in]idraw ID for specific chip
Returns
the TOT gain for that chip

Definition at line 92 of file HgcrocTriggerCalculations.h.

92{ return ict_.get(id, ITOT_GAIN); }
static const unsigned int ITOT_GAIN
column index for TOT gain

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

Referenced by ldmx::HgcrocTriggerCalculations::addDigi().

◆ totPedestal()

int ldmx::HgcrocTriggerConditions::totPedestal ( unsigned int  id) const
inline

get the TOT pedestal

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

Definition at line 74 of file HgcrocTriggerCalculations.h.

74{ return ict_.get(id, ITOT_PEDESTAL); }
static const unsigned int ITOT_PEDESTAL
column index for TOT pedestal

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

Referenced by ldmx::HgcrocTriggerCalculations::addDigi().

◆ totThreshold()

int ldmx::HgcrocTriggerConditions::totThreshold ( unsigned int  id) const
inline

get the TOT threshold

Parameters
[in]idraw ID for specific chip
Returns
the TOT threshold for that chip

Definition at line 82 of file HgcrocTriggerCalculations.h.

82 {
83 return ict_.get(id, ITOT_THRESHOLD);
84 }
static const unsigned int ITOT_THRESHOLD
column index for TOT threshold

References conditions::HomogenousTableCondition< T >::get(), ict_, and ITOT_THRESHOLD.

Referenced by ldmx::HgcrocTriggerCalculations::addDigi().

Member Data Documentation

◆ IADC_PEDESTAL

const unsigned int ldmx::HgcrocTriggerConditions::IADC_PEDESTAL = 0
static

column index for ADC pedestal

Definition at line 27 of file HgcrocTriggerCalculations.h.

Referenced by adcPedestal().

◆ IADC_THRESHOLD

const unsigned int ldmx::HgcrocTriggerConditions::IADC_THRESHOLD = 1
static

column index for ADC threshold

Definition at line 29 of file HgcrocTriggerCalculations.h.

Referenced by adcThreshold().

◆ ict_

const conditions::IntegerTableCondition& ldmx::HgcrocTriggerConditions::ict_
private

reference to the table of conditions storing the chip conditions

Definition at line 96 of file HgcrocTriggerCalculations.h.

Referenced by adcPedestal(), adcThreshold(), HgcrocTriggerConditions(), totGain(), totPedestal(), and totThreshold().

◆ ITOT_GAIN

const unsigned int ldmx::HgcrocTriggerConditions::ITOT_GAIN = 4
static

column index for TOT gain

Definition at line 35 of file HgcrocTriggerCalculations.h.

Referenced by totGain().

◆ ITOT_PEDESTAL

const unsigned int ldmx::HgcrocTriggerConditions::ITOT_PEDESTAL = 2
static

column index for TOT pedestal

Definition at line 31 of file HgcrocTriggerCalculations.h.

Referenced by totPedestal().

◆ ITOT_THRESHOLD

const unsigned int ldmx::HgcrocTriggerConditions::ITOT_THRESHOLD = 3
static

column index for TOT threshold

Definition at line 33 of file HgcrocTriggerCalculations.h.

Referenced by totThreshold().


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