LDMX Software
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ldmx::HgcrocDigiCollection Class Reference

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.
 

Detailed Description

Represents a collection of the digi hits readout by an HGCROC.

Note
This class represents the digitized signal information in the form of a series of samples for each channel of readout. Each channel is represented by an ID integer and each sample is a 32-bit word. The number of samples for each digi is configurable, but is required to be the same for all channels.

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.

Constructor & Destructor Documentation

◆ HgcrocDigiCollection()

ldmx::HgcrocDigiCollection::HgcrocDigiCollection ( )
inline

Class constructor.

Definition at line 320 of file HgcrocDigiCollection.h.

320{}

◆ ~HgcrocDigiCollection()

virtual ldmx::HgcrocDigiCollection::~HgcrocDigiCollection ( )
inlinevirtual

Class destructor.

Definition at line 325 of file HgcrocDigiCollection.h.

325{}

Member Function Documentation

◆ addDigi()

void ldmx::HgcrocDigiCollection::addDigi ( unsigned int  id,
const std::vector< Sample > &  digi 
)

Add samples to collection.

See also
Sample for how the valid measurements depend on the flags.
Parameters
[in]idglobal integer ID for this channel
[in]digilist of new samples to add

Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalAlignPolarfires::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().

◆ begin()

iterator ldmx::HgcrocDigiCollection::begin ( )
inline

The beginning of this collection.

We just point the user to the zero'th entry.

Definition at line 482 of file HgcrocDigiCollection.h.

482{ return iterator(*this, 0); }

◆ Clear()

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.

◆ end()

iterator ldmx::HgcrocDigiCollection::end ( )
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.

490{ return iterator(*this, getNumDigis()); }
unsigned int getNumDigis() const
Get total number of digis.

References getNumDigis().

◆ getDigi()

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.

See also
Sample for how the valid measurements depend on the flags.
HgcrocDigi for how to use the object returned from this function
Parameters
[in]digiIndexindex of digi to decode
Returns
HgcrocDigi package with accessors

Referenced by dqm::NtuplizeHgcrocDigiCollection::analyze(), hcal::test::HcalCheckReconstruction::analyze(), hcal::HcalPedestalAnalyzer::analyze(), ldmx::HgcrocDigiCollection::iterator::operator*(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().

◆ getNumDigis()

unsigned int ldmx::HgcrocDigiCollection::getNumDigis ( ) const
inline

Get total number of digis.

Returns
unsigned int number of digis

Definition at line 410 of file HgcrocDigiCollection.h.

410{ return channelIDs_.size(); }
std::vector< unsigned int > channelIDs_
list of channel IDs that we have digis for

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().

◆ getNumSamplesPerDigi()

unsigned int ldmx::HgcrocDigiCollection::getNumSamplesPerDigi ( ) const
inline

Get number of samples per digi.

Returns
unsigned int number of samples per digi

Definition at line 361 of file HgcrocDigiCollection.h.

361{ return numSamplesPerDigi_; }
unsigned int numSamplesPerDigi_
number of samples for each digi

References numSamplesPerDigi_.

Referenced by hcal::HcalRawDecoder::produce().

◆ getSampleOfInterestIndex()

unsigned int ldmx::HgcrocDigiCollection::getSampleOfInterestIndex ( ) const
inline

Get index of sample of interest.

Returns
unsigned int index for SOI

Definition at line 376 of file HgcrocDigiCollection.h.

376{ return sampleOfInterest_; }
unsigned int sampleOfInterest_
index for the sample of interest in the samples list

References sampleOfInterest_.

Referenced by hcal::HcalSingleEndRecProducer::produce(), and ldmx::HgcrocDigiCollection::HgcrocDigi::soi().

◆ getVersion()

int ldmx::HgcrocDigiCollection::getVersion ( ) const
inline

Get the version of ROC we have read.

Returns
int version number of ROC

Definition at line 347 of file HgcrocDigiCollection.h.

347{ return version_; }
int version_
version of the ROC we have read

References version_.

Referenced by ldmx::HgcrocDigiCollection::HgcrocDigi::at().

◆ Print()

void ldmx::HgcrocDigiCollection::Print ( ) const

Print out the object.

Prints out the lengths of the stored vectors and the other settings of this collection.

◆ setNumSamplesPerDigi()

void ldmx::HgcrocDigiCollection::setNumSamplesPerDigi ( unsigned int  n)
inline

Set number of samples for each digi.

Parameters
[in]nnumber of samples per digi

Definition at line 367 of file HgcrocDigiCollection.h.

367 {
369 return;
370 }

References numSamplesPerDigi_.

Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().

◆ setSampleOfInterestIndex()

void ldmx::HgcrocDigiCollection::setSampleOfInterestIndex ( unsigned int  n)
inline

Set index of sample of interest.

Note
Does not check if input is a valid index! (i.e. input less than numSamplesPerDigi_)
Parameters
[in]nindex for the sample of interest

Definition at line 386 of file HgcrocDigiCollection.h.

386 {
388 return;
389 }

References sampleOfInterest_.

Referenced by ecal::EcalDigiProducer::produce(), ecal::EcalRawDecoder::produce(), hcal::HcalDigiProducer::produce(), and hcal::HcalRawDecoder::produce().

◆ setVersion()

void ldmx::HgcrocDigiCollection::setVersion ( int  v)
inline

Set the version of the ROC we have read.

Definition at line 352 of file HgcrocDigiCollection.h.

352 {
353 version_ = v;
354 return;
355 }

References version_.

Referenced by ecal::EcalRawDecoder::produce(), and hcal::HcalRawDecoder::produce().

◆ size()

unsigned int ldmx::HgcrocDigiCollection::size ( ) const
inline

Get total number of digis.

Returns
unsigned int number of digis

Definition at line 416 of file HgcrocDigiCollection.h.

416{ return channelIDs_.size(); }

References channelIDs_.

Member Data Documentation

◆ channelIDs_

std::vector<unsigned int> ldmx::HgcrocDigiCollection::channelIDs_
private

list of channel IDs that we have digis for

Definition at line 513 of file HgcrocDigiCollection.h.

Referenced by getNumDigis(), and size().

◆ FIRSTFLAG_POS

const int ldmx::HgcrocDigiCollection::FIRSTFLAG_POS = 31
staticprivate

Bit position of first flag.

Definition at line 500 of file HgcrocDigiCollection.h.

Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTinProgress().

◆ FIRSTMEAS_POS

const int ldmx::HgcrocDigiCollection::FIRSTMEAS_POS = 20
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().

◆ numSamplesPerDigi_

unsigned int ldmx::HgcrocDigiCollection::numSamplesPerDigi_
private

number of samples for each digi

Definition at line 519 of file HgcrocDigiCollection.h.

Referenced by getNumSamplesPerDigi(), and setNumSamplesPerDigi().

◆ ONE_BIT_MASK

const int ldmx::HgcrocDigiCollection::ONE_BIT_MASK = 1
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().

◆ sampleOfInterest_

unsigned int ldmx::HgcrocDigiCollection::sampleOfInterest_
private

index for the sample of interest in the samples list

Definition at line 522 of file HgcrocDigiCollection.h.

Referenced by getSampleOfInterestIndex(), and setSampleOfInterestIndex().

◆ samples_

std::vector<uint32_t> ldmx::HgcrocDigiCollection::samples_
private

list of samples that we have been given

Definition at line 516 of file HgcrocDigiCollection.h.

◆ SECONFLAG_POS

const int ldmx::HgcrocDigiCollection::SECONFLAG_POS = 30
staticprivate

Bit position of second flag.

Definition at line 503 of file HgcrocDigiCollection.h.

Referenced by ldmx::HgcrocDigiCollection::Sample::isTOTComplete().

◆ SECONMEAS_POS

const int ldmx::HgcrocDigiCollection::SECONMEAS_POS = 10
staticprivate

Bit position of second measurement.

Definition at line 509 of file HgcrocDigiCollection.h.

Referenced by ldmx::HgcrocDigiCollection::Sample::secon().

◆ TEN_BIT_MASK

const int ldmx::HgcrocDigiCollection::TEN_BIT_MASK = (1 << 10) - 1
staticprivate

◆ version_

int ldmx::HgcrocDigiCollection::version_
private

version of the ROC we have read

Definition at line 525 of file HgcrocDigiCollection.h.

Referenced by getVersion(), and setVersion().


The documentation for this class was generated from the following file: