30 EcalPedestalsHist() :
cond::payloadInspector::PlotImage<
EcalPedestals>(
"ECAL pedestal map") { setSingleIov(
true); }
31 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
33 TH1F** barrel_m =
new TH1F*[
kGains];
34 TH1F** endcap_m =
new TH1F*[
kGains];
35 TH1F** barrel_r =
new TH1F*[
kGains];
36 TH1F** endcap_r =
new TH1F*[
kGains];
39 float emin[
kGains] = {1.5, 0.8, 0.4};
40 float emax[
kGains] = {3.0, 2.0, 1.0};
49 auto iov = iovs.front();
50 std::shared_ptr<EcalPedestals>
payload = fetchPayload(std::get<1>(iov));
51 unsigned int run = std::get<0>(iov);
54 if (
payload->barrelItems().empty())
60 barrel_m[0]->Fill((*
payload)[rawid].mean_x12);
61 barrel_r[0]->Fill((*
payload)[rawid].rms_x12);
62 barrel_m[1]->Fill((*
payload)[rawid].mean_x6);
63 barrel_r[1]->Fill((*
payload)[rawid].rms_x6);
64 barrel_m[2]->Fill((*
payload)[rawid].mean_x1);
65 barrel_r[2]->Fill((*
payload)[rawid].rms_x1);
67 if (
payload->endcapItems().empty())
71 for (
int iz = -1; iz < 2; iz = iz + 2)
76 uint32_t rawid = myEEId.
rawId();
79 endcap_m[0]->Fill((*
payload)[rawid].mean_x12);
80 endcap_r[0]->Fill((*
payload)[rawid].rms_x12);
81 endcap_m[1]->Fill((*
payload)[rawid].mean_x6);
82 endcap_r[1]->Fill((*
payload)[rawid].rms_x6);
83 endcap_m[2]->Fill((*
payload)[rawid].mean_x1);
84 endcap_r[2]->Fill((*
payload)[rawid].rms_x1);
90 gStyle->SetPalette(1);
91 gStyle->SetOptStat(111110);
92 TCanvas
canvas(
"CC map",
"CC map", 1600, 2600);
97 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Pedestals, IOV %i",
run));
99 float xmi[2] = {0.0, 0.50};
100 float xma[2] = {0.50, 1.00};
101 TPad*** pad =
new TPad**[6];
102 for (
int gId = 0; gId < 6; gId++) {
103 pad[gId] =
new TPad*[2];
107 float yma = 0.94 - (0.16 * gId);
108 float ymi = yma - 0.14;
109 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId), Form(
"p_%i_%i",
obj, gId), xmi[
obj], ymi, xma[
obj], yma);
110 pad[gId][
obj]->Draw();
113 for (
int gId = 0; gId <
kGains; gId++) {
115 barrel_m[gId]->Draw();
116 pad[gId +
kGains][0]->cd();
117 barrel_r[gId]->Draw();
119 endcap_m[gId]->Draw();
120 pad[gId +
kGains][1]->cd();
121 endcap_r[gId]->Draw();
125 canvas.SaveAs(ImageName.c_str());
136 EcalPedestalsPlot() :
cond::payloadInspector::PlotImage<
EcalPedestals>(
"ECAL pedestal map") { setSingleIov(
true); }
137 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
139 TH2F** barrel_m =
new TH2F*[
kGains];
140 TH2F** endc_p_m =
new TH2F*[
kGains];
141 TH2F** endc_m_m =
new TH2F*[
kGains];
142 TH2F** barrel_r =
new TH2F*[
kGains];
143 TH2F** endc_p_r =
new TH2F*[
kGains];
144 TH2F** endc_m_r =
new TH2F*[
kGains];
148 for (
int gId = 0; gId <
kGains; gId++) {
149 barrel_m[gId] =
new TH2F(Form(
"EBm%i", gId),
157 endc_p_m[gId] =
new TH2F(Form(
"EE+m%i", gId),
165 endc_m_m[gId] =
new TH2F(Form(
"EE-m%i", gId),
173 barrel_r[gId] =
new TH2F(Form(
"EBr%i", gId),
181 endc_p_r[gId] =
new TH2F(Form(
"EE+r%i", gId),
189 endc_m_r[gId] =
new TH2F(Form(
"EE-r%i", gId),
204 auto iov = iovs.front();
205 std::shared_ptr<EcalPedestals>
payload = fetchPayload(std::get<1>(iov));
206 unsigned int run = std::get<0>(iov);
209 if (
payload->barrelItems().empty())
222 Double_t
val = (*payload)[rawid].rms_x12;
225 EBmean[0] = EBmean[0] +
val;
226 EBrms[0] = EBrms[0] +
val *
val;
231 val = (*payload)[rawid].rms_x6;
234 EBmean[1] = EBmean[1] +
val;
235 EBrms[1] = EBrms[1] +
val *
val;
240 val = (*payload)[rawid].rms_x1;
243 EBmean[2] = EBmean[2] +
val;
244 EBrms[2] = EBrms[2] +
val *
val;
249 if (
payload->endcapItems().empty())
253 for (
int iz = -1; iz < 2; iz = iz + 2)
258 uint32_t rawid = myEEId.
rawId();
262 endc_p_m[0]->Fill(
ix,
iy, (*
payload)[rawid].mean_x12);
263 Double_t
val = (*payload)[rawid].rms_x12;
264 endc_p_r[0]->Fill(
ix,
iy,
val);
266 EEmean[0] = EEmean[0] +
val;
267 EErms[0] = EErms[0] +
val *
val;
270 endc_p_m[1]->Fill(
ix,
iy, (*
payload)[rawid].mean_x6);
271 val = (*payload)[rawid].rms_x6;
272 endc_p_r[1]->Fill(
ix,
iy,
val);
274 EEmean[1] = EEmean[1] +
val;
275 EErms[1] = EErms[1] +
val *
val;
278 endc_p_m[2]->Fill(
ix,
iy, (*
payload)[rawid].mean_x1);
279 val = (*payload)[rawid].rms_x1;
280 endc_p_r[2]->Fill(
ix,
iy,
val);
282 EEmean[2] = EEmean[2] +
val;
283 EErms[2] = EErms[2] +
val *
val;
287 endc_m_m[0]->Fill(
ix,
iy, (*
payload)[rawid].mean_x12);
288 Double_t
val = (*payload)[rawid].rms_x12;
289 endc_m_r[0]->Fill(
ix,
iy,
val);
291 EEmean[0] = EEmean[0] +
val;
292 EErms[0] = EErms[0] +
val *
val;
295 endc_m_m[1]->Fill(
ix,
iy, (*
payload)[rawid].mean_x6);
296 val = (*payload)[rawid].rms_x6;
297 endc_m_r[1]->Fill(
ix,
iy,
val);
299 EEmean[1] = EEmean[1] +
val;
300 EErms[1] = EErms[1] +
val *
val;
303 endc_m_m[2]->Fill(
ix,
iy, (*
payload)[rawid].mean_x1);
304 val = (*payload)[rawid].rms_x1;
305 endc_m_r[2]->Fill(
ix,
iy,
val);
307 EEmean[2] = EEmean[2] +
val;
308 EErms[2] = EErms[2] +
val *
val;
317 gStyle->SetPalette(1);
318 gStyle->SetOptStat(0);
319 TCanvas
canvas(
"CC map",
"CC map", 1600, 2600);
323 t1.SetTextSize(0.05);
324 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Pedestals, IOV %i",
run));
326 float xmi[3] = {0.0, 0.24, 0.76};
327 float xma[3] = {0.24, 0.76, 1.00};
328 TPad*** pad =
new TPad**[6];
330 for (
int gId = 0; gId <
kGains; gId++) {
332 pad[
view] =
new TPad*[3];
334 float yma = 0.94 - (0.16 *
view);
335 float ymi = yma - 0.14;
342 double vt = (double)EBtot[gId];
343 EBmean[gId] = EBmean[gId] / vt;
344 EBrms[gId] = (EBrms[gId] / vt) - (EBmean[gId] * EBmean[gId]);
345 EBrms[gId] =
sqrt(EBrms[gId]);
346 if (EBrms[gId] == 0.)
348 pEBmin[gId] = EBmean[gId] - kRMS * EBrms[gId];
349 pEBmax[gId] = EBmean[gId] + kRMS * EBrms[gId];
352 if (pEBmin[gId] < 0.)
354 vt = (double)EEtot[gId];
355 EEmean[gId] = EEmean[gId] / vt;
356 EErms[gId] = (EErms[gId] / vt) - (EEmean[gId] * EEmean[gId]);
357 EErms[gId] =
sqrt(EErms[gId]);
358 if (EErms[gId] == 0.)
360 pEEmin[gId] = EEmean[gId] - kRMS * EErms[gId];
361 pEEmax[gId] = EEmean[gId] + kRMS * EErms[gId];
364 if (pEEmin[gId] < 0.)
373 for (
int gId = 0; gId <
kGains; gId++) {
375 DrawEE(endc_m_m[gId], 180., 300.);
376 pad[gId +
kGains][0]->cd();
377 DrawEE(endc_m_r[gId], pEEmin[gId], pEEmax[gId]);
379 DrawEB(barrel_m[gId], 180., 240.);
380 pad[gId +
kGains][1]->cd();
381 DrawEB(barrel_r[gId], pEBmin[gId], pEBmax[gId]);
383 DrawEE(endc_p_m[gId], 180., 300.);
384 pad[gId +
kGains][2]->cd();
385 DrawEE(endc_p_r[gId], pEEmin[gId], pEEmax[gId]);
389 canvas.SaveAs(ImageName.c_str());
398 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags,
int method>
401 EcalPedestalsBase() :
cond::payloadInspector::PlotImage<
EcalPedestals, nIOVs, ntags>(
"ECAL pedestals comparison") {}
402 bool fill()
override {
404 TH2F** barrel_m =
new TH2F*[
kGains];
405 TH2F** endc_p_m =
new TH2F*[
kGains];
406 TH2F** endc_m_m =
new TH2F*[
kGains];
407 TH2F** barrel_r =
new TH2F*[
kGains];
408 TH2F** endc_p_r =
new TH2F*[
kGains];
409 TH2F** endc_m_r =
new TH2F*[
kGains];
413 for (
int gId = 0; gId <
kGains; gId++) {
414 barrel_m[gId] =
new TH2F(Form(
"EBm%i", gId),
422 endc_p_m[gId] =
new TH2F(Form(
"EE+m%i", gId),
430 endc_m_m[gId] =
new TH2F(Form(
"EE-m%i", gId),
438 barrel_r[gId] =
new TH2F(Form(
"EBr%i", gId),
446 endc_p_r[gId] =
new TH2F(Form(
"EE+r%i", gId),
454 endc_m_r[gId] =
new TH2F(Form(
"EE-r%i", gId),
469 unsigned int run[2] = {0, 0};
475 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
476 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
477 auto firstiov = iovs.front();
478 run[0] = std::get<0>(firstiov);
479 std::tuple<cond::Time_t, cond::Hash> lastiov;
481 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
482 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
483 lastiov = tag2iovs.front();
485 lastiov = iovs.back();
486 l_tagname[1] = l_tagname[0];
488 run[1] = std::get<0>(lastiov);
489 for (
int irun = 0; irun < nIOVs; irun++) {
490 std::shared_ptr<EcalPedestals>
payload;
492 payload = this->fetchPayload(std::get<1>(firstiov));
494 payload = this->fetchPayload(std::get<1>(lastiov));
498 if (!
payload->barrelItems().empty()) {
505 meanEB[0][cellid] = (*payload)[rawid].mean_x12;
506 rmsEB[0][cellid] = (*payload)[rawid].rms_x12;
507 meanEB[1][cellid] = (*payload)[rawid].mean_x6;
508 rmsEB[1][cellid] = (*payload)[rawid].rms_x6;
509 meanEB[2][cellid] = (*payload)[rawid].mean_x1;
510 rmsEB[2][cellid] = (*payload)[rawid].rms_x1;
520 float val = (*payload)[rawid].mean_x12;
521 float valr = (*payload)[rawid].rms_x12;
523 dr =
val - meanEB[0][cellid];
524 drms = valr - rmsEB[0][cellid];
526 if (meanEB[0][cellid] == 0) {
532 dr =
val / meanEB[0][cellid];
533 if (rmsEB[0][cellid] == 0) {
539 drms = valr / rmsEB[0][cellid];
542 barrel_r[0]->Fill(
phi,
eta, drms);
544 EBmean[0] = EBmean[0] + drms;
545 EBrms[0] = EBrms[0] + drms * drms;
549 val = (*payload)[rawid].mean_x6;
550 valr = (*payload)[rawid].rms_x6;
552 dr =
val - meanEB[1][cellid];
553 drms = valr - rmsEB[1][cellid];
555 if (meanEB[1][cellid] == 0) {
561 dr =
val / meanEB[1][cellid];
562 if (rmsEB[1][cellid] == 0) {
568 drms = valr / rmsEB[1][cellid];
571 barrel_r[1]->Fill(
phi,
eta, drms);
573 EBmean[1] = EBmean[1] + drms;
574 EBrms[1] = EBrms[1] + drms * drms;
578 val = (*payload)[rawid].mean_x1;
579 valr = (*payload)[rawid].rms_x1;
581 dr =
val - meanEB[2][cellid];
582 drms = valr - rmsEB[2][cellid];
584 if (meanEB[2][cellid] == 0) {
590 dr =
val / meanEB[2][cellid];
591 if (rmsEB[2][cellid] == 0) {
597 drms = valr / rmsEB[2][cellid];
600 barrel_r[2]->Fill(
phi,
eta, drms);
602 EBmean[2] = EBmean[2] + drms;
603 EBrms[2] = EBrms[2] + drms * drms;
609 if (
payload->endcapItems().empty()) {
611 for (
int iz = -1; iz < 2; iz = iz + 2) {
616 uint32_t rawid = myEEId.
rawId();
621 meanEE[0][
index] = (*payload)[rawid].mean_x12;
622 rmsEE[0][
index] = (*payload)[rawid].rms_x12;
623 meanEE[1][
index] = (*payload)[rawid].mean_x6;
624 rmsEE[1][
index] = (*payload)[rawid].rms_x6;
625 meanEE[2][
index] = (*payload)[rawid].mean_x1;
626 rmsEE[2][
index] = (*payload)[rawid].rms_x1;
631 float val = (*payload)[rawid].mean_x12;
632 float valr = (*payload)[rawid].rms_x12;
635 drms = valr - rmsEE[0][
index];
637 if (meanEE[0][
index] == 0) {
644 if (rmsEE[0][
index] == 0) {
650 drms = valr / rmsEE[0][
index];
653 endc_p_m[0]->Fill(
ix,
iy,
dr);
654 endc_p_r[0]->Fill(
ix,
iy, drms);
656 endc_m_m[0]->Fill(
ix,
iy,
dr);
657 endc_m_r[0]->Fill(
ix,
iy, drms);
660 EEmean[0] = EEmean[0] + drms;
661 EErms[0] = EErms[0] + drms * drms;
665 val = (*payload)[rawid].mean_x6;
666 valr = (*payload)[rawid].rms_x6;
669 drms = valr - rmsEE[1][
index];
671 if (meanEE[1][
index] == 0) {
678 if (rmsEE[1][
index] == 0) {
684 drms = valr / rmsEE[1][
index];
687 endc_p_m[1]->Fill(
ix,
iy,
dr);
688 endc_p_r[1]->Fill(
ix,
iy, drms);
690 endc_m_m[1]->Fill(
ix,
iy,
dr);
691 endc_m_r[1]->Fill(
ix,
iy, drms);
694 EEmean[1] = EEmean[1] + drms;
695 EErms[1] = EErms[1] + drms * drms;
699 val = (*payload)[rawid].mean_x1;
700 valr = (*payload)[rawid].rms_x1;
703 drms = valr - rmsEE[2][
index];
705 if (meanEE[2][
index] == 0) {
712 if (rmsEE[2][
index] == 0) {
718 drms = valr / rmsEE[2][
index];
721 endc_p_m[2]->Fill(
ix,
iy,
dr);
722 endc_p_r[2]->Fill(
ix,
iy, drms);
724 endc_m_m[2]->Fill(
ix,
iy,
dr);
725 endc_m_r[2]->Fill(
ix,
iy, drms);
728 EEmean[2] = EEmean[2] + drms;
729 EErms[2] = EErms[2] + drms * drms;
743 gStyle->SetPalette(1);
744 gStyle->SetOptStat(0);
745 TCanvas
canvas(
"CC map",
"CC map", 1600, 2600);
749 int len = l_tagname[0].length() + l_tagname[1].length();
753 t1.SetTextSize(0.025);
756 Form(
"%s IOV %i %s %s IOV %i",
757 l_tagname[1].c_str(),
760 l_tagname[0].c_str(),
763 t1.SetTextSize(0.05);
764 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Pedestals, IOV %i %s %i",
run[1],
dr[
method].c_str(),
run[0]));
767 t1.SetTextSize(0.05);
768 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i %s %i", l_tagname[0].c_str(),
run[1],
dr[
method].c_str(),
run[0]));
770 float xmi[3] = {0.0, 0.24, 0.76};
771 float xma[3] = {0.24, 0.76, 1.00};
772 TPad*** pad =
new TPad**[6];
774 for (
int gId = 0; gId <
kGains; gId++) {
776 pad[
view] =
new TPad*[3];
778 float yma = 0.94 - (0.16 *
view);
779 float ymi = yma - 0.14;
786 double vt = (double)EBtot[gId];
787 EBmean[gId] = EBmean[gId] / vt;
788 EBrms[gId] = (EBrms[gId] / vt) - (EBmean[gId] * EBmean[gId]);
789 EBrms[gId] =
sqrt(EBrms[gId]);
790 if (EBrms[gId] == 0.)
792 pEBmin[gId] = EBmean[gId] - kRMS * EBrms[gId];
793 pEBmax[gId] = EBmean[gId] + kRMS * EBrms[gId];
796 vt = (double)EEtot[gId];
797 EEmean[gId] = EEmean[gId] / vt;
798 EErms[gId] = (EErms[gId] / vt) - (EEmean[gId] * EEmean[gId]);
799 EErms[gId] =
sqrt(EErms[gId]);
800 if (EErms[gId] == 0.)
802 pEEmin[gId] = EEmean[gId] - kRMS * EErms[gId];
803 pEEmax[gId] = EEmean[gId] + kRMS * EErms[gId];
807 for (
int gId = 0; gId <
kGains; gId++) {
809 DrawEE(endc_m_m[gId], -2., 2.);
810 pad[gId +
kGains][0]->cd();
811 DrawEE(endc_m_r[gId], pEEmin[gId], pEEmax[gId]);
813 DrawEB(barrel_m[gId], -2., 2.);
814 pad[gId +
kGains][1]->cd();
815 DrawEB(barrel_r[gId], pEBmin[gId], pEBmax[gId]);
817 DrawEE(endc_p_m[gId], -2., 2.);
818 pad[gId +
kGains][2]->cd();
819 DrawEE(endc_p_r[gId], pEEmin[gId], pEEmax[gId]);
823 canvas.SaveAs(ImageName.c_str());
827 using EcalPedestalsDiffOneTag = EcalPedestalsBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
828 using EcalPedestalsDiffTwoTags = EcalPedestalsBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
829 using EcalPedestalsRatioOneTag = EcalPedestalsBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
830 using EcalPedestalsRatioTwoTags = EcalPedestalsBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
839 EcalPedestalsEBMean12Map()
840 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel pedestal gain12 - map",
849 Base::setSingleIov(
true);
853 bool fill()
override {
854 auto tag = PlotBase::getTag<0>();
855 for (
auto const& iov :
tag.iovs) {
856 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
859 if (
payload->barrelItems().empty())
863 fillWithValue(
iphi, 0, 200);
870 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
878 float valped = (*payload)[rawid].mean_x12;
892 EcalPedestalsEBMean6Map()
893 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel pedestal gain6 - map",
902 Base::setSingleIov(
true);
905 bool fill()
override {
906 auto tag = PlotBase::getTag<0>();
907 for (
auto const& iov :
tag.iovs) {
908 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
911 if (
payload->barrelItems().empty())
915 fillWithValue(
iphi, 0, 200);
922 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
926 float valped = (*payload)[rawid].mean_x6;
940 EcalPedestalsEBMean1Map()
941 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel pedestal gain1 - map",
950 Base::setSingleIov(
true);
953 bool fill()
override {
954 auto tag = PlotBase::getTag<0>();
955 for (
auto const& iov :
tag.iovs) {
956 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
959 if (
payload->barrelItems().empty())
963 fillWithValue(
iphi, 0, 200);
970 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
974 float valped = (*payload)[rawid].mean_x1;
988 EcalPedestalsEEMean12Map()
989 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain12 - map",
998 Base::setSingleIov(
true);
1002 bool fill()
override {
1003 auto tag = PlotBase::getTag<0>();
1004 for (
auto const& iov :
tag.iovs) {
1005 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1007 if (
payload->endcapItems().empty())
1011 for (
int iz = -1; iz < 2; iz = iz + 2)
1016 uint32_t rawid = myEEId.
rawId();
1020 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1023 float valped = (*payload)[rawid].mean_x12;
1028 fillWithValue(
ix,
iy, valped);
1041 EcalPedestalsEEMean6Map()
1042 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain6 - map",
1051 Base::setSingleIov(
true);
1054 bool fill()
override {
1055 auto tag = PlotBase::getTag<0>();
1056 for (
auto const& iov :
tag.iovs) {
1057 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1059 if (
payload->endcapItems().empty())
1063 for (
int iz = -1; iz < 2; iz = iz + 2)
1068 uint32_t rawid = myEEId.
rawId();
1072 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1075 float valped = (*payload)[rawid].mean_x6;
1080 fillWithValue(
ix,
iy, valped);
1092 EcalPedestalsEEMean1Map()
1093 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain1 - map",
1102 Base::setSingleIov(
true);
1105 bool fill()
override {
1106 auto tag = PlotBase::getTag<0>();
1107 for (
auto const& iov :
tag.iovs) {
1108 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1110 if (
payload->endcapItems().empty())
1114 for (
int iz = -1; iz < 2; iz = iz + 2)
1119 uint32_t rawid = myEEId.
rawId();
1123 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1126 float valped = (*payload)[rawid].mean_x1;
1131 fillWithValue(
ix,
iy, valped);
1143 EcalPedestalsEBRMS12Map()
1144 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain12 - map",
1153 Base::setSingleIov(
true);
1157 bool fill()
override {
1158 auto tag = PlotBase::getTag<0>();
1159 for (
auto const& iov :
tag.iovs) {
1160 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1163 if (
payload->barrelItems().empty())
1167 fillWithValue(
iphi, 0, 2);
1174 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1182 float valrms = (*payload)[rawid].rms_x12;
1195 EcalPedestalsEBRMS6Map()
1196 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain6 - map",
1205 Base::setSingleIov(
true);
1208 bool fill()
override {
1209 auto tag = PlotBase::getTag<0>();
1210 for (
auto const& iov :
tag.iovs) {
1211 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1214 if (
payload->barrelItems().empty())
1218 fillWithValue(
iphi, 0, 1);
1225 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1229 float valrms = (*payload)[rawid].rms_x6;
1242 EcalPedestalsEBRMS1Map()
1243 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain1 - map",
1252 Base::setSingleIov(
true);
1255 bool fill()
override {
1256 auto tag = PlotBase::getTag<0>();
1257 for (
auto const& iov :
tag.iovs) {
1258 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1261 if (
payload->barrelItems().empty())
1265 fillWithValue(
iphi, 0, 0.5);
1272 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
1276 float valrms = (*payload)[rawid].rms_x1;
1289 EcalPedestalsEERMS12Map()
1290 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain12 - map",
1299 Base::setSingleIov(
true);
1303 bool fill()
override {
1304 auto tag = PlotBase::getTag<0>();
1305 for (
auto const& iov :
tag.iovs) {
1306 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1308 if (
payload->endcapItems().empty())
1312 for (
int iz = -1; iz < 2; iz = iz + 2)
1317 uint32_t rawid = myEEId.
rawId();
1321 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1324 float valrms = (*payload)[rawid].rms_x12;
1328 fillWithValue(
ix,
iy, valrms);
1341 EcalPedestalsEERMS6Map()
1342 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain6 - map",
1351 Base::setSingleIov(
true);
1354 bool fill()
override {
1355 auto tag = PlotBase::getTag<0>();
1356 for (
auto const& iov :
tag.iovs) {
1357 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1359 if (
payload->endcapItems().empty())
1363 for (
int iz = -1; iz < 2; iz = iz + 2)
1368 uint32_t rawid = myEEId.
rawId();
1372 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1375 float valrms = (*payload)[rawid].rms_x6;
1379 fillWithValue(
ix,
iy, valrms);
1391 EcalPedestalsEERMS1Map()
1392 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain1 - map",
1401 Base::setSingleIov(
true);
1404 bool fill()
override {
1405 auto tag = PlotBase::getTag<0>();
1406 for (
auto const& iov :
tag.iovs) {
1407 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1409 if (
payload->endcapItems().empty())
1413 for (
int iz = -1; iz < 2; iz = iz + 2)
1418 uint32_t rawid = myEEId.
rawId();
1422 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1425 float valrms = (*payload)[rawid].rms_x1;
1429 fillWithValue(
ix,
iy, valrms);
1444 EcalPedestalsSummaryPlot() :
cond::payloadInspector::PlotImage<
EcalPedestals>(
"Ecal Pedestals Summary - map ") {
1448 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
1449 auto iov = iovs.front();
1450 std::shared_ptr<EcalPedestals>
payload =
1451 fetchPayload(std::get<1>(iov));
1452 unsigned int run = std::get<0>(iov);
1460 align =
new TH2F(
"Ecal Pedestals Summary",
1461 "EB/EE Gain Mean RMS Total Items",
1469 float ebVals[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
1470 float eeVals[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
1472 long unsigned int ebTotal = (
payload->barrelItems()).
size();
1473 long unsigned int eeTotal = (
payload->endcapItems()).
size();
1475 pedestalsSummary(
payload->barrelItems(), ebVals, ebTotal);
1476 pedestalsSummary(
payload->endcapItems(), eeVals, eeTotal);
1478 double row = NbRows - 0.5;
1481 align->Fill(1.5, row, 12);
1482 align->Fill(2.5, row, ebVals[0]);
1483 align->Fill(3.5, row, ebVals[1]);
1487 align->Fill(0.5, row, 1);
1488 align->Fill(1.5, row, 6);
1489 align->Fill(2.5, row, ebVals[2]);
1490 align->Fill(3.5, row, ebVals[3]);
1491 align->Fill(4.5, row, ebTotal);
1495 align->Fill(1.5, row, 1);
1496 align->Fill(2.5, row, ebVals[4]);
1497 align->Fill(3.5, row, ebVals[5]);
1502 align->Fill(1.5, row, 12);
1503 align->Fill(2.5, row, eeVals[0]);
1504 align->Fill(3.5, row, eeVals[1]);
1508 align->Fill(0.5, row, 2);
1509 align->Fill(1.5, row, 6);
1510 align->Fill(2.5, row, eeVals[2]);
1511 align->Fill(3.5, row, eeVals[3]);
1512 align->Fill(4.5, row, eeTotal);
1516 align->Fill(1.5, row, 1);
1517 align->Fill(2.5, row, eeVals[4]);
1518 align->Fill(3.5, row, eeVals[5]);
1524 gStyle->SetPalette(1);
1525 gStyle->SetOptStat(0);
1526 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
1529 t1.SetTextAlign(26);
1530 t1.SetTextSize(0.05);
1532 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Pedestals Summary, IOV %i",
run));
1534 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
1537 align->Draw(
"TEXT");
1538 TLine*
l =
new TLine;
1541 for (
int i = 1;
i < NbRows;
i++) {
1542 double y = (double)
i;
1543 if (
i == NbRows / 2)
1544 l =
new TLine(0.,
y, NbColumns,
y);
1546 l =
new TLine(1.,
y, NbColumns - 1,
y);
1550 for (
int i = 1;
i < NbColumns;
i++) {
1551 double x = (double)
i;
1552 double y = (double)NbRows;
1553 l =
new TLine(
x, 0.,
x,
y);
1557 align->GetXaxis()->SetTickLength(0.);
1558 align->GetXaxis()->SetLabelSize(0.);
1559 align->GetYaxis()->SetTickLength(0.);
1560 align->GetYaxis()->SetLabelSize(0.);
1563 canvas.SaveAs(ImageName.c_str());
1567 void pedestalsSummary(std::vector<EcalPedestal> vItems,
float vals[],
long unsigned int&
total) {
1568 for (std::vector<EcalPedestal>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
1570 vals[0] += iItems->mean(1);
1571 vals[1] += iItems->rms(1);
1572 vals[2] += iItems->mean(2);
1573 vals[3] += iItems->rms(2);
1574 vals[4] += iItems->mean(3);
1575 vals[5] += iItems->rms(3);
1578 vals[0] = vals[0] /
total;
1579 vals[1] = vals[1] /
total;
1580 vals[2] = vals[2] /
total;
1581 vals[3] = vals[3] /
total;
1582 vals[4] = vals[4] /
total;
1583 vals[5] = vals[5] /
total;
const Int_t gainValues[kGains]
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
Abs< T >::type abs(const T &t)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
constexpr uint32_t rawId() const
get the raw id
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)