LDMX Software
Classes | Functions
HgcrocDigiCollection.h File Reference

Class that represents a digitized hit in a calorimeter cell readout by an HGCROC. More...

#include "TObject.h"
#include <stdint.h>
#include <iostream>
#include <vector>

Go to the source code of this file.

Classes

class  ldmx::HgcrocDigiCollection
 Represents a collection of the digi hits readout by an HGCROC. More...
 
class  ldmx::HgcrocDigiCollection::Sample
 One sample of a digi channel corresponding to one clock of the HGCROC chip. More...
 
class  ldmx::HgcrocDigiCollection::HgcrocDigi
 One DIGI signal coming from the HGC ROC. More...
 
class  ldmx::HgcrocDigiCollection::iterator
 iterator class so we can do range-based loops over digi collections More...
 

Functions

std::ostream & operator<< (std::ostream &s, const ldmx::HgcrocDigiCollection::Sample &sample)
 Streamer for the HgcrocDigiCollection::Sample.
 
std::ostream & operator<< (std::ostream &s, const ldmx::HgcrocDigiCollection::HgcrocDigi &digi)
 Streamer for HgcrocDigiCollection::HgcrocDigi.
 
std::ostream & operator<< (std::ostream &s, const ldmx::HgcrocDigiCollection &col)
 Streamer for HgcrocDigiCollection.
 

Detailed Description

Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.

Author
Cameron Bravo, SLAC National Accelerator Laboratory
Tom Eichlersmith, University of Minnesota

Definition in file HgcrocDigiCollection.h.

Function Documentation

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream &  s,
const ldmx::HgcrocDigiCollection col 
)

Streamer for HgcrocDigiCollection.

Prints all of the digi's using their streamer.

Parameters
[in]sostream to print sample to
[in]colHgcrocDigiCollection to print
Returns
modified ostream

Definition at line 136 of file HgcrocDigiCollection.cxx.

137 {
138 s << "HgcrocDigiCollection { " << std::endl;
139 for (unsigned int iDigi = 0; iDigi < col.getNumDigis(); iDigi++)
140 s << " " << col.getDigi(iDigi) << std::endl;
141 s << "}";
142 return s;
143}
const HgcrocDigi getDigi(unsigned int digiIndex) const
Get samples for the input digi index.
unsigned int getNumDigis() const
Get total number of digis.

References ldmx::HgcrocDigiCollection::getDigi(), and ldmx::HgcrocDigiCollection::getNumDigis().

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream &  s,
const ldmx::HgcrocDigiCollection::HgcrocDigi digi 
)

Streamer for HgcrocDigiCollection::HgcrocDigi.

Prints TOT measurement (if it was TOT) or SOI otherwise

Parameters
[in]sostream to print sample to
[in]digiHgcrocDigi to print
Returns
modified ostream

Definition at line 122 of file HgcrocDigiCollection.cxx.

123 {
124 s << "HgcrocDigi { ";
125
126 s << " Id: 0x" << std::hex << digi.id() << std::dec << " ";
127
128 if (digi.isADC())
129 s << "ADC Mode -> SOI: " << digi.soi() << " }";
130 else
131 s << "TOT Mode -> " << digi.tot() << " }";
132
133 return s;
134}
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.

References ldmx::HgcrocDigiCollection::HgcrocDigi::id(), ldmx::HgcrocDigiCollection::HgcrocDigi::isADC(), ldmx::HgcrocDigiCollection::HgcrocDigi::soi(), and ldmx::HgcrocDigiCollection::HgcrocDigi::tot().

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream &  s,
const ldmx::HgcrocDigiCollection::Sample sample 
)

Streamer for the HgcrocDigiCollection::Sample.

Prints Flags and three ten bit measurements.

Parameters
[in]sostream to print sample to
[in]sampleSample to print
Returns
modified ostream

Definition at line 103 of file HgcrocDigiCollection.cxx.

104 {
105 s << "Sample { "
106 << "tot prog: " << sample.isTOTinProgress() << ", "
107 << "tot comp: " << sample.isTOTComplete() << ", ";
108 if (sample.isTOTComplete() and sample.isTOTinProgress())
109 s << "adc t: " << sample.adc_t() << ", "
110 << "tot: " << sample.tot() << ", ";
111 else if (sample.isTOTComplete())
112 s << "adc t-1: " << sample.adc_tm1() << ", "
113 << "tot: " << sample.tot() << ", ";
114 else
115 s << "adc t-1: " << sample.adc_tm1() << ", "
116 << "adc t: " << sample.adc_t() << ", ";
117
118 s << "toa: " << sample.toa() << " }";
119 return s;
120}
int adc_t() const
Get the ADC measurement from this sample.
int tot() const
Get the TOT measurement from this sample.
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.

References ldmx::HgcrocDigiCollection::Sample::adc_t(), ldmx::HgcrocDigiCollection::Sample::adc_tm1(), ldmx::HgcrocDigiCollection::Sample::isTOTComplete(), ldmx::HgcrocDigiCollection::Sample::isTOTinProgress(), ldmx::HgcrocDigiCollection::Sample::toa(), and ldmx::HgcrocDigiCollection::Sample::tot().