LDMX Software
HgcrocTriggerCalculations.h
Go to the documentation of this file.
1
8#ifndef TOOLS_HGCROCTRIGGERCALCULATIONS_H_
9#define TOOLS_HGCROCTRIGGERCALCULATIONS_H_
10
11#include <map>
12
13#include "Conditions/SimpleTableCondition.h"
14
15namespace ldmx {
16
25 public:
27 static const unsigned int IADC_PEDESTAL = 0;
29 static const unsigned int IADC_THRESHOLD = 1;
31 static const unsigned int ITOT_PEDESTAL = 2;
33 static const unsigned int ITOT_THRESHOLD = 3;
35 static const unsigned int ITOT_GAIN = 4;
36
48 bool validate = true);
49
56 int adcPedestal(unsigned int id) const { return ict_.get(id, IADC_PEDESTAL); }
57
64 int adcThreshold(unsigned int id) const {
65 return ict_.get(id, IADC_THRESHOLD);
66 }
67
74 int totPedestal(unsigned int id) const { return ict_.get(id, ITOT_PEDESTAL); }
75
82 int totThreshold(unsigned int id) const {
83 return ict_.get(id, ITOT_THRESHOLD);
84 }
85
92 int totGain(unsigned int id) const { return ict_.get(id, ITOT_GAIN); }
93
94 private:
97}; // HgcrocTriggerConditions
98
110 public:
126 static unsigned int singleChannelCharge(int adc, int tot, int adc_ped,
127 int adc_thresh, int tot_ped,
128 int tot_thresh, int tot_gain);
129
143
156 void addDigi(unsigned int id, unsigned int tid, int adc, int tot);
157
175 void compressDigis(int cells_per_trig);
176
182 const std::map<unsigned int, uint8_t> &compressedEnergies() const {
183 return compressedCharge_;
184 }
185
186 private:
190 std::map<unsigned int, unsigned int> linearCharge_;
192 std::map<unsigned int, uint8_t> compressedCharge_;
193}; // HgcrocTriggerCalculations
194
195} // namespace ldmx
196
197#endif // TOOLS_HGCROCTRIGGERCALCULATIONS_H_
T get(unsigned int id, unsigned int col) const
Get an entry by DetectorId and number.
Contains the core logic for the Hgcroc trigger calculations.
void addDigi(unsigned int id, unsigned int tid, int adc, int tot)
Determine the linear charge for the given channel, using the calibration information,...
const std::map< unsigned int, uint8_t > & compressedEnergies() const
Access the map of trigger ids to compressed energies.
std::map< unsigned int, uint8_t > compressedCharge_
A map of trigger channel id to compressed charge.
void compressDigis(int cells_per_trig)
Convert the linear charges to compressed charges, with a division depending on the number of cells su...
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)
std::map< unsigned int, unsigned int > linearCharge_
A map of trigger channel id to linear charge.
HgcrocTriggerConditions conditions_
The conditions to be used.
Class to wrap around an integer table of conditions.
int totThreshold(unsigned int id) const
get the TOT threshold
int totGain(unsigned int id) const
get the TOT gain
static const unsigned int ITOT_THRESHOLD
column index for TOT threshold
int adcPedestal(unsigned int id) const
get the ADC pedestal
static const unsigned int ITOT_GAIN
column index for TOT gain
static const unsigned int ITOT_PEDESTAL
column index for TOT pedestal
int adcThreshold(unsigned int id) const
get the ADC threshold
static const unsigned int IADC_THRESHOLD
column index for ADC threshold
int totPedestal(unsigned int id) const
get the TOT pedestal
const conditions::IntegerTableCondition & ict_
reference to the table of conditions storing the chip conditions
static const unsigned int IADC_PEDESTAL
column index for ADC pedestal