62 const TObject&
object,
63 const dqm_core::AlgorithmConfig&
config) {
64 const TH2* histo =
dynamic_cast<const TH2*
> (&
object);
67 throw dqm_core::BadConfig(ERS_HERE, name,
"Input object is not a TH2");
70 std::vector<std::string> dead_rpc_panel {};
71 std::vector<int> coun_rpc_panel {};
75 if (histo->GetEntries() < minstat) {
76 dqm_core::Result*
result =
new dqm_core::Result(dqm_core::Result::Undefined);
77 result->tags_[
"InsufficientEntries"] = histo->GetEntries();
85 double bin_threshold {};
91 catch (dqm_core::Exception& ex) {
92 throw dqm_core::BadConfig(ERS_HERE, name, ex.what(), ex);
95 dead_rpc_panel.clear( );
96 coun_rpc_panel.clear( );
97 using namespace std::string_view_literals;
98 for (
int ibinx = 1; ibinx != histo->GetNbinsX() + 1; ++ibinx) {
99 for (
int ibiny = 1; ibiny != histo->GetNbinsY() + 1; ++ibiny) {
100 float content = histo->GetBinContent(ibinx, ibiny);
101 if (content < bin_threshold) {
102 std::string chamber_name {};
103 std::string Title = histo->GetTitle();
104 if (Title.find(
"HighPt0_BA") != std::string::npos || Title.find(
"HighPt1_BA") != std::string::npos) {
105 if (listContains({1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
106 constexpr int maxPossible {12};
107 if (ibinx > maxPossible)
continue;
109 constexpr std::array<std::string_view, maxPossible> chamberNames {
123 chamber_name = chamberNames[ibinx - 1];
124 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
125 constexpr int maxPossible {12};
126 if (ibinx > maxPossible)
continue;
127 constexpr std::array<std::string_view, maxPossible> chamberNames {
141 chamber_name = chamberNames[ibinx - 1];
142 }
else if (ibiny == 25 || ibiny == 26) {
143 constexpr int maxPossible {13};
144 constexpr std::array<std::string_view, maxPossible> chamberNames {
160 if (ibinx <= maxPossible) chamber_name = chamberNames[ibinx - 1];
163 constexpr int maxPossible {12};
164 if (ibinx > maxPossible)
continue;
165 constexpr std::array<std::string_view, maxPossible> chamberNames {
179 chamber_name = chamberNames[ibinx - 1];
181 }
else if (Title.find(
"LowPt0_BA") != std::string::npos || Title.find(
"LowPt1_BA") != std::string::npos) {
182 if (listContains({1, 2, 5, 6, 9, 10}, ibiny)) {
183 constexpr int maxPossible {10};
184 if (ibinx > maxPossible)
continue;
185 constexpr std::array<std::string_view, maxPossible> chamberNames {
197 chamber_name = chamberNames[ibinx - 1];
198 }
else if (listContains({13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
199 constexpr int maxPossible {9};
200 if (ibinx > maxPossible)
continue;
201 constexpr std::array<std::string_view, maxPossible> chamberNames {
212 chamber_name = chamberNames[ibinx - 1];
213 }
else if (ibiny == 25 || ibiny == 26) {
214 constexpr int maxPossible {10};
215 if (ibinx > maxPossible)
continue;
216 constexpr std::array<std::string_view, maxPossible> chamberNames {
228 chamber_name = chamberNames[ibinx - 1];
229 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
230 constexpr int maxPossible {12};
231 if (ibinx > maxPossible)
continue;
232 constexpr std::array<std::string_view, maxPossible> chamberNames {
246 chamber_name = chamberNames[ibinx - 1];
248 constexpr int maxPossible {5};
249 if (ibinx > maxPossible)
continue;
250 constexpr std::array<std::string_view, maxPossible> chamberNames {
257 chamber_name = chamberNames[ibinx - 1];
259 }
else if (Title.find(
"Pivot0_BA") != std::string::npos || Title.find(
"Pivot1_BA") != std::string::npos ||
260 Title.find(
"LowPt_BA") != std::string::npos) {
261 if (listContains({1, 2, 5, 6, 9, 10}, ibiny)) {
262 constexpr int maxPossible {11};
263 if (ibinx > maxPossible)
continue;
264 constexpr std::array<std::string_view, maxPossible> chamberNames {
277 chamber_name = chamberNames[ibinx - 1];
278 }
else if (listContains({13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
279 constexpr int maxPossible {10};
280 if (ibinx > maxPossible)
continue;
281 constexpr std::array<std::string_view, maxPossible> chamberNames {
293 chamber_name = chamberNames[ibinx - 1];
294 }
else if (ibiny == 25 || ibiny == 26) {
295 constexpr int maxPossible {11};
296 if (ibinx > maxPossible)
continue;
297 constexpr std::array<std::string_view, maxPossible> chamberNames {
310 chamber_name = chamberNames[ibinx - 1];
311 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
312 constexpr int maxPossible {13};
313 if (ibinx > maxPossible)
continue;
314 constexpr std::array<std::string_view, maxPossible> chamberNames {
329 chamber_name = chamberNames[ibinx - 1];
331 constexpr int maxPossible {13};
332 if (ibinx > maxPossible)
continue;
333 constexpr std::array<std::string_view, maxPossible> chamberNames {
348 chamber_name = chamberNames[ibinx - 1];
350 }
else if (Title.find(
"HighPt_BA") != std::string::npos) {
351 if (listContains({1, 2, 5, 6, 9, 10}, ibiny)) {
352 constexpr int maxPossible {11};
353 if (ibinx > maxPossible)
continue;
354 constexpr std::array<std::string_view, maxPossible> chamberNames {
367 chamber_name = chamberNames[ibinx - 1];
368 }
else if (listContains({13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
369 constexpr int maxPossible {10};
370 if (ibinx > maxPossible)
continue;
371 constexpr std::array<std::string_view, maxPossible> chamberNames {
383 chamber_name = chamberNames[ibinx - 1];
384 }
else if (ibiny == 25 || ibiny == 26) {
385 constexpr int maxPossible {11};
386 if (ibinx > maxPossible)
continue;
387 constexpr std::array<std::string_view, maxPossible> chamberNames {
400 chamber_name = chamberNames[ibinx - 1];
401 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
402 constexpr int maxPossible {13};
403 if (ibinx > maxPossible)
continue;
404 constexpr std::array<std::string_view, maxPossible> chamberNames {
419 chamber_name = chamberNames[ibinx - 1];
421 constexpr int maxPossible {6};
422 if (ibinx > maxPossible)
continue;
423 constexpr std::array<std::string_view, maxPossible> chamberNames {
431 chamber_name = chamberNames[ibinx - 1];
433 }
else if (Title.find(
"HighPt0_BC") != std::string::npos || Title.find(
"HighPt1_BC") != std::string::npos) {
434 if (listContains({1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
435 constexpr int maxPossible {12};
436 if (ibinx > maxPossible)
continue;
437 constexpr std::array<std::string_view, maxPossible> chamberNames {
451 chamber_name = chamberNames[ibinx - 1];
452 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
453 constexpr int maxPossible {12};
454 if (ibinx > maxPossible)
continue;
455 constexpr std::array<std::string_view, maxPossible> chamberNames {
469 chamber_name = chamberNames[ibinx - 1];
470 }
else if (ibiny == 25 || ibiny == 26) {
471 constexpr int maxPossible {13};
472 constexpr std::array<std::string_view, maxPossible> chamberNames {
488 chamber_name = (ibinx > maxPossible) ?
"" : chamberNames[ibinx - 1];
490 constexpr int maxPossible {11};
491 if (ibinx > maxPossible)
continue;
492 constexpr std::array<std::string_view, maxPossible> chamberNames {
505 chamber_name = chamberNames[ibinx - 1];
507 }
else if (Title.find(
"LowPt0_BC") != std::string::npos || Title.find(
"LowPt1_BC") != std::string::npos) {
508 if (ibiny == 5 || ibiny == 6 || ibiny == 9 || ibiny == 10) {
509 constexpr int maxPossible {10};
510 if (ibinx > maxPossible)
continue;
511 constexpr std::array<std::string_view, maxPossible> chamberNames {
523 chamber_name = chamberNames[ibinx - 1];
524 }
else if (listContains({1, 2, 13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
525 constexpr int maxPossible {9};
526 if (ibinx > maxPossible)
continue;
527 constexpr std::array<std::string_view, maxPossible> chamberNames {
538 chamber_name = chamberNames[ibinx - 1];
539 }
else if (ibiny == 25 || ibiny == 26) {
540 constexpr int maxPossible {10};
541 if (ibinx > maxPossible)
continue;
542 constexpr std::array<std::string_view, maxPossible> chamberNames {
554 chamber_name = chamberNames[ibinx - 1];
555 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
556 constexpr int maxPossible {12};
557 if (ibinx > maxPossible)
continue;
558 constexpr std::array<std::string_view, maxPossible> chamberNames {
572 chamber_name = chamberNames[ibinx - 1];
574 constexpr int maxPossible {5};
575 if (ibinx > maxPossible)
continue;
576 constexpr std::array<std::string_view, maxPossible> chamberNames {
583 chamber_name = chamberNames[ibinx - 1];
585 }
else if (Title.find(
"Pivot0_BC") != std::string::npos || Title.find(
"Pivot1_BC") != std::string::npos ||
586 Title.find(
"LowPt_BC") != std::string::npos) {
587 if (ibiny == 5 || ibiny == 6 || ibiny == 9 || ibiny == 10) {
588 constexpr int maxPossible {11};
589 if (ibinx > maxPossible)
continue;
590 constexpr std::array<std::string_view, maxPossible> chamberNames {
603 chamber_name = chamberNames[ibinx - 1];
604 }
else if (listContains({1, 2, 13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
605 constexpr int maxPossible {10};
606 if (ibinx > maxPossible)
continue;
607 constexpr std::array<std::string_view, maxPossible> chamberNames {
619 chamber_name = chamberNames[ibinx - 1];
620 }
else if (ibiny == 25 || ibiny == 26) {
621 constexpr int maxPossible {11};
622 if (ibinx > maxPossible)
continue;
623 constexpr std::array<std::string_view, maxPossible> chamberNames {
636 chamber_name = chamberNames[ibinx - 1];
637 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
638 constexpr int maxPossible {13};
639 if (ibinx > maxPossible)
continue;
640 constexpr std::array<std::string_view, maxPossible> chamberNames {
655 chamber_name = chamberNames[ibinx - 1];
657 constexpr int maxPossible {13};
658 if (ibinx > maxPossible)
continue;
659 constexpr std::array<std::string_view, maxPossible> chamberNames {
674 chamber_name = chamberNames[ibinx - 1];
676 }
else if (Title.find(
"HighPt_BC") != std::string::npos) {
677 if (ibiny == 5 || ibiny == 6 || ibiny == 9 || ibiny == 10) {
678 constexpr int maxPossible {11};
679 if (ibinx > maxPossible)
continue;
680 constexpr std::array<std::string_view, maxPossible> chamberNames {
693 chamber_name = chamberNames[ibinx - 1];
694 }
else if (listContains({1, 2, 13, 14, 17, 18, 21, 22, 29, 30}, ibiny)) {
695 constexpr int maxPossible {10};
696 if (ibinx > maxPossible)
continue;
697 constexpr std::array<std::string_view, maxPossible> chamberNames {
709 chamber_name = chamberNames[ibinx - 1];
710 }
else if (ibiny == 25 || ibiny == 26) {
711 constexpr int maxPossible {11};
712 if (ibinx > maxPossible)
continue;
713 constexpr std::array<std::string_view, maxPossible> chamberNames {
726 chamber_name = chamberNames[ibinx - 1];
727 }
else if (listContains({3, 4, 7, 8, 11, 12, 15, 16, 19, 20, 31, 32}, ibiny)) {
728 constexpr int maxPossible {13};
729 if (ibinx > maxPossible)
continue;
730 constexpr std::array<std::string_view, maxPossible> chamberNames {
745 chamber_name = chamberNames[ibinx - 1];
747 constexpr int maxPossible {6};
748 if (ibinx > maxPossible)
continue;
749 constexpr std::array<std::string_view, maxPossible> chamberNames {
757 chamber_name = chamberNames[ibinx - 1];
763 std::string chamber {};
764 std::string sector {};
765 std::string secnum {};
766 std::string layer {};
769 std::string dzeta {};
771 std::string
dot =
".";
772 if (Title.find(
"Eta") != std::string::npos) view =
"eta";
773 if (Title.find(
"Phi") != std::string::npos) view =
"phi";
774 secnum = sector_name.substr(1, 2);
775 if (sector_name.find(
"HV") != std::string::npos) {
777 if (secnum ==
"02" || secnum ==
"04" || secnum ==
"06" || secnum ==
"08" || secnum ==
"10" ||
778 secnum ==
"12" || secnum ==
"14" || secnum ==
"16") dphi =
"DP2";
779 }
else if (sector_name.find(
"RO") != std::string::npos) {
781 if (secnum ==
"02" || secnum ==
"04" || secnum ==
"06" || secnum ==
"08" || secnum ==
"10" ||
782 secnum ==
"12" || secnum ==
"14" || secnum ==
"16") dphi =
"DP1";
785 if (Title.find(
"HighPt0") != std::string::npos) {
789 if (Title.find(
"HighPt1") != std::string::npos) {
793 if (Title.find(
"LowPt0") != std::string::npos) {
797 if (Title.find(
"LowPt1") != std::string::npos) {
801 if (Title.find(
"Pivot0") != std::string::npos) {
805 if (Title.find(
"Pivot1") != std::string::npos) {
809 if (Title.find(
"LowPt_") != std::string::npos) {
813 if (Title.find(
"HighPt_") != std::string::npos) {
817 sector = sector_name.substr(0, 3);
818 dzeta = chamber_name;
820 chamber = chamber_name.substr(0, 4);
821 std::string panel_name = chamber + sector + layer + dphi + gap + dzeta +
dot + view;
822 dead_rpc_panel.push_back(std::move(panel_name));
823 coun_rpc_panel.push_back(content);
829 dqm_core::Result*
result =
new dqm_core::Result();
830 std::map<std::string, double>
tags;
835 for (std::vector<std::string>::const_iterator itr = dead_rpc_panel.begin(); itr != dead_rpc_panel.end(); ++itr) {
836 tags[TString::Format(
"%s", (*itr).c_str()).Data()] = coun_rpc_panel.at(writes);
838 if (writes > 100)
break;
841 int count = TotalPanels - dead_rpc_panel.size();
843 tags[TString::Format(
"Alive panels").Data()] = 100. *
count / TotalPanels;
844 tags[TString::Format(
"# Alive panels").Data()] =
count;
845 tags[TString::Format(
"# Dead panels").Data()] = writes;
848 if (
count >= gthreshold) {
849 result->status_ = dqm_core::Result::Green;
850 }
else if (
count > rthreshold) {
851 result->status_ = dqm_core::Result::Yellow;
853 result->status_ = dqm_core::Result::Red;