17 #include "TPaveStats.h"
32 EcalTPGPedestalsPlot() :
cond::payloadInspector::PlotImage<
EcalTPGPedestals>(
"ECAL Gain Ratios - map ") {
36 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
37 TH2F** barrel_m =
new TH2F*[
kGains];
38 TH2F** endc_p_m =
new TH2F*[
kGains];
39 TH2F** endc_m_m =
new TH2F*[
kGains];
74 auto iov = iovs.front();
76 unsigned int run = std::get<0>(iov);
79 int thesign =
sign == 1 ? 1 : -1;
87 float val = (*payload)[
id.rawId()].mean_x12;
93 val = (*payload)[
id.rawId()].mean_x6;
99 val = (*payload)[
id.rawId()].mean_x1;
108 for (
int ix = 0; ix <
IX_MAX; ix++) {
109 for (
int iy = 0; iy <
IY_MAX; iy++) {
113 float val = (*payload)[
id.rawId()].mean_x12;
115 endc_p_m[0]->Fill(ix + 1, iy + 1,
val);
117 endc_m_m[0]->Fill(ix + 1, iy + 1,
val);
122 val = (*payload)[
id.rawId()].mean_x6;
124 endc_p_m[1]->Fill(ix + 1, iy + 1,
val);
126 endc_m_m[1]->Fill(ix + 1, iy + 1,
val);
131 val = (*payload)[
id.rawId()].mean_x1;
133 endc_p_m[2]->Fill(ix + 1, iy + 1,
val);
135 endc_m_m[2]->Fill(ix + 1, iy + 1,
val);
150 gStyle->SetPalette(1);
151 gStyle->SetOptStat(0);
152 TCanvas
canvas(
"CC map",
"CC map", 1200, 900);
156 t1.SetTextSize(0.05);
157 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Gain TPGPedestals, IOV %i",
run));
159 float xmi[3] = {0.0, 0.22, 0.78};
160 float xma[3] = {0.22, 0.78, 1.00};
161 TPad*** pad =
new TPad**[
kGains];
162 for (
int gId = 0; gId <
kGains; gId++) {
163 pad[gId] =
new TPad*[3];
165 float yma = 0.94 - (0.32 * gId);
166 float ymi = yma - 0.30;
167 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId), Form(
"p_%i_%i",
obj, gId), xmi[
obj], ymi, xma[
obj], yma);
168 pad[gId][
obj]->Draw();
172 for (
int gId = 0; gId <
kGains; gId++) {
174 DrawEE(endc_m_m[gId], mEEmin[gId], mEEmax[gId]);
176 DrawEB(barrel_m[gId], mEBmin[gId], mEBmax[gId]);
178 DrawEE(endc_p_m[gId], mEEmin[gId], mEEmax[gId]);
182 canvas.SaveAs(ImageName.c_str());
192 EcalTPGPedestalsDiff() :
cond::payloadInspector::PlotImage<
EcalTPGPedestals>(
"ECAL Gain Ratios difference") {
196 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
197 TH2F** barrel_m =
new TH2F*[
kGains];
198 TH2F** endc_p_m =
new TH2F*[
kGains];
199 TH2F** endc_m_m =
new TH2F*[
kGains];
233 unsigned int run[2], irun = 0;
235 for (
auto const& iov : iovs) {
237 run[irun] = std::get<0>(iov);
240 int thesign =
sign == 1 ? 1 : -1;
245 int hashindex =
id.hashedIndex();
249 float val = (*payload)[
id.rawId()].mean_x12;
251 mEB[0][hashindex] =
val;
253 float diff =
val - mEB[0][hashindex];
255 if (
diff < mEBmin[0])
257 if (
diff > mEBmax[0])
260 val = (*payload)[
id.rawId()].mean_x6;
262 mEB[1][hashindex] =
val;
264 float diff =
val - mEB[1][hashindex];
266 if (
diff < mEBmin[1])
268 if (
diff > mEBmax[1])
271 val = (*payload)[
id.rawId()].mean_x1;
273 mEB[2][hashindex] =
val;
275 float diff =
val - mEB[2][hashindex];
277 if (
diff < mEBmin[2])
279 if (
diff > mEBmax[2])
285 for (
int ix = 0; ix <
IX_MAX; ix++) {
286 for (
int iy = 0; iy <
IY_MAX; iy++) {
290 int hashindex =
id.hashedIndex();
291 float val = (*payload)[
id.rawId()].mean_x12;
293 mEE[0][hashindex] =
val;
295 float diff =
val - mEE[0][hashindex];
297 endc_p_m[0]->Fill(ix + 1, iy + 1,
diff);
299 endc_m_m[0]->Fill(ix + 1, iy + 1,
diff);
300 if (
diff < mEEmin[0])
302 if (
diff > mEEmax[0])
305 val = (*payload)[
id.rawId()].mean_x6;
307 mEE[1][hashindex] =
val;
309 float diff =
val - mEE[1][hashindex];
311 endc_p_m[1]->Fill(ix + 1, iy + 1,
diff);
313 endc_m_m[1]->Fill(ix + 1, iy + 1,
diff);
314 if (
diff < mEEmin[1])
316 if (
diff > mEEmax[1])
319 val = (*payload)[
id.rawId()].mean_x1;
321 mEE[2][hashindex] =
val;
323 float diff =
val - mEE[2][hashindex];
325 endc_p_m[2]->Fill(ix + 1, iy + 1,
diff);
327 endc_m_m[2]->Fill(ix + 1, iy + 1,
diff);
328 if (
diff < mEEmin[2])
330 if (
diff > mEEmax[2])
343 gStyle->SetPalette(1);
344 gStyle->SetOptStat(0);
345 TCanvas
canvas(
"CC map",
"CC map", 1200, 900);
349 t1.SetTextSize(0.05);
350 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGPedestals, IOV %i - %i",
run[1],
run[0]));
352 float xmi[3] = {0.0, 0.22, 0.78};
353 float xma[3] = {0.22, 0.78, 1.00};
354 TPad*** pad =
new TPad**[
kGains];
355 for (
int gId = 0; gId <
kGains; gId++) {
356 pad[gId] =
new TPad*[3];
358 float yma = 0.94 - (0.32 * gId);
359 float ymi = yma - 0.30;
360 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId), Form(
"p_%i_%i",
obj, gId), xmi[
obj], ymi, xma[
obj], yma);
361 pad[gId][
obj]->Draw();
365 for (
int gId = 0; gId <
kGains; gId++) {
367 DrawEE(endc_m_m[gId], mEEmin[gId], mEEmax[gId]);
369 DrawEB(barrel_m[gId], mEBmin[gId], mEBmax[gId]);
371 DrawEE(endc_p_m[gId], mEEmin[gId], mEEmax[gId]);
375 canvas.SaveAs(ImageName.c_str());