Project
Loading...
Searching...
No Matches
o2::emcal::STUDecoderError Class Referencefinal

Handling of STU reconstruction errors. More...

#include <STUDecoderError.h>

Inherits std::exception.

Public Types

enum class  ErrorCode_t {
  PAGE_ERROR , WORD_UNEXPECTED , INDEX_UNEXPECTED , ADC_OVERFLOW ,
  FEEID_UNEXPECTED , OLD_PAYLOAD_VERSION , FULL_PAYLOAD_SIZE_UNEXPECTED , SHORT_PAYLOAD_SIZE_UNEXPECTED ,
  UNKNOWN
}
 Error codes of STU decoding. More...
 

Public Member Functions

 STUDecoderError (int ddlID, ErrorCode_t errcode)
 Constructor.
 
 ~STUDecoderError () noexcept final=default
 Destructor.
 
const charwhat () const noexcept final
 Access to error message.
 
int getDDLID () const noexcept
 Get the ID of the DDL in which the exception is raised.
 
ErrorCode_t getErrorCode () const noexcept
 Get error code of the exception.
 
void printStream (std::ostream &stream) const
 Print details of the error on the stream.
 

Static Public Member Functions

static int errorCodeToInt (ErrorCode_t errorcode)
 Get integer representation of error code.
 
static ErrorCode_t intToErrorCode (int errorcode)
 Convert integer to error code.
 
static std::string getErrorCodeName (ErrorCode_t errorcode)
 Get the name of the error code.
 
static std::string getErrorCodeName (int errorcode)
 Get the name of the error code.
 
static std::string getErrorCodeTitle (ErrorCode_t errorcode)
 Get the title of the error code.
 
static std::string getErrorCodeTitle (int errorcode)
 Get the title of the error code.
 

Detailed Description

Handling of STU reconstruction errors.

Since
April 25, 2023

In order to distinguish different error types the STUDecoder error carries an error code which can be uniquely identified with a condition raising the excpetion. Source is always the DDL of the STU raising the exception.

Definition at line 30 of file STUDecoderError.h.

Member Enumeration Documentation

◆ ErrorCode_t

Error codes of STU decoding.

Enumerator
PAGE_ERROR 

Page decoding failed (missing header)

WORD_UNEXPECTED 

Word unexpected.

INDEX_UNEXPECTED 

Patch index unexpected.

ADC_OVERFLOW 

ADC overflow.

FEEID_UNEXPECTED 

FeeID index unexpected.

OLD_PAYLOAD_VERSION 

unsupported old payload version

FULL_PAYLOAD_SIZE_UNEXPECTED 

full payload size unexpected

SHORT_PAYLOAD_SIZE_UNEXPECTED 

short payload size unexpected

UNKNOWN 

Unknown error code (needed for conversion to int)

Definition at line 35 of file STUDecoderError.h.

Constructor & Destructor Documentation

◆ STUDecoderError()

STUDecoderError::STUDecoderError ( int  ddlID,
ErrorCode_t  errcode 
)

Constructor.

Parameters
ddlIDID of the DDL for which the exception is raised
errcodeError code of the exception

Definition at line 17 of file STUDecoderError.cxx.

◆ ~STUDecoderError()

o2::emcal::STUDecoderError::~STUDecoderError ( )
finaldefaultnoexcept

Destructor.

Member Function Documentation

◆ errorCodeToInt()

int STUDecoderError::errorCodeToInt ( ErrorCode_t  errorcode)
static

Get integer representation of error code.

Parameters
errorcodeError code
Returns
Integer representation

Definition at line 33 of file STUDecoderError.cxx.

◆ getDDLID()

int o2::emcal::STUDecoderError::getDDLID ( ) const
inlinenoexcept

Get the ID of the DDL in which the exception is raised.

Returns
ID of the DDL

Definition at line 91 of file STUDecoderError.h.

◆ getErrorCode()

ErrorCode_t o2::emcal::STUDecoderError::getErrorCode ( ) const
inlinenoexcept

Get error code of the exception.

Returns
Error code

Definition at line 95 of file STUDecoderError.h.

◆ getErrorCodeName() [1/2]

std::string STUDecoderError::getErrorCodeName ( ErrorCode_t  errorcode)
static

Get the name of the error code.

Parameters
errorcodeError code
Returns
Name of the error code

Definition at line 65 of file STUDecoderError.cxx.

◆ getErrorCodeName() [2/2]

static std::string o2::emcal::STUDecoderError::getErrorCodeName ( int  errorcode)
inlinestatic

Get the name of the error code.

Parameters
errorcodeError code (integer representation)
Returns
Name of the error code

Definition at line 65 of file STUDecoderError.h.

◆ getErrorCodeTitle() [1/2]

std::string STUDecoderError::getErrorCodeTitle ( ErrorCode_t  errorcode)
static

Get the title of the error code.

Parameters
errorcodeError code
Returns
Title of the error code

Definition at line 88 of file STUDecoderError.cxx.

◆ getErrorCodeTitle() [2/2]

static std::string o2::emcal::STUDecoderError::getErrorCodeTitle ( int  errorcode)
inlinestatic

Get the title of the error code.

Parameters
errorcodeError code (integer representation)
Returns
Title of the error code

Definition at line 75 of file STUDecoderError.h.

◆ intToErrorCode()

STUDecoderError::ErrorCode_t STUDecoderError::intToErrorCode ( int  errorcode)
static

Convert integer to error code.

Parameters
errorcodeError code as integer
Returns
Error code (symbolic) - UNKNOWN for invalid integer error codes

Definition at line 56 of file STUDecoderError.cxx.

◆ printStream()

void STUDecoderError::printStream ( std::ostream &  stream) const

Print details of the error on the stream.

Parameters
streamStream to print on

Helper function for streaming operator

Definition at line 23 of file STUDecoderError.cxx.

◆ what()

const char * o2::emcal::STUDecoderError::what ( ) const
inlinefinalnoexcept

Access to error message.

Returns
Error message

Definition at line 87 of file STUDecoderError.h.


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