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

One DIGI signal coming from the HGC ROC. More...

#include <HgcrocDigiCollection.h>

Public Member Functions

 HgcrocDigi (unsigned int id, std::vector< uint32_t >::const_iterator first, const HgcrocDigiCollection &collection)
 Constructor.
 
unsigned int id () const
 Get the ID for this DIGI.
 
bool isADC () const
 Check if this DIGI is an ADC measurement.
 
bool isTOT () const
 Check if this DIGI is a TOT measurement.
 
int tot () const
 Get the 12-bit decoded TOT measurement from this DIGI.
 
HgcrocDigiCollection::Sample at (unsigned int i_sample) const
 get the sample at a specific index in the digi
 
HgcrocDigiCollection::Sample soi () const
 Get the sample of interest from this DIGI.
 
unsigned int size () const
 

Private Attributes

unsigned int id_
 channel ID where this signal is coming from
 
std::vector< uint32_t >::const_iterator first_
 the location of the first sample that are in this digi
 
const HgcrocDigiCollectioncollection_
 Reference to collection that owns this DIGI.
 

Detailed Description

One DIGI signal coming from the HGC ROC.

This stores the channel ID and the samples coming from a channel It really only makes sense to use this object when retrieving DIGIs from the collection. Do not try to make one of these yourself.

Definition at line 227 of file HgcrocDigiCollection.h.

Constructor & Destructor Documentation

◆ HgcrocDigi()

ldmx::HgcrocDigiCollection::HgcrocDigi::HgcrocDigi ( unsigned int  id,
std::vector< uint32_t >::const_iterator  first,
const HgcrocDigiCollection collection 
)
inline

Constructor.

Passes required variables to this structure.

Parameters
[in]idglobal integer ID for the DIGI channel
[in]firstiterator pointing to first sample of this DIGI in the collection
[in]collectionconst reference to the collection this DIGI references

Definition at line 240 of file HgcrocDigiCollection.h.

242 : id_(id), first_(first), collection_(collection) {}
unsigned int id_
channel ID where this signal is coming from
const HgcrocDigiCollection & collection_
Reference to collection that owns this DIGI.
std::vector< uint32_t >::const_iterator first_
the location of the first sample that are in this digi

Member Function Documentation

◆ at()

HgcrocDigiCollection::Sample ldmx::HgcrocDigiCollection::HgcrocDigi::at ( unsigned int  i_sample) const
inline

get the sample at a specific index in the digi

Definition at line 289 of file HgcrocDigiCollection.h.

289 {
290 return Sample(*(first_ + i_sample), collection_.getVersion());
291 }
int getVersion() const
Get the version of ROC we have read.

References collection_, first_, and ldmx::HgcrocDigiCollection::getVersion().

Referenced by hcal::HcalSingleEndRecProducer::extract_measurements(), hcal::HcalRecProducer::getTOA(), and soi().

◆ id()

unsigned int ldmx::HgcrocDigiCollection::HgcrocDigi::id ( ) const
inline

Get the ID for this DIGI.

Returns
global integer ID for this DIGI channel

Definition at line 249 of file HgcrocDigiCollection.h.

249{ return id_; }

References id_.

Referenced by operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().

◆ isADC()

bool ldmx::HgcrocDigiCollection::HgcrocDigi::isADC ( ) const
inline

Check if this DIGI is an ADC measurement.

We consider this DIGI an ADC measurement if both of the flags for the Sample Of Interest are false.

Returns
true if we consider this DIGI an ADC measurement

Definition at line 259 of file HgcrocDigiCollection.h.

259 {
260 return !(soi().isTOTinProgress() or soi().isTOTComplete());
261 }
HgcrocDigiCollection::Sample soi() const
Get the sample of interest from this DIGI.
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::isTOTComplete(), ldmx::HgcrocDigiCollection::Sample::isTOTinProgress(), and soi().

Referenced by hcal::test::HcalCheckReconstruction::analyze(), isTOT(), and operator<<().

◆ isTOT()

bool ldmx::HgcrocDigiCollection::HgcrocDigi::isTOT ( ) const
inline

Check if this DIGI is a TOT measurement.

Note
Just NOT an ADC measurement right now. May need to include the callibration case in the future.
Returns
true if this DIGI is a TOT measurement

Definition at line 271 of file HgcrocDigiCollection.h.

271{ return !isADC(); }
bool isADC() const
Check if this DIGI is an ADC measurement.

References isADC().

Referenced by tot().

◆ size()

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

Definition at line 302 of file HgcrocDigiCollection.h.

unsigned int getNumSamplesPerDigi() const
Get number of samples per digi.

◆ soi()

HgcrocDigiCollection::Sample ldmx::HgcrocDigiCollection::HgcrocDigi::soi ( ) const
inline

Get the sample of interest from this DIGI.

Returns
Sample that is the sample of interest in this DIGI

Definition at line 298 of file HgcrocDigiCollection.h.

298 {
300 }
HgcrocDigiCollection::Sample at(unsigned int i_sample) const
get the sample at a specific index in the digi
unsigned int getSampleOfInterestIndex() const
Get index of sample of interest.

References at(), collection_, and ldmx::HgcrocDigiCollection::getSampleOfInterestIndex().

Referenced by isADC(), operator<<(), ecal::EcalTrigPrimDigiProducer::produce(), hcal::HcalTrigPrimDigiProducer::produce(), and tot().

◆ tot()

int ldmx::HgcrocDigiCollection::HgcrocDigi::tot ( ) const
inline

Get the 12-bit decoded TOT measurement from this DIGI.

Note
Returns -1 if this DIGI is not TOT.
Returns -2 if this DIGI has a TOT in progress during the SOI.
Returns
12-bit TOT measurement

Definition at line 282 of file HgcrocDigiCollection.h.

282 {
283 if (not isTOT()) return -1;
284 if (soi().isTOTinProgress()) return -2;
285 return soi().tot();
286 }
bool isTOT() const
Check if this DIGI is a TOT measurement.
int tot() const
Get the TOT measurement from this sample.

References isTOT(), soi(), and ldmx::HgcrocDigiCollection::Sample::tot().

Referenced by operator<<().

Member Data Documentation

◆ collection_

const HgcrocDigiCollection& ldmx::HgcrocDigiCollection::HgcrocDigi::collection_
private

Reference to collection that owns this DIGI.

Definition at line 312 of file HgcrocDigiCollection.h.

Referenced by at(), and soi().

◆ first_

std::vector<uint32_t>::const_iterator ldmx::HgcrocDigiCollection::HgcrocDigi::first_
private

the location of the first sample that are in this digi

Definition at line 309 of file HgcrocDigiCollection.h.

Referenced by at().

◆ id_

unsigned int ldmx::HgcrocDigiCollection::HgcrocDigi::id_
private

channel ID where this signal is coming from

Definition at line 306 of file HgcrocDigiCollection.h.

Referenced by id().


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