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] = {2.5, 1.5, 0.8};
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], 175., 225.);
376 pad[gId +
kGains][0]->cd();
377 DrawEE(endc_m_r[gId], pEEmin[gId], pEEmax[gId]);
379 DrawEB(barrel_m[gId], 175., 225.);
380 pad[gId +
kGains][1]->cd();
381 DrawEB(barrel_r[gId], pEBmin[gId], pEBmax[gId]);
383 DrawEE(endc_p_m[gId], 175., 225.);
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())
867 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
875 float valped = (*payload)[rawid].mean_x12;
889 EcalPedestalsEBMean6Map()
890 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel pedestal gain6 - map",
899 Base::setSingleIov(
true);
902 bool fill()
override {
903 auto tag = PlotBase::getTag<0>();
904 for (
auto const& iov :
tag.iovs) {
905 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
908 if (
payload->barrelItems().empty())
916 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
920 float valped = (*payload)[rawid].mean_x6;
934 EcalPedestalsEBMean1Map()
935 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel pedestal gain1 - map",
944 Base::setSingleIov(
true);
947 bool fill()
override {
948 auto tag = PlotBase::getTag<0>();
949 for (
auto const& iov :
tag.iovs) {
950 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
953 if (
payload->barrelItems().empty())
961 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
965 float valped = (*payload)[rawid].mean_x1;
979 EcalPedestalsEEMean12Map()
980 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain12 - map",
989 Base::setSingleIov(
true);
993 bool fill()
override {
994 auto tag = PlotBase::getTag<0>();
995 for (
auto const& iov :
tag.iovs) {
996 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
998 if (
payload->endcapItems().empty())
1002 for (
int iz = -1; iz < 2; iz = iz + 2)
1007 uint32_t rawid = myEEId.
rawId();
1011 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1014 float valped = (*payload)[rawid].mean_x12;
1019 fillWithValue(ix, iy, valped);
1021 fillWithValue(ix +
IX_MAX + 20, iy, valped);
1032 EcalPedestalsEEMean6Map()
1033 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain6 - map",
1042 Base::setSingleIov(
true);
1045 bool fill()
override {
1046 auto tag = PlotBase::getTag<0>();
1047 for (
auto const& iov :
tag.iovs) {
1048 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1050 if (
payload->endcapItems().empty())
1054 for (
int iz = -1; iz < 2; iz = iz + 2)
1059 uint32_t rawid = myEEId.
rawId();
1063 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1066 float valped = (*payload)[rawid].mean_x6;
1071 fillWithValue(ix, iy, valped);
1073 fillWithValue(ix +
IX_MAX + 20, iy, valped);
1083 EcalPedestalsEEMean1Map()
1084 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap pedestal gain1 - map",
1093 Base::setSingleIov(
true);
1096 bool fill()
override {
1097 auto tag = PlotBase::getTag<0>();
1098 for (
auto const& iov :
tag.iovs) {
1099 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1101 if (
payload->endcapItems().empty())
1105 for (
int iz = -1; iz < 2; iz = iz + 2)
1110 uint32_t rawid = myEEId.
rawId();
1114 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1117 float valped = (*payload)[rawid].mean_x1;
1122 fillWithValue(ix, iy, valped);
1124 fillWithValue(ix +
IX_MAX + 20, iy, valped);
1134 EcalPedestalsEBRMS12Map()
1135 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain12 - map",
1144 Base::setSingleIov(
true);
1148 bool fill()
override {
1149 auto tag = PlotBase::getTag<0>();
1150 for (
auto const& iov :
tag.iovs) {
1151 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1154 if (
payload->barrelItems().empty())
1162 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1170 float valrms = (*payload)[rawid].rms_x12;
1183 EcalPedestalsEBRMS6Map()
1184 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain6 - map",
1193 Base::setSingleIov(
true);
1196 bool fill()
override {
1197 auto tag = PlotBase::getTag<0>();
1198 for (
auto const& iov :
tag.iovs) {
1199 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1202 if (
payload->barrelItems().empty())
1210 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1214 float valrms = (*payload)[rawid].rms_x6;
1227 EcalPedestalsEBRMS1Map()
1228 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Barrel noise gain1 - map",
1237 Base::setSingleIov(
true);
1240 bool fill()
override {
1241 auto tag = PlotBase::getTag<0>();
1242 for (
auto const& iov :
tag.iovs) {
1243 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1246 if (
payload->barrelItems().empty())
1254 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
1258 float valrms = (*payload)[rawid].rms_x1;
1271 EcalPedestalsEERMS12Map()
1272 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain12 - map",
1281 Base::setSingleIov(
true);
1285 bool fill()
override {
1286 auto tag = PlotBase::getTag<0>();
1287 for (
auto const& iov :
tag.iovs) {
1288 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1290 if (
payload->endcapItems().empty())
1294 for (
int iz = -1; iz < 2; iz = iz + 2)
1299 uint32_t rawid = myEEId.
rawId();
1303 if (!(*
payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1306 float valrms = (*payload)[rawid].rms_x12;
1310 fillWithValue(ix, iy, valrms);
1312 fillWithValue(ix +
IX_MAX + 20, iy, valrms);
1323 EcalPedestalsEERMS6Map()
1324 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain6 - map",
1333 Base::setSingleIov(
true);
1336 bool fill()
override {
1337 auto tag = PlotBase::getTag<0>();
1338 for (
auto const& iov :
tag.iovs) {
1339 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1341 if (
payload->endcapItems().empty())
1345 for (
int iz = -1; iz < 2; iz = iz + 2)
1350 uint32_t rawid = myEEId.
rawId();
1354 if (!(*
payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1357 float valrms = (*payload)[rawid].rms_x6;
1361 fillWithValue(ix, iy, valrms);
1363 fillWithValue(ix +
IX_MAX + 20, iy, valrms);
1373 EcalPedestalsEERMS1Map()
1374 :
cond::payloadInspector::Histogram2D<
EcalPedestals>(
"ECAL Endcap noise gain1 - map",
1383 Base::setSingleIov(
true);
1386 bool fill()
override {
1387 auto tag = PlotBase::getTag<0>();
1388 for (
auto const& iov :
tag.iovs) {
1389 std::shared_ptr<EcalPedestals>
payload = Base::fetchPayload(std::get<1>(iov));
1391 if (
payload->endcapItems().empty())
1395 for (
int iz = -1; iz < 2; iz = iz + 2)
1400 uint32_t rawid = myEEId.
rawId();
1404 if (!(*
payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1407 float valrms = (*payload)[rawid].rms_x1;
1411 fillWithValue(ix, iy, valrms);
1413 fillWithValue(ix +
IX_MAX + 20, iy, valrms);
1426 EcalPedestalsSummaryPlot() :
cond::payloadInspector::PlotImage<
EcalPedestals>(
"Ecal Pedestals Summary - map ") {
1430 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
1431 auto iov = iovs.front();
1432 std::shared_ptr<EcalPedestals>
payload =
1433 fetchPayload(std::get<1>(iov));
1434 unsigned int run = std::get<0>(iov);
1442 align =
new TH2F(
"Ecal Pedestals Summary",
1443 "EB/EE Gain Mean RMS Total Items",
1451 float ebVals[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
1452 float eeVals[] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
1454 long unsigned int ebTotal = (
payload->barrelItems()).
size();
1455 long unsigned int eeTotal = (
payload->endcapItems()).
size();
1457 pedestalsSummary(
payload->barrelItems(), ebVals, ebTotal);
1458 pedestalsSummary(
payload->endcapItems(), eeVals, eeTotal);
1460 double row = NbRows - 0.5;
1463 align->Fill(1.5, row, 12);
1464 align->Fill(2.5, row, ebVals[0]);
1465 align->Fill(3.5, row, ebVals[1]);
1469 align->Fill(0.5, row, 1);
1470 align->Fill(1.5, row, 6);
1471 align->Fill(2.5, row, ebVals[2]);
1472 align->Fill(3.5, row, ebVals[3]);
1473 align->Fill(4.5, row, ebTotal);
1477 align->Fill(1.5, row, 1);
1478 align->Fill(2.5, row, ebVals[4]);
1479 align->Fill(3.5, row, ebVals[5]);
1484 align->Fill(1.5, row, 12);
1485 align->Fill(2.5, row, eeVals[0]);
1486 align->Fill(3.5, row, eeVals[1]);
1490 align->Fill(0.5, row, 2);
1491 align->Fill(1.5, row, 6);
1492 align->Fill(2.5, row, eeVals[2]);
1493 align->Fill(3.5, row, eeVals[3]);
1494 align->Fill(4.5, row, eeTotal);
1498 align->Fill(1.5, row, 1);
1499 align->Fill(2.5, row, eeVals[4]);
1500 align->Fill(3.5, row, eeVals[5]);
1506 gStyle->SetPalette(1);
1507 gStyle->SetOptStat(0);
1508 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
1511 t1.SetTextAlign(26);
1512 t1.SetTextSize(0.05);
1514 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Pedestals Summary, IOV %i",
run));
1516 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
1519 align->Draw(
"TEXT");
1520 TLine*
l =
new TLine;
1523 for (
int i = 1;
i < NbRows;
i++) {
1524 double y = (double)
i;
1525 if (
i == NbRows / 2)
1526 l =
new TLine(0.,
y, NbColumns,
y);
1528 l =
new TLine(1.,
y, NbColumns - 1,
y);
1532 for (
int i = 1;
i < NbColumns;
i++) {
1533 double x = (double)
i;
1534 double y = (double)NbRows;
1535 l =
new TLine(
x, 0.,
x,
y);
1539 align->GetXaxis()->SetTickLength(0.);
1540 align->GetXaxis()->SetLabelSize(0.);
1541 align->GetYaxis()->SetTickLength(0.);
1542 align->GetYaxis()->SetLabelSize(0.);
1545 canvas.SaveAs(ImageName.c_str());
1549 void pedestalsSummary(std::vector<EcalPedestal> vItems,
float vals[],
long unsigned int&
total) {
1550 for (std::vector<EcalPedestal>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems) {
1552 vals[0] += iItems->mean(1);
1553 vals[1] += iItems->rms(1);
1554 vals[2] += iItems->mean(2);
1555 vals[3] += iItems->rms(2);
1556 vals[4] += iItems->mean(3);
1557 vals[5] += iItems->rms(3);
1560 vals[0] = vals[0] /
total;
1561 vals[1] = vals[1] /
total;
1562 vals[2] = vals[2] /
total;
1563 vals[3] = vals[3] /
total;
1564 vals[4] = vals[4] /
total;
1565 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)
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