8 int firstMeas,
int seconMeas,
int toa,
15 word_ = (((seconMeas > 0xfff ? 0xfff : seconMeas) & 0xfff) << 20) +
22 if (not tot_progress and tot_complete) {
53 std::cout <<
"HgcrocDigiCollection { Num Channel IDs: "
62 unsigned int digiIndex)
const {
63 return HgcrocDigiCollection::HgcrocDigi(
69 unsigned int id,
const std::vector<HgcrocDigiCollection::Sample> &digi) {
70 if (digi.size() != this->getNumSamplesPerDigi()) {
71 std::cerr <<
"[ WARN ] [ HgcrocDigiCollection ] Input list of samples "
74 <<
"' that does not match the number of samples per digi '"
80 for (
auto const &s : digi)
samples_.push_back(s.raw());
86 const std::vector<uint32_t> &digi) {
87 if (digi.size() != this->getNumSamplesPerDigi()) {
88 std::cerr <<
"[ WARN ] [ HgcrocDigiCollection ] Input list of samples "
91 <<
"' that does not match the number of samples per digi '"
97 for (
auto const &s : digi)
samples_.push_back(s);
103std::ostream &operator<<(std::ostream &s,
109 s <<
"adc t: " << sample.
adc_t() <<
", "
110 <<
"tot: " << sample.
tot() <<
", ";
112 s <<
"adc t-1: " << sample.
adc_tm1() <<
", "
113 <<
"tot: " << sample.
tot() <<
", ";
115 s <<
"adc t-1: " << sample.
adc_tm1() <<
", "
116 <<
"adc t: " << sample.
adc_t() <<
", ";
118 s <<
"toa: " << sample.
toa() <<
" }";
122std::ostream &operator<<(std::ostream &s,
124 s <<
"HgcrocDigi { ";
126 s <<
" Id: 0x" << std::hex << digi.
id() << std::dec <<
" ";
129 s <<
"ADC Mode -> SOI: " << digi.
soi() <<
" }";
131 s <<
"TOT Mode -> " << digi.
tot() <<
" }";
136std::ostream &operator<<(std::ostream &s,
138 s <<
"HgcrocDigiCollection { " << std::endl;
139 for (
unsigned int iDigi = 0; iDigi < col.
getNumDigis(); iDigi++)
140 s <<
" " << col.
getDigi(iDigi) << std::endl;
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
One DIGI signal coming from the HGC ROC.
bool isADC() const
Check if this DIGI is an ADC measurement.
unsigned int id() const
Get the ID for this DIGI.
int tot() const
Get the 12-bit decoded TOT measurement from this DIGI.
HgcrocDigiCollection::Sample soi() const
Get the sample of interest from this DIGI.
One sample of a digi channel corresponding to one clock of the HGCROC chip.
int adc_t() const
Get the ADC measurement from this sample.
int tot() const
Get the TOT measurement from this sample.
int version_
version to use for {de,en}coding
uint32_t word_
The actual 32-bit word spit out by the chip.
Sample()
Default constructor.
int adc_tm1() const
Get the last ADC measurement from this sample.
int toa() const
Get the Time Of Arrival of this sample which is always the third position in all readout modes.
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.
Represents a collection of the digi hits readout by an HGCROC.
std::vector< uint32_t > samples_
list of samples that we have been given
static const int SECONFLAG_POS
Bit position of second flag.
static const int FIRSTFLAG_POS
Bit position of first flag.
unsigned int numSamplesPerDigi_
number of samples for each digi
unsigned int getNumSamplesPerDigi() const
Get number of samples per digi.
static const int FIRSTMEAS_POS
Bit position of first measurement.
void Print() const
Print out the object.
static const int TEN_BIT_MASK
Mask for lowest order ten bits in an int.
std::vector< unsigned int > channelIDs_
list of channel IDs that we have digis for
static const int SECONMEAS_POS
Bit position of second measurement.
void addDigi(unsigned int id, const std::vector< Sample > &digi)
Add samples to collection.
const HgcrocDigi getDigi(unsigned int digiIndex) const
Get samples for the input digi index.
unsigned int getNumDigis() const
Get total number of digis.
unsigned int sampleOfInterest_
index for the sample of interest in the samples list
void Clear()
Clear the data in the object.