17 #include "TPaveStats.h"
31 EcalGainRatiosPlot() :
cond::payloadInspector::PlotImage<
EcalGainRatios>(
"ECAL Gain Ratios - map ") {
35 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
42 TH1F* b_12O6 =
new TH1F(
"b_12O6",
"EB gain 12/6", 50, 1.8, 2.1);
43 TH1F* e_12O6 =
new TH1F(
"e_12O6",
"EE gain 12/6", 50, 1.8, 2.1);
44 TH1F* b_6O1 =
new TH1F(
"b_6O1",
"EB gain 6/1", 100, 5.3, 6.3);
45 TH1F* e_6O1 =
new TH1F(
"e_6O1",
"EE gain 6/1", 100, 5.3, 6.3);
47 auto iov = iovs.front();
49 unsigned int run = std::get<0>(iov);
62 b_12O6->Fill((*
payload)[rawid].gain12Over6());
63 b_6O1->Fill((*
payload)[rawid].gain6Over1());
72 if (myEEId.zside() == 1) {
73 endc_p_12O6->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain12Over6());
74 endc_p_6O1->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain6Over1());
76 endc_m_12O6->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain12Over6());
77 endc_m_6O1->Fill(myEEId.ix(), myEEId.iy(), (*payload)[rawid].gain6Over1());
79 e_12O6->Fill((*
payload)[rawid].gain12Over6());
80 e_6O1->Fill((*
payload)[rawid].gain6Over1());
86 gStyle->SetPalette(1);
87 gStyle->SetOptStat(0);
88 TCanvas
canvas(
"CC map",
"CC map", 1680, 1320);
93 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Gain Ratios, IOV %i",
run));
95 float xmi[3] = {0.0, 0.22, 0.78};
96 float xma[3] = {0.22, 0.78, 1.00};
97 TPad*** pad =
new TPad**[2];
98 for (
int gId = 0; gId < 2; gId++) {
99 pad[gId] =
new TPad*[3];
101 float yma = 0.94 - (0.32 * gId);
102 float ymi = yma - 0.28;
103 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId), Form(
"p_%i_%i",
obj, gId), xmi[
obj], ymi, xma[
obj], yma);
104 pad[gId][
obj]->Draw();
107 TPad** pad1 =
new TPad*[4];
109 float xmi = 0.26 *
obj;
110 float xma = xmi + 0.22;
111 pad1[
obj] =
new TPad(Form(
"p1_%i",
obj), Form(
"p1_%i",
obj), xmi, 0.0, xma, 0.32);
115 float min12O6 = 1.8, max12O6 = 2.1, min6O1 = 5.3, max6O1 = 6.3;
117 DrawEE(endc_m_12O6, min12O6, max12O6);
118 endc_m_12O6->SetStats(
false);
120 DrawEB(barrel_12O6, min12O6, max12O6);
121 barrel_12O6->SetStats(
false);
123 DrawEE(endc_p_12O6, min12O6, max12O6);
124 endc_p_12O6->SetStats(
false);
126 DrawEE(endc_m_6O1, min6O1, max6O1);
127 endc_m_6O1->SetStats(
false);
129 DrawEB(barrel_6O1, min6O1, max6O1);
130 barrel_6O1->SetStats(
false);
132 DrawEE(endc_p_6O1, min6O1, max6O1);
133 endc_p_6O1->SetStats(
false);
135 gStyle->SetOptStat(111110);
139 TPaveStats* st = (TPaveStats*)b_12O6->FindObject(
"stats");
145 st = (TPaveStats*)e_12O6->FindObject(
"stats");
151 st = (TPaveStats*)b_6O1->FindObject(
"stats");
157 st = (TPaveStats*)e_6O1->FindObject(
"stats");
162 canvas.SaveAs(ImageName.c_str());
172 EcalGainRatiosDiff() :
cond::payloadInspector::PlotImage<
EcalGainRatios>(
"ECAL Gain Ratios difference") {
176 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
189 TH1F* b_12O6 =
new TH1F(
"b_12O6",
"EB gain 12/6 difference", 50, -0.1, 0.1);
190 TH1F* e_12O6 =
new TH1F(
"e_12O6",
"EE gain 12/6 difference", 50, -0.1, 0.1);
191 TH1F* b_6O1 =
new TH1F(
"b_6O1",
"EB gain 6/1 difference", 100, -0.1, 0.1);
192 TH1F* e_6O1 =
new TH1F(
"e_6O1",
"EE gain 6/1 difference", 100, -0.1, 0.1);
194 unsigned int run[2], irun = 0;
196 for (
auto const& iov : iovs) {
198 run[irun] = std::get<0>(iov);
204 gEB[0][cellid] = (*payload)[rawid].gain12Over6();
205 gEB[1][cellid] = (*payload)[rawid].gain6Over1();
213 float diff = gEB[0][cellid] - (*payload)[rawid].gain12Over6();
216 diff = gEB[1][cellid] - (*payload)[rawid].gain6Over1();
229 gEE[0][cellid] = (*payload)[rawid].gain12Over6();
230 gEE[1][cellid] = (*payload)[rawid].gain6Over1();
232 float diff1 = gEE[0][cellid] - (*payload)[rawid].gain12Over6();
233 float diff2 = gEE[1][cellid] - (*payload)[rawid].gain6Over1();
234 if (myEEId.zside() == 1) {
235 endc_p_12O6->Fill(myEEId.ix(), myEEId.iy(), diff1);
236 endc_p_6O1->Fill(myEEId.ix(), myEEId.iy(), diff2);
238 endc_m_12O6->Fill(myEEId.ix(), myEEId.iy(), diff1);
239 endc_m_6O1->Fill(myEEId.ix(), myEEId.iy(), diff2);
251 gStyle->SetPalette(1);
252 gStyle->SetOptStat(0);
253 TCanvas
canvas(
"CC map",
"CC map", 1680, 1320);
257 t1.SetTextSize(0.05);
258 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Gain Ratios, IOV %i - %i",
run[1],
run[0]));
260 float xmi[3] = {0.0, 0.22, 0.78};
261 float xma[3] = {0.22, 0.78, 1.00};
262 TPad*** pad =
new TPad**[2];
263 for (
int gId = 0; gId < 2; gId++) {
264 pad[gId] =
new TPad*[3];
266 float yma = 0.94 - (0.32 * gId);
267 float ymi = yma - 0.28;
268 pad[gId][
obj] =
new TPad(Form(
"p_%i_%i",
obj, gId), Form(
"p_%i_%i",
obj, gId), xmi[
obj], ymi, xma[
obj], yma);
269 pad[gId][
obj]->Draw();
272 TPad** pad1 =
new TPad*[4];
274 float xmi = 0.26 *
obj;
275 float xma = xmi + 0.22;
276 pad1[
obj] =
new TPad(Form(
"p1_%i",
obj), Form(
"p1_%i",
obj), xmi, 0.0, xma, 0.32);
280 float min12O6 = -0.1, max12O6 = 0.1, min6O1 = -0.1, max6O1 = 0.1;
282 DrawEE(endc_m_12O6, min12O6, max12O6);
283 endc_m_12O6->SetStats(
false);
285 DrawEB(barrel_12O6, min12O6, max12O6);
286 barrel_12O6->SetStats(
false);
288 DrawEE(endc_p_12O6, min12O6, max12O6);
289 endc_p_12O6->SetStats(
false);
291 DrawEE(endc_m_6O1, min6O1, max6O1);
292 endc_m_6O1->SetStats(
false);
294 DrawEB(barrel_6O1, min6O1, max6O1);
295 barrel_6O1->SetStats(
false);
297 DrawEE(endc_p_6O1, min6O1, max6O1);
298 endc_p_6O1->SetStats(
false);
300 gStyle->SetOptStat(111110);
304 TPaveStats* st = (TPaveStats*)b_12O6->FindObject(
"stats");
310 st = (TPaveStats*)e_12O6->FindObject(
"stats");
316 st = (TPaveStats*)b_6O1->FindObject(
"stats");
322 st = (TPaveStats*)e_6O1->FindObject(
"stats");
327 canvas.SaveAs(ImageName.c_str());