20 #define STDDEV_POS 1.0
21 #define MARKER_POS_RED 0.6
25 #define MARKER_POS_BLUE 0.15
35 if (
v.at(0) + 1 !=
v.at(1)) std::cout <<
v.at(0) <<
", ";
36 else if (
v.at(0) + 1 ==
v.at(1)) std::cout <<
v.at(0) <<
"-";
37 for (
unsigned int i = 1;
i <
v.size() - 1;
i++) {
38 if (
v.at(
i) + 1 !=
v.at(
i + 1)) std::cout <<
v.at(
i) <<
", ";
39 else if (
v.at(
i - 1) + 1 !=
v.at(
i) &&
v.at(
i) + 1 ==
v.at(
i + 1)) std::cout <<
v.at(
i) <<
"-";
41 std::cout <<
v.back();
42 }
else if (
v.size() > 0) std::cout <<
v.at(0);
43 std::cout <<
" }" << std::endl;
50 else if (
v.at(0) + 1 ==
v.at(1))
outputfile <<
v.at(0) <<
"-";
51 for (
unsigned int i = 1;
i <
v.size() - 1;
i++) {
62 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
63 if (
h->At(
i) <= 0)
v.push_back(
i);
67 bool find(std::vector<int>&
v,
unsigned int x) {
68 for (
unsigned int i = 0;
i <
v.size();
i++)
69 if ((
int)
x ==
v.at(
i))
return true;
76 if (
h->At(1) <= 0 &&
h->At(2) != 0 && !
find(betweenlist, 1))
v.push_back(1);
77 for (
int i = 2;
i <=
h->GetNbinsX() - 1;
i++) {
78 if (
h->At(
i - 1) > 0 &&
h->At(
i) <= 0 &&
h->At(
i + 1) > 0 && !
find(betweenlist,
i))
v.push_back(
i);
80 if (
h->At(
h->GetNbinsX()) <= 0 &&
h->At(
h->GetNbinsX() - 1) != 0 && !
find(betweenlist,
h->GetNbinsX()))
v.push_back(
84 void getNotBetweenList(std::vector<int>&
v, std::vector<int>& surely_v, std::vector<int>& betweenlist) {
86 for (
unsigned int i = 0;
i <
v.size();
i++) {
87 if (!
find(betweenlist,
v.at(
i))) {
88 surely_v.push_back(
v.at(
i));
95 for (
int i = 1;
i <=
h->GetNbinsX();
i++)
96 v.push_back((
int) (
h->At(
i)));
101 if (x1 < 1 || x2 >
h->GetNbinsX()) {
102 std::cout <<
"WARNING in " <<
103 ((TString)
h->GetName())(0,
104 7) <<
": in getAllBinsInRange: (" <<
x1 <<
"," <<
x2 <<
") outside histo range!" <<
109 v.push_back((
int) (
h->At(
i)));
114 if (x1 < 1 || x2 >
h->GetNbinsX()) {
115 std::cout <<
"WARNING in " <<
116 ((TString)
h->GetName())(0,
117 7) <<
": in getAllBinsInRangeBelowCrustCutoff: (" <<
x1 <<
"," <<
x2 <<
118 ") outside histo range!" << std::endl;
121 for (
int i =
x1;
i <=
x2; ++
i) {
122 if (
h->At(
i) < crustCutoff)
v.push_back((
int) (
h->At(
i)));
123 else v.push_back(crustCutoff);
130 if (x1 < 1 || x2 >
h->GetNbinsX()) {
131 std::cout <<
"WARNING in " <<
132 ((TString)
h->GetName())(0,
133 7) <<
": in getAllUnmaskedBinsInRangeBelowCrustCutoff: (" <<
x1 <<
"," <<
x2 <<
134 ") outside histo range!" <<
138 for (
int i =
x1;
i <=
x2; ++
i) {
139 if ((
h->At(
i) < crustCutoff) && !
AinB(
i, maskedTubes))
v.push_back((
int) (
h->At(
i)));
140 else v.push_back(crustCutoff);
146 for (
unsigned int i = 0;
i <
indices.size(); ++
i) {
152 std::vector<int>
tmp;
153 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
154 if (
v.at(
i) > 0)
tmp.push_back(
v.at(
i));
161 for (
int i = 1;
i <=
h->GetNbinsX(); ++
i) {
162 if (
h->At(
i) > 0)
v.push_back((
int) (
h->At(
i)));
168 for (
int i = 1;
i <=
h->GetNbinsX(); ++
i) {
175 for (
int i = 1;
i <=
h->GetNbinsX(); ++
i) {
176 if (
h->At(
i) > 0)
v.push_back(
i);
183 if (maskedTubes.empty())
return;
185 std::vector<int>
tmp;
186 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
187 if (!
AinB(
v.at(
i), maskedTubes)) {
188 tmp.push_back(
v.at(
i));
194 void getNotInDeadMezz(std::vector<int>&
v, std::vector<int>& deadMezz_v,
const TString& hardware_name,
196 if (deadMezz_v.empty())
return;
201 std::vector<TubeRange> tubeRanges =
getMezzRanges(hardware_name, totalTubes, groupsPerLayer);
203 std::vector<int>
tmp;
204 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
209 tmp.push_back(
v.at(
i));
215 void getNotInDeadLayer(std::vector<int>&
v, std::vector<int>& deadLayer_v,
const TString& hardware_name,
217 if (deadLayer_v.empty())
return;
219 std::vector<int>
tmp;
220 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
222 tmp.push_back(
v.at(
i));
228 void getNotInDeadML(std::vector<int>&
v, std::vector<int>& deadML_v,
const TString& hardware_name,
int totalTubes) {
229 if (deadML_v.empty())
return;
232 std::vector<int>
tmp;
233 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
237 tmp.push_back(
v.at(
i));
245 double runningMean = 0;
247 for (
unsigned int i = 0;
i <
v.size();
i++) {
248 runningMean = (runningMean * (
i) +
v.at(
i)) / (
double) (
i + 1);
254 double runningMean = 0;
257 for (
unsigned int i = 0;
i <
v.size(); ++
i) {
258 if ((
double)
v.at(
i) <
cut) {
266 void getNoBetweens(
TH1F*
h, std::vector<int>& no_dead, std::vector<int>& no_betweens, std::vector<int>& betweenlist,
267 float minBinContent) {
270 std::vector<int> tmp_no_dead_pruned;
272 double no_dead_mean =
getMean(tmp_no_dead_pruned);
273 std::vector<int> tmp_no_betweens, tmp_betweenlist;
274 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
275 if (
h->At(
i) > minBinContent * no_dead_mean) {
276 tmp_no_betweens.push_back((
int) (
h->At(
i)));
277 tmp_betweenlist.push_back(
i);
279 if (tmp_no_betweens.size() >= 1 &&
getMean_WithCut(tmp_no_betweens, 2. * no_dead_mean) < 0.25 * no_dead_mean) {
280 betweenlist.insert(betweenlist.end(), tmp_betweenlist.begin(), tmp_betweenlist.end());
281 tmp_no_betweens.clear();
282 tmp_betweenlist.clear();
283 }
else if (tmp_no_betweens.size() >= 1) {
284 no_betweens.insert(no_betweens.end(), tmp_no_betweens.begin(), tmp_no_betweens.end());
285 tmp_no_betweens.clear();
286 tmp_betweenlist.clear();
288 betweenlist.push_back(
i);
292 if (tmp_no_betweens.size() >= 1 &&
getMean_WithCut(tmp_no_betweens, 2. * no_dead_mean) < 0.25 * no_dead_mean) {
293 betweenlist.insert(betweenlist.end(), tmp_betweenlist.begin(), tmp_betweenlist.end());
294 }
else if (tmp_no_betweens.size() >= 1) {
295 no_betweens.insert(no_betweens.end(), tmp_no_betweens.begin(), tmp_no_betweens.end());
300 std::vector<int> betweenlist_copy = betweenlist;
301 std::vector<int> tmp_betweenlist;
303 if (betweenlist_copy.size() <= 2)
return;
305 for (
unsigned int i = 0;
i < betweenlist_copy.size() - 1;
i++) {
306 if (betweenlist_copy.at(
i) + 1 == betweenlist_copy.at(
i + 1)) {
307 tmp_betweenlist.push_back(betweenlist_copy.at(
i));
308 if (
i == betweenlist_copy.size() - 2) tmp_betweenlist.push_back(betweenlist_copy.at(
i + 1));
310 if (tmp_betweenlist.size() >= 1) tmp_betweenlist.push_back(betweenlist_copy.at(
i));
311 if (tmp_betweenlist.size() >=
sz) betweenlist.insert(betweenlist.end(),
312 tmp_betweenlist.begin(), tmp_betweenlist.end());
313 tmp_betweenlist.clear();
316 if (tmp_betweenlist.size() >=
sz) betweenlist.insert(betweenlist.end(),
317 tmp_betweenlist.begin(), tmp_betweenlist.end());
321 no_betweens_middle.clear();
322 sort(no_betweens.begin(), no_betweens.end());
323 int crustSize = no_betweens.size() / 20;
324 no_betweens_middle.insert(no_betweens_middle.begin(), no_betweens.begin() + crustSize,
325 no_betweens.end() - crustSize);
329 no_betweens_lowmiddle.clear();
330 sort(no_betweens.begin(), no_betweens.end());
331 int crustSize = no_betweens.size() / 4;
332 no_betweens_lowmiddle.insert(no_betweens_lowmiddle.begin(), no_betweens.begin() + crustSize,
333 no_betweens.begin() + 2 * crustSize);
337 no_betweens_middle_aggressive.clear();
338 sort(no_betweens.begin(), no_betweens.end());
339 int crustSize = no_betweens.size() / 4;
340 no_betweens_middle_aggressive.insert(no_betweens_middle_aggressive.begin(),
341 no_betweens.begin() + crustSize, no_betweens.end() - crustSize);
345 std::vector<int>& no_betweens_middle_aggressive) {
346 no_betweens_middle_aggressive.clear();
347 sort(no_betweens.begin(), no_betweens.end());
348 int crustSize = no_betweens.size() / 8;
349 no_betweens_middle_aggressive.insert(no_betweens_middle_aggressive.begin(),
350 no_betweens.begin() + crustSize, no_betweens.end() - crustSize);
354 std::vector<int>& no_betweens_lowmiddle_aggressive) {
355 no_betweens_lowmiddle_aggressive.clear();
356 sort(no_betweens.begin(), no_betweens.end());
357 int crustSize = no_betweens.size() / 10;
358 no_betweens_lowmiddle_aggressive.insert(no_betweens_lowmiddle_aggressive.begin(),
359 no_betweens.begin() + crustSize, no_betweens.begin() + 2 * crustSize);
363 std::vector<int>& no_betweens_lowmiddle_aggressive) {
364 no_betweens_lowmiddle_aggressive.clear();
365 sort(no_betweens.begin(), no_betweens.end());
366 int crustSize = no_betweens.size() / 10;
367 no_betweens_lowmiddle_aggressive.insert(no_betweens_lowmiddle_aggressive.begin(),
368 no_betweens.end() - 2 * crustSize, no_betweens.end() - crustSize);
374 for (
unsigned int i = 0;
i <
v.size();
i++) {
380 return std::sqrt(
sum / (
double)
v.size());
386 for (
unsigned int i = 0;
i <
v.size();
i++) {
392 return std::sqrt(
sum / (
double)
v.size());
398 for (
unsigned int i = 0;
i <
v.size();
i++) {
404 return std::sqrt(
sum / (
double)
v.size());
407 void getNoisyList(
TH1F*
h, std::vector<int>& no_betweens_middle, std::vector<int>& no_betweens_middle_aggressive,
408 double num_std_dev, std::vector<int>& noisylist) {
410 double mean =
getMean(no_betweens_middle_aggressive);
412 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
413 if (
h->At(
i) -
mean > num_std_dev * stddev) noisylist.push_back(
i);
418 std::vector<int>& no_betweens_middle_aggressive,
double num_pct, std::vector<int>& noisylist) {
420 double mean =
getMean(no_betweens_middle_aggressive);
422 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
423 if (
h->At(
i) > (
mean) * ((num_pct / 100.) + (500. - 25. * (num_pct / 100.)) / (
mean *
mean))) {
424 noisylist.push_back(
i);
430 void getIneffList(
TH1F*
h, std::vector<int>& no_betweens_middle, std::vector<int>& no_betweens_lowmiddle_aggressive,
431 double num_std_dev, std::vector<int>& inefflist) {
433 double mean =
getMean(no_betweens_lowmiddle_aggressive);
435 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
436 if (
mean -
h->At(
i) > num_std_dev * stddev) inefflist.push_back(
i);
440 void getIneffList(
TH1F*
h, std::vector<int>& no_betweens_middle, std::vector<int>& no_betweens_lowmiddle_aggressive,
441 double num_std_dev_1,
double num_std_dev_2, std::vector<int>& inefflist) {
443 double mean =
getMean(no_betweens_lowmiddle_aggressive);
445 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
446 if (
mean -
h->At(
i) > num_std_dev_1 * stddev &&
mean -
h->At(
i) <= num_std_dev_2 * stddev) inefflist.push_back(
i);
452 std::vector<int>& no_betweens_lowmiddle_aggressive,
double num_pct, std::vector<int>& inefflist) {
454 double mean =
getMean(no_betweens_lowmiddle_aggressive);
455 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
456 if (
h->At(
i) <
mean * num_pct / 100.) inefflist.push_back(
i);
461 std::vector<int>& no_betweens_lowmiddle_aggressive,
double num_pct, std::vector<int>& inefflist) {
463 double mean =
getMean(no_betweens_lowmiddle_aggressive);
464 for (
unsigned int i = 0;
i <
indices.size(); ++
i) {
471 std::vector<int>& no_betweens_lowmiddle_aggressive,
double num_pct_1,
double num_pct_2,
472 std::vector<int>& inefflist) {
474 double mean =
getMean(no_betweens_lowmiddle_aggressive);
475 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
476 if (
h->At(
i) <
mean * num_pct_2 / 100. &&
h->At(
i) >
mean * num_pct_1 / 100.) inefflist.push_back(
i);
481 bool validityCheckDead(std::vector<int>& no_betweens_middle, std::vector<int>& no_betweens_lowmiddle) {
485 if (no_betweens_middle.size() < 60) {
510 bool validityCheckNoise(std::vector<int>& no_betweens_middle, std::vector<int>& no_betweens_middle_aggressive
513 double mean =
getMean(no_betweens_middle_aggressive);
518 if (no_betweens_middle.size() < 60) {
535 std::vector<int> no_deads, non_noisy, no_betweens, no_betweens_middle, no_betweens_middle_aggressive,
536 no_betweens_highmiddle_aggressive, betweenlist, noisylist;
537 non_dead_non_noisy.clear();
540 getNoBetweens(h_tube_fornoise, no_deads, no_betweens, betweenlist, .05);
544 getNoisyList2(h_tube_fornoise, no_betweens_middle, no_betweens_highmiddle_aggressive, 300.0, noisylist);
548 std::vector<int> tmp_non_dead_non_noisy;
549 for (
int i = 1;
i <= h_tube->GetNbinsX();
i++) {
550 if (h_tube->At(
i) > 0) {
552 for (
unsigned int j = 0; j < noisylist.size(); j++) {
553 if (
i == noisylist.at(j)) {
558 if (dopush) tmp_non_dead_non_noisy.push_back((
int) h_tube->At(
i));
561 non_dead_non_noisy = std::move(tmp_non_dead_non_noisy);
565 TH1F* EffVSNoise_num,
TH1F* EffVSNoise_den,
TH1F* EffVSNoise_ADCCut_num,
566 TH1F* EffVSNoise_ADCCut_den,
TH1F* EffVSBkd_num,
TH1F* EffVSBkd_den) {
569 h->Scale(1. / nTriggers / 300. * 1e9);
570 TH1F* h2 = (
TH1F*) h_tube_fornoise->Clone();
571 h2->Scale(1. / nTriggers / 300. * 1e9);
573 for (
int i = 1;
i !=
h->GetNbinsX() + 1; ++
i) {
574 if (den->At(
i) > 0) {
575 EffVSNoise_ADCCut_num->Fill(
h->At(
i) / 1000.,
num->At(
i));
576 EffVSNoise_ADCCut_den->Fill(
h->At(
i) / 1000., den->At(
i));
577 if (h2->At(
i) < 2000) {
578 EffVSBkd_num->Fill(
h->At(
i) / 1000.,
num->At(
i));
579 EffVSBkd_den->Fill(
h->At(
i) / 1000., den->At(
i));
581 EffVSNoise_num->Fill(h2->At(
i) / 1000.,
num->At(
i));
582 EffVSNoise_den->Fill(h2->At(
i) / 1000., den->At(
i));
592 TH1F*
h = (
TH1F*) h_tube_fornoise->Clone();
594 h->Scale(1. / nTriggers / 300. * 1e9);
595 std::vector<int> noisyTubes;
596 for (
int i = 1;
i !=
h->GetNbinsX() + 1; ++
i)
if (
h->At(
i) >
frequency) noisyTubes.push_back(
i);
606 std::vector<int> no_deads, no_betweens, no_betweens_middle, no_betweens_middle_aggressive,
607 no_betweens_highmiddle_aggressive, betweenlist, noisylist;
611 getNoBetweens(h_tube_fornoise, no_deads, no_betweens, betweenlist, .05);
622 getNoisyList2(h_tube_fornoise, no_betweens_middle, no_betweens_highmiddle_aggressive, 300.0, noisylist);
627 no_betweens_middle_aggressive )) {
641 std::vector<int> no_deads, no_betweens, no_betweens_middle, no_betweens_middle_aggressive,
642 no_betweens_highmiddle_aggressive, betweenlist, noisylist;
646 getNoBetweens(h_tube, no_deads, no_betweens, betweenlist, .05);
656 getNoisyList2(h_tube, no_betweens_middle, no_betweens_highmiddle_aggressive, 500.0, noisylist);
669 return std::vector<int>();
673 std::vector<int> tubes;
682 std::vector<int>
GetDeadTubes(
TH1F* h_tube,
int& validity, std::vector<int>& deadML_v, std::vector<int>& deadLayer_v,
683 std::vector<int>& deadMezz_v) {
685 TString
chamber = ((TString) h_tube->GetName())(0, 7);
686 int totalTubes = h_tube->GetNbinsX();
688 std::vector<int> non_empty, non_empty_non_noisy, no_betweens, no_betweens_middle, no_betweens_lowmiddle,
689 no_betweens_middle_aggressive, no_betweens_lowmiddle_aggressive, deadlist, surelydeadlist,
690 betweenlist, inefflist,
692 std::vector<int> all_tubes_DeadRegionsRemoved;
702 getBins(h_tube, all_tubes_DeadRegionsRemoved, no_betweens);
711 getIneffList2(all_tubes_DeadRegionsRemoved, h_tube, no_betweens_middle, no_betweens_lowmiddle_aggressive, 10.0,
722 return std::vector<int>();
728 TString hardware_name = ((TString) h_tube->GetName())(0, 7);
731 if (hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") {
734 41, 42, 43, 44, 45, 46, 47, 48, 89, 90, 91, 92, 93, 94, 95, 96, 137, 138, 139, 140, 141, 142, 143, 144
736 return std::vector<int>(cutouts, cutouts + 24);
739 if (hardware_name(0, 3) ==
"BIR" &&
numLayers <= 4) {
740 if (hardware_name(5, 2) ==
"11" || hardware_name(5, 2) ==
"15") {
741 if (hardware_name(3, 1) ==
"1") {
743 1, 2, 3, 4, 5, 6, 31, 32, 33, 34, 35, 36, 61, 62, 63, 64, 65, 66, 91, 92, 93, 94, 95, 96
745 return std::vector<int>(cutouts, cutouts + 24);
747 if (hardware_name(3, 1) ==
"2") {
749 28, 29, 30, 58, 59, 60, 88, 89, 90, 118, 119, 120
751 return std::vector<int>(cutouts, cutouts + 12);
753 if (hardware_name(3, 1) ==
"4") {
755 1, 2, 3, 31, 32, 33, 61, 62, 63, 91, 92, 93
757 return std::vector<int>(cutouts, cutouts + 12);
759 if (hardware_name(3, 1) ==
"5") {
761 22, 23, 24, 46, 47, 48, 70, 71, 72, 94, 95, 96
763 return std::vector<int>(cutouts, cutouts + 12);
767 if (hardware_name(0, 3) ==
"BIR" && hardware_name(3, 1) ==
"3") {
769 34, 35, 36, 70, 71, 72, 106, 107, 108, 142, 143, 144, 178, 179, 180, 214, 215, 216, 250, 251, 252, 286, 287, 288
771 return std::vector<int>(cutouts, cutouts + 24);
774 return std::vector<int>();
780 std::vector<int> no_deads, no_betweens, no_betweens_middle, no_betweens_middle_aggressive, betweenlist;
784 getNoBetweens(h_tube_fornoise, no_deads, no_betweens, betweenlist, .05);
800 std::vector<int> non_empty, no_betweens, no_betweens_middle, no_betweens_middle_aggressive, betweenlist;
803 getNoBetweens(h_tube, non_empty, no_betweens, betweenlist, .05);
807 double mean =
getMean(no_betweens_middle_aggressive);
814 std::vector<int> non_empty, no_betweens, no_betweens_middle, betweenlist;
817 getNoBetweens(h_tube, non_empty, no_betweens, betweenlist, .05);
825 int derived_NumLayerPerML = 1;
827 if (hardware_name(0, 4) ==
"BIS8" ) {
828 derived_NumLayerPerML = 3;
829 }
else if ( hardware_name(0, 3) ==
"BEE") {
830 derived_NumLayerPerML = 4;
831 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
832 derived_NumLayerPerML = 4;
834 derived_NumLayerPerML = 3;
837 return derived_NumLayerPerML;
841 if (hardware_name(0, 3) ==
"BIR") {
842 if (hardware_name(3, 1) ==
"2" && mezz == 5)
return 12;
843 else if (hardware_name(3, 1) ==
"3" && (mezz == 6 || mezz == 12))
return 12;
844 else if (hardware_name(3, 1) ==
"4" && mezz == 1)
return 12;
845 else if (hardware_name(3, 1) ==
"5" && mezz == 4)
return 12;
851 if (hardware_name(0, 3) ==
"BIR" || hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") {
852 if (hardware_name(0, 4) ==
"BIR3")
return 132;
855 if (hardware_name(0, 3) ==
"BMS")
return 120;
857 if (hardware_name(3, 1) ==
"1")
return 120;
859 if (hardware_name(3, 1) ==
"2")
return 108;
861 if (hardware_name(3, 1) ==
"4")
return 108;
863 if (hardware_name(3, 1) ==
"5")
return 84;
865 return (
int) TotalTubes /
GetNumML(hardware_name);
867 return (
int) TotalTubes /
GetNumML(hardware_name);
871 if (hardware_name(0, 3) ==
"BIR" || hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") {
872 if (hardware_name(0, 4) ==
"BIR3")
return 33;
875 if (hardware_name(0, 3) ==
"BMS")
return 40;
877 if (hardware_name(3, 1) ==
"1")
return 24;
879 if (hardware_name(3, 1) ==
"2")
return 27;
881 if (hardware_name(3, 1) ==
"4")
return 27;
883 if (hardware_name(3, 1) ==
"5")
return 21;
891 int derived_NumML = 1;
893 if (hardware_name(0, 4) ==
"BIS8" ) {
895 }
else if ( hardware_name(0, 3) ==
"BEE") {
897 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
903 return derived_NumML;
907 int tubeID = firstTubeInLayer;
910 int derived_layer = 1;
914 int derived_NumTubePerLayer = 1;
916 int derived_NumLayer = 1;
917 int derived_NumLayerPerML = 1;
918 int derived_NumML = 1;
920 if (hardware_name(0, 4) ==
"BIS8" ) {
921 derived_NumLayerPerML = 3;
923 }
else if ( hardware_name(0, 3) ==
"BEE") {
924 derived_NumLayerPerML = 4;
926 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
927 derived_NumLayerPerML = 4;
930 derived_NumLayerPerML = 3;
934 derived_NumLayer = derived_NumLayerPerML * derived_NumML;
936 derived_NumTubePerLayer = totalTubes / derived_NumLayer;
939 if (hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") derived_NumTubePerLayer = 48;
940 if ((hardware_name(5, 2) ==
"11" || hardware_name(5, 2) ==
"15")) {
941 if (hardware_name(0, 4) ==
"BIR1") derived_NumTubePerLayer = 30;
942 if (hardware_name(0, 4) ==
"BIR2") derived_NumTubePerLayer = 30;
943 if (hardware_name(0, 4) ==
"BIR3") derived_NumTubePerLayer = 36;
944 if (hardware_name(0, 4) ==
"BIR4") derived_NumTubePerLayer = 30;
945 if (hardware_name(0, 4) ==
"BIR5") derived_NumTubePerLayer = 24;
953 derived_layer = (tubeID - 1) / derived_NumTubePerLayer + 1;
958 int lastTubeInLayer = -1;
959 if (derived_layer <= derived_NumLayer) lastTubeInLayer = tubeID + derived_NumTubePerLayer - 1;
961 return lastTubeInLayer;
969 int derived_NumLayerPerML = 1;
972 if (hardware_name(0, 4) ==
"BIS8" ) {
973 derived_NumLayerPerML = 3;
975 }
else if ( hardware_name(0, 3) ==
"BEE") {
976 derived_NumLayerPerML = 4;
978 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
979 derived_NumLayerPerML = 4;
982 derived_NumLayerPerML = 3;
988 derived_ML = (
layer - 1) / derived_NumLayerPerML + 1;
993 int getLastTubeInML(
int& firstTubeInML,
const TString& hardware_name,
int totalTubes) {
994 int tubeID = firstTubeInML;
1002 int derived_NumTubePerML = 1;
1005 int derived_NumML = 1;
1007 if (hardware_name(0, 4) ==
"BIS8" ) {
1010 }
else if ( hardware_name(0, 3) ==
"BEE") {
1013 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1022 derived_NumTubePerML = totalTubes / derived_NumML;
1027 if (hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") derived_NumTubePerLayer = 48;
1028 if ((hardware_name(5, 2) ==
"11" || hardware_name(5, 2) ==
"15")) {
1029 if (hardware_name(0, 4) ==
"BIR1") derived_NumTubePerLayer = 30;
1030 if (hardware_name(0, 4) ==
"BIR2") derived_NumTubePerLayer = 30;
1031 if (hardware_name(0, 4) ==
"BIR3") derived_NumTubePerLayer = 36;
1032 if (hardware_name(0, 4) ==
"BIR4") derived_NumTubePerLayer = 30;
1033 if (hardware_name(0, 4) ==
"BIR5") derived_NumTubePerLayer = 24;
1041 derived_ML = (tubeID - 1) / derived_NumTubePerML + 1;
1047 int lastTubeInML = -1;
1048 if (derived_ML <= derived_NumML) lastTubeInML = tubeID + derived_NumTubePerML - 1;
1050 return lastTubeInML;
1054 int totalTubes = h_tube->GetNbinsX();
1055 TString hardware_name = ((TString) h_tube->GetName())(0, 7);
1058 std::vector<TubeRange> tubeRange =
getMezzRanges(hardware_name, totalTubes, groupsPerLayer);
1059 return tubeRange.size();
1062 std::vector<TubeRange>
getMezzRanges(
const TString& hardware_name,
int totalTubes,
int& groupsPerLayer) {
1064 int derived_NumTubePerLayer = 1;
1066 int derived_NumLayer = 1;
1067 int derived_NumLayerPerML = 1;
1068 int derived_NumML = 1;
1070 if (hardware_name(0, 4) ==
"BIS8" ) {
1071 derived_NumLayerPerML = 3;
1073 }
else if ( hardware_name(0, 3) ==
"BEE") {
1074 derived_NumLayerPerML = 4;
1076 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1077 derived_NumLayerPerML = 4;
1080 derived_NumLayerPerML = 3;
1084 derived_NumLayer = derived_NumLayerPerML * derived_NumML;
1086 derived_NumTubePerLayer = totalTubes / derived_NumLayer;
1090 if (derived_NumLayerPerML == 3) groupSize = 8;
1092 groupsPerLayer = derived_NumTubePerLayer / groupSize;
1098 int firstTubeID = 1;
1099 int lastTubeID = firstTubeID + groupSize - 1;
1100 std::vector<TubeRange>
ranges;
1101 while (lastTubeID <= totalTubes) {
1104 firstTubeID = lastTubeID + 1;
1105 lastTubeID += groupSize;
1113 int derived_NumTubePerLayer = 1;
1115 int derived_NumLayer = 1;
1116 int derived_NumLayerPerML = 1;
1117 int derived_NumML = 1;
1119 if (hardware_name(0, 4) ==
"BIS8" ) {
1120 derived_NumLayerPerML = 3;
1122 }
else if ( hardware_name(0, 3) ==
"BEE") {
1123 derived_NumLayerPerML = 4;
1125 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1126 derived_NumLayerPerML = 4;
1129 derived_NumLayerPerML = 3;
1133 derived_NumLayer = derived_NumLayerPerML * derived_NumML;
1135 derived_NumTubePerLayer = totalTubes / derived_NumLayer;
1139 if (derived_NumLayerPerML == 3) groupSize = 8;
1141 int groupsPerLayer = derived_NumTubePerLayer / groupSize;
1143 if (mezz > groupsPerLayer) {
1144 mezz -= groupsPerLayer;
1154 int derived_NumTubePerLayer = 1;
1156 int derived_NumLayer = 1;
1157 int derived_NumLayerPerML = 1;
1158 int derived_NumML = 1;
1160 if (hardware_name(0, 4) ==
"BIS8" ) {
1161 derived_NumLayerPerML = 3;
1163 }
else if ( hardware_name(0, 3) ==
"BEE") {
1164 derived_NumLayerPerML = 4;
1166 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1167 derived_NumLayerPerML = 4;
1170 derived_NumLayerPerML = 3;
1174 derived_NumLayer = derived_NumLayerPerML * derived_NumML;
1176 derived_NumTubePerLayer = totalTubes / derived_NumLayer;
1180 if (derived_NumLayerPerML == 3) groupSize = 8;
1182 int groupsPerLayer = derived_NumTubePerLayer / groupSize;
1184 if (mezz > groupsPerLayer) {
1193 std::vector<TubeRange>& tubeRanges,
int groupsPerLayer) {
1194 unsigned int rangeIndexOfTube = 9999;
1196 for (
unsigned int i = 0;
i < tubeRanges.size();
i++) {
1197 if (tubeRanges.at(
i).InRange(tubeID)) {
1198 rangeIndexOfTube =
i;
1202 if (rangeIndexOfTube == 9999) {
1203 std::cout <<
"ERROR: tubeRange problem in Get_Mezz_of_Tube()!" << std::endl;
1207 unsigned int mezz = rangeIndexOfTube % groupsPerLayer + 1;
1208 unsigned int numML =
GetNumML(hardware_name);
1209 if (numML == 2 && rangeIndexOfTube >= tubeRanges.size() / 2) {
1210 mezz += groupsPerLayer;
1218 int derived_layer = 1;
1221 int derived_NumTubePerLayer = 1;
1222 int derived_NumLayer = 1;
1223 int derived_NumLayerPerML = 1;
1224 int derived_NumML = 1;
1226 if (hardware_name(0, 4) ==
"BIS8" ) {
1227 derived_NumLayerPerML = 3;
1229 }
else if ( hardware_name(0, 3) ==
"BEE") {
1230 derived_NumLayerPerML = 4;
1232 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1233 derived_NumLayerPerML = 4;
1236 derived_NumLayerPerML = 3;
1240 derived_NumLayer = derived_NumLayerPerML * derived_NumML;
1241 derived_NumTubePerLayer = totalTubes / derived_NumLayer;
1244 if (hardware_name(0, 4) ==
"BMS4" || hardware_name(0, 4) ==
"BMS6") derived_NumTubePerLayer = 48;
1245 if ((hardware_name(5, 2) ==
"11" || hardware_name(5, 2) ==
"15")) {
1246 if (hardware_name(0, 4) ==
"BIR1") derived_NumTubePerLayer = 30;
1247 if (hardware_name(0, 4) ==
"BIR2") derived_NumTubePerLayer = 30;
1248 if (hardware_name(0, 4) ==
"BIR3") derived_NumTubePerLayer = 36;
1249 if (hardware_name(0, 4) ==
"BIR4") derived_NumTubePerLayer = 30;
1250 if (hardware_name(0, 4) ==
"BIR5") derived_NumTubePerLayer = 24;
1257 derived_layer = (tubeID - 1) / derived_NumTubePerLayer + 1;
1259 return derived_layer;
1266 int derived_NumTubePerML = 1;
1267 int derived_NumML = 1;
1269 if (hardware_name(0, 4) ==
"BIS8" ) {
1271 }
else if ( hardware_name(0, 3) ==
"BEE") {
1273 }
else if (hardware_name(0, 2) ==
"BI" || hardware_name(0, 2) ==
"EI") {
1279 derived_NumTubePerML = totalTubes / derived_NumML;
1282 derived_ML = (tubeID - 1) / derived_NumTubePerML + 1;
1287 std::vector<TubeRange>
getLayerRanges(
const TString& hardware_name,
int totalTubes) {
1288 int firstTubeID = 1;
1291 std::vector<TubeRange>
ranges;
1292 while ((lastTubeID =
getLastTubeInLayer(firstTubeID, hardware_name, totalTubes)) != -1) {
1295 firstTubeID = lastTubeID + 1;
1300 std::vector<TubeRange>
getMLRanges(
const TString& hardware_name,
int totalTubes) {
1301 int firstTubeID = 1;
1304 std::vector<TubeRange>
ranges;
1305 while ((lastTubeID =
getLastTubeInML(firstTubeID, hardware_name, totalTubes)) != -1) {
1308 firstTubeID = lastTubeID + 1;
1317 int totalTubes = h_tube->GetNbinsX();
1319 int numML =
GetNumML(hardware_name);
1321 std::vector<TubeRange> tubeRange =
getMezzRanges(hardware_name, totalTubes, groupsPerLayer);
1322 int numMezz = groupsPerLayer * numML;
1323 std::vector<double> means;
1324 std::vector<int> valuesAll;
1326 sort(valuesAll.begin(), valuesAll.end());
1327 int crustSize = (valuesAll.size()) / 3;
1328 int crustCutoff = 0;
1329 if (valuesAll.size() > 0) crustCutoff = valuesAll.at(valuesAll.size() - 1 - crustSize);
1330 for (
unsigned int i = 0;
i < tubeRange.size();
i++) {
1331 std::vector<int> valuesInRange_crusted;
1333 i).x1, tubeRange.at(
i).x2);
1336 if (valuesInRange_crusted.size() > 0) {
1337 means.push_back(
getMean(valuesInRange_crusted));
1338 }
else means.push_back(crustCutoff);
1344 std::vector<std::vector<double> > mezz_means(numMezz);
1347 for (
unsigned int k = 0;
k < means.size();
k++) {
1348 if (numML == 2 &&
k >= means.size() / 2) {
1351 mezz_means.at((
k % groupsPerLayer) + groupsPerLayer).push_back(means.at(
k));
1355 mezz_means.at((
k % groupsPerLayer)).push_back(means.at(
k));
1359 double mean_of_means =
getMean(means);
1360 std::vector<int> deviant_mezz;
1361 for (
unsigned int i = 0;
i < mezz_means.size(); ++
i) {
1363 bool deviant =
true;
1364 for (
unsigned int j = 0; j < mezz_means.at(
i).
size(); j++) {
1367 if (!(mezz_means.at(
i).at(j) < 0.25 * mean_of_means)) deviant =
false;
1369 if (deviant && !
AinB(
Get_ML_of_Mezz(mezz, hardware_name, totalTubes), deadML_v)) deviant_mezz.push_back(mezz);
1375 return deviant_mezz;
1382 int totalTubes = h_tube->GetNbinsX();
1384 std::vector<TubeRange> tubeRange =
getLayerRanges(hardware_name, totalTubes);
1385 std::vector<double> means;
1386 std::vector<int> valuesAll;
1389 sort(valuesAll.begin(), valuesAll.end());
1391 int crustSize = (valuesAll.size()) / 3;
1392 int crustCutoff = 0;
1393 if (valuesAll.size() > 0) crustCutoff = valuesAll.at(valuesAll.size() - 1 - crustSize);
1395 for (
unsigned i = 0;
i < tubeRange.size();
i++) {
1396 std::vector<int> valuesInRange_crusted;
1398 i).x1, tubeRange.at(
i).x2);
1399 if (valuesInRange_crusted.size() > 0) {
1400 means.push_back(
getMean(valuesInRange_crusted));
1401 }
else means.push_back(crustCutoff);
1405 double mean_of_means =
getMean(means);
1406 std::vector<int> deviant_layers;
1407 for (
unsigned i = 0;
i < means.size(); ++
i) {
1408 if (means.at(
i) < 0.25 * mean_of_means) {
1413 if (deviant_layers.size() > 0) {
1417 return deviant_layers;
1421 for (
unsigned int i = 0;
i < B.size(); ++
i) {
1422 if (B.at(
i) ==
A)
return true;
1427 bool AinB(
int A,
const std::vector<int>* B) {
1428 for (
unsigned int i = 0;
i < B->size(); ++
i) {
1429 if (B->at(
i) ==
A)
return true;
1438 int totalTubes = h_tube->GetNbinsX();
1440 std::vector<TubeRange> tubeRange =
getMLRanges(hardware_name, totalTubes);
1441 std::vector<double> means;
1442 std::vector<int> valuesAll;
1444 sort(valuesAll.begin(), valuesAll.end());
1445 int crustSize = (valuesAll.size()) / 3;
1446 int crustCutoff = 0;
1447 if (valuesAll.size() > 0) crustCutoff = valuesAll.at(valuesAll.size() - 1 - crustSize);
1448 for (
unsigned int i = 0;
i < tubeRange.size();
i++) {
1449 std::vector<int> valuesInRange_crusted;
1451 i).x1, tubeRange.at(
i).x2);
1452 if (valuesInRange_crusted.size() > 0) {
1453 means.push_back(
getMean(valuesInRange_crusted));
1454 }
else means.push_back(crustCutoff);
1458 double mean_of_means =
getMean(means);
1459 std::vector<int> deviant_ML;
1460 for (
unsigned i = 0;
i < means.size(); ++
i) {
1461 if (means.at(
i) < 0.25 * mean_of_means) deviant_ML.push_back(
i + 1);
1463 if (deviant_ML.size() > 0) {
1475 int deadTubesChamberValidity,
int noisyTubesChamberValidity,
1476 bool draw_Mezz_L_ML_guidlines,
bool draw_mean,
bool draw_masked_tubes,
bool separate_dead_noisy_histos,
1477 bool draw_validity_message,
bool draw_histo_if_nothing_to_report) {
1478 if (!noisyML)
return;
1480 if (!noisyLayer)
return;
1482 if (!noisyMEZZ)
return;
1484 if (!noisyASD)
return;
1486 if (!deadASD)
return;
1488 if (!draw_histo_if_nothing_to_report && deadTubes->size() == 0 && noisyTubes->size() == 0 && deadML->size() == 0 &&
1489 deadLayer->size() == 0 && deadMEZZ->size() == 0)
return;
1493 if (!hNoise)
return;
1496 if (separate_dead_noisy_histos)
c->Divide(2, 1);
1497 TString chamberName = ((TString) hDead->GetName())(0, 7);
1498 c->SetTitle(chamberName);
1501 TH1F* hOnlyDead =
new TH1F(hDead->GetName(), hDead->GetTitle(), hDead->GetNbinsX(), 1, hDead->GetNbinsX());
1502 TH1F* hOnlyNoise =
new TH1F(hNoise->GetName(), hNoise->GetTitle(), hNoise->GetNbinsX(), 1, hNoise->GetNbinsX());
1504 TString maskedStr = hDead->GetName();
1505 maskedStr +=
"_masked";
1506 TH1F* hOnlyMaskedDead =
new TH1F(maskedStr, hDead->GetTitle(), hDead->GetNbinsX(), 1, hDead->GetNbinsX());
1509 std::vector<TLine> rangeLines;
1510 std::vector<TLine> rangeLines_onlyMLLMezz;
1511 std::vector<TubeRange> tubeRange =
getLayerRanges(chamberName, hDead->GetNbinsX());
1512 for (
unsigned int i = 0;
i < tubeRange.size();
i++) {
1513 TLine
l(hDead->GetBinLowEdge(tubeRange.at(
i).x1) + hDead->GetBinWidth(tubeRange.at(
1514 i).x1) / 2.0,
LAYER_POS, hDead->GetBinLowEdge(tubeRange.at(
1515 i).x2) + hDead->GetBinWidth(tubeRange.at(
1518 if (
i % 2 == 0)
l.SetLineColor(kViolet);
1519 else l.SetLineColor(kViolet + 6);
1522 rangeLines_onlyMLLMezz.push_back(
l);
1524 l.SetLineColor(kRed);
1526 rangeLines.push_back(
l);
1527 }
else if (draw_Mezz_L_ML_guidlines) {
1528 rangeLines.push_back(
l);
1532 tubeRange =
getMLRanges(chamberName, hDead->GetNbinsX());
1533 for (
unsigned int i = 0;
i < tubeRange.size();
i++) {
1534 TLine
l(hDead->GetBinLowEdge(tubeRange.at(
i).x1) + hDead->GetBinWidth(tubeRange.at(
1535 i).x1) / 2.0,
ML_POS, hDead->GetBinLowEdge(tubeRange.at(
1536 i).x2) + hDead->GetBinWidth(tubeRange.at(
1539 if (
i % 2 == 0)
l.SetLineColor(kViolet);
1540 else l.SetLineColor(kViolet + 6);
1541 int multilayer =
i + 1;
1543 rangeLines_onlyMLLMezz.push_back(
l);
1544 if (
AinB(multilayer, deadML)) {
1545 l.SetLineColor(kRed);
1547 rangeLines.push_back(
l);
1548 }
else if (draw_Mezz_L_ML_guidlines) {
1550 rangeLines.push_back(
l);
1555 tubeRange =
getMezzRanges(chamberName, hDead->GetNbinsX(), groupsPerLayer);
1556 for (
unsigned int i = 0;
i < tubeRange.size();
i++) {
1557 TLine
l(hDead->GetBinLowEdge(tubeRange.at(
i).x1) + hDead->GetBinWidth(tubeRange.at(
1558 i).x1) / 2.0,
MEZZ_POS, hDead->GetBinLowEdge(tubeRange.at(
1559 i).x2) + hDead->GetBinWidth(tubeRange.at(
1562 l.SetLineColor(kViolet + (
i % groupsPerLayer));
1563 int mezz =
i % groupsPerLayer + 1;
1565 if (numML == 2 &&
i >= tubeRange.size() / 2) {
1566 mezz += groupsPerLayer;
1569 rangeLines_onlyMLLMezz.push_back(
l);
1570 if (
AinB(mezz, deadMEZZ)) {
1571 l.SetLineColor(kRed);
1573 rangeLines.push_back(
l);
1574 }
else if (draw_Mezz_L_ML_guidlines) {
1576 rangeLines.push_back(
l);
1581 std::vector<TLine> rangeLines_dead;
1584 double dev_low =
mean - stddev;
1585 double dev_high =
mean + stddev;
1587 if (dev_high > 2. * hDead->GetMaximum()) dev_high = 2. * hDead->GetMaximum() - 1.;
1589 TLine l_mean(hDead->GetBinLowEdge(1),
mean, hDead->GetBinLowEdge(hDead->GetNbinsX()),
mean);
1590 l_mean.SetLineColor(kGreen + 3);
1591 l_mean.SetLineWidth(2);
1592 rangeLines_dead.push_back(l_mean);
1593 TLine l_dev_low(hDead->GetBinLowEdge(1), dev_low, hDead->GetBinLowEdge(hDead->GetNbinsX()), dev_low);
1594 l_dev_low.SetLineColor(kGreen);
1595 l_dev_low.SetLineWidth(2);
1596 rangeLines_dead.push_back(l_dev_low);
1597 TLine l_dev_high(hDead->GetBinLowEdge(1), dev_high, hDead->GetBinLowEdge(hDead->GetNbinsX()), dev_high);
1598 l_dev_high.SetLineColor(kGreen);
1599 l_dev_high.SetLineWidth(2);
1600 rangeLines_dead.push_back(l_dev_high);
1602 std::vector<TLine> rangeLines_noise;
1605 dev_low =
mean - stddev;
1606 dev_high =
mean + stddev;
1608 if (dev_high > 2. * hNoise->GetMaximum()) dev_high = 2. * hNoise->GetMaximum() - 1.;
1610 TLine l_mean(hNoise->GetBinLowEdge(1),
mean, hNoise->GetBinLowEdge(hNoise->GetNbinsX()),
mean);
1611 l_mean.SetLineColor(kGreen + 3);
1612 l_mean.SetLineWidth(2);
1613 rangeLines_noise.push_back(l_mean);
1614 TLine l_dev_low(hNoise->GetBinLowEdge(1), dev_low, hNoise->GetBinLowEdge(hNoise->GetNbinsX()), dev_low);
1615 l_dev_low.SetLineColor(kGreen);
1616 l_dev_low.SetLineWidth(2);
1617 rangeLines_noise.push_back(l_dev_low);
1618 TLine l_dev_high(hNoise->GetBinLowEdge(1), dev_high, hNoise->GetBinLowEdge(hNoise->GetNbinsX()), dev_high);
1619 l_dev_high.SetLineColor(kGreen);
1620 l_dev_high.SetLineWidth(2);
1621 rangeLines_noise.push_back(l_dev_high);
1625 for (
unsigned i = 0;
i != noisyTubes->size(); ++
i) {
1626 int TubeId = noisyTubes->at(
i);
1627 if (hNoise->At(TubeId) < 1.) {
1629 hOnlyNoise->SetBinError(TubeId, 0.001);
1631 if (separate_dead_noisy_histos) hOnlyNoise->SetBinContent(TubeId, hNoise->GetBinContent(TubeId));
1632 else hOnlyNoise->SetBinContent(TubeId, hDead->GetBinContent(TubeId));
1633 hOnlyNoise->SetBinError(TubeId, 0.001);
1637 for (
unsigned i = 0;
i != deadTubes->size(); ++
i) {
1638 int TubeId = deadTubes->at(
i);
1639 if (hDead->At(TubeId) < 1.) {
1641 hOnlyDead->SetBinError(TubeId, 0.001);
1643 hOnlyDead->SetBinContent(TubeId, hDead->GetBinContent(TubeId));
1644 hOnlyDead->SetBinError(TubeId, 0.001);
1648 for (
unsigned i = 0;
i != maskedTubesForDead.size(); ++
i) {
1649 int TubeId = maskedTubesForDead.at(
i);
1650 if (hDead->At(TubeId) < 1.) {
1652 hOnlyMaskedDead->SetBinError(TubeId, 0.001);
1654 hOnlyMaskedDead->SetBinContent(TubeId, hDead->GetBinContent(TubeId));
1655 hOnlyMaskedDead->SetBinError(TubeId, 0.001);
1671 double maxy_dead = hDead->GetMaximum() + 1.1;
1672 hDead->SetAxisRange(0.1, 2 * maxy_dead,
"y");
1673 hOnlyDead->SetMarkerColor(kRed);
1674 hOnlyDead->SetMarkerStyle(22);
1675 hOnlyDead->SetMarkerSize(1);
1676 hOnlyDead->SetAxisRange(0.1, 2 * maxy_dead,
"y");
1677 hOnlyMaskedDead->SetMarkerColor(kBlue);
1678 hOnlyMaskedDead->SetMarkerStyle(21);
1679 hOnlyMaskedDead->SetMarkerSize(.5);
1680 hOnlyMaskedDead->SetAxisRange(0.1, 2 * maxy_dead,
"y");
1682 double maxy_noise = hNoise->GetMaximum() + 1.1;
1683 hNoise->SetAxisRange(0.1, 2 * maxy_noise,
"y");
1684 hOnlyNoise->SetMarkerColor(kRed);
1685 hOnlyNoise->SetMarkerStyle(22);
1686 hOnlyNoise->SetMarkerSize(1);
1687 hOnlyNoise->SetAxisRange(0.1, 2 * maxy_noise,
"y");
1691 TText validityFailAll(1, 1,
"FAILED VALIDITY CHECKS");
1692 TText validityFailDead(1, 1,
"FAILED VALIDITY CHECKS FOR DEAD TUBES");
1693 TText validityFailNoise(2, 2,
"FAILED VALIDITY CHECKS FOR NOISY TUBES");
1694 TText validityFailNoiseRetry(1, 1,
"VALIDITY: USING ALL HITS HISTO");
1699 if (draw_masked_tubes) hOnlyMaskedDead->Draw(
"same");
1700 hOnlyDead->Draw(
"same");
1701 for (
unsigned int i = 0;
i < rangeLines.size();
i++) rangeLines.at(
i).Draw(
"same");
1703 for (
unsigned int i = 0;
i < rangeLines_dead.size();
i++) rangeLines_dead.at(
i).Draw(
"same");
1705 if (deadTubesChamberValidity != 1 && draw_validity_message) validityFailDead.Draw(
"same");
1706 if (separate_dead_noisy_histos) {
1710 hOnlyNoise->Draw(
"same");
1712 for (
unsigned int i = 0;
i < rangeLines.size();
i++) rangeLines_onlyMLLMezz.at(
i).Draw(
"same");
1714 for (
unsigned int i = 0;
i < rangeLines_dead.size();
i++) rangeLines_noise.at(
i).Draw(
"same");
1716 if (draw_validity_message) {
1717 if (noisyTubesChamberValidity == 2) validityFailNoiseRetry.Draw(
"same");
1718 else if (noisyTubesChamberValidity != 1) validityFailAll.Draw(
"same");
1721 if (noisyTubesChamberValidity != 1 && draw_validity_message) validityFailNoise.Draw(
"same");
1722 hOnlyNoise->Draw(
"same");
1725 std::ostringstream Out;
1727 TString ecapStr =
"MDTBADead";
1728 if (chamberName(0, 1) ==
"B" && chamberName(4, 1) ==
"C") ecapStr =
"MDTBCDead";
1729 else if (chamberName(0, 1) ==
"E" && chamberName(4, 1) ==
"A") ecapStr =
"MDTEADead";
1730 else if (chamberName(0, 1) ==
"E" && chamberName(4, 1) ==
"C") ecapStr =
"MDTECDead";
1732 Out << inFilename <<
"." << ecapStr <<
".pdf";
1734 c->Print(Out.str().c_str(),
"pdf");
1737 delete hOnlyMaskedDead;