Skip to content

Commit b8cea45

Browse files
authored
ITSFeeTask and Checks: SummaryPlots and RDH (#1134)
* ITSFeeTask and Checks: Summary and RDH * ClockEvt in LaneStatus and LaneStatusOverview
1 parent 6dcb536 commit b8cea45

5 files changed

Lines changed: 215 additions & 34 deletions

File tree

Modules/ITS/include/ITS/ITSFeeCheck.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class ITSFeeCheck : public o2::quality_control::checker::CheckInterface
5252
static constexpr int NFlags = 3;
5353
const double minTextPosY[NLayer] = { 0.43, 0.41, 0.39, 0.23, 0.21, 0.16, 0.13 }; // Text y coordinates in TH2Poly
5454
std::string mLaneStatusFlag[NFlags] = { "WARNING", "ERROR", "FAULT" };
55+
static constexpr int NSummary = 4;
56+
std::string mSummaryPlots[NSummary] = { "Global", "IB", "ML", "OL" };
57+
const int laneMaxSummaryPlots[NSummary] = { 3816, 1, 864, 2520 };
58+
const int laneMax[NLayer] = { 108, 144, 180, 384, 480, 1176, 1344 };
5559
};
5660

5761
} // namespace o2::quality_control_modules::its

Modules/ITS/include/ITS/ITSFeeTask.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <TH2Poly.h>
2828
#include "TMath.h"
2929
#include <TLine.h>
30+
#include <TText.h>
3031

3132
class TH2I;
3233
class TH1I;
@@ -79,6 +80,7 @@ class ITSFeeTask final : public TaskInterface
7980
void createFeePlots();
8081
void getStavePoint(int layer, int stave, double* px, double* py); // prepare for fill TH2Poly, get all point for add TH2Poly bin
8182
void setPlotsFormat();
83+
void drawLayerName(TH2I* laneStatus);
8284
void resetGeneralPlots();
8385
static constexpr int NLayer = 7;
8486
const int NStaves[NLayer] = { 12, 16, 20, 24, 30, 42, 48 };
@@ -92,11 +94,21 @@ class ITSFeeTask final : public TaskInterface
9294
const int LayerBoundaryFEE[NLayer - 1] = { 35, 83, 143, 191, 251, 335 };
9395
const float StartAngle[7] = { 16.997 / 360 * (TMath::Pi() * 2.), 17.504 / 360 * (TMath::Pi() * 2.), 17.337 / 360 * (TMath::Pi() * 2.), 8.75 / 360 * (TMath::Pi() * 2.), 7 / 360 * (TMath::Pi() * 2.), 5.27 / 360 * (TMath::Pi() * 2.), 4.61 / 360 * (TMath::Pi() * 2.) }; // start angle of first stave in each layer
9496
const float MidPointRad[7] = { 23.49, 31.586, 39.341, 197.598, 246.944, 345.348, 394.883 };
97+
const int laneMax[NLayer] = { 108, 144, 180, 384, 480, 1176, 1344 };
98+
const int lanesPerFeeId[NLayer] = { 3, 3, 3, 8, 8, 14, 14 };
99+
const int feePerLayer[NLayer] = { 36, 48, 60, 48, 60, 84, 96 };
100+
const int StavePerLayer[NLayer] = { 12, 16, 20, 24, 30, 42, 48 };
101+
const int feePerStave[NLayer] = { 3, 3, 3, 2, 2, 2, 2 };
102+
const int feeBoundary[NLayer] = { 0, 35, 83, 143, 191, 251, 335 };
103+
const int indexFeeLow[NLayer] = { 0, 3, 6, 3, 17, 0, 14 };
104+
const int indexFeeUp[NLayer] = { 3, 6, 9, 11, 25, 14, 28 };
95105
int mTimeFrameId = 0;
96106
TString mTriggerType[NTrigger] = { "ORBIT", "HB", "HBr", "HC", "PHYSICS", "PP", "CAL", "SOT", "EOT", "SOC", "EOC", "TF", "INT" };
97107
std::string mLaneStatusFlag[NFlags] = { "WARNING", "ERROR", "FAULT" }; // b00 OK, b01 WARNING, b10 ERROR, b11 FAULT
98108

99109
int mStatusFlagNumber[7][48][28][3] = { { { 0 } } }; //[iLayer][iStave][iLane][iLaneStatusFlag]
110+
int mStatusSummaryLayerNumber[7][3] = { { 0 } }; //[iLayer][iflag]
111+
int mStatusSummaryNumber[4][3] = { { 0 } }; //[summary][iflag] ---> Global, IB, ML, OL
100112

101113
// parameters taken from the .json
102114
int mNPayloadSizeBins = 0;
@@ -105,9 +117,10 @@ class ITSFeeTask final : public TaskInterface
105117
TH2I* mTriggerVsFeeId;
106118
TH1I* mTrigger;
107119
TH2I* mLaneInfo;
108-
TH2I* mFlag1Check; // include transmission_timeout, packet_overflow, lane_starts_violation
109-
TH2I* mIndexCheck; // should be zero
110-
TH2I* mIdCheck; // should be 0x : e4
120+
TH2I* mFlag1Check; // include transmission_timeout, packet_overflow, lane_starts_violation
121+
TH2I* mIndexCheck; // should be zero
122+
TH2I* mIdCheck; // should be 0x : e4
123+
TH2I* mRDHSummary;
111124
TH2I* mLaneStatus[NFlags]; // 4 flags for each lane. 3/8/14 lane for each link. 3/2/2 link for each RU. TODO: remove the OK flag in these 4 flag plots, OK flag plot just used to debug.
112125
TH2Poly* mLaneStatusOverview[NFlags] = { 0x0 };
113126
TH1I* mLaneStatusSummary[NLayer];

Modules/ITS/itsFee.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"location": "local",
3838
"taskParameters": {
39-
"NPayloadSizeBins": "4096",
39+
"NPayloadSizeBins": "4096"
4040
}
4141
}
4242
},
@@ -57,7 +57,12 @@
5757
"LaneStatus/laneStatusFlagWARNING",
5858
"LaneStatus/laneStatusOverviewFlagFAULT",
5959
"LaneStatus/laneStatusOverviewFlagERROR",
60-
"LaneStatus/laneStatusOverviewFlagWARNING"
60+
"LaneStatus/laneStatusOverviewFlagWARNING",
61+
"LaneStatusSummary/LaneStatusSummaryGlobal",
62+
"LaneStatusSummary/LaneStatusSummaryIB",
63+
"LaneStatusSummary/LaneStatusSummaryML",
64+
"LaneStatusSummary/LaneStatusSummaryOL",
65+
"RDHSummary"
6166
]
6267
}
6368
]

Modules/ITS/src/ITSFeeCheck.cxx

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,41 @@ Quality ITSFeeCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>
9595
result.set(Quality::Bad);
9696
}
9797
} // end lanestatusOverview
98-
} // end flag loop
99-
} // end mop
98+
}
99+
// Adding summary Plots Checks (General, IB, ML, OL)
100+
for (int isummary = 0; isummary < NSummary; isummary++) {
101+
bool StatusSummary = true;
102+
if (mo->getName() == Form("LaneStatusSummary/LaneStatusSummary%s", mSummaryPlots[isummary].c_str())) {
103+
result = Quality::Good;
104+
for (int iflag = 0; iflag < 3; iflag++) {
105+
result.addMetadata(Form("Flag%s", (mLaneStatusFlag[iflag]).c_str()), "good");
106+
auto* h = dynamic_cast<TH1I*>(mo->getObject());
107+
if (strcmp(mSummaryPlots[isummary].c_str(), "IB") == 0) {
108+
if (h->GetBinContent(iflag + 1) > 0) {
109+
result.updateMetadata(Form("Flag%s", (mLaneStatusFlag[iflag]).c_str()), "bad");
110+
StatusSummary = false;
111+
}
112+
} // end IB
113+
else { // General, ML, OL: if #lane > 25% than bad status assigned
114+
if (h->GetBinContent(iflag + 1) > 0.25 * laneMaxSummaryPlots[isummary]) {
115+
result.updateMetadata(Form("Flag%s", (mLaneStatusFlag[iflag]).c_str()), "bad");
116+
StatusSummary = false;
117+
}
118+
}
119+
}
120+
} // end flag plot loop
121+
if (!StatusSummary) {
122+
result.set(Quality::Bad);
123+
}
124+
} // end summary loop
125+
if (mo->getName() == Form("RDHSummary")) {
126+
result = Quality::Good;
127+
auto* h = dynamic_cast<TH2I*>(mo->getObject());
128+
if (h->GetMaximum() > 0) {
129+
result.set(Quality::Bad);
130+
}
131+
}
132+
}
100133
return result;
101134
} // end check
102135

@@ -109,6 +142,7 @@ void ITSFeeCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResul
109142
TText* tInfoML = new TText();
110143
TText* tInfoOL = new TText();
111144
TText* tInfoLayers[7];
145+
TText* tInfoSummary[4];
112146

113147
for (int iflag = 0; iflag < NFlags; iflag++) {
114148
if (mo->getName() == Form("LaneStatus/laneStatusFlag%s", mLaneStatusFlag[iflag].c_str())) {
@@ -132,7 +166,6 @@ void ITSFeeCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResul
132166
tInfo->SetTextSize(22);
133167
tInfo->SetNDC();
134168
hp->GetListOfFunctions()->Add(tInfo);
135-
136169
} else if (checkResult == Quality::Bad) {
137170
tInfo->SetText(0.12, 0.835, "Quality::BAD (call expert)");
138171
tInfo->SetTextColor(kRed);
@@ -174,6 +207,52 @@ void ITSFeeCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResul
174207
}
175208
}
176209
} // end flags
177-
}
210+
for (int isummary = 0; isummary < NSummary; isummary++) {
211+
if (mo->getName() == Form("LaneStatusSummary/LaneStatusSummary%s", mSummaryPlots[isummary].c_str())) {
212+
auto* h = dynamic_cast<TH1I*>(mo->getObject());
213+
if (checkResult == Quality::Good) {
214+
tInfo->SetText(0.12, 0.835, "Quality::GOOD");
215+
tInfo->SetTextColor(kGreen);
216+
tInfo->SetTextSize(22);
217+
tInfo->SetNDC();
218+
h->GetListOfFunctions()->Add(tInfo);
219+
} else if (checkResult == Quality::Bad) {
220+
tInfo->SetText(0.12, 0.835, "Quality::BAD (call expert)");
221+
tInfo->SetTextColor(kRed);
222+
tInfo->SetTextSize(22);
223+
tInfo->SetNDC();
224+
h->GetListOfFunctions()->Add(tInfo);
225+
tInfo->Draw();
226+
for (int iflag = 0; iflag < NFlags; iflag++) {
227+
tInfoSummary[iflag] = new TText();
228+
if (strcmp(checkResult.getMetadata(Form("Flag%s", mLaneStatusFlag[iflag].c_str())).c_str(), "bad") == 0) {
229+
if (strcmp(mSummaryPlots[isummary].c_str(), "IB") == 0) {
230+
tInfoSummary[iflag]->SetText(0.12, 0.75 - 0.07 * iflag, Form("%s: > 1 lane in %s", mSummaryPlots[isummary].c_str(), mLaneStatusFlag[iflag].c_str()));
231+
} else {
232+
tInfoSummary[iflag]->SetText(0.12, 0.75 - 0.07 * iflag, Form("%s: > 25%% of staves in %s", mSummaryPlots[isummary].c_str(), mLaneStatusFlag[iflag].c_str()));
233+
}
234+
tInfoSummary[iflag]->SetTextColor(kRed + 1);
235+
tInfoSummary[iflag]->SetTextSize(21);
236+
tInfoSummary[iflag]->SetNDC();
237+
h->GetListOfFunctions()->Add(tInfoSummary[iflag]);
238+
}
239+
}
240+
}
241+
}
242+
} // end summary
243+
if (mo->getName() == Form("RDHSummary")) {
244+
auto* h = dynamic_cast<TH2I*>(mo->getObject());
245+
if (checkResult == Quality::Good) {
246+
tInfo->SetText(0.1, 0.8, "Quality::GOOD");
247+
tInfo->SetTextColor(kGreen);
248+
} else if (checkResult == Quality::Bad) {
249+
tInfo->SetText(0.15, 0.8, "Quality::BAD (call expert)");
250+
tInfo->SetTextColor(kRed);
251+
}
252+
tInfo->SetTextSize(18);
253+
tInfo->SetNDC();
254+
h->GetListOfFunctions()->Add(tInfo);
255+
}
256+
} // end beautify
178257

179258
} // namespace o2::quality_control_modules::its

0 commit comments

Comments
 (0)