Project
Loading...
Searching...
No Matches
o2::mch::raw::DataDecoder Class Reference

#include <DataDecoder.h>

Classes

struct  RawDigit
 
struct  SampaInfo
 Structure storing the raw SAMPA information. More...
 
struct  TimeFrameStartRecord
 

Public Types

enum class  TimeRecoMode : uint8_t { HBPackets = 0 , BCReset = 1 }
 
using RawDigitVector = std::vector< RawDigit >
 

Public Member Functions

 DataDecoder (SampaChannelHandler channelHandler, RdhHandler rdhHandler, std::string mapCRUfile, std::string mapFECfile, bool ds2manu, bool verbose, bool useDummyElecMap, TimeRecoMode timeRecoMode=TimeRecoMode::HBPackets, uint32_t nofOrbitsPerTF=32)
 
void reset ()
 
void setOrbitsInTF (uint32_t nofOrbitsPerTF)
 
void setFirstOrbitInTF (uint32_t orbit)
 
bool decodeBuffer (gsl::span< const std::byte > buf)
 
void updateTimeFrameStartRecord (uint64_t chipId, uint32_t mFirstOrbitInTF, uint32_t bcTF)
 For a given SAMPA chip, update the information about the BC counter value at the beginning of the TimeFrame.
 
void computeDigitsTimeHBPackets ()
 Compute the time of all the digits that have been decoded in the current TimeFrame.
 
int32_t getDigitTimeBCRst (uint32_t orbitTF, uint32_t bcTF, uint32_t orbitDigit, uint32_t bcDigit)
 
void computeDigitsTimeBCRst ()
 Compute the time of all the digits that have been decoded in the current TimeFrame.
 
void computeDigitsTime ()
 
const RawDigitVectorgetDigits () const
 Get the vector of digits that have been decoded in the current TimeFrame.
 
const std::unordered_set< OrbitInfo, OrbitInfoHash > & getOrbits () const
 Get the list of orbits that have been found in the current TimeFrame for each CRU link.
 
const std::vector< o2::mch::DecoderError > & getErrors () const
 Get the list of decoding errors that have been found in the current TimeFrame.
 
const std::vector< o2::mch::HeartBeatPacket > & getHBPackets () const
 Get the list of heart-beat packets that have been found in the current TimeFrame.
 
void setDigits (const RawDigitVector &digits)
 Initialize the digits from an external vector. To be only used for unit tests.
 
void logErrorMap (int tfcount) const
 send all messages from our error map to the infologger
 

Static Public Member Functions

static uint64_t getChipId (uint32_t solar, uint32_t ds, uint32_t chip)
 Convert a Solar/Ds/Chip triplet into an unique chip index.
 
static int32_t getDigitTimeHBPackets (uint32_t orbitTF, uint32_t bcTF, uint32_t orbitDigit, uint32_t bcDigit)
 Helper function for computing the digit time relative to the beginning of the TimeFrame.
 

Static Public Attributes

static constexpr int32_t tfTimeMax {0x7FFFFFFF}
 
static constexpr int32_t tfTimeInvalid {-tfTimeMax}
 

Detailed Description

Definition at line 57 of file DataDecoder.h.

Member Typedef Documentation

◆ RawDigitVector

Definition at line 149 of file DataDecoder.h.

Member Enumeration Documentation

◆ TimeRecoMode

enum class o2::mch::raw::DataDecoder::TimeRecoMode : uint8_t
strong
Enumerator
HBPackets 
BCReset 

Definition at line 63 of file DataDecoder.h.

Constructor & Destructor Documentation

◆ DataDecoder()

o2::mch::raw::DataDecoder::DataDecoder ( SampaChannelHandler  channelHandler,
RdhHandler  rdhHandler,
std::string  mapCRUfile,
std::string  mapFECfile,
bool  ds2manu,
bool  verbose,
bool  useDummyElecMap,
TimeRecoMode  timeRecoMode = TimeRecoMode::HBPackets,
uint32_t  nofOrbitsPerTF = 32 
)

Definition at line 242 of file DataDecoder.cxx.

Member Function Documentation

◆ computeDigitsTime()

void o2::mch::raw::DataDecoder::computeDigitsTime ( )

Definition at line 820 of file DataDecoder.cxx.

◆ computeDigitsTimeBCRst()

void o2::mch::raw::DataDecoder::computeDigitsTimeBCRst ( )

Compute the time of all the digits that have been decoded in the current TimeFrame.

Definition at line 783 of file DataDecoder.cxx.

◆ computeDigitsTimeHBPackets()

void o2::mch::raw::DataDecoder::computeDigitsTimeHBPackets ( )

Compute the time of all the digits that have been decoded in the current TimeFrame.

Definition at line 729 of file DataDecoder.cxx.

◆ decodeBuffer()

bool o2::mch::raw::DataDecoder::decodeBuffer ( gsl::span< const std::byte >  buf)

Decode one TimeFrame buffer and fill the vector of digits.

Returns
true if decoding went ok, or false otherwise. if false is returned, the decoding of the (rest of the) TF should be abandonned simply.

Definition at line 269 of file DataDecoder.cxx.

◆ getChipId()

uint64_t o2::mch::raw::DataDecoder::getChipId ( uint32_t  solar,
uint32_t  ds,
uint32_t  chip 
)
static

Convert a Solar/Ds/Chip triplet into an unique chip index.

Definition at line 529 of file DataDecoder.cxx.

◆ getDigits()

const RawDigitVector & o2::mch::raw::DataDecoder::getDigits ( ) const
inline

Get the vector of digits that have been decoded in the current TimeFrame.

Definition at line 187 of file DataDecoder.h.

◆ getDigitTimeBCRst()

int32_t o2::mch::raw::DataDecoder::getDigitTimeBCRst ( uint32_t  orbitTF,
uint32_t  bcTF,
uint32_t  orbitDigit,
uint32_t  bcDigit 
)

Definition at line 762 of file DataDecoder.cxx.

◆ getDigitTimeHBPackets()

int32_t o2::mch::raw::DataDecoder::getDigitTimeHBPackets ( uint32_t  orbitTF,
uint32_t  bcTF,
uint32_t  orbitDigit,
uint32_t  bcDigit 
)
static

Helper function for computing the digit time relative to the beginning of the TimeFrame.

Definition at line 699 of file DataDecoder.cxx.

◆ getErrors()

const std::vector< o2::mch::DecoderError > & o2::mch::raw::DataDecoder::getErrors ( ) const
inline

Get the list of decoding errors that have been found in the current TimeFrame.

Definition at line 191 of file DataDecoder.h.

◆ getHBPackets()

const std::vector< o2::mch::HeartBeatPacket > & o2::mch::raw::DataDecoder::getHBPackets ( ) const
inline

Get the list of heart-beat packets that have been found in the current TimeFrame.

Definition at line 193 of file DataDecoder.h.

◆ getOrbits()

const std::unordered_set< OrbitInfo, OrbitInfoHash > & o2::mch::raw::DataDecoder::getOrbits ( ) const
inline

Get the list of orbits that have been found in the current TimeFrame for each CRU link.

Definition at line 189 of file DataDecoder.h.

◆ logErrorMap()

void o2::mch::raw::DataDecoder::logErrorMap ( int  tfcount) const

send all messages from our error map to the infologger

Definition at line 252 of file DataDecoder.cxx.

◆ reset()

void o2::mch::raw::DataDecoder::reset ( )

Definition at line 915 of file DataDecoder.cxx.

◆ setDigits()

void o2::mch::raw::DataDecoder::setDigits ( const RawDigitVector digits)
inline

Initialize the digits from an external vector. To be only used for unit tests.

Definition at line 195 of file DataDecoder.h.

◆ setFirstOrbitInTF()

void o2::mch::raw::DataDecoder::setFirstOrbitInTF ( uint32_t  orbit)

Store the value of the first orbit in the TimeFrame to be processed Must be called before processing the TmeFrame buffer

Definition at line 262 of file DataDecoder.cxx.

◆ setOrbitsInTF()

void o2::mch::raw::DataDecoder::setOrbitsInTF ( uint32_t  nofOrbitsPerTF)
inline

Definition at line 160 of file DataDecoder.h.

◆ updateTimeFrameStartRecord()

void o2::mch::raw::DataDecoder::updateTimeFrameStartRecord ( uint64_t  chipId,
uint32_t  mFirstOrbitInTF,
uint32_t  bcTF 
)

For a given SAMPA chip, update the information about the BC counter value at the beginning of the TimeFrame.

Definition at line 536 of file DataDecoder.cxx.

Member Data Documentation

◆ tfTimeInvalid

constexpr int32_t o2::mch::raw::DataDecoder::tfTimeInvalid {-tfTimeMax}
staticconstexpr

Definition at line 61 of file DataDecoder.h.

◆ tfTimeMax

constexpr int32_t o2::mch::raw::DataDecoder::tfTimeMax {0x7FFFFFFF}
staticconstexpr

Definition at line 60 of file DataDecoder.h.


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