forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSiPixelRawDataError.cc
101 lines (88 loc) · 2.6 KB
/
SiPixelRawDataError.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "DataFormats/SiPixelRawDataError.h"
//---------------------------------------------------------------------------
//! \class SiPixelRawDataError
//! \brief Pixel error -- collection of errors and error information
//!
//! Class to contain and store all information about errors
//!
//!
//! \author Andrew York, University of Tennessee
//---------------------------------------------------------------------------
//Constructors
SiPixelRawDataError::SiPixelRawDataError() {}
SiPixelRawDataError::SiPixelRawDataError(uint32_t errorWord32, const int errorType, int fedId)
: errorWord32_(errorWord32), errorType_(errorType), fedId_(fedId) {
setMessage();
}
SiPixelRawDataError::SiPixelRawDataError(uint64_t errorWord64, const int errorType, int fedId)
: errorWord64_(errorWord64), errorType_(errorType), fedId_(fedId) {
setMessage();
}
//Destructor
SiPixelRawDataError::~SiPixelRawDataError() {}
//functions to get error words and types
void SiPixelRawDataError::setWord32(uint32_t errorWord32) { errorWord32_ = errorWord32; }
void SiPixelRawDataError::setWord64(uint64_t errorWord64) { errorWord64_ = errorWord64; }
void SiPixelRawDataError::setType(int errorType) {
errorType_ = errorType;
setMessage();
}
void SiPixelRawDataError::setFedId(int fedId) { fedId_ = fedId; }
void SiPixelRawDataError::setMessage() {
switch (errorType_) {
case (25): {
errorMessage_ = "Error: Disabled FED channel (ROC=25)";
break;
}
case (26): {
errorMessage_ = "Error: Gap word";
break;
}
case (27): {
errorMessage_ = "Error: Dummy word";
break;
}
case (28): {
errorMessage_ = "Error: FIFO nearly full";
break;
}
case (29): {
errorMessage_ = "Error: Timeout";
break;
}
case (30): {
errorMessage_ = "Error: Trailer";
break;
}
case (31): {
errorMessage_ = "Error: Event number mismatch";
break;
}
case (32): {
errorMessage_ = "Error: Invalid or missing header";
break;
}
case (33): {
errorMessage_ = "Error: Invalid or missing trailer";
break;
}
case (34): {
errorMessage_ = "Error: Size mismatch";
break;
}
case (35): {
errorMessage_ = "Error: Invalid channel";
break;
}
case (36): {
errorMessage_ = "Error: Invalid ROC number";
break;
}
case (37): {
errorMessage_ = "Error: Invalid dcol/pixel address";
break;
}
default:
errorMessage_ = "Error: Unknown error type";
};
}