Skip to content

Commit e611cc0

Browse files
Add histo for PostProcessing evolution of localBoards (#2635)
* Add histo for PostProcessing evolution of localBoards * MID: debug
1 parent edcd7b9 commit e611cc0

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed

Modules/MUON/MID/include/MID/DigitsQcCheck.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class DigitsQcCheck : public o2::quality_control::checker::CheckInterface
5353
int nBadLB = 0;
5454
double maxVal = 0;
5555
double minVal = 1000;
56+
int LineResp[36] = { 0 }; // NN
5657

5758
std::unordered_map<std::string, Quality> mQualityMap; ///! Quality map
5859

Modules/MUON/MID/include/MID/DigitsQcTask.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class DigitsQcTask final : public TaskInterface
8585
std::array<std::unique_ptr<TH2F>, 4> mBendHitsMap{};
8686
std::array<std::unique_ptr<TH2F>, 4> mNBendHitsMap{};
8787

88+
std::array<std::unique_ptr<TH1F>, 36> mLineLocalResp{};
89+
8890
std::unique_ptr<TH1F> mDigitBCCounts{ nullptr };
8991

9092
o2::mid::Mapping mMapping;

Modules/MUON/MID/src/DigitsQcCheck.cxx

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace o2::quality_control_modules::mid
3030

3131
void DigitsQcCheck::configure()
3232
{
33+
3334
ILOG(Info, Devel) << "configure DigitsQcCheck" << ENDM;
3435
if (auto param = mCustomParameters.find("MeanMultThreshold"); param != mCustomParameters.end()) {
3536
ILOG(Info, Devel) << "Custom parameter - MeanMultThreshold: " << param->second << ENDM;
@@ -63,6 +64,7 @@ void DigitsQcCheck::configure()
6364

6465
Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
6566
{
67+
6668
Quality result = Quality::Good;
6769
// This info must be available from the beginning
6870
TH1* meanMultiHits = nullptr;
@@ -124,12 +126,21 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
124126
nBadLB = 0;
125127
maxVal = 0;
126128
minVal = 1000;
129+
int Resp = 0;
127130
auto histo = dynamic_cast<TH2F*>(item.second->getObject());
128131
if (histo) {
129132
mHistoHelper.normalizeHistoTokHz(histo);
133+
int by0 = 0; // NN
134+
for (int by = 1; by < 37; by++)
135+
LineResp[by - 1] = 0;
130136
for (int bx = 1; bx < 15; bx++) {
131137
for (int by = 1; by < 37; by++) {
132-
if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) { // central zone empty
138+
Resp = 0; // NN
139+
if (bx > 1)
140+
LineResp[by - 1] = LineResp[by - 1] << 2;
141+
142+
if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) {
143+
Resp = 1;
133144
double val = histo->GetBinContent(bx, by);
134145
if (val > maxVal) {
135146
maxVal = val;
@@ -139,15 +150,29 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
139150
}
140151
if (val == 0) {
141152
nEmptyLB++;
153+
Resp = 0; // NN
142154
} else if (val > mLocalBoardThreshold) {
143155
nBadLB++;
156+
Resp = 3; // NN
144157
}
158+
LineResp[by - 1] = LineResp[by - 1] + Resp;
159+
by0 = by;
145160
if ((bx == 1) || (bx == 14) || (by == 1) || (by == 33)) {
161+
if ((bx == 14) && (by > 1) && (by < 33)) {
162+
LineResp[by + 1] = LineResp[by + 1] << 2;
163+
if ((by > 12) && (by < 25)) {
164+
LineResp[by] = LineResp[by] << 2;
165+
LineResp[by + 2] = LineResp[by + 2] << 2;
166+
}
167+
}
146168
by += 3;
147-
} // zones 1 board
148-
else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) {
169+
} else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) {
170+
171+
if ((bx > 10) && (by > 12) && (by < 25)) {
172+
LineResp[by] = LineResp[by] << 2;
173+
}
149174
by += 1;
150-
} // zones 2 boards
175+
}
151176
}
152177
}
153178
}
@@ -192,8 +217,24 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
192217

193218
mQualityMap[item.second->getName()] = qual;
194219
result = qual;
220+
195221
} // if mNTFInSeconds > 0.
196222
}
223+
224+
/////NN
225+
for (int by = 1; by < 37; by++) {
226+
std::string nline = std::to_string(by);
227+
std::string HistoName = "RespBoardLine" + nline;
228+
if (item.second->getName() == HistoName) {
229+
auto histo = dynamic_cast<TH1F*>(item.second->getObject());
230+
if (histo) {
231+
histo->SetBins(1, LineResp[by - 1] - 0.5, LineResp[by - 1] + 0.5);
232+
histo->Fill(LineResp[by - 1]);
233+
}
234+
}
235+
}
236+
/////NN
237+
197238
if (item.second->getName() == "NbLBEmpty") {
198239
auto histo = dynamic_cast<TH1F*>(item.second->getObject());
199240
if (histo) {

Modules/MUON/MID/src/DigitsQcTask.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/)
6868

6969
std::array<std::string, 4> chId{ "11", "12", "21", "22" };
7070

71+
for (size_t i = 0; i < 36; ++i) {
72+
std::string nline = "";
73+
nline = std::to_string(i + 1);
74+
mLineLocalResp[i] = std::make_unique<TH1F>(fmt::format("RespBoardLine{}", nline).c_str(), fmt::format("RespBoardLine{}", nline).c_str(), 1, 0, 1);
75+
getObjectsManager()->startPublishing(mLineLocalResp[i].get());
76+
}
77+
7178
for (size_t ich = 0; ich < 5; ++ich) {
7279
std::string chName = "";
7380
if (ich < 4) {

0 commit comments

Comments
 (0)