forked from AliceO2Group/QualityControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRawErrorCheck.cxx
More file actions
550 lines (509 loc) · 22.8 KB
/
RawErrorCheck.cxx
File metadata and controls
550 lines (509 loc) · 22.8 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include <algorithm>
#include <array>
#include <string>
#include <boost/algorithm/string.hpp>
#include "DataFormatsEMCAL/ErrorTypeFEE.h"
#include "EMCALBase/Geometry.h"
#include "EMCALReconstruction/AltroDecoder.h"
#include "EMCALReconstruction/CaloRawFitter.h"
#include "EMCALReconstruction/RawDecodingError.h"
#include "EMCALReconstruction/ReconstructionErrors.h"
#include "EMCAL/RawErrorCheck.h"
#include "QualityControl/MonitorObject.h"
#include "QualityControl/Quality.h"
#include "QualityControl/QcInfoLogger.h"
// ROOT
#include <TH1.h>
#include <TH2.h>
#include <TLatex.h>
#include <TList.h>
#include <TLine.h>
#include <DataFormatsQualityControl/FlagType.h>
#include <DataFormatsQualityControl/FlagTypeFactory.h>
using namespace o2::quality_control;
namespace o2::quality_control_modules::emcal
{
void RawErrorCheck::configure()
{
mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000);
// switch on/off messages on the infoLogger
auto switchNotifyIL = mCustomParameters.find("NotifyInfologger");
if (switchNotifyIL != mCustomParameters.end()) {
try {
mNotifyInfologger = decodeBool(switchNotifyIL->second);
} catch (std::exception& e) {
ILOG(Error, Support) << e.what() << ENDM;
}
}
const std::string keyThreshRawdataErrors = "ThresholdRDE",
keyThreshPageError = "ThresholdPE",
keyThreshMajorAltroError = "ThresholdMAAE",
keyThreshMinorAltroError = "ThresholdMIAE",
keyThresRawFitError = "ThresholdRFE",
keyThresholdGeometryError = "ThresholdGEE",
keyThresholdGainTypeError = "ThresholdGTE";
try {
for (auto& [param, value] : mCustomParameters.getAllDefaults()) {
if (param.find(keyThreshRawdataErrors) == 0) {
auto errortype = param.substr(keyThreshRawdataErrors.length());
auto errorcode = findErrorCodeRDE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram RawDataErrors: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdRDE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram RawDataErrors: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram RawDataErrors: Requested error type " << errortype << " not found" << ENDM;
}
}
// Raw data error summary hists start with RDESummaryErr for error values and RDESummaryWarn for warning values
std::string strSummaryErr = "RDESummaryErr";
if (param.starts_with(strSummaryErr)) {
auto errortype = param.substr(strSummaryErr.length());
auto errorcode = findErrorCodeRDE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram RawDataErrors Summary Errors: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdRDESummary[errorcode][0] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram RawDataErrors Summary Errors: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram RawDataErrors Summary Errors: Requested error type " << errortype << " not found" << ENDM;
}
}
std::string strSummaryWarn = "RDESummaryWarn";
if (param.starts_with(strSummaryWarn)) {
auto errortype = param.substr(strSummaryWarn.length());
auto errorcode = findErrorCodeRDE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram RawDataErrors Summary Warning: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdRDESummary[errorcode][1] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram RawDataErrors Summary Warning: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram RawDataErrors Summary Warning: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThreshPageError) == 0) {
auto errortype = param.substr(keyThreshPageError.length());
auto errorcode = findErrorCodePE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram PageErrors: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdPE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram PageErrors: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram PageErrors: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThreshMajorAltroError) == 0) {
auto errortype = param.substr(keyThreshMajorAltroError.length());
auto errorcode = findErrorCodeMAAE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram MajorAltroErrors: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdMAAE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram MajorAltroErrors: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram MajorAltroErrors: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThreshMinorAltroError) == 0) {
auto errortype = param.substr(keyThreshMinorAltroError.length());
auto errorcode = findErrorCodeMIAE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram MinorAltroError: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdMAAE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram MinorAltroError: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram MinorAltroError: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThresRawFitError) == 0) {
auto errortype = param.substr(keyThresRawFitError.length());
auto errorcode = findErrorCodeRFE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram RawFitError: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdRFE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram RawFitError: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram RawFitError: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThresholdGeometryError) == 0) {
auto errortype = param.substr(keyThresholdGeometryError.length());
auto errorcode = findErrorCodeGEE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram GeometryError: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdGEE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram GeometryError: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram GeometryError: Requested error type " << errortype << " not found" << ENDM;
}
}
if (param.find(keyThresholdGainTypeError) == 0) {
auto errortype = param.substr(keyThresholdGainTypeError.length());
auto errorcode = findErrorCodeGTE(errortype);
if (errorcode > -1) {
try {
auto threshold = std::stoi(value);
ILOG(Info) << "Setting custom threshold in Histogram GainTypeError: " << errortype << " <= " << threshold << ENDM;
mErrorCountThresholdGTE[errorcode] = threshold;
} catch (...) {
ILOG(Error) << "Thresholds for histogram GainTypeError: Failure in decoding threshold value (" << value << ") for error type " << errortype << ENDM;
}
} else {
ILOG(Error) << "Thresholds for histogram GainTypeError: Requested error type " << errortype << " not found" << ENDM;
}
}
}
} catch (std::out_of_range& e) {
// Nothing to be done, no parameter found.
ILOG(Debug) << "Error in parameter extraction" << ENDM;
}
}
Quality RawErrorCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
{
std::array<std::string, 1> errorSummaryHists = { { "RawDataErrors" } };
std::array<std::string, 6> errorhists = { { "PageErrors", "MajorAltroErrors", "MinorAltroError", "RawFitError", "GeometryError", "GainTypeError" } };
std::array<std::string, 2> gainhists = { { "NoHGPerDDL", "NoLGPerDDL" } };
std::array<std::string, 2> channelgainhists = { { "ChannelLGnoHG", "ChannelHGnoLG" } };
Quality result = Quality::Good;
std::map<std::string, const std::map<int, int>*> thresholdConfigErrorHists = {
{ "RawDataErrors", &mErrorCountThresholdRDE },
{ "PageErrors", &mErrorCountThresholdPE },
{ "MajorAltroErrors", &mErrorCountThresholdMAAE },
{ "MinorAltroError", &mErrorCountThresholdMIAE },
{ "RawFitError", &mErrorCountThresholdRFE },
{ "GeometryError", &mErrorCountThresholdGEE },
{ "GainTypeError", &mErrorCountThresholdGTE }
};
for (auto& [moName, mo] : *moMap) {
if (std::find(errorSummaryHists.begin(), errorSummaryHists.end(), mo->getName()) != errorSummaryHists.end()) {
// Check for presence of error codes
auto* errorhist = dynamic_cast<TH2*>(mo->getObject());
for (int errorcode = 0; errorcode < errorhist->GetYaxis()->GetNbins(); errorcode++) {
// try to find a threshold for the number of errors per bin
int threshold = 0;
auto thresholdHandler = thresholdConfigErrorHists.find(mo->getName());
if (thresholdHandler != thresholdConfigErrorHists.end()) {
auto thresholdFound = thresholdHandler->second->find(errorcode);
if (thresholdFound != thresholdHandler->second->end()) {
threshold = thresholdFound->second;
}
}
// try to find the threshold for the number of links from when on it is considered to be warning ot bad
int thresholdTotalErrBad = 0;
int thresholdTotalErrWarn = 0;
if (mErrorCountThresholdRDESummary.contains(errorcode)) {
thresholdTotalErrBad = mErrorCountThresholdRDESummary[errorcode][0];
thresholdTotalErrWarn = mErrorCountThresholdRDESummary[errorcode][1];
}
int numErrors = 0;
for (int linkID = 0; linkID < errorhist->GetXaxis()->GetNbins(); linkID++) {
int nErr = errorhist->GetBinContent(linkID + 1, errorcode + 1);
if (nErr > threshold) {
numErrors++;
}
}
if (numErrors > thresholdTotalErrBad) { // Number of raw error exceeds the threshold and is considered to be bad
if (result != Quality::Bad) {
result = Quality::Bad;
}
result.addFlag(FlagTypeFactory::Unknown(), "Raw error " + std::string(errorhist->GetYaxis()->GetBinLabel(errorcode + 1)) + " above critical threshold: Call oncall!");
} else if (numErrors > thresholdTotalErrWarn && result != Quality::Bad) { // Number of raw error exceeds the threshold but is considered to be okay. Error can be fixed at beam dump
if (result != Quality::Medium) {
result = Quality::Medium;
}
result.addFlag(FlagTypeFactory::Unknown(), "Raw error " + std::string(errorhist->GetYaxis()->GetBinLabel(errorcode + 1)) + " below critical threshold: Call oncall at beam dump");
}
}
} else if (std::find(errorhists.begin(), errorhists.end(), mo->getName()) != errorhists.end()) {
// Check for presence of error codes
auto* errorhist = dynamic_cast<TH2*>(mo->getObject());
for (int errorcode = 0; errorcode < errorhist->GetYaxis()->GetNbins(); errorcode++) {
// try to find a threshold
int threshold = 0;
auto thresholdHandler = thresholdConfigErrorHists.find(mo->getName());
if (thresholdHandler != thresholdConfigErrorHists.end()) {
auto thresholdFound = thresholdHandler->second->find(errorcode);
if (thresholdFound != thresholdHandler->second->end()) {
threshold = thresholdFound->second;
}
}
int numErrors = 0;
for (int linkID = 0; linkID < errorhist->GetXaxis()->GetNbins(); linkID++) {
numErrors += errorhist->GetBinContent(linkID + 1, errorcode + 1);
}
if (numErrors > threshold) {
// Found number of raw data errors is above threshold for bin
if (result != Quality::Bad) {
result = Quality::Bad;
}
result.addFlag(FlagTypeFactory::Unknown(), "Raw error " + std::string(errorhist->GetYaxis()->GetBinLabel(errorcode + 1)) + " above critical threshold: Call oncall!");
}
}
} else if (std::find(gainhists.begin(), gainhists.end(), mo->GetName()) != gainhists.end()) {
// Find FEC with gain error
auto errorhist = dynamic_cast<TH2*>(mo->getObject());
std::string errortype;
std::string_view histname = mo->GetName();
if (histname == "NoHGPerDDL") {
errortype = "LGnoHG";
} else {
errortype = "HGnoLG";
}
for (int linkID = 0; linkID < errorhist->GetXaxis()->GetNbins(); linkID++) {
for (int fecID = 0; fecID < errorhist->GetYaxis()->GetNbins(); fecID++) {
if (errorhist->GetBinContent(linkID + 1, fecID + 1)) {
if (result != Quality::Bad) {
result = Quality::Bad;
}
result.addFlag(FlagTypeFactory::Unknown(), "Gain error " + errortype + " in FEC " + std::to_string(fecID) + " of DDL " + std::to_string(linkID));
ILOG(Debug, Support) << "Detected " << errortype << " in FEC " << fecID << " of DDL " << linkID << ENDM;
}
}
}
} else if (std::find(channelgainhists.begin(), channelgainhists.end(), mo->GetName()) != channelgainhists.end()) {
auto errorhist = dynamic_cast<TH2*>(mo->getObject());
std::string errortype;
std::string_view histname = mo->GetName();
if (histname == "ChannelLGnoHG") {
errortype = "LGnoHG";
} else {
errortype = "HGnoLG";
}
for (int column = 0; column < 96; column++) {
for (int row = 0; row < 208; row++) {
if (errorhist->GetBinContent(column + 1, row + 1)) {
if (result != Quality::Bad) {
result = Quality::Bad;
}
// Get position in supermodule
auto [supermoduleID, rowSM, columnSM] = mGeometry->GetPositionInSupermoduleFromGlobalRowCol(row, column);
result.addFlag(FlagTypeFactory::Unknown(), "Gain error " + errortype + " in channel col " + std::to_string(column) + " row " + std::to_string(column) + " (SM " + std::to_string(supermoduleID) + ", row " + std::to_string(rowSM) + " col " + std::to_string(columnSM) + ")");
ILOG(Debug, Support) << "Detected " << errortype << " in column " << column << " row " << row << " ( SM " << supermoduleID << ", " << columnSM << ", " << rowSM << ")" << ENDM;
}
}
}
} else {
ILOG(Error, Support) << "Unsupported histogram in check: " << mo->GetName() << ENDM;
continue;
}
}
return result;
}
void RawErrorCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
{
auto* h = dynamic_cast<TH1*>(mo->getObject());
if (checkResult == Quality::Good) {
TLatex* msg = new TLatex(0.2, 0.8, "#color[418]{No Error: OK}");
msg->SetNDC();
msg->SetTextSize(16);
msg->SetTextFont(43);
h->GetListOfFunctions()->Add(msg);
msg->Draw();
} else if (checkResult == Quality::Bad) {
TLatex* msg = new TLatex(0.2, 0.8, "#color[2]{Presence of Error Code: call EMCAL oncall}");
msg->SetNDC();
msg->SetTextSize(16);
msg->SetTextFont(43);
h->GetListOfFunctions()->Add(msg);
msg->Draw();
// Notify about found errors on the infoLogger:
if (mNotifyInfologger) {
for (const auto& flag : checkResult.getFlags()) {
ILOG(Warning, Devel) << "Raw Error in " << mo->GetName() << " found: " << flag.second << ENDM;
}
}
} else if (checkResult == Quality::Medium) {
TLatex* msg = new TLatex(0.2, 0.8, "#color[802]{Non-critical error codes present: call EMCAL oncall at beam dump}");
msg->SetNDC();
msg->SetTextSize(16);
msg->SetTextFont(43);
h->GetListOfFunctions()->Add(msg);
msg->Draw();
// Notify about found errors on the infoLogger:
if (mNotifyInfologger) {
for (const auto& flag : checkResult.getFlags()) {
ILOG(Warning, Devel) << "Non-critical raw Error in " << mo->GetName() << " found: " << flag.second << ENDM;
}
}
}
// SM grid
if (mo->getName().find("Channel") != std::string::npos) {
auto* h2D = dynamic_cast<TH2*>(mo->getObject());
// orizontal
TLine* l1 = new TLine(-0.5, 24, 95.5, 24);
TLine* l2 = new TLine(-0.5, 48, 95.5, 48);
TLine* l3 = new TLine(-0.5, 72, 95.5, 72);
TLine* l4 = new TLine(-0.5, 96, 95.5, 96);
TLine* l5 = new TLine(-0.5, 120, 95.5, 120);
TLine* l6 = new TLine(-0.5, 128, 95.5, 128);
TLine* l7 = new TLine(-0.5, 152, 31.5, 152);
TLine* l8 = new TLine(63.5, 152, 95.5, 152);
TLine* l9 = new TLine(-0.5, 176, 31.5, 176);
TLine* l10 = new TLine(63.5, 176, 95.5, 176);
TLine* l11 = new TLine(-0.5, 200, 95.5, 200);
TLine* l12 = new TLine(47.5, 200, 47.5, 207.5);
// vertical
TLine* l13 = new TLine(47.5, -0.5, 47.5, 128);
TLine* l14 = new TLine(31.5, 128, 31.5, 200);
TLine* l15 = new TLine(63.5, 128, 63.5, 200);
h2D->GetListOfFunctions()->Add(l1);
h2D->GetListOfFunctions()->Add(l2);
h2D->GetListOfFunctions()->Add(l3);
h2D->GetListOfFunctions()->Add(l4);
h2D->GetListOfFunctions()->Add(l5);
h2D->GetListOfFunctions()->Add(l6);
h2D->GetListOfFunctions()->Add(l7);
h2D->GetListOfFunctions()->Add(l8);
h2D->GetListOfFunctions()->Add(l9);
h2D->GetListOfFunctions()->Add(l10);
h2D->GetListOfFunctions()->Add(l11);
h2D->GetListOfFunctions()->Add(l12);
h2D->GetListOfFunctions()->Add(l13);
h2D->GetListOfFunctions()->Add(l14);
h2D->GetListOfFunctions()->Add(l15);
l1->Draw();
l2->Draw();
l3->Draw();
l4->Draw();
l5->Draw();
l6->Draw();
l7->Draw();
l8->Draw();
l9->Draw();
l10->Draw();
l11->Draw();
l12->Draw();
l13->Draw();
l14->Draw();
l15->Draw();
}
}
bool RawErrorCheck::decodeBool(std::string value) const
{
boost::algorithm::to_lower_copy(value);
if (value == "true") {
return true;
}
if (value == "false") {
return false;
}
throw std::runtime_error(fmt::format("Value {} not a boolean", value.data()).data());
}
int RawErrorCheck::findErrorCodeRDE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::ErrorTypeFEE::getNumberOfErrorTypes(); error++) {
if (std::string_view(o2::emcal::ErrorTypeFEE::getErrorTypeName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodePE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::RawDecodingError::getNumberOfErrorTypes(); error++) {
if (std::string_view(o2::emcal::RawDecodingError::getErrorCodeNames(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodeMAAE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::AltroDecoderError::getNumberOfErrorTypes(); error++) {
if (std::string_view(o2::emcal::AltroDecoderError::getErrorTypeName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodeMIAE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::MinorAltroDecodingError::getNumberOfErrorTypes(); error++) {
if (std::string_view(o2::emcal::MinorAltroDecodingError::getErrorTypeName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodeRFE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::CaloRawFitter::getNumberOfErrorTypes(); error++) {
if (std::string_view(o2::emcal::CaloRawFitter::getErrorTypeName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodeGEE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::reconstructionerrors::getNumberOfGeometryErrorCodes(); error++) {
if (std::string_view(o2::emcal::reconstructionerrors::getGeometryErrorName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
int RawErrorCheck::findErrorCodeGTE(const std::string_view errorname) const
{
int result = -1;
for (int error = 0; error < o2::emcal::reconstructionerrors::getNumberOfGainErrorCodes(); error++) {
if (std::string_view(o2::emcal::reconstructionerrors::getGainErrorName(error)) == errorname) {
result = error;
break;
}
}
return result;
}
} // namespace o2::quality_control_modules::emcal