Skip to content

Commit d652781

Browse files
authored
QC checks review first round - update for shifters' plots (#1377)
* QC checks review first round - update for shifters' plots * reintroduced normal params in jsons * solved trivial issue with macOS build * change bad to medium for lane overview
1 parent ea61787 commit d652781

12 files changed

Lines changed: 711 additions & 243 deletions

Modules/ITS/include/ITS/ITSClusterCheck.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "QualityControl/CheckInterface.h"
2323
#include <TLatex.h>
2424
#include <TH2Poly.h>
25+
#include <vector>
26+
#include <string>
27+
#include <sstream>
2528

2629
namespace o2::quality_control_modules::its
2730
{
@@ -41,11 +44,14 @@ class ITSClusterCheck : public o2::quality_control::checker::CheckInterface
4144
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4245
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4346
std::string getAcceptedType() override;
47+
std::vector<int> convertToIntArray(std::string input);
4448

4549
private:
4650
ClassDefOverride(ITSClusterCheck, 2);
4751

4852
std::shared_ptr<TLatex> msg;
53+
std::shared_ptr<TLatex> text[14];
54+
std::shared_ptr<TLatex> text2[14];
4955
static constexpr int NLayer = 7;
5056
const int mNStaves[NLayer] = { 12, 16, 20, 24, 30, 42, 48 };
5157
const int StaveBoundary[NLayer + 1] = { 0, 12, 28, 48, 72, 102, 144, 192 };

Modules/ITS/include/ITS/ITSFeeCheck.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "QualityControl/CheckInterface.h"
2323
#include <TH2Poly.h>
2424
#include <TLatex.h>
25+
#include <string>
26+
#include <vector>
27+
#include <sstream>
2528

2629
namespace o2::quality_control_modules::its
2730
{
@@ -41,6 +44,7 @@ class ITSFeeCheck : public o2::quality_control::checker::CheckInterface
4144
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4245
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4346
std::string getAcceptedType() override;
47+
std::vector<int> convertToIntArray(std::string input);
4448

4549
private:
4650
ClassDefOverride(ITSFeeCheck, 2);
@@ -50,19 +54,19 @@ class ITSFeeCheck : public o2::quality_control::checker::CheckInterface
5054
const int NLanePerStaveLayer[NLayer] = { 9, 9, 9, 16, 16, 28, 28 };
5155
const int NStaves[NLayer] = { 12, 16, 20, 24, 30, 42, 48 };
5256
static constexpr int NFlags = 3;
57+
static constexpr int NTrg = 13;
5358
const double minTextPosY[NLayer] = { 0.45, 0.41, 0.37, 0.23, 0.20, 0.16, 0.13 }; // Text y coordinates in TH2Poly
5459
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 };
5860
const int laneMax[NLayer] = { 108, 144, 180, 384, 480, 1176, 1344 };
5961

6062
std::shared_ptr<TLatex> tInfo;
6163
std::shared_ptr<TLatex> tInfoLayers[7];
6264
std::shared_ptr<TLatex> tInfoIB;
6365
std::shared_ptr<TLatex> tInfoML;
6466
std::shared_ptr<TLatex> tInfoOL;
65-
std::shared_ptr<TLatex> tInfoSummary[4];
67+
std::shared_ptr<TLatex> tInfoPL[10];
68+
std::shared_ptr<TLatex> tInfoSummary;
69+
std::shared_ptr<TLatex> tInfoTrg[13];
6670
};
6771

6872
} // namespace o2::quality_control_modules::its

Modules/ITS/include/ITS/ITSFhrCheck.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#define QC_MODULE_ITS_ITSFHRCHECK_H
2020

2121
#include "QualityControl/CheckInterface.h"
22+
#include <string>
23+
#include <vector>
24+
#include <sstream>
25+
#include <TLatex.h>
2226

2327
namespace o2::quality_control_modules::its
2428
{
@@ -38,9 +42,11 @@ class ITSFhrCheck : public o2::quality_control::checker::CheckInterface
3842
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
3943
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4044
std::string getAcceptedType() override;
45+
std::vector<int> convertToIntArray(std::string input);
4146

4247
private:
4348
int mNPixelPerStave[3] = { 4718592, 58720256, 102760448 }; // IB, ML, OL
49+
std::shared_ptr<TLatex> tInfo[5];
4450
ClassDefOverride(ITSFhrCheck, 2);
4551
};
4652

Modules/ITS/include/ITS/ITSTrackCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define QC_MODULE_ITS_ITSTRACKCHECK_H
2020

2121
#include "QualityControl/CheckInterface.h"
22+
#include <TLatex.h>
2223

2324
namespace o2::quality_control_modules::its
2425
{
@@ -41,6 +42,8 @@ class ITSTrackCheck : public o2::quality_control::checker::CheckInterface
4142
int getDigit(int number, int digit);
4243

4344
private:
45+
std::shared_ptr<TLatex> tInfo;
46+
std::shared_ptr<TLatex> tMessage[10];
4447
ClassDefOverride(ITSTrackCheck, 2);
4548
};
4649

Modules/ITS/itsCluster.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@
5454
"moduleName": "QcITS",
5555
"policy": "OnEachSeparately",
5656
"detectorName": "ITS",
57+
"checkParameters": {
58+
"maxcluoccL0" : "5",
59+
"maxcluoccL1" : "4",
60+
"maxcluoccL2" : "3",
61+
"maxcluoccL3" : "2",
62+
"maxcluoccL4" : "1",
63+
"maxcluoccL5" : "1",
64+
"maxcluoccL6" : "1",
65+
"skipxbinsoccupancy" : "",
66+
"skipybinsoccupancy" : ""
67+
},
5768
"dataSource": [{
5869
"type": "Task",
5970
"name": "ITSClusterTask",

Modules/ITS/itsFee.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"config": {
44
"database": {
55
"implementation": "CCDB",
6-
"host": "ccdb-test.cern.ch:8080",
6+
"host": ":188.184.2.55:8080",
77
"username": "not_applicable",
88
"password": "not_applicable",
99
"name": "not_applicable"
@@ -19,7 +19,7 @@
1919
"url": ""
2020
},
2121
"conditionDB": {
22-
"url": "ccdb-test.cern.ch:8080"
22+
"url": "188.184.2.55:8080"
2323
}
2424
},
2525
"tasks": {
@@ -47,6 +47,14 @@
4747
"moduleName": "QcITS",
4848
"policy": "OnEachSeparately",
4949
"detectorName": "ITS",
50+
"checkParameters": {
51+
"skipbinstrg": "",
52+
"skipfeeids": "",
53+
"maxbadchipsIB": "2",
54+
"maxbadlanesML": "4",
55+
"maxbadlanesOL": "7",
56+
"maxfractionbadlanes": "0.1"
57+
},
5058
"dataSource": [
5159
{
5260
"type": "Task",
@@ -59,10 +67,9 @@
5967
"LaneStatus/laneStatusOverviewFlagERROR",
6068
"LaneStatus/laneStatusOverviewFlagWARNING",
6169
"LaneStatusSummary/LaneStatusSummaryGlobal",
62-
"LaneStatusSummary/LaneStatusSummaryIB",
63-
"LaneStatusSummary/LaneStatusSummaryML",
64-
"LaneStatusSummary/LaneStatusSummaryOL",
65-
"RDHSummary"
70+
"RDHSummary",
71+
"TriggerVsFeeid",
72+
"PayloadSize"
6673
]
6774
}
6875
]

Modules/ITS/itsFhr.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"config": {
44
"database": {
55
"implementation": "CCDB",
6-
"host": "ccdb-test.cern.ch:8080",
6+
"host": "188.184.2.55:8080",
77
"username": "not_applicable",
88
"password": "not_applicable",
99
"name": "not_applicable"
@@ -19,7 +19,7 @@
1919
"url": ""
2020
},
2121
"conditionDB": {
22-
"url": "ccdb-test.cern.ch:8080"
22+
"url": "188.184.2.55:8080"
2323
}
2424
},
2525
"tasks": {
@@ -60,6 +60,11 @@
6060
"moduleName": "QcITS",
6161
"policy": "OnEachSeparately",
6262
"detectorName": "ITS",
63+
"checkParameters": {
64+
"fhrcutIB": "0.01",
65+
"fhrcutOB": "0.0001",
66+
"skipbins": ""
67+
},
6368
"dataSource": [{
6469
"type": "Task",
6570
"name": "FHRTask",

Modules/ITS/itsTrack.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"active" : "true",
5454
"className" : "o2::quality_control_modules::its::ITSTrackCheck",
5555
"moduleName" : "QcITS",
56-
"policy" : "OnAny",
56+
"policy" : "OnEachSeparately",
5757
"detectorName" : "ITS",
5858
"dataSource" : [ {
5959
"type" : "Task",

Modules/ITS/src/ITSClusterCheck.cxx

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Quality ITSClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
3333
{
3434
Quality result = Quality::Null;
3535
double averageClusterSizeLimit[NLayer] = { 5, 5, 5, 5, 5, 5, 5 };
36-
double clusterOccupationLimit[NLayer] = { 40, 30, 20, 60, 25, 15, 14 };
3736

3837
std::map<std::string, std::shared_ptr<MonitorObject>>::iterator iter;
3938
for (iter = moMap->begin(); iter != moMap->end(); ++iter) {
@@ -52,16 +51,48 @@ Quality ITSClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
5251

5352
if (iter->second->getName().find("General_Occupancy") != std::string::npos) {
5453
auto* hp = dynamic_cast<TH2D*>(iter->second->getObject());
54+
std::vector<int> skipxbins = convertToIntArray(mCustomParameters["skipxbinsoccupancy"]);
55+
std::vector<int> skipybins = convertToIntArray(mCustomParameters["skipybinsoccupancy"]);
56+
std::vector<std::pair<int, int>> xypairs;
57+
for (int i = 0; i < (int)skipxbins.size(); i++) {
58+
xypairs.push_back(std::make_pair(skipxbins[i], skipybins[i]));
59+
}
60+
result.set(Quality::Good);
5561
for (int iy = 1; iy <= hp->GetNbinsY(); iy++) {
5662
int ilayer = iy <= hp->GetNbinsY() / 2 ? hp->GetNbinsY() / 2 - iy : iy - hp->GetNbinsY() / 2 - 1;
5763
std::string tb = iy <= hp->GetNbinsY() / 2 ? "B" : "T";
5864
result.addMetadata(Form("Layer%d%s", ilayer, tb.c_str()), "good");
5965
for (int ix = 1; ix <= hp->GetNbinsX(); ix++) { // loop on staves
60-
if (hp->GetBinContent(ix) > clusterOccupationLimit[ilayer]) {
66+
if (std::find(xypairs.begin(), xypairs.end(), std::make_pair(ix, iy)) != xypairs.end()) {
67+
continue;
68+
}
69+
if (hp->GetBinContent(ix, iy) > std::stod(mCustomParameters[Form("maxcluoccL%d", ilayer)])) {
6170
result.set(Quality::Medium);
6271
result.updateMetadata(Form("Layer%d%s", ilayer, tb.c_str()), "medium");
6372
}
6473
}
74+
// check for empty bins (empty staves)
75+
result.addMetadata(Form("Layer%d%s_empty", ilayer, tb.c_str()), "good");
76+
for (int ix = 12; ix > 12 - mNStaves[ilayer] / 4; ix--) {
77+
if (std::find(xypairs.begin(), xypairs.end(), std::make_pair(ix, iy)) != xypairs.end()) {
78+
continue;
79+
}
80+
if (hp->GetBinContent(ix, iy) < 1e-15) {
81+
result.updateMetadata(Form("Layer%d%s_empty", ilayer, tb.c_str()), "bad");
82+
result.set(Quality::Bad);
83+
LOG(info) << "************************ " << Form("Layer%d%s_empty", ilayer, tb.c_str());
84+
}
85+
}
86+
int stop = (iy == 2 || iy == 13) ? 13 + mNStaves[ilayer] / 4 + 1 : 13 + mNStaves[ilayer] / 4; // for L5
87+
for (int ix = 13; ix < stop; ix++) {
88+
if (std::find(xypairs.begin(), xypairs.end(), std::make_pair(ix, iy)) != xypairs.end()) {
89+
continue;
90+
}
91+
if (hp->GetBinContent(ix, iy) < 1e-15) {
92+
result.updateMetadata(Form("Layer%d%s_empty", ilayer, tb.c_str()), "bad");
93+
result.set(Quality::Bad);
94+
}
95+
}
6596
}
6697
} // end GeneralOccupancy
6798
}
@@ -74,7 +105,7 @@ std::string ITSClusterCheck::getAcceptedType() { return "TH2D"; }
74105
void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
75106
{
76107

77-
TString text;
108+
TString status;
78109
int textColor;
79110
Double_t positionX, positionY;
80111

@@ -84,18 +115,18 @@ void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
84115
int iLayer = histoName[histoName.find("Layer") + 5] - 48; // Searching for position of "Layer" in the name of the file, then +5 is the NUMBER of the layer, -48 is conversion to int
85116

86117
if (checkResult == Quality::Medium) {
87-
text = "INFO: large clusters - do not call expert";
118+
status = "INFO: large clusters - do not call expert";
88119
textColor = kYellow;
89120
positionX = 0.15;
90121
positionY = 0.8;
91122
} else {
92-
text = "Quality::GOOD";
123+
status = "Quality::GOOD";
93124
textColor = kGreen;
94125
positionX = 0.02;
95126
positionY = 0.91;
96127
}
97128

98-
msg = std::make_shared<TLatex>(positionX, positionY, Form("#bf{%s}", text.Data()));
129+
msg = std::make_shared<TLatex>(positionX, positionY, Form("#bf{%s}", status.Data()));
99130
msg->SetTextColor(textColor);
100131
msg->SetTextSize(0.06);
101132
msg->SetTextFont(43);
@@ -105,28 +136,62 @@ void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
105136

106137
if (mo->getName().find("General_Occupancy") != std::string::npos) {
107138
auto* h = dynamic_cast<TH2D*>(mo->getObject());
108-
109-
std::string histoName = mo->getName();
110-
111139
if (checkResult == Quality::Good) {
112-
text = "Quality::GOOD";
140+
status = "Quality::GOOD";
113141
textColor = kGreen;
114-
positionX = 0.02;
115-
positionY = 0.91;
142+
positionX = 0.12;
143+
positionY = 0.75;
116144
} else {
117-
text = "Large cluster occupancy - notify expert, do not call";
118-
textColor = kYellow;
119-
positionX = 0.15;
120-
positionY = 0.8;
145+
for (int il = 0; il < 14; il++) {
146+
std::string tb = il < 7 ? "T" : "B";
147+
if (strcmp(checkResult.getMetadata(Form("Layer%d%s", il % 7, tb.c_str())).c_str(), "medium") == 0) {
148+
text[il] = std::make_shared<TLatex>(0.3, 0.1 + il * 0.05, Form("L%d%s has large cluster occupancy", il % 7, tb.c_str()));
149+
text[il]->SetTextFont(43);
150+
text[il]->SetTextSize(0.03);
151+
text[il]->SetTextColor(kOrange);
152+
text[il]->SetNDC();
153+
h->GetListOfFunctions()->Add(text[il]->Clone());
154+
status = "#splitline{Quality::Medium}{do NOT call, create log entry}";
155+
textColor = kOrange;
156+
positionX = 0.12;
157+
positionY = 0.75;
158+
}
159+
160+
if (strcmp(checkResult.getMetadata(Form("Layer%d%s_empty", il % 7, tb.c_str())).c_str(), "bad") == 0) {
161+
text2[il] = std::make_shared<TLatex>(0.7, 0.1 + il * 0.05, Form("L%d%s has empty staves", il % 7, tb.c_str()));
162+
text2[il]->SetTextFont(43);
163+
text2[il]->SetTextSize(0.03);
164+
text2[il]->SetTextColor(kRed);
165+
text2[il]->SetNDC();
166+
h->GetListOfFunctions()->Add(text2[il]->Clone());
167+
status = "#splitline{Quality::Bad}{Call expert}";
168+
textColor = kRed;
169+
positionX = 0.12;
170+
positionY = 0.75;
171+
}
172+
}
121173
}
122-
msg = std::make_shared<TLatex>(positionX, positionY, Form("#bf{%s}", text.Data()));
174+
msg = std::make_shared<TLatex>(positionX, positionY, Form("#bf{%s}", status.Data()));
123175
msg->SetTextColor(textColor);
124-
msg->SetTextSize(0.06);
176+
msg->SetTextSize(0.04);
125177
msg->SetTextFont(43);
126178
msg->SetNDC();
127-
128179
h->GetListOfFunctions()->Add(msg->Clone());
129180
}
130181
}
131182

183+
std::vector<int> ITSClusterCheck::convertToIntArray(std::string input)
184+
{
185+
std::replace(input.begin(), input.end(), ',', ' ');
186+
std::istringstream stringReader{ input };
187+
188+
std::vector<int> result;
189+
int number;
190+
while (stringReader >> number) {
191+
result.push_back(number);
192+
}
193+
194+
return result;
195+
}
196+
132197
} // namespace o2::quality_control_modules::its

0 commit comments

Comments
 (0)