|
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. | |
| 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, 6) | |
| The ROOT class definition. | |
Private Attributes | |
| std::vector< unsigned int > | channel_ids_ |
| list of channel IDs that we have digis for | |
| std::vector< uint32_t > | samples_ |
| list of samples that we have been given | |
| unsigned int | num_samples_per_digi_ |
| number of samples for each digi | |
| unsigned int | sample_of_interest_ |
| 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. | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const HgcrocDigiCollection &d) |
| Print out the object. | |
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().
| void ldmx::HgcrocDigiCollection::addDigi | ( | unsigned int | id, |
| const std::vector< uint32_t > & | digi ) |
Definition at line 81 of file HgcrocDigiCollection.cxx.
|
inline |
The beginning of this collection.
We just point the user to the zero'th entry.
Definition at line 481 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.
Definition at line 43 of file HgcrocDigiCollection.cxx.
References channel_ids_, and samples_.
|
inline |
The end of this collection.
The end of the collection is the number of digis stored in it.
Definition at line 489 of file HgcrocDigiCollection.h.
References getNumDigis().
| const HgcrocDigiCollection::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 |
Definition at line 57 of file HgcrocDigiCollection.cxx.
References channel_ids_, getNumSamplesPerDigi(), and samples_.
Referenced by 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 channel_ids_.
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 num_samples_per_digi_.
Referenced by getDigi(), and hcal::HcalRawDecoder::produce().
|
inline |
Get index of sample of interest.
Definition at line 376 of file HgcrocDigiCollection.h.
References sample_of_interest_.
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().
|
inline |
Set number of samples for each digi.
| [in] | n | number of samples per digi |
Definition at line 367 of file HgcrocDigiCollection.h.
References num_samples_per_digi_.
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 sample_of_interest_.
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 channel_ids_.
Referenced by ecal::EcalTrigPrimDigiProducer::produce().
|
friend |
Print out the object.
Prints out the lengths of the stored vectors and the other settings of this collection.
Prints all of the digi's using their streamer.
| [in] | s | ostream to print sample to |
| [in] | col | HgcrocDigiCollection to print |
Definition at line 50 of file HgcrocDigiCollection.cxx.
|
private |
list of channel IDs that we have digis for
Definition at line 512 of file HgcrocDigiCollection.h.
Referenced by clear(), getDigi(), getNumDigis(), and size().
|
staticprivate |
Bit position of first flag.
Definition at line 499 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTinProgress(), and ldmx::HgcrocDigiCollection::Sample::Sample().
|
staticprivate |
Bit position of first measurement.
Definition at line 505 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::first(), ldmx::HgcrocDigiCollection::Sample::Sample(), and ldmx::HgcrocDigiCollection::Sample::tot().
|
private |
number of samples for each digi
Definition at line 518 of file HgcrocDigiCollection.h.
Referenced by getNumSamplesPerDigi(), and setNumSamplesPerDigi().
|
staticprivate |
Mask for lowest order bit in an int.
Definition at line 493 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 521 of file HgcrocDigiCollection.h.
Referenced by getSampleOfInterestIndex(), and setSampleOfInterestIndex().
|
private |
list of samples that we have been given
Definition at line 515 of file HgcrocDigiCollection.h.
|
staticprivate |
Bit position of second flag.
Definition at line 502 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTComplete(), and ldmx::HgcrocDigiCollection::Sample::Sample().
|
staticprivate |
Bit position of second measurement.
Definition at line 508 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::Sample(), and ldmx::HgcrocDigiCollection::Sample::secon().
|
staticprivate |
Mask for lowest order ten bits in an int.
Definition at line 496 of file HgcrocDigiCollection.h.
Referenced by ldmx::HgcrocDigiCollection::Sample::first(), ldmx::HgcrocDigiCollection::Sample::Sample(), ldmx::HgcrocDigiCollection::Sample::secon(), and ldmx::HgcrocDigiCollection::Sample::third().
|
private |
version of the ROC we have read
Definition at line 524 of file HgcrocDigiCollection.h.
Referenced by getVersion(), and setVersion().