Project
Loading...
Searching...
No Matches
ErrorTypeFEE.cxx
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
13#include <iomanip>
14#include <iostream>
15
16using namespace o2::emcal;
17
18void ErrorTypeFEE::PrintStream(std::ostream& stream) const
19{
20 std::string typestring;
21 switch (mErrorSource) {
23 typestring = "decode error";
24 break;
26 typestring = "decode error";
27 break;
29 typestring = "fit error";
30 break;
32 typestring = "page error";
33 break;
35 typestring = "geometry error";
36 break;
38 typestring = "gain type error";
39 break;
41 typestring = "STU decoder error";
42 break;
44 typestring = "STU decoder error";
45 break;
47 typestring = "Link missing error";
48 break;
50 typestring = "unknown error";
51 break;
52 default:
53 typestring = "unknown error";
54 break;
55 };
56 stream << "EMCAL SM: " << getFEEID() << ", " << typestring << " Type: " << getErrorCode();
57 if (mSubspecification >= 0) {
58 stream << ", Subspecification: " << mSubspecification;
59 }
60 if (mHardwareAddress >= 0) {
61 stream << ", hardware address 0x" << std::hex << mHardwareAddress << std::dec;
62 }
63}
64
65const char* ErrorTypeFEE::getErrorTypeName(unsigned int errorTypeID)
66{
67 switch (errorTypeID) {
69 return "Page";
71 return "MajorAltro";
73 return "MinorAltro";
75 return "Fit";
77 return "Geometry";
79 return "GainType";
81 return "TRUDecoding";
83 return "STUDecoding";
85 return "LinkMissing";
87 return "Undefined";
88 default:
89 return "";
90 };
91}
92
93const char* ErrorTypeFEE::getErrorTypeTitle(unsigned int errorTypeID)
94{
95 switch (errorTypeID) {
97 return "Page";
99 return "Major ALTRO";
101 return "Minor ALTRO";
103 return "Fit";
105 return "Geometry";
107 return "Gain";
109 return "TRU Decoding";
111 return "STU Decoding";
113 return "Link missing";
115 return "Unknown";
116 default:
117 return "";
118 };
119}
120
121std::ostream& o2::emcal::operator<<(std::ostream& stream, const ErrorTypeFEE& error)
122{
123 error.PrintStream(stream);
124 return stream;
125}
Errors per FEE information.
int getErrorCode() const
Get the error code of the object.
static const char * getErrorTypeTitle(unsigned int errorTypeID)
Get the title of the error type.
static const char * getErrorTypeName(unsigned int errorTypeID)
Get the name of the error type.
int getFEEID() const
Get the FEE ID of the electronics responsible for the error.
void PrintStream(std::ostream &stream) const
Printing information of the error type.
@ 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.
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