8#ifndef TOOLS_HGCROCTRIGGERCALCULATIONS_H_
9#define TOOLS_HGCROCTRIGGERCALCULATIONS_H_
13#include "Conditions/SimpleTableCondition.h"
48 bool validate =
true);
127 int adc_thresh,
int tot_ped,
128 int tot_thresh,
int tot_gain);
156 void addDigi(
unsigned int id,
unsigned int tid,
int adc,
int tot);
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