CMS 3D CMS Logo

EcalLaserAPDPNRatios_PayloadInspector.cc
Go to the documentation of this file.
7 
8 // the data format of the condition to be inspected
10 
11 #include "TH2F.h"
12 #include "TCanvas.h"
13 #include "TStyle.h"
14 #include "TLine.h"
15 #include "TLatex.h"
16 
17 #include <memory>
18 #include <sstream>
19 
20 namespace {
21  enum { kEBChannels = 61200, kEEChannels = 14648 };
22  enum {
23  MIN_IETA = 1,
24  MIN_IPHI = 1,
25  MAX_IETA = 85,
26  MAX_IPHI = 360,
27  EBhistEtaMax = 171
28  }; // barrel lower and upper bounds on eta and phi
29  enum {
30  IX_MIN = 1,
31  IY_MIN = 1,
32  IX_MAX = 100,
33  IY_MAX = 100,
34  EEhistXMax = 220
35  }; // endcaps lower and upper bounds on x and y
36 
37  /*******************************************************
38 
39  2d histogram of ECAL barrel APDPNRatios of 1 IOV
40 
41  *******************************************************/
42 
43  // inherit from one of the predefined plot class: Histogram2D
44  class EcalLaserAPDPNRatiosEBMap : public cond::payloadInspector::Histogram2D<EcalLaserAPDPNRatios> {
45  public:
46  EcalLaserAPDPNRatiosEBMap()
47  : cond::payloadInspector::Histogram2D<EcalLaserAPDPNRatios>("ECAL Barrel APDPNRatios - map ",
48  "iphi",
49  MAX_IPHI,
50  MIN_IPHI,
51  MAX_IPHI + 1,
52  "ieta",
54  -MAX_IETA,
55  MAX_IETA + 1) {
56  Base::setSingleIov(true);
57  }
58 
59  // Histogram2D::fill (virtual) needs be overridden - the implementation should use fillWithValue
60  bool fill() override {
61  auto tag = PlotBase::getTag<0>();
62  for (auto const& iov : tag.iovs) {
63  std::shared_ptr<EcalLaserAPDPNRatios> payload = Base::fetchPayload(std::get<1>(iov));
64  if (payload.get()) {
65  // set to -1 for ieta 0 (no crystal)
66  for (int iphi = 1; iphi < 361; iphi++)
67  fillWithValue(iphi, 0, -1);
68 
69  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
70  uint32_t rawid = EBDetId::unhashIndex(cellid);
71  float p2 = (payload->getLaserMap())[rawid].p2;
72  // fill the Histogram2D here
73  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), p2);
74  } // loop over cellid
75  } // if payload.get()
76  } // loop over IOV's (1 in this case)
77 
78  return true;
79  } // fill method
80  };
81 
82  class EcalLaserAPDPNRatiosEEMap : public cond::payloadInspector::Histogram2D<EcalLaserAPDPNRatios> {
83  private:
84  int EEhistSplit = 20;
85 
86  public:
87  EcalLaserAPDPNRatiosEEMap()
88  : cond::payloadInspector::Histogram2D<EcalLaserAPDPNRatios>("ECAL Endcap APDPNRatios - map ",
89  "ix",
90  EEhistXMax,
91  IX_MIN,
92  EEhistXMax + 1,
93  "iy",
94  IY_MAX,
95  IY_MIN,
96  IY_MAX + 1) {
97  Base::setSingleIov(true);
98  }
99 
100  bool fill() override {
101  auto tag = PlotBase::getTag<0>();
102  for (auto const& iov : tag.iovs) {
103  std::shared_ptr<EcalLaserAPDPNRatios> payload = Base::fetchPayload(std::get<1>(iov));
104  if (payload.get()) {
105  // set to -1 everywhwere
106  for (int ix = IX_MIN; ix < EEhistXMax + 1; ix++)
107  for (int iy = IY_MAX; iy < IY_MAX + 1; iy++)
108  fillWithValue(ix, iy, -1);
109 
110  for (int cellid = 0; cellid < EEDetId::kSizeForDenseIndexing; ++cellid) {
111  if (!EEDetId::validHashIndex(cellid))
112  continue;
113  uint32_t rawid = EEDetId::unhashIndex(cellid);
114  float p2 = (payload->getLaserMap())[rawid].p2;
115  EEDetId myEEId(rawid);
116  if (myEEId.zside() == -1)
117  fillWithValue(myEEId.ix(), myEEId.iy(), p2);
118  else
119  fillWithValue(myEEId.ix() + IX_MAX + EEhistSplit, myEEId.iy(), p2);
120  } // loop over cellid
121  } // payload
122  } // loop over IOV's (1 in this case)
123  return true;
124  } // fill method
125  };
126 
127  /*************************************************
128  2d plot of ECAL IntercalibConstants of 1 IOV
129  *************************************************/
130  class EcalLaserAPDPNRatiosPlot : public cond::payloadInspector::PlotImage<EcalLaserAPDPNRatios> {
131  public:
132  EcalLaserAPDPNRatiosPlot()
133  : cond::payloadInspector::PlotImage<EcalLaserAPDPNRatios>("ECAL Laser APDPNRatios - map ") {
134  setSingleIov(true);
135  }
136 
137  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
138  TH2F** barrel = new TH2F*[3];
139  TH2F** endc_p = new TH2F*[3];
140  TH2F** endc_m = new TH2F*[3];
141  float pEBmin[3], pEEmin[3];
142 
143  for (int i = 0; i < 3; i++) {
144  barrel[i] =
145  new TH2F(Form("EBp%i", i), Form("EB p%i", i + 1), MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA);
146  endc_p[i] =
147  new TH2F(Form("EE+p%i", i), Form("EE+ p%i", i + 1), IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1);
148  endc_m[i] =
149  new TH2F(Form("EE-p%i", i), Form("EE- p%i", i + 1), IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1);
150  pEBmin[i] = 10.;
151  pEEmin[i] = 10.;
152  }
153 
154  auto iov = iovs.front();
155  std::shared_ptr<EcalLaserAPDPNRatios> payload = fetchPayload(std::get<1>(iov));
156  unsigned long IOV = std::get<0>(iov);
157  int run = 0;
158  if (IOV < 4294967296)
159  run = std::get<0>(iov);
160  else // time type IOV
161  run = IOV >> 32;
162  if (payload.get()) {
163  // looping over the EB channels, via the dense-index, mapped into EBDetId's
164  for (int cellid = 0; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) { // loop on EB cells
165  uint32_t rawid = EBDetId::unhashIndex(cellid);
166  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
167  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
168  if (eta > 0.)
169  eta = eta - 0.5; // 0.5 to 84.5
170  else
171  eta = eta + 0.5; // -84.5 to -0.5
172  float p1 = (payload->getLaserMap())[rawid].p1;
173  if (p1 < pEBmin[0])
174  pEBmin[0] = p1;
175  float p2 = (payload->getLaserMap())[rawid].p2;
176  if (p2 < pEBmin[1])
177  pEBmin[1] = p2;
178  float p3 = (payload->getLaserMap())[rawid].p3;
179  if (p3 < pEBmin[2])
180  pEBmin[2] = p3;
181  barrel[0]->Fill(phi, eta, p1);
182  barrel[1]->Fill(phi, eta, p2);
183  barrel[2]->Fill(phi, eta, p3);
184  } // loop over cellid
185 
186  // looping over the EE channels
187  for (int cellid = 0; cellid < EEDetId::kSizeForDenseIndexing; ++cellid) {
188  if (!EEDetId::validHashIndex(cellid))
189  continue;
190  uint32_t rawid = EEDetId::unhashIndex(cellid);
191  EEDetId myEEId(rawid);
192  float p1 = (payload->getLaserMap())[rawid].p1;
193  if (p1 < pEEmin[0])
194  pEEmin[0] = p1;
195  float p2 = (payload->getLaserMap())[rawid].p2;
196  if (p2 < pEEmin[1])
197  pEEmin[1] = p2;
198  float p3 = (payload->getLaserMap())[rawid].p3;
199  if (p3 < pEEmin[2])
200  pEEmin[2] = p3;
201  if (myEEId.zside() == 1) {
202  endc_p[0]->Fill(myEEId.ix(), myEEId.iy(), p1);
203  endc_p[1]->Fill(myEEId.ix(), myEEId.iy(), p2);
204  endc_p[2]->Fill(myEEId.ix(), myEEId.iy(), p3);
205  } else {
206  endc_m[0]->Fill(myEEId.ix(), myEEId.iy(), p1);
207  endc_m[1]->Fill(myEEId.ix(), myEEId.iy(), p2);
208  endc_m[2]->Fill(myEEId.ix(), myEEId.iy(), p3);
209  }
210  } // validDetId
211  } // if payload.get()
212  else
213  return false;
214 
215  gStyle->SetPalette(1);
216  gStyle->SetOptStat(0);
217  TCanvas canvas("CC map", "CC map", 2800, 2600);
218  TLatex t1;
219  t1.SetNDC();
220  t1.SetTextAlign(26);
221  t1.SetTextSize(0.05);
222  if (IOV < 4294967296)
223  t1.DrawLatex(0.5, 0.96, Form("Ecal Laser APD/PN, IOV %i", run));
224  else { // time type IOV
225  time_t t = run;
226  char buf[256];
227  struct tm lt;
228  localtime_r(&t, &lt);
229  strftime(buf, sizeof(buf), "%F %R:%S", &lt);
230  buf[sizeof(buf) - 1] = 0;
231  t1.DrawLatex(0.5, 0.96, Form("Ecal Laser APD/PN, IOV %s", buf));
232  }
233 
234  float xmi[3] = {0.0, 0.26, 0.74};
235  float xma[3] = {0.26, 0.74, 1.00};
236  TPad*** pad = new TPad**[3];
237  for (int i = 0; i < 3; i++) {
238  pad[i] = new TPad*[3];
239  for (int obj = 0; obj < 3; obj++) {
240  float yma = 0.94 - (0.32 * i);
241  float ymi = yma - 0.28;
242  pad[i][obj] = new TPad(Form("p_%i_%i", obj, i), Form("p_%i_%i", obj, i), xmi[obj], ymi, xma[obj], yma);
243  pad[i][obj]->Draw();
244  }
245  }
246 
247  for (int i = 0; i < 3; i++) {
248  // compute histo limits with some rounding
249  // std::cout << " before " << pEBmin[i];
250  float xmin = pEBmin[i] * 10.;
251  int min = (int)xmin;
252  pEBmin[i] = (float)min / 10.;
253  // std::cout << " after " << pEBmin[i] << std::endl << " before " << pEEmin[i];
254  xmin = pEEmin[i] * 10.;
255  min = (int)xmin;
256  pEEmin[i] = (float)min / 10.;
257  // std::cout << " after " << pEEmin[i] << std::endl;
258  pad[i][0]->cd();
259  DrawEE(endc_m[i], pEEmin[i], 1.1);
260  pad[i][1]->cd();
261  DrawEB(barrel[i], pEBmin[i], 1.1);
262  pad[i][2]->cd();
263  DrawEE(endc_p[i], pEEmin[i], 1.1);
264  }
265 
266  std::string ImageName(m_imageFileName);
267  canvas.SaveAs(ImageName.c_str());
268  return true;
269  } // fill method
270  };
271 
272  /*****************************************************************
273  2d plot of ECAL IntercalibConstants difference between 2 IOVs
274  ******************************************************************/
275  template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags, int method>
276  class EcalLaserAPDPNRatiosBase : public cond::payloadInspector::PlotImage<EcalLaserAPDPNRatios, nIOVs, ntags> {
277  public:
278  EcalLaserAPDPNRatiosBase()
279  : cond::payloadInspector::PlotImage<EcalLaserAPDPNRatios, nIOVs, ntags>("ECAL Laser APDPNRatios difference") {}
280 
281  bool fill() override {
282  TH2F** barrel = new TH2F*[3];
283  TH2F** endc_p = new TH2F*[3];
284  TH2F** endc_m = new TH2F*[3];
285  float pEBmin[3], pEEmin[3], pEBmax[3], pEEmax[3];
286  for (int i = 0; i < 3; i++) {
287  barrel[i] =
288  new TH2F(Form("EBp%i", i), Form("EB p%i", i + 1), MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA);
289  endc_p[i] =
290  new TH2F(Form("EE+p%i", i), Form("EE+ p%i", i + 1), IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1);
291  endc_m[i] =
292  new TH2F(Form("EE-p%i", i), Form("EE- p%i", i + 1), IX_MAX, IX_MIN, IX_MAX + 1, IY_MAX, IY_MIN, IY_MAX + 1);
293  pEBmin[i] = 10.;
294  pEEmin[i] = 10.;
295  pEBmax[i] = -10.;
296  pEEmax[i] = -10.;
297  }
298  unsigned int run[2] = {0, 0};
299  std::string l_tagname[2];
300  unsigned long IOV = 0;
301  float pEB[3][kEBChannels], pEE[3][kEEChannels];
302  auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
303  l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().name;
304  auto firstiov = iovs.front();
305  IOV = std::get<0>(firstiov);
306  if (IOV < 4294967296)
307  run[0] = std::get<0>(firstiov);
308  else // time type IOV
309  run[0] = IOV >> 32;
310  std::tuple<cond::Time_t, cond::Hash> lastiov;
311  if (ntags == 2) {
312  auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
313  l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
314  lastiov = tag2iovs.front();
315  } else {
316  lastiov = iovs.back();
317  l_tagname[1] = l_tagname[0];
318  }
319  IOV = std::get<0>(lastiov);
320  if (IOV < 4294967296)
321  run[1] = std::get<0>(lastiov);
322  else // time type IOV
323  run[1] = IOV >> 32;
324 
325  for (int irun = 0; irun < nIOVs; irun++) {
326  std::shared_ptr<EcalLaserAPDPNRatios> payload;
327  if (irun == 0) {
328  payload = this->fetchPayload(std::get<1>(firstiov));
329  } else {
330  payload = this->fetchPayload(std::get<1>(lastiov));
331  }
332  if (payload.get()) {
333  // looping over the EB channels, via the dense-index, mapped into EBDetId's
334  for (int cellid = 0; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) { // loop on EB cells
335  uint32_t rawid = EBDetId::unhashIndex(cellid);
336  if (irun == 0) {
337  pEB[0][cellid] = (payload->getLaserMap())[rawid].p1;
338  pEB[1][cellid] = (payload->getLaserMap())[rawid].p2;
339  pEB[2][cellid] = (payload->getLaserMap())[rawid].p3;
340  } else {
341  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
342  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
343  if (eta > 0.)
344  eta = eta - 0.5; // 0.5 to 84.5
345  else
346  eta = eta + 0.5; // -84.5 to -0.5
347  double dr;
348  if (method == 0) // difference
349  dr = (payload->getLaserMap())[rawid].p1 - pEB[0][cellid];
350  else { // ratio
351  if (pEB[0][cellid] == 0.) {
352  if ((payload->getLaserMap())[rawid].p1 == 0.)
353  dr = 1.;
354  else
355  dr = 9999.; //use a large value
356  } else
357  dr = (payload->getLaserMap())[rawid].p1 / pEB[0][cellid];
358  }
359  if (dr < pEBmin[0])
360  pEBmin[0] = dr;
361  if (dr > pEBmax[0])
362  pEBmax[0] = dr;
363  barrel[0]->Fill(phi, eta, dr);
364  if (method == 0) // difference
365  dr = (payload->getLaserMap())[rawid].p2 - pEB[1][cellid];
366  else { // ratio
367  if (pEB[1][cellid] == 0.) {
368  if ((payload->getLaserMap())[rawid].p2 == 0.)
369  dr = 1.;
370  else
371  dr = 9999.; //use a large value
372  } else
373  dr = (payload->getLaserMap())[rawid].p2 / pEB[1][cellid];
374  }
375  if (dr < pEBmin[1])
376  pEBmin[1] = dr;
377  if (dr > pEBmax[1])
378  pEBmax[1] = dr;
379  barrel[1]->Fill(phi, eta, dr);
380  if (method == 0) // difference
381  dr = (payload->getLaserMap())[rawid].p3 - pEB[2][cellid];
382  else { // ratio
383  if (pEB[2][cellid] == 0.) {
384  if ((payload->getLaserMap())[rawid].p3 == 0.)
385  dr = 1.;
386  else
387  dr = 9999.; //use a large value
388  } else
389  dr = (payload->getLaserMap())[rawid].p3 / pEB[2][cellid];
390  }
391  if (dr < pEBmin[2])
392  pEBmin[2] = dr;
393  if (dr > pEBmax[2])
394  pEBmax[2] = dr;
395  barrel[2]->Fill(phi, eta, dr);
396  }
397  } // loop over cellid
398 
399  // looping over the EE channels
400  for (int cellid = 0; cellid < EEDetId::kSizeForDenseIndexing; ++cellid) {
401  if (!EEDetId::validHashIndex(cellid))
402  continue;
403  uint32_t rawid = EEDetId::unhashIndex(cellid);
404  EEDetId myEEId(rawid);
405  if (irun == 0) {
406  pEE[0][cellid] = (payload->getLaserMap())[rawid].p1;
407  pEE[1][cellid] = (payload->getLaserMap())[rawid].p2;
408  pEE[2][cellid] = (payload->getLaserMap())[rawid].p3;
409  } else {
410  double dr1, dr2, dr3;
411  if (method == 0) // difference
412  dr1 = (payload->getLaserMap())[rawid].p1 - pEE[0][cellid];
413  else { // ratio
414  if (pEE[0][cellid] == 0.) {
415  if ((payload->getLaserMap())[rawid].p1 == 0.)
416  dr1 = 1.;
417  else
418  dr1 = 9999.; //use a large value
419  } else
420  dr1 = (payload->getLaserMap())[rawid].p1 / pEE[0][cellid];
421  }
422  if (dr1 < pEEmin[0])
423  pEEmin[0] = dr1;
424  if (dr1 > pEEmax[0])
425  pEEmax[0] = dr1;
426  if (method == 0) // difference
427  dr2 = (payload->getLaserMap())[rawid].p2 - pEE[1][cellid];
428  else { // ratio
429  if (pEE[1][cellid] == 0.) {
430  if ((payload->getLaserMap())[rawid].p2 == 0.)
431  dr2 = 1.;
432  else
433  dr2 = 9999.; //use a large value
434  } else
435  dr2 = (payload->getLaserMap())[rawid].p2 / pEE[1][cellid];
436  }
437  if (dr2 < pEEmin[1])
438  pEEmin[1] = dr2;
439  if (dr2 > pEEmax[1])
440  pEEmax[1] = dr2;
441  if (method == 0) // difference
442  dr3 = (payload->getLaserMap())[rawid].p3 - pEE[2][cellid];
443  else { // ratio
444  if (pEE[0][cellid] == 0.) {
445  if ((payload->getLaserMap())[rawid].p3 == 0.)
446  dr3 = 1.;
447  else
448  dr3 = 9999.; //use a large value
449  } else
450  dr3 = (payload->getLaserMap())[rawid].p3 / pEE[2][cellid];
451  }
452  if (dr3 < pEEmin[2])
453  pEEmin[2] = dr3;
454  if (dr3 > pEEmax[2])
455  pEEmax[2] = dr3;
456  if (myEEId.zside() == 1) {
457  endc_p[0]->Fill(myEEId.ix(), myEEId.iy(), dr1);
458  endc_p[1]->Fill(myEEId.ix(), myEEId.iy(), dr2);
459  endc_p[2]->Fill(myEEId.ix(), myEEId.iy(), dr3);
460  } else {
461  endc_m[0]->Fill(myEEId.ix(), myEEId.iy(), dr1);
462  endc_m[1]->Fill(myEEId.ix(), myEEId.iy(), dr2);
463  endc_m[2]->Fill(myEEId.ix(), myEEId.iy(), dr3);
464  }
465  }
466  } // loop over cellid
467  } // if payload.get()
468  else
469  return false;
470  } // loop over IOVs
471 
472  gStyle->SetPalette(1);
473  gStyle->SetOptStat(0);
474  TCanvas canvas("CC map", "CC map", 2800, 2600);
475  TLatex t1;
476  t1.SetNDC();
477  t1.SetTextAlign(26);
478  int len = l_tagname[0].length() + l_tagname[1].length();
479  std::string dr[2] = {"-", "/"};
480  if (IOV < 4294967296) {
481  if (ntags == 2) {
482  if (len < 80) {
483  t1.SetTextSize(0.02);
484  t1.DrawLatex(0.5,
485  0.96,
486  Form("%s IOV %i %s %s IOV %i",
487  l_tagname[1].c_str(),
488  run[1],
489  dr[method].c_str(),
490  l_tagname[0].c_str(),
491  run[0]));
492  } else {
493  t1.SetTextSize(0.03);
494  t1.DrawLatex(0.5, 0.96, Form("Ecal LaserAPDPNRatios, IOV %i %s %i", run[1], dr[method].c_str(), run[0]));
495  }
496  } else {
497  t1.SetTextSize(0.03);
498  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]));
499  }
500  } else { // time type IOV
501  time_t t = run[0];
502  char buf0[256], buf1[256];
503  struct tm lt;
504  localtime_r(&t, &lt);
505  strftime(buf0, sizeof(buf0), "%F %R:%S", &lt);
506  buf0[sizeof(buf0) - 1] = 0;
507  t = run[1];
508  localtime_r(&t, &lt);
509  strftime(buf1, sizeof(buf1), "%F %R:%S", &lt);
510  buf1[sizeof(buf1) - 1] = 0;
511  if (ntags == 2) {
512  if (len < 80) {
513  t1.SetTextSize(0.02);
514  t1.DrawLatex(0.5,
515  0.96,
516  Form("%s IOV %i %s %s IOV %i",
517  l_tagname[1].c_str(),
518  run[1],
519  dr[method].c_str(),
520  l_tagname[0].c_str(),
521  run[0]));
522  } else {
523  t1.SetTextSize(0.03);
524  t1.DrawLatex(0.5, 0.96, Form("Ecal LaserAPDPNRatios, IOV %i %s %i", run[1], dr[method].c_str(), run[0]));
525  }
526  } else {
527  t1.SetTextSize(0.03);
528  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]));
529  }
530  }
531  float xmi[3] = {0.0, 0.24, 0.76};
532  float xma[3] = {0.24, 0.76, 1.00};
533  TPad*** pad = new TPad**[3];
534  for (int i = 0; i < 3; i++) {
535  pad[i] = new TPad*[3];
536  for (int obj = 0; obj < 3; obj++) {
537  float yma = 0.94 - (0.32 * i);
538  float ymi = yma - 0.28;
539  pad[i][obj] = new TPad(Form("p_%i_%i", obj, i), Form("p_%i_%i", obj, i), xmi[obj], ymi, xma[obj], yma);
540  pad[i][obj]->Draw();
541  }
542  }
543 
544  for (int i = 0; i < 3; i++) {
545  // compute histo limits with some rounding
546  // std::cout << " before min " << pEBmin[i] << " max " << pEBmax[i];
547  float xmin = (pEBmin[i] - 0.009) * 100.;
548  int min = (int)xmin;
549  pEBmin[i] = (float)min / 100.;
550  float xmax = (pEBmax[i] + 0.009) * 100.;
551  int max = (int)xmax;
552  pEBmax[i] = (float)max / 100.;
553  // std::cout << " after min " << pEBmin[i] << " max " << pEBmax[i] << std::endl << " before min " << pEEmin[i] << " max " << pEEmax[i];
554  xmin = (pEEmin[i] + 0.009) * 100.;
555  min = (int)xmin;
556  pEEmin[i] = (float)min / 100.;
557  xmax = (pEEmax[i] + 0.009) * 100.;
558  max = (int)xmax;
559  pEEmax[i] = (float)max / 100.;
560  // std::cout << " after min " << pEEmin[i] << " max " << pEEmax[i]<< std::endl;
561  pad[i][0]->cd();
562  DrawEE(endc_m[i], pEEmin[i], pEEmax[i]);
563  endc_m[i]->GetZaxis()->SetLabelSize(0.02);
564  pad[i][1]->cd();
565  DrawEB(barrel[i], pEBmin[i], pEBmax[i]);
566  pad[i][2]->cd();
567  DrawEE(endc_p[i], pEEmin[i], pEEmax[i]);
568  endc_p[i]->GetZaxis()->SetLabelSize(0.02);
569  }
570 
571  std::string ImageName(this->m_imageFileName);
572  canvas.SaveAs(ImageName.c_str());
573  return true;
574  } // fill method
575  }; // class EcalLaserAPDPNRatiosDiffBase
576  using EcalLaserAPDPNRatiosDiffOneTag = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 1, 0>;
577  using EcalLaserAPDPNRatiosDiffTwoTags = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 2, 0>;
578  using EcalLaserAPDPNRatiosRatioOneTag = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 1, 1>;
579  using EcalLaserAPDPNRatiosRatioTwoTags = EcalLaserAPDPNRatiosBase<cond::payloadInspector::SINGLE_IOV, 2, 1>;
580 
581 } // namespace
582 
583 // Register the classes as boost python plugin
585  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosEBMap);
586  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosEEMap);
587  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosPlot);
588  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosDiffOneTag);
589  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosDiffTwoTags);
590  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosRatioOneTag);
591  PAYLOAD_INSPECTOR_CLASS(EcalLaserAPDPNRatiosRatioTwoTags);
592 }
void fillWithValue(float xvalue, float yvalue, float weight=1)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
static bool validHashIndex(int i)
Definition: EEDetId.h:239
void DrawEE(TH2F *endc, float min, float max)
Definition: EcalDrawUtils.h:29
void DrawEB(TH2F *ebmap, float min, float max)
Definition: EcalDrawUtils.h:4
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
Definition: EBDetId.h:149
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
Definition: plugin.cc:23
def canvas(sub, attr)
Definition: svgfig.py:482
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)