Project
Loading...
Searching...
No Matches
ErrorTypeFEE.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_EMCAL_ERRORTYPEFEE_H
13#define ALICEO2_EMCAL_ERRORTYPEFEE_H
14
15#include <iostream>
16#include "Rtypes.h"
17
18namespace o2
19{
20
21namespace emcal
22{
23
49{
50 public:
66 ErrorTypeFEE() = default;
67
74 ErrorTypeFEE(int FEEID, ErrorSource_t errortype, int errorCode, int subspec, int hardwareAddress) : mFEEID(FEEID), mErrorSource(errortype), mErrorCode(errorCode), mSubspecification(subspec), mHardwareAddress(hardwareAddress) {}
75
77 ~ErrorTypeFEE() = default;
78
81 void setFEEID(int feeid) { mFEEID = feeid; }
82
85 void setDecodeErrorType(int decodeError) { setError(ErrorSource_t::ALTRO_ERROR, decodeError); }
86
90
93 void setRawFitErrorType(int rawfitterError) { setError(ErrorSource_t::FIT_ERROR, rawfitterError); }
94
97 void setPageErrorType(int pageError) { setError(ErrorSource_t::PAGE_ERROR, pageError); }
98
101 void setGainErrorType(int gainError) { setError(ErrorSource_t::GAIN_ERROR, gainError); }
102
105 void setLinkErrorTYpe(int linkError) { setError(ErrorSource_t::LINK_ERROR, linkError); }
106
110
114
117 void setErrorType(ErrorSource_t errorsource) { mErrorSource = errorsource; }
118
121 void setErrorCode(int errorcode) { mErrorCode = errorcode; }
122
126 void setError(ErrorSource_t errorsource, int errorcode)
127 {
128 setErrorType(errorsource);
129 setErrorCode(errorcode);
130 }
131
134 void setSubspecification(int subspec) { mSubspecification = subspec; }
135
138 void setHardwareAddress(int hardwareAddress) { mHardwareAddress = hardwareAddress; }
139
142 int getFEEID() const
143 {
144 return mFEEID;
145 }
146
149 ErrorSource_t getErrorType() const { return mErrorSource; }
150
153 int getErrorCode() const { return mErrorCode; }
154
157 int getDecodeErrorType() const { return getRawErrorForType(ErrorSource_t::ALTRO_ERROR); }
158
161 int getMinorDecodeErrorType() const { return getRawErrorForType(ErrorSource_t::MINOR_ALTRO_ERROR); }
162
165 int getRawFitErrorType() const { return getRawErrorForType(ErrorSource_t::FIT_ERROR); }
166
169 int getRawPageErrorType() const { return getRawErrorForType(ErrorSource_t::PAGE_ERROR); }
170
173 int getGainTypeErrorType() const { return getRawErrorForType(ErrorSource_t::GAIN_ERROR); }
174
177 int getLinkErrorType() const { return getRawErrorForType(ErrorSource_t::LINK_ERROR); }
178
181 int getSTUDecoderErrorType() const { return getRawErrorForType(ErrorSource_t::STU_ERROR); }
182
185 int getTRUDecoderErrorType() const { return getRawErrorForType(ErrorSource_t::TRU_ERROR); }
186
189 int getSubspecification() const { return mSubspecification; }
190
193 int getHarwareAddress() const { return mHardwareAddress; }
194
199 void PrintStream(std::ostream& stream) const;
200
203 static constexpr int getNumberOfErrorTypes() { return 10; }
204
208 static const char* getErrorTypeName(unsigned int errorTypeID);
209
213 static const char* getErrorTypeTitle(unsigned int errorTypeID);
214
215 private:
218 int getRawErrorForType(ErrorSource_t source) const { return mErrorSource == source ? mErrorCode : -1; }
219
220 int mFEEID = -1;
222 int mErrorCode = -1;
223 int mSubspecification;
224 int mHardwareAddress;
225
226 ClassDefNV(ErrorTypeFEE, 1);
227};
228
233std::ostream& operator<<(std::ostream& stream, const ErrorTypeFEE& errorType);
234
235} // namespace emcal
236
237} // namespace o2
238
239#endif
Errors per FEE information.
int getLinkErrorType() const
Get the error code of the obect in case the object is a link error.
~ErrorTypeFEE()=default
Destructor.
void setFEEID(int feeid)
Set the ID of the FEE responsible for the error.
int getSubspecification() const
Get subspecification of the error.
void setSubspecification(int subspec)
Set the subspecification of the error.
void setErrorCode(int errorcode)
Set the error code of the object.
void setMinorDecodingErrorType(int decodeError)
Set the error as minor (non-fatal) decoding error and store the error code.
int getGainTypeErrorType() const
Get the error code of the obect in case the object is a gain type error.
void setGainErrorType(int gainError)
Set the error as gain type error and store the error code.
void setPageErrorType(int pageError)
Set the error as page parser error and store the error code.
int getMinorDecodeErrorType() const
Get the error code of the obect in case the object is a decoding error.
ErrorTypeFEE()=default
Constructor.
int getTRUDecoderErrorType() const
Get the error code of the obect in case the object is a TRU decoder error.
int getRawFitErrorType() const
Get the error code of the obect in case the object is a raw fitter error.
void setSTUDecoderErrorType(int stuerror)
Set the error as STU decoder error and store the error code.
int getErrorCode() const
Get the error code of the object.
static const char * getErrorTypeTitle(unsigned int errorTypeID)
Get the title of the error type.
void setErrorType(ErrorSource_t errorsource)
Set the error type of the object.
ErrorSource_t getErrorType() const
Get the type of the error handled by the object.
void setLinkErrorTYpe(int linkError)
Set the error type as link error and store the error code.
static const char * getErrorTypeName(unsigned int errorTypeID)
Get the name of the error type.
int getDecodeErrorType() const
Get the error code of the obect in case the object is a decoding error.
int getHarwareAddress() const
Get the hardware address of the error.
int getFEEID() const
Get the FEE ID of the electronics responsible for the error.
int getRawPageErrorType() const
Get the error code of the obect in case the object is a page parsing error.
void setRawFitErrorType(int rawfitterError)
Set the error as raw fitter error and store the error code.
int getSTUDecoderErrorType() const
Get the error code of the obect in case the object is a STU decoder error.
void setDecodeErrorType(int decodeError)
Set the error as decoding error and store the error code.
void setTRUDecoderErrorType(int truerror)
Set the error as TRU decoder error and store the error code.
void setHardwareAddress(int hardwareAddress)
Set the hardware address of the error.
void setError(ErrorSource_t errorsource, int errorcode)
Set source and code of the error.
void PrintStream(std::ostream &stream) const
Printing information of the error type.
static constexpr int getNumberOfErrorTypes()
Get the number of error types.
ErrorTypeFEE(int FEEID, ErrorSource_t errortype, int errorCode, int subspec, int hardwareAddress)
Constructor initializing the object.
ErrorSource_t
Source of the error.
@ FIT_ERROR
Raw fit failed.
@ LINK_ERROR
Error due to missing DDL links.
@ ALTRO_ERROR
Decoding of the ALTRO payload failed.
@ GEOMETRY_ERROR
Decoded position outside EMCAL.
@ TRU_ERROR
Errors from TRU data.
@ MINOR_ALTRO_ERROR
Non-fatal error in decoding of the ALTRO payload.
@ STU_ERROR
Error from STU data.
@ GAIN_ERROR
Error due to gain type.
@ PAGE_ERROR
Raw page decoding failed.
@ UNDEFINED
Error source undefined.
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
Definition Cell.cxx:355
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...