/** @file CbmErrorMessage.h
** @author Pierre-Alain Loizeau
** @date 19.02.2020
**/
#ifndef CBMERRORMESSAGE_H
#define CBMERRORMESSAGE_H 1
/// CbmRoot (+externals) headers
#include "CbmDefs.h"
/// FairRoot headers
/// Fairsoft (Root, Boost, ...) headers
#include "TObject.h"
/// C/C++ headers
#include
#include
/** @class CbmErrorMessage
** @brief Base class for persistent representation of error messages information.
** @author Pierre-Alain Loizeau
** @since 19.02.2020
** @version 19.02.2020
**
** CbmErrorMessage is a base class for the ROOT representation of
** the error message delivered by the detector readout chains.
** The available information fields are the system ID, the time stamp,
** an origin index (address), the flags and (optionally) a payload.
**
** The base class only provides bulk setters/getters, with the idea that
** derived class will provide direct accessors to specific flags/payloads.
**/
class CbmErrorMessage : public TObject
{
public:
/** Default constructor **/
CbmErrorMessage();
/**
* \brief Standard constructor.
* \param[in] sysId System ID from ECbmModuleId enum.
* \param[in] dTime Error time [ns].
* \param[in] uAddress Some address for the error source.
* \param[in] uFlags Flags/error pattern, 32b available.
* \param[in] uPayload Optional error payload, 32b available.
**/
CbmErrorMessage( ECbmModuleId sysId, Double_t dTime, UInt_t uAddress,
UInt_t uFlags, UInt_t uPayload = 0 );
/** Destructor **/
virtual ~CbmErrorMessage();
/** @brief System (enum DetectorId) **/
virtual Int_t GetSystemId() const { return fModuleId; }
/** @brief Absolute time [ns] **/
virtual Double_t GetTime() const { return fdTime; }
/** @brief Origin address **/
virtual UInt_t GetAddress() const { return fuAddress; }
/** @brief Flags (bitfield) **/
virtual UInt_t GetFlags() const { return fuFlags; }
/** @brief Payload (optional) **/
virtual UInt_t GetPayload() const { return fuPayload; }
/** @brief Output information **/
virtual std::string ToString() const;
private:
ECbmModuleId fModuleId;
Double_t fdTime;
UInt_t fuAddress;
UInt_t fuFlags;
UInt_t fuPayload;
ClassDef(CbmErrorMessage,0);
};
typedef std::unique_ptr up_CbmErrorMessage;
#endif