Skip to content

Commit 0576852

Browse files
zz951JianLIUhepiravasen
authored
ITS decoding error check (#1903)
* deadchip * camel case for phi and eta bins * Decoding Error for ErrId 10 * DecodingErrorID10 bug * bug for DecodingErrorID10 * bug for DecodingErrorId10 --------- Co-authored-by: JianLIUhep <jian@cern.ch> Co-authored-by: iravasen <ivan.ravasenga@cern.ch>
1 parent 711db3a commit 0576852

3 files changed

Lines changed: 52 additions & 11 deletions

File tree

Modules/ITS/include/ITS/ITSDecodingErrorCheck.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ITSDecodingErrorCheck : public o2::quality_control::checker::CheckInterfac
4141
// Override interface
4242
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4343
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
44-
std::vector<int> vDecErrorLimits, vListErrorIdBad, vListErrorIdMedium;
44+
std::vector<int> vListErrorIdBad, vListErrorIdMedium;
4545
bool doFlatCheck = false;
4646
o2::itsmft::GBTLinkDecodingStat statistics;
4747

@@ -58,6 +58,8 @@ class ITSDecodingErrorCheck : public o2::quality_control::checker::CheckInterfac
5858

5959
if constexpr (std::is_same_v<T, int>) {
6060
result.push_back(std::stoi(token));
61+
} else if constexpr (std::is_same_v<T, float>) {
62+
result.push_back(std::stof(token));
6163
} else if constexpr (std::is_same_v<T, std::string>) {
6264
result.push_back(token);
6365
}
@@ -66,6 +68,11 @@ class ITSDecodingErrorCheck : public o2::quality_control::checker::CheckInterfac
6668
}
6769

6870
private:
71+
int nCycle = 0;
72+
// set timer
73+
std::chrono::time_point<std::chrono::high_resolution_clock> start;
74+
std::chrono::time_point<std::chrono::high_resolution_clock> end;
75+
int TIME = 1;
6976
ClassDefOverride(ITSDecodingErrorCheck, 1);
7077

7178
std::shared_ptr<TLatex> tInfo;

Modules/ITS/itsDecoding.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"detectorName": "ITS",
4949
"checkParameters": {
5050
"DecLinkErrorLimits": "1, 1, 1, 1, 1, 1000, 1000, 1000, 1000, 1000, 1000, 1, 1, 1000, 1000, 1, 1, 1, 1, 1000, 1000, 50, 50",
51+
"DecLinkErrorLimitsRatio": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0",
52+
"DecLinkErrorType": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0",
5153
"plotWithTextMessage": "",
5254
"textMessage": ""
5355
},

Modules/ITS/src/ITSDecodingErrorCheck.cxx

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,31 @@ namespace o2::quality_control_modules::its
3030

3131
Quality ITSDecodingErrorCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
3232
{
33+
// set timer
34+
if (nCycle == 0) {
35+
start = std::chrono::high_resolution_clock::now();
36+
nCycle++;
37+
} else {
38+
end = std::chrono::high_resolution_clock::now();
39+
TIME = std::chrono::duration_cast<std::chrono::seconds>(end - start).count();
40+
}
3341
std::vector<int> vDecErrorLimits = convertToArray<int>(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "DecLinkErrorLimits", ""));
3442
if (vDecErrorLimits.size() != o2::itsmft::GBTLinkDecodingStat::NErrorsDefined) {
3543
LOG(error) << "Incorrect vector with DecodingError limits, check .json" << ENDM;
3644
doFlatCheck = true;
3745
}
46+
std::vector<float> vDecErrorLimitsRatio = convertToArray<float>(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "DecLinkErrorLimitsRatio", ""));
47+
if (vDecErrorLimitsRatio.size() != o2::itsmft::GBTLinkDecodingStat::NErrorsDefined) {
48+
LOG(error) << "Incorrect vector with DecodingError limits Ratio, check .json" << ENDM;
49+
doFlatCheck = true;
50+
}
51+
std::vector<int> vDecErrorType = convertToArray<int>(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "DecLinkErrorType", ""));
52+
if (vDecErrorType.size() != o2::itsmft::GBTLinkDecodingStat::NErrorsDefined) {
53+
LOG(error) << "Incorrect vector with DecodingError Type, check .json" << ENDM;
54+
doFlatCheck = true;
55+
}
3856

3957
Quality result = Quality::Null;
40-
4158
for (auto& [moName, mo] : *moMap) {
4259
(void)moName;
4360
if (mo->getName() == "General/ChipErrorPlots") {
@@ -60,15 +77,30 @@ Quality ITSDecodingErrorCheck::check(std::map<std::string, std::shared_ptr<Monit
6077

6178
if (vDecErrorLimits[iBin - 1] < 0)
6279
continue; // skipping bin
63-
if (vDecErrorLimits[iBin - 1] <= h->GetBinContent(iBin)) {
64-
vListErrorIdBad.push_back(iBin - 1);
65-
result.set(Quality::Bad);
66-
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("BAD: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
67-
} else if (vDecErrorLimits[iBin - 1] / 2 < h->GetBinContent(iBin)) {
68-
vListErrorIdMedium.push_back(iBin - 1);
69-
if (result != Quality::Bad) {
70-
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("Medium: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
71-
result.set(Quality::Medium);
80+
81+
if (vDecErrorType[iBin - 1] == 1 && TIME != 0) {
82+
if (vDecErrorLimitsRatio[iBin - 1] <= h->GetBinContent(iBin) / TIME) {
83+
vListErrorIdBad.push_back(iBin - 1);
84+
result.set(Quality::Bad);
85+
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("BAD: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
86+
} else if (vDecErrorLimitsRatio[iBin - 1] / 2 < h->GetBinContent(iBin) / TIME) {
87+
vListErrorIdMedium.push_back(iBin - 1);
88+
if (result != Quality::Bad) {
89+
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("Medium: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
90+
result.set(Quality::Medium);
91+
}
92+
}
93+
} else { // normal check, as we have in the code now
94+
if (vDecErrorLimits[iBin - 1] <= h->GetBinContent(iBin)) {
95+
vListErrorIdBad.push_back(iBin - 1);
96+
result.set(Quality::Bad);
97+
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("BAD: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
98+
} else if (vDecErrorLimits[iBin - 1] / 2 < h->GetBinContent(iBin)) {
99+
vListErrorIdMedium.push_back(iBin - 1);
100+
if (result != Quality::Bad) {
101+
result.addReason(o2::quality_control::FlagReasonFactory::Unknown(), Form("Medium: ID = %d, %s", iBin - 1, std::string(statistics.ErrNames[iBin - 1]).c_str()));
102+
result.set(Quality::Medium);
103+
}
72104
}
73105
}
74106
}

0 commit comments

Comments
 (0)