LDMX Software
|
Contains the core logic for the Hgcroc trigger calculations. More...
#include <HgcrocTriggerCalculations.h>
Public Member Functions | |
HgcrocTriggerCalculations (const conditions::IntegerTableCondition &ict) | |
Construct the chip trigger calculator. | |
void | addDigi (unsigned int id, unsigned int tid, int adc, int tot) |
Determine the linear charge for the given channel, using the calibration information, and add it to the map of trigger channel IDs to linear charge measurements. | |
void | compressDigis (int cells_per_trig) |
Convert the linear charges to compressed charges, with a division depending on the number of cells summed by HGCROC. | |
const std::map< unsigned int, uint8_t > & | compressedEnergies () const |
Access the map of trigger ids to compressed energies. | |
Static Public Member Functions | |
static unsigned int | singleChannelCharge (int adc, int tot, int adc_ped, int adc_thresh, int tot_ped, int tot_thresh, int tot_gain) |
Calculates the linear trigger charge for a single precision channel (before 2x2 or 3x3 summing) | |
Private Attributes | |
HgcrocTriggerConditions | conditions_ |
The conditions to be used. | |
std::map< unsigned int, unsigned int > | linearCharge_ |
A map of trigger channel id to linear charge. | |
std::map< unsigned int, uint8_t > | compressedCharge_ |
A map of trigger channel id to compressed charge. | |
Contains the core logic for the Hgcroc trigger calculations.
This class is meant to be created once per event along with the conditions for the chip. These chip conditions are wrapped in an HgcrocTriggerConditions class for easier access. These chip conditions may change from event-to-event, so it is best to allow for this object to change from event-to-event.
Definition at line 109 of file HgcrocTriggerCalculations.h.
ldmx::HgcrocTriggerCalculations::HgcrocTriggerCalculations | ( | const conditions::IntegerTableCondition & | ict | ) |
Construct the chip trigger calculator.
Here we pass the table of chip conditions that is used to emulate the chip's behavior for all of the different channel IDs.
We also use this opportunity to double check that the column indices in HgcrocTriggerConditions match the column indices imported from the input table.
[in] | ict | table of chip conditions |
Definition at line 56 of file HgcrocTriggerCalculations.cxx.
void ldmx::HgcrocTriggerCalculations::addDigi | ( | unsigned int | id, |
unsigned int | tid, | ||
int | adc, | ||
int | tot | ||
) |
Determine the linear charge for the given channel, using the calibration information, and add it to the map of trigger channel IDs to linear charge measurements.
id | Precision channel id (used to lookup in the conditions table) |
tid | Trigger channel id |
adc | ADC measurement of precision channel if not TOT complete |
tot | TOT measurement of precision channel if TOT is complete |
Definition at line 60 of file HgcrocTriggerCalculations.cxx.
References ldmx::HgcrocTriggerConditions::adcPedestal(), ldmx::HgcrocTriggerConditions::adcThreshold(), conditions_, linearCharge_, singleChannelCharge(), ldmx::HgcrocTriggerConditions::totGain(), ldmx::HgcrocTriggerConditions::totPedestal(), and ldmx::HgcrocTriggerConditions::totThreshold().
Referenced by ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
void ldmx::HgcrocTriggerCalculations::compressDigis | ( | int | cells_per_trig | ) |
Convert the linear charges to compressed charges, with a division depending on the number of cells summed by HGCROC.
Fills the map of trigger channel IDs to compressed charge measurements. Some of the lowest order bits are dropped during compression in order to effectively reach the necessary dynamic range. The number of these bits that are dropped depends on the number of cells in each trigger grouping.
@raises Exception if the input cells_per_trig is not 4 or 9.
cells_per_trig | Valid values are 4 or 9 |
Definition at line 75 of file HgcrocTriggerCalculations.cxx.
References compressedCharge_, ldmx::HgcrocTrigDigi::linear2Compressed(), and linearCharge_.
Referenced by ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
inline |
Access the map of trigger ids to compressed energies.
Definition at line 182 of file HgcrocTriggerCalculations.h.
References compressedCharge_.
Referenced by ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
static |
Calculates the linear trigger charge for a single precision channel (before 2x2 or 3x3 summing)
adc | ADC measurement for the channel |
tot | TOT measurement for the channel or zero if no TOT |
adc_ped | Trigger pedestal to subtract (8 bits, per channel) |
adc_thresh | ADC threshold for noise-suppression in the trigger path (5 bits, global for ROC) |
tot_ped | TOT pedestal (7 bits, group-of-nine) |
tot_thresh | TOT threshold, use this fixed value as "TOT" if the TOT is below this value (8 bits, group-of-nine) |
tot_gain | TOT to charge multiplicative factor (5 bits, integer math, global for ROC) |
Definition at line 34 of file HgcrocTriggerCalculations.cxx.
Referenced by addDigi().
|
private |
A map of trigger channel id to compressed charge.
Definition at line 192 of file HgcrocTriggerCalculations.h.
Referenced by compressDigis(), and compressedEnergies().
|
private |
The conditions to be used.
Definition at line 188 of file HgcrocTriggerCalculations.h.
Referenced by addDigi().
|
private |
A map of trigger channel id to linear charge.
Definition at line 190 of file HgcrocTriggerCalculations.h.
Referenced by addDigi(), and compressDigis().