LDMX Software
|
Represents a collection of the digi hits readout by an HGCROC. More...
#include <HgcrocDigiCollection.h>
Classes | |
class | HgcrocDigi |
One DIGI signal coming from the HGC ROC. More... | |
class | iterator |
iterator class so we can do range-based loops over digi collections More... | |
class | Sample |
One sample of a digi channel corresponding to one clock of the HGCROC chip. More... | |
Public Member Functions | |
HgcrocDigiCollection () | |
Class constructor. | |
virtual | ~HgcrocDigiCollection () |
Class destructor. | |
void | Clear () |
Clear the data in the object. | |
void | Print () const |
Print out the object. | |
int | getVersion () const |
Get the version of ROC we have read. | |
void | setVersion (int v) |
Set the version of the ROC we have read. | |
unsigned int | getNumSamplesPerDigi () const |
Get number of samples per digi. | |
void | setNumSamplesPerDigi (unsigned int n) |
Set number of samples for each digi. | |
unsigned int | getSampleOfInterestIndex () const |
Get index of sample of interest. | |
void | setSampleOfInterestIndex (unsigned int n) |
Set index of sample of interest. | |
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 | size () const |
Get total number of digis. | |
void | addDigi (unsigned int id, const std::vector< Sample > &digi) |
Add samples to collection. | |
void | addDigi (unsigned int id, const std::vector< uint32_t > &digi) |
iterator | begin () |
The beginning of this collection. | |
iterator | end () |
The end of this collection. | |
Private Member Functions | |
ClassDef (HgcrocDigiCollection, 4) | |
The ROOT class definition. | |
Private Attributes | |
std::vector< unsigned int > | channelIDs_ |
list of channel IDs that we have digis for | |
std::vector< uint32_t > | samples_ |
list of samples that we have been given | |
unsigned int | numSamplesPerDigi_ |
number of samples for each digi | |
unsigned int | sampleOfInterest_ |
index for the sample of interest in the samples list | |
int | version_ |
version of the ROC we have read | |
Static Private Attributes | |
static const int | ONE_BIT_MASK = 1 |
Mask for lowest order bit in an int. | |
static const int | TEN_BIT_MASK = (1 << 10) - 1 |
Mask for lowest order ten bits in an int. | |
static const int | FIRSTFLAG_POS = 31 |
Bit position of first flag. | |
static const int | SECONFLAG_POS = 30 |
Bit position of second flag. | |
static const int | FIRSTMEAS_POS = 20 |
Bit position of first measurement. | |
static const int | SECONMEAS_POS = 10 |
Bit position of second measurement. | |
Represents a collection of the digi hits readout by an HGCROC.
Each digi corresponds to one channel ID and numSamplesPerDigi_ samples.
A custom iterator class and begin() and end() methods are also implemented so that a user can loop through this collection similar to any other container in C++.
for (auto digi : digi_collection) { // digi is of type HgcrocDigi }
Definition at line 43 of file HgcrocDigiCollection.h.
|
inline |
|
inlinevirtual |
void ldmx::HgcrocDigiCollection::addDigi | ( | unsigned int | id, |
const std::vector< Sample > & | digi | ||
) |
Add samples to collection.
[in] | id | global integer ID for this channel |
[in] | digi | list of new samples to add |
Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalAlignPolarfires::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().
|
inline |
The beginning of this collection.
We just point the user to the zero'th entry.
Definition at line 482 of file HgcrocDigiCollection.h.
void ldmx::HgcrocDigiCollection::Clear | ( | ) |
Clear the data in the object.
Clears the vectors of channel IDs and samples, but does not change the other settings of this collection.
|
inline |
The end of this collection.
The end of the collection is the number of digis stored in it.
Definition at line 490 of file HgcrocDigiCollection.h.
References getNumDigis().
const HgcrocDigi ldmx::HgcrocDigiCollection::getDigi | ( | unsigned int | digiIndex | ) | const |
Get samples for the input digi index.
Each "digi" is numSamplesPerDigi_ samples. The sample is a single 32-bit word that is then translated into the 10-bit measurements depending on the first two bits.
[in] | digiIndex | index of digi to decode |
Referenced by dqm::NtuplizeHgcrocDigiCollection::analyze(), hcal::test::HcalCheckReconstruction::analyze(), hcal::HcalPedestalAnalyzer::analyze(), ldmx::HgcrocDigiCollection::iterator::operator*(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
inline |
Get total number of digis.
Definition at line 410 of file HgcrocDigiCollection.h.
References channelIDs_.
Referenced by end(), operator<<(), ecal::EcalDigiProducer::produce(), ecal::EcalTrigPrimDigiProducer::produce(), hcal::HcalDigiProducer::produce(), hcal::HcalRawDecoder::produce(), hcal::HcalRecProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
|
inline |
Get number of samples per digi.
Definition at line 361 of file HgcrocDigiCollection.h.
References numSamplesPerDigi_.
Referenced by hcal::HcalRawDecoder::produce().
|
inline |
Get index of sample of interest.
Definition at line 376 of file HgcrocDigiCollection.h.
References sampleOfInterest_.
Referenced by hcal::HcalSingleEndRecProducer::produce(), and ldmx::HgcrocDigiCollection::HgcrocDigi::soi().
|
inline |
Get the version of ROC we have read.
Definition at line 347 of file HgcrocDigiCollection.h.
References version_.
Referenced by ldmx::HgcrocDigiCollection::HgcrocDigi::at().
void ldmx::HgcrocDigiCollection::Print | ( | ) | const |
Print out the object.
Prints out the lengths of the stored vectors and the other settings of this collection.
|
inline |
Set number of samples for each digi.
[in] | n | number of samples per digi |
Definition at line 367 of file HgcrocDigiCollection.h.
References numSamplesPerDigi_.
Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().
|
inline |
Set index of sample of interest.
[in] | n | index for the sample of interest |
Definition at line 386 of file HgcrocDigiCollection.h.
References sampleOfInterest_.
Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().
|
inline |
Set the version of the ROC we have read.
Definition at line 352 of file HgcrocDigiCollection.h.
References version_.
Referenced by ecal::EcalRawDecoder::produce(), and hcal::HcalRawDecoder::produce().
|
inline |
Get total number of digis.
Definition at line 416 of file HgcrocDigiCollection.h.
References channelIDs_.
|
private |
list of channel IDs that we have digis for
Definition at line 513 of file HgcrocDigiCollection.h.
Referenced by getNumDigis(), and size().
|
staticprivate |
Bit position of first flag.
Definition at line 500 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTinProgress().
|
staticprivate |
Bit position of first measurement.
Definition at line 506 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::first(), and ldmx::HgcrocDigiCollection::Sample::tot().
|
private |
number of samples for each digi
Definition at line 519 of file HgcrocDigiCollection.h.
Referenced by getNumSamplesPerDigi(), and setNumSamplesPerDigi().
|
staticprivate |
Mask for lowest order bit in an int.
Definition at line 494 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTComplete(), and ldmx::HgcrocDigiCollection::Sample::isTOTinProgress().
|
private |
index for the sample of interest in the samples list
Definition at line 522 of file HgcrocDigiCollection.h.
Referenced by getSampleOfInterestIndex(), and setSampleOfInterestIndex().
|
private |
list of samples that we have been given
Definition at line 516 of file HgcrocDigiCollection.h.
|
staticprivate |
Bit position of second flag.
Definition at line 503 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTComplete().
|
staticprivate |
Bit position of second measurement.
Definition at line 509 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::secon().
|
staticprivate |
Mask for lowest order ten bits in an int.
Definition at line 497 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::first(), ldmx::HgcrocDigiCollection::Sample::secon(), and ldmx::HgcrocDigiCollection::Sample::third().
|
private |
version of the ROC we have read
Definition at line 525 of file HgcrocDigiCollection.h.
Referenced by getVersion(), and setVersion().