Project
Loading...
Searching...
No Matches
o2::emcal::Bunch Class Reference

ALTRO bunch information. More...

#include <Bunch.h>

Public Member Functions

 Bunch ()=default
 Constructor.
 
 Bunch (uint8_t length, uint8_t start)
 Initialize the bunch with start time and bunch length.
 
 ~Bunch ()=default
 
void addADC (uint16_t adc)
 Add ADC value to the bunch.
 
void initFromRange (gsl::span< uint16_t > range)
 Initialize the ADC values in the bunch from a range.
 
const std::vector< uint16_t > & getADC () const
 Get range of ADC values in the bunch.
 
uint8_t getBunchLength () const
 Get the length of the bunch (number of time bins)
 
uint8_t getStartTime () const
 Get the start time bin.
 
uint8_t getEndTime () const
 Get the end time bin.
 
void setBunchLength (uint8_t length)
 Set the length of the ALTRO bunch.
 
void setStartTime (uint8_t start)
 Set the start time bin.
 

Detailed Description

ALTRO bunch information.

The bunch contains the ADC values of a given data bunch for a channel in the ALTRO stream. The ADC values are stored in reversed order in time both in the ALTRO stream and in the bunch object.

For iteration one should assume that the end time is 0, however it can also be larger than 0. In this case the first value has to be mapped to the end timebin and the last value to the start timebin, still iterating only over the number of samples.

Definition at line 39 of file Bunch.h.

Constructor & Destructor Documentation

◆ Bunch() [1/2]

o2::emcal::Bunch::Bunch ( )
default

Constructor.

◆ Bunch() [2/2]

o2::emcal::Bunch::Bunch ( uint8_t  length,
uint8_t  start 
)
inline

Initialize the bunch with start time and bunch length.

Parameters
lengthLength of the bunch
startStart time of the bunch

Definition at line 48 of file Bunch.h.

◆ ~Bunch()

o2::emcal::Bunch::~Bunch ( )
default

Member Function Documentation

◆ addADC()

void o2::emcal::Bunch::addADC ( uint16_t  adc)
inline

Add ADC value to the bunch.

Parameters
adcNext ADC value

ADC values are stored in reversed order. The next ADC value has to be earlier in time compared to the previous one.

Definition at line 58 of file Bunch.h.

◆ getADC()

const std::vector< uint16_t > & o2::emcal::Bunch::getADC ( ) const
inline

Get range of ADC values in the bunch.

Returns
ADC values in the bunch

The ADC values are stored in reversed order in time. Therefore the last entry is the one earliest in time.

Definition at line 72 of file Bunch.h.

◆ getBunchLength()

uint8_t o2::emcal::Bunch::getBunchLength ( ) const
inline

Get the length of the bunch (number of time bins)

Returns
Length of the bunch

Definition at line 76 of file Bunch.h.

◆ getEndTime()

uint8_t o2::emcal::Bunch::getEndTime ( ) const
inline

Get the end time bin.

Returns
End timebin

The end timebin is the lower of the two, the samples are in reversed order.

Definition at line 90 of file Bunch.h.

◆ getStartTime()

uint8_t o2::emcal::Bunch::getStartTime ( ) const
inline

Get the start time bin.

Returns
Start timebin

The start timebin is the higher of the two, the samples are in reversed order.

Definition at line 83 of file Bunch.h.

◆ initFromRange()

void Bunch::initFromRange ( gsl::span< uint16_t >  range)

Initialize the ADC values in the bunch from a range.

Parameters
rangeRange of ADC values

The ADC values are stored in reversed order in time. Therefore the last entry is the one earliest in time.

Definition at line 15 of file Bunch.cxx.

◆ setBunchLength()

void o2::emcal::Bunch::setBunchLength ( uint8_t  length)
inline

Set the length of the ALTRO bunch.

Parameters
lengthBunch length

Definition at line 94 of file Bunch.h.

◆ setStartTime()

void o2::emcal::Bunch::setStartTime ( uint8_t  start)
inline

Set the start time bin.

Parameters
starttimebin

The start timebin is the higher of the two, the samples are in reversed order.

Definition at line 101 of file Bunch.h.


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