LDMX Software
|
One sample of a digi channel corresponding to one clock of the HGCROC chip. More...
#include <HgcrocDigiCollection.h>
Public Member Functions | |
Sample (bool tot_progress, bool tot_complete, int firstMeas, int seconMeas, int toa, int version=3) | |
Helpful alternative constructor. | |
Sample (uint32_t w, int version=3) | |
Basic constructor. | |
Sample () | |
Default constructor. | |
bool | isTOTinProgress () const |
Get the first flag from the sample checking if TOT is in progress during this sample. | |
bool | isTOTComplete () const |
Get the second flag from the sample checking if TOT is complete at this sample. | |
int | toa () const |
Get the Time Of Arrival of this sample which is always the third position in all readout modes. | |
int | tot () const |
Get the TOT measurement from this sample. | |
int | adc_tm1 () const |
Get the last ADC measurement from this sample. | |
int | adc_t () const |
Get the ADC measurement from this sample. | |
uint32_t | raw () const |
Get the raw value of this sample. | |
Private Member Functions | |
int | first () const |
Get the first 10-bit measurement out of the sample. | |
int | secon () const |
Get the second 10-bit measurement out of the sample. | |
int | third () const |
Get the third 10-bit measurement out of the smaple. | |
Private Attributes | |
uint32_t | word_ |
The actual 32-bit word spit out by the chip. | |
int | version_ |
version to use for {de,en}coding | |
One sample of a digi channel corresponding to one clock of the HGCROC chip.
Not all of these measurements are valid in each sample. The valid measurements depend on the tot_progress and tot_complete flags.
The TOA measurement is always valid and is inserted as the third measurement in the 32-bit word.
If the TOT measurment is NOT complete, then the other two valid measurements (in order) are
If the TOT is NOT in progress and the TOT is complete, then
If both flags are true, then
Usually several samples are used for each channel to re-construct the hit.
Definition at line 71 of file HgcrocDigiCollection.h.
ldmx::HgcrocDigiCollection::Sample::Sample | ( | bool | tot_progress, |
bool | tot_complete, | ||
int | firstMeas, | ||
int | seconMeas, | ||
int | toa, | ||
int | version = 3 |
||
) |
Helpful alternative constructor.
Encodes the various measurements into the word depending on the passed flags. Use this constructor inside of the chip emulator when converting voltage pulses into DIGIs.
|
inline |
Basic constructor.
Use this constructor when translating binary data coming off the detector into our event model.
Definition at line 91 of file HgcrocDigiCollection.h.
|
inline |
Default constructor.
Not used, but required for Event dictionary generation
Definition at line 98 of file HgcrocDigiCollection.h.
|
inline |
Get the ADC measurement from this sample.
Checks which running mode we are in to determine which position the measurement should be taken from.
Definition at line 172 of file HgcrocDigiCollection.h.
References first(), isTOTComplete(), secon(), third(), and version_.
Referenced by hcal::HcalSingleEndRecProducer::extract_measurements(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
inline |
Get the last ADC measurement from this sample.
Definition at line 162 of file HgcrocDigiCollection.h.
References first().
Referenced by operator<<().
|
inlineprivate |
Get the first 10-bit measurement out of the sample.
Definition at line 196 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::FIRSTMEAS_POS, ldmx::HgcrocDigiCollection::TEN_BIT_MASK, and word_.
|
inline |
Get the second flag from the sample checking if TOT is complete at this sample.
Definition at line 117 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::ONE_BIT_MASK, ldmx::HgcrocDigiCollection::SECONFLAG_POS, and word_.
Referenced by adc_t(), ldmx::HgcrocDigiCollection::HgcrocDigi::isADC(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
inline |
Get the first flag from the sample checking if TOT is in progress during this sample.
Definition at line 106 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::FIRSTFLAG_POS, ldmx::HgcrocDigiCollection::ONE_BIT_MASK, and word_.
Referenced by ldmx::HgcrocDigiCollection::HgcrocDigi::isADC(), and operator<<().
|
inline |
Get the raw value of this sample.
Definition at line 188 of file HgcrocDigiCollection.h.
References word_.
|
inlineprivate |
Get the second 10-bit measurement out of the sample.
Definition at line 203 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::SECONMEAS_POS, ldmx::HgcrocDigiCollection::TEN_BIT_MASK, and word_.
|
inlineprivate |
Get the third 10-bit measurement out of the smaple.
Definition at line 209 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::TEN_BIT_MASK, and word_.
|
inline |
Get the Time Of Arrival of this sample which is always the third position in all readout modes.
Definition at line 127 of file HgcrocDigiCollection.h.
References secon(), third(), and version_.
Referenced by hcal::HcalSingleEndRecProducer::extract_measurements(), hcal::HcalRecProducer::getTOA(), and operator<<().
|
inline |
Get the TOT measurement from this sample.
Expands the 10-bit measurment inside the sample into the 12-bit actual measurement of TOT.
Definition at line 145 of file HgcrocDigiCollection.h.
References ldmx::HgcrocDigiCollection::FIRSTMEAS_POS, secon(), version_, and word_.
Referenced by hcal::HcalSingleEndRecProducer::extract_measurements(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), hcal::HcalTrigPrimDigiProducer::produce(), and ldmx::HgcrocDigiCollection::HgcrocDigi::tot().
|
private |
version to use for {de,en}coding
Definition at line 215 of file HgcrocDigiCollection.h.
|
private |
The actual 32-bit word spit out by the chip.
Definition at line 213 of file HgcrocDigiCollection.h.
Referenced by first(), isTOTComplete(), isTOTinProgress(), raw(), secon(), third(), and tot().