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

Class to wrap around the various recon condition tables. More...

#include <HcalReconConditions.h>

Public Member Functions

 HcalReconConditions (const conditions::DoubleTableCondition &adc_ped, const conditions::DoubleTableCondition &adc_gain, const conditions::DoubleTableCondition &tot_calib, const conditions::DoubleTableCondition &toa_calib)
 Provide the necessary tables to hold in one conditions object.
 
double adcPedestal (const ldmx::HcalDigiID &id, int idx=0) const
 get the ADC pedestal
 
double adcGain (const ldmx::HcalDigiID &id, int idx=0) const
 get the ADC gain
 
bool is_adc (const ldmx::HcalDigiID &id, double sum_tot) const
 check if the input digi is in ADC mode (or not) using the digi id and its evaluated sum tot
 
double linearize (const ldmx::HcalDigiID &id, double sum_tot) const
 linearize the input sum_tot for the input channel into unified amplitude units
 
double totCalib (const ldmx::HcalDigiID &id, int idx=0) const
 get a TOT calibration value
 
double toaCalib (const ldmx::HcalDigiID &id, int idx=0) const
 get a TOA calibration value
 
- Public Member Functions inherited from framework::ConditionsObject
 ConditionsObject (const std::string &name)
 Class constructor.
 
virtual ~ConditionsObject ()
 Destructor.
 
std::string getName () const
 Get the name of this object.
 

Static Public Attributes

static const unsigned int i_m_adc_i = 0
 index of m_adc_i in tot_calib table
 
static const unsigned int i_cut_point_tot = 1
 index of cut_point_tot in tot_calib table
 
static const unsigned int i_high_slope = 2
 index of high_slope in tot_calib table
 
static const unsigned int i_high_offset = 3
 index of high_offset in tot_calib table
 
static const unsigned int i_low_slope = 4
 index of low_slope in tot_calib table
 
static const unsigned int i_low_power = 5
 index of low_power in tot_calib table
 
static const unsigned int i_lower_offset = 6
 index of lower_offset in tot_calib table
 
static const unsigned int i_tot_not = 7
 index of tot_not in tot_calib table
 
static const unsigned int i_channel = 8
 index of channel in tot_calib table
 
static const unsigned int i_flagged = 9
 index of flagged in tot_calib table
 
static const std::string CONDITIONS_NAME = "HcalReconConditions"
 the name of the HcalReconConditions table (must match python registration name)
 

Private Attributes

const conditions::DoubleTableConditionadc_pedestals_
 reference to the table of conditions storing the adc pedestals
 
const conditions::DoubleTableConditionadc_gains_
 reference to the table of conditions storing the adc gains
 
const conditions::DoubleTableConditiontot_calibs_
 reference to the table of conditions storing the tot calibrations
 
const conditions::DoubleTableConditiontoa_calibs_
 reference to the table of conditions storing the toa calibrations
 

Detailed Description

Class to wrap around the various recon condition tables.

We expect all of the condition tables to only have two columns (the DetID and the condition itself) so that the column number for getting a value from any of them is zero.

Definition at line 17 of file HcalReconConditions.h.

Constructor & Destructor Documentation

◆ HcalReconConditions()

hcal::HcalReconConditions::HcalReconConditions ( const conditions::DoubleTableCondition adc_ped,
const conditions::DoubleTableCondition adc_gain,
const conditions::DoubleTableCondition tot_calib,
const conditions::DoubleTableCondition toa_calib 
)

Provide the necessary tables to hold in one conditions object.

Parameters
[in]adc_peddouble table of ADC pedestals
[in]adc_gaindouble table of ADC gains
[in]tot_calibdouble table of TOT calibrations
[in]toa_calibdouble table of TOA calibrations

Definition at line 10 of file HcalReconConditions.cxx.

16 adc_pedestals_{adc_ped},
17 adc_gains_{adc_gain},
18 tot_calibs_{tot_calib},
19 toa_calibs_{toa_calib} {}
Base class for all conditions objects, very simple.
const conditions::DoubleTableCondition & adc_pedestals_
reference to the table of conditions storing the adc pedestals
static const std::string CONDITIONS_NAME
the name of the HcalReconConditions table (must match python registration name)
const conditions::DoubleTableCondition & tot_calibs_
reference to the table of conditions storing the tot calibrations
const conditions::DoubleTableCondition & adc_gains_
reference to the table of conditions storing the adc gains
const conditions::DoubleTableCondition & toa_calibs_
reference to the table of conditions storing the toa calibrations

Member Function Documentation

◆ adcGain()

double hcal::HcalReconConditions::adcGain ( const ldmx::HcalDigiID id,
int  idx = 0 
) 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 77 of file HcalReconConditions.h.

77 {
78 return adc_gains_.get(id.raw(), idx);
79 }
T get(unsigned int id, unsigned int col) const
Get an entry by DetectorId and number.

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

◆ adcPedestal()

double hcal::HcalReconConditions::adcPedestal ( const ldmx::HcalDigiID id,
int  idx = 0 
) const
inline

get the ADC pedestal

Parameters
[in]idHCal Digi ID for specific chip
[in]indexof column in condition file
Returns
the ADC pedestal for that chip in counts

Definition at line 63 of file HcalReconConditions.h.

63 {
64 return adc_pedestals_.get(id.raw(), idx);
65 }

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

◆ is_adc()

bool hcal::HcalReconConditions::is_adc ( const ldmx::HcalDigiID id,
double  sum_tot 
) const

check if the input digi is in ADC mode (or not) using the digi id and its evaluated sum tot

Parameters
[in]idHcalDigiID for the channel
[in]sum_totalready evaluated sum of TOT values
Returns
true if digi is in ADC mode

Definition at line 21 of file HcalReconConditions.cxx.

22 {
23 // check if the linearization has been done correctly
24 // a non-zero flag value is implicitly converted to true
25 if (totCalib(id, i_flagged) == 1) {
26 return true;
27 }
28
29 // if we are in ADC range (which was used as a reference in linearization),
30 // we use ADC
31 if (sum_tot < totCalib(id, i_lower_offset)) {
32 return true;
33 }
34
35 return false;
36}
static const unsigned int i_lower_offset
index of lower_offset in tot_calib table
static const unsigned int i_flagged
index of flagged in tot_calib table
double totCalib(const ldmx::HcalDigiID &id, int idx=0) const
get a TOT calibration value

References i_flagged, i_lower_offset, and totCalib().

◆ linearize()

double hcal::HcalReconConditions::linearize ( const ldmx::HcalDigiID id,
double  sum_tot 
) const

linearize the input sum_tot for the input channel into unified amplitude units

Note
We assume the input channel is already known to be in TOT mode
Parameters
[in]idHcalDigiID for the channel
[in]sum_totoalready evaluated sum of TOT values
Returns
linearized amplitude

Definition at line 38 of file HcalReconConditions.cxx.

39 {
40 // we know we have a linearization fit and are in TOT range,
41 // the lower side of TOT needs to be linearized with a specialized power law
42 if (sum_tot < totCalib(id, i_cut_point_tot)) {
43 return pow((sum_tot - totCalib(id, i_lower_offset)) /
45 1 / totCalib(id, i_low_power)) +
47 }
48
49 // we know sum_tot is >= lower offset and >= tot cut
50 // higher tot, linearized with adc using a simple linear mapping
51 return (sum_tot - totCalib(id, i_high_offset)) * totCalib(id, i_high_slope);
52}
static const unsigned int i_high_offset
index of high_offset in tot_calib table
static const unsigned int i_high_slope
index of high_slope in tot_calib table
static const unsigned int i_cut_point_tot
index of cut_point_tot in tot_calib table
static const unsigned int i_tot_not
index of tot_not in tot_calib table
static const unsigned int i_low_slope
index of low_slope in tot_calib table
static const unsigned int i_low_power
index of low_power in tot_calib table

References i_cut_point_tot, i_high_offset, i_high_slope, i_low_power, i_low_slope, i_lower_offset, i_tot_not, and totCalib().

◆ toaCalib()

double hcal::HcalReconConditions::toaCalib ( const ldmx::HcalDigiID id,
int  idx = 0 
) const
inline

get a TOA calibration value

Parameters
[in]idHCal Digi ID for specific chip
[in]indexof column in condition file
Returns
the TOA calibration for that i

Definition at line 124 of file HcalReconConditions.h.

124 {
125 return toa_calibs_.get(id.raw(), idx);
126 }

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

◆ totCalib()

double hcal::HcalReconConditions::totCalib ( const ldmx::HcalDigiID id,
int  idx = 0 
) const
inline

get a TOT calibration value

The column indices are stored as static members of this class.

Parameters
[in]idHCal Digi ID for specific chip
[in]indexof column in condition file
Returns
the TOT calibration for that i

Definition at line 113 of file HcalReconConditions.h.

113 {
114 return tot_calibs_.get(id.raw(), idx);
115 }

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

Referenced by is_adc(), and linearize().

Member Data Documentation

◆ adc_gains_

const conditions::DoubleTableCondition& hcal::HcalReconConditions::adc_gains_
private

reference to the table of conditions storing the adc gains

Definition at line 132 of file HcalReconConditions.h.

Referenced by adcGain().

◆ adc_pedestals_

const conditions::DoubleTableCondition& hcal::HcalReconConditions::adc_pedestals_
private

reference to the table of conditions storing the adc pedestals

Definition at line 130 of file HcalReconConditions.h.

Referenced by adcPedestal().

◆ CONDITIONS_NAME

const std::string hcal::HcalReconConditions::CONDITIONS_NAME = "HcalReconConditions"
static

◆ i_channel

const unsigned int hcal::HcalReconConditions::i_channel = 8
static

index of channel in tot_calib table

Definition at line 36 of file HcalReconConditions.h.

◆ i_cut_point_tot

const unsigned int hcal::HcalReconConditions::i_cut_point_tot = 1
static

index of cut_point_tot in tot_calib table

Definition at line 22 of file HcalReconConditions.h.

Referenced by linearize().

◆ i_flagged

const unsigned int hcal::HcalReconConditions::i_flagged = 9
static

index of flagged in tot_calib table

Definition at line 38 of file HcalReconConditions.h.

Referenced by is_adc().

◆ i_high_offset

const unsigned int hcal::HcalReconConditions::i_high_offset = 3
static

index of high_offset in tot_calib table

Definition at line 26 of file HcalReconConditions.h.

Referenced by linearize().

◆ i_high_slope

const unsigned int hcal::HcalReconConditions::i_high_slope = 2
static

index of high_slope in tot_calib table

Definition at line 24 of file HcalReconConditions.h.

Referenced by linearize().

◆ i_low_power

const unsigned int hcal::HcalReconConditions::i_low_power = 5
static

index of low_power in tot_calib table

Definition at line 30 of file HcalReconConditions.h.

Referenced by linearize().

◆ i_low_slope

const unsigned int hcal::HcalReconConditions::i_low_slope = 4
static

index of low_slope in tot_calib table

Definition at line 28 of file HcalReconConditions.h.

Referenced by linearize().

◆ i_lower_offset

const unsigned int hcal::HcalReconConditions::i_lower_offset = 6
static

index of lower_offset in tot_calib table

Definition at line 32 of file HcalReconConditions.h.

Referenced by is_adc(), and linearize().

◆ i_m_adc_i

const unsigned int hcal::HcalReconConditions::i_m_adc_i = 0
static

index of m_adc_i in tot_calib table

Definition at line 20 of file HcalReconConditions.h.

◆ i_tot_not

const unsigned int hcal::HcalReconConditions::i_tot_not = 7
static

index of tot_not in tot_calib table

Definition at line 34 of file HcalReconConditions.h.

Referenced by linearize().

◆ toa_calibs_

const conditions::DoubleTableCondition& hcal::HcalReconConditions::toa_calibs_
private

reference to the table of conditions storing the toa calibrations

Definition at line 136 of file HcalReconConditions.h.

Referenced by toaCalib().

◆ tot_calibs_

const conditions::DoubleTableCondition& hcal::HcalReconConditions::tot_calibs_
private

reference to the table of conditions storing the tot calibrations

Definition at line 134 of file HcalReconConditions.h.

Referenced by totCalib().


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