Skip to content

Commit b03622f

Browse files
authored
ITS Checks: updates for NClustersPerTrack and FHR_Occupancy MOs (#1761)
* ITS Checks: updates for NClustersPerTrack and FHROccupancy MOs * clang * Ivan's comments
1 parent a57ed54 commit b03622f

2 files changed

Lines changed: 57 additions & 14 deletions

File tree

Modules/ITS/src/ITSFhrCheck.cxx

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <TH2Poly.h>
2828
#include <TString.h>
2929
#include "Common/Utils.h"
30+
#include "TMath.h"
3031

3132
namespace o2::quality_control_modules::its
3233
{
@@ -50,35 +51,54 @@ Quality ITSFhrCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>
5051
result.addMetadata("Gen_Occu_empty", "good");
5152
result.set(Quality::Good);
5253
std::vector<int> skipbins = convertToIntArray(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "skipbins", ""));
53-
for (int ibin = 1; ibin <= h->GetNumberOfBins(); ibin++) {
54-
if (ibin <= 48) { // IB
54+
55+
TIter next(h->GetBins());
56+
int ibin = 0;
57+
double_t nBadStaves[4];
58+
59+
while (TH2PolyBin* Bin = (TH2PolyBin*)next()) {
60+
61+
if (std::find(skipbins.begin(), skipbins.end(), ibin) != skipbins.end()) {
62+
ibin++;
63+
continue;
64+
}
65+
66+
double X_center = (Bin->GetXMax() + Bin->GetXMin()) / 2;
67+
double Y_center = (Bin->GetYMax() + Bin->GetYMin()) / 2;
68+
double phi = TMath::ATan2(Y_center, X_center);
69+
int sector = 2 * (phi + TMath::Pi()) / TMath::Pi();
70+
71+
if (ibin < 48) { // IB
5572
fhrcutIB = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "fhrcutIB", fhrcutIB);
5673
if (h->GetBinContent(ibin) > fhrcutIB) {
57-
if (std::find(skipbins.begin(), skipbins.end(), ibin) != skipbins.end()) {
58-
continue;
59-
}
6074
result.updateMetadata("Gen_Occu_IB", "bad");
6175
result.set(Quality::Bad);
6276
}
6377
} else { // OB
6478
fhrcutOB = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "fhrcutOB", fhrcutOB);
6579
if (h->GetBinContent(ibin) > fhrcutOB) {
66-
if (std::find(skipbins.begin(), skipbins.end(), ibin) != skipbins.end()) {
67-
continue;
68-
}
6980
result.updateMetadata("Gen_Occu_OB", "bad");
7081
result.set(Quality::Bad);
7182
}
7283
}
7384

74-
if (h->GetBinContent(ibin) < 1e-15) { // in case of empty stave
75-
if (std::find(skipbins.begin(), skipbins.end(), ibin) != skipbins.end()) {
76-
continue;
77-
}
85+
if (Bin->GetContent() < 1e-15) { // in case of empty stave
86+
nBadStaves[sector]++;
87+
}
88+
ibin++;
89+
}
90+
91+
for (int iSector = 0; iSector < 4; iSector++) {
92+
if (nBadStaves[iSector] / 48 > 0.1) {
7893
result.updateMetadata("Gen_Occu_empty", "bad");
7994
result.set(Quality::Bad);
95+
break;
96+
} else if (nBadStaves[iSector] / 48 > 0.05) {
97+
result.updateMetadata("Gen_Occu_empty", "medium");
98+
result.set(Quality::Medium);
8099
}
81-
} // end loop on bins
100+
}
101+
82102
} else if (mo->getName() == "General/Noisy_Pixel") {
83103
auto* h = dynamic_cast<TH2Poly*>(mo->getObject());
84104
result.addMetadata("Noi_Pix", "good");
@@ -183,12 +203,19 @@ void ITSFhrCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResul
183203
h->GetListOfFunctions()->Add(tInfo[1]->Clone());
184204
}
185205
if (strcmp(checkResult.getMetadata("Gen_Occu_empty").c_str(), "bad") == 0) {
186-
tInfo[2] = std::make_shared<TLatex>(0.4, 0.3, "#splitline{There are staves without hits}{IGNORE them if run has just started OR if it's TECH RUN}");
206+
tInfo[2] = std::make_shared<TLatex>(0.4, 0.3, "#splitline{ITS sector has more than 10% of empty staves}{IGNORE them if run has just started OR if it's TECH RUN}");
187207
tInfo[2]->SetTextColor(kRed);
188208
tInfo[2]->SetTextSize(0.03);
189209
tInfo[2]->SetTextFont(43);
190210
tInfo[2]->SetNDC();
191211
h->GetListOfFunctions()->Add(tInfo[2]->Clone());
212+
} else if (strcmp(checkResult.getMetadata("Gen_Occu_empty").c_str(), "medium") == 0) {
213+
tInfo[2] = std::make_shared<TLatex>(0.4, 0.3, "#splitline{ITS sector has more than 5% of empty staves}{IGNORE them if run has just started OR if it's TECH RUN}");
214+
tInfo[2]->SetTextColor(kOrange);
215+
tInfo[2]->SetTextSize(0.03);
216+
tInfo[2]->SetTextFont(43);
217+
tInfo[2]->SetNDC();
218+
h->GetListOfFunctions()->Add(tInfo[2]->Clone());
192219
}
193220

194221
tInfo[3] = std::make_shared<TLatex>(0.12, 0.835, Form("#bf{%s}", status.Data()));

Modules/ITS/src/ITSTrackCheck.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Quality ITSTrackCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
4545
result.addMetadata("CheckTracks6", "good");
4646
result.addMetadata("CheckTracks7", "good");
4747
result.addMetadata("CheckEmpty", "good");
48+
result.addMetadata("CheckMean", "good");
4849
if (h->GetBinContent(h->FindBin(4)) < 1e-15) {
4950
result.updateMetadata("CheckTracks4", "bad");
5051
result.set(Quality::Bad);
@@ -65,6 +66,11 @@ Quality ITSTrackCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
6566
result.updateMetadata("CheckEmpty", "bad");
6667
result.set(Quality::Bad);
6768
}
69+
if (h->GetMean() < 5.2 || h->GetMean() > 5.8) {
70+
71+
result.updateMetadata("CheckMean", "medium");
72+
result.set(Quality::Medium);
73+
}
6874
}
6975

7076
if (iter->second->getName() == "AngularDistribution") {
@@ -217,6 +223,16 @@ void ITSTrackCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkRes
217223
tMessage[4]->SetNDC();
218224
h->GetListOfFunctions()->Add(tMessage[4]->Clone());
219225
}
226+
if (strcmp(checkResult.getMetadata("CheckMean").c_str(), "medium") == 0) {
227+
status = "";
228+
textColor = kOrange;
229+
tMessage[5] = std::make_shared<TLatex>(0.12, 0.7, Form("Quality::Medium: Mean (%.1f) is outside of 5.2 - 5.9, (ignore for COSMICS and TECHICALS", h->GetMean()));
230+
tMessage[5]->SetTextFont(43);
231+
tMessage[5]->SetTextSize(0.04);
232+
tMessage[5]->SetTextColor(kOrange);
233+
tMessage[5]->SetNDC();
234+
h->GetListOfFunctions()->Add(tMessage[5]->Clone());
235+
}
220236
}
221237

222238
tInfo = std::make_shared<TLatex>(0.12, 0.75, Form("#bf{%s}", status.Data()));

0 commit comments

Comments
 (0)