CMS 3D CMS Logo

EcalPedestals_PayloadInspector.cc
Go to the documentation of this file.
4 
5 // 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, kGains = 3, kRMS = 5 };
22  enum { MIN_IETA = 1, MIN_IPHI = 1, MAX_IETA = 85, MAX_IPHI = 360 }; // barrel lower and upper bounds on eta and phi
23  enum { IX_MIN = 1, IY_MIN = 1, IX_MAX = 100, IY_MAX = 100 }; // endcaps lower and upper bounds on x and y
24 
25  /**************************************
26  1d plot of ECAL pedestal of 1 IOV
27  ***************************************/
28  class EcalPedestalsHist : public cond::payloadInspector::PlotImage<EcalPedestals> {
29  public:
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 {
32  uint32_t gainValues[kGains] = {12, 6, 1};
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];
37  float bmin[kGains] = {0.7, 0.5, 0.4};
38  float bmax[kGains] = {3.6, 2.0, 1.0}; // 11/11/2023
39  float emin[kGains] = {1.5, 0.8, 0.4};
40  float emax[kGains] = {3.0, 2.0, 1.0}; // 11/11/2023
41  for (int gainId = 0; gainId < kGains; gainId++) {
42  barrel_m[gainId] = new TH1F(Form("EBm%i", gainId), Form("mean %i EB", gainValues[gainId]), 100, 150., 250.);
43  endcap_m[gainId] = new TH1F(Form("EEm%i", gainId), Form("mean %i EE", gainValues[gainId]), 100, 150., 250.);
44  barrel_r[gainId] =
45  new TH1F(Form("EBr%i", gainId), Form("rms %i EB", gainValues[gainId]), 100, bmin[gainId], bmax[gainId]);
46  endcap_r[gainId] =
47  new TH1F(Form("EEr%i", gainId), Form("rms %i EE", gainValues[gainId]), 100, emin[gainId], emax[gainId]);
48  }
49  auto iov = iovs.front();
50  std::shared_ptr<EcalPedestals> payload = fetchPayload(std::get<1>(iov));
51  unsigned int run = std::get<0>(iov);
52  if (payload.get()) {
53  // looping over the EB channels, via the dense-index, mapped into EBDetId's
54  if (payload->barrelItems().empty())
55  return false;
56  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
57  uint32_t rawid = EBDetId::unhashIndex(cellid);
58  if (payload->find(rawid) == payload->end())
59  continue;
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);
66  } // loop over cellid
67  if (payload->endcapItems().empty())
68  return false;
69 
70  // looping over the EE channels
71  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
72  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
73  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
74  if (EEDetId::validDetId(ix, iy, iz)) {
75  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
76  uint32_t rawid = myEEId.rawId();
77  if (payload->find(rawid) == payload->end())
78  continue;
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);
85  } // validDetId
86  } // if payload.get()
87  else
88  return false;
89 
90  gStyle->SetPalette(1);
91  gStyle->SetOptStat(111110);
92  TCanvas canvas("CC map", "CC map", 1600, 2600);
93  TLatex t1;
94  t1.SetNDC();
95  t1.SetTextAlign(26);
96  t1.SetTextSize(0.05);
97  t1.DrawLatex(0.5, 0.96, Form("Ecal Pedestals, IOV %i", run));
98 
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];
104  for (int obj = 0; obj < 2; obj++) {
105  // float yma = 1.- (0.17 * gId);
106  // float ymi = yma - 0.15;
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();
111  }
112  }
113  for (int gId = 0; gId < kGains; gId++) {
114  pad[gId][0]->cd();
115  barrel_m[gId]->Draw();
116  pad[gId + kGains][0]->cd();
117  barrel_r[gId]->Draw();
118  pad[gId][1]->cd();
119  endcap_m[gId]->Draw();
120  pad[gId + kGains][1]->cd();
121  endcap_r[gId]->Draw();
122  }
123 
124  std::string ImageName(m_imageFileName);
125  canvas.SaveAs(ImageName.c_str());
126  return true;
127  } // fill method
128  }; // class EcalPedestalsHist
129 
130  /**************************************
131  2d plot of ECAL pedestal of 1 IOV
132  ***************************************/
133 
134  class EcalPedestalsPlot : public cond::payloadInspector::PlotImage<EcalPedestals> {
135  public:
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 {
138  uint32_t gainValues[kGains] = {12, 6, 1};
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];
145  double EBmean[kGains], EBrms[kGains], EEmean[kGains], EErms[kGains], pEBmin[kGains], pEBmax[kGains],
146  pEEmin[kGains], pEEmax[kGains];
147  int EBtot[kGains], EEtot[kGains];
148  for (int gId = 0; gId < kGains; gId++) {
149  barrel_m[gId] = new TH2F(Form("EBm%i", gId),
150  Form("mean %i EB", gainValues[gId]),
151  MAX_IPHI,
152  0,
153  MAX_IPHI,
154  2 * MAX_IETA,
155  -MAX_IETA,
156  MAX_IETA);
157  endc_p_m[gId] = new TH2F(Form("EE+m%i", gId),
158  Form("mean %i EE+", gainValues[gId]),
159  IX_MAX,
160  IX_MIN,
161  IX_MAX + 1,
162  IY_MAX,
163  IY_MIN,
164  IY_MAX + 1);
165  endc_m_m[gId] = new TH2F(Form("EE-m%i", gId),
166  Form("mean %i EE-", gainValues[gId]),
167  IX_MAX,
168  IX_MIN,
169  IX_MAX + 1,
170  IY_MAX,
171  IY_MIN,
172  IY_MAX + 1);
173  barrel_r[gId] = new TH2F(Form("EBr%i", gId),
174  Form("rms %i EB", gainValues[gId]),
175  MAX_IPHI,
176  0,
177  MAX_IPHI,
178  2 * MAX_IETA,
179  -MAX_IETA,
180  MAX_IETA);
181  endc_p_r[gId] = new TH2F(Form("EE+r%i", gId),
182  Form("rms %i EE+", gainValues[gId]),
183  IX_MAX,
184  IX_MIN,
185  IX_MAX + 1,
186  IY_MAX,
187  IY_MIN,
188  IY_MAX + 1);
189  endc_m_r[gId] = new TH2F(Form("EE-r%i", gId),
190  Form("rms %i EE-", gainValues[gId]),
191  IX_MAX,
192  IX_MIN,
193  IX_MAX + 1,
194  IY_MAX,
195  IY_MIN,
196  IY_MAX + 1);
197  EBmean[gId] = 0.;
198  EBrms[gId] = 0.;
199  EEmean[gId] = 0.;
200  EErms[gId] = 0.;
201  EBtot[gId] = 0;
202  EEtot[gId] = 0;
203  }
204  auto iov = iovs.front();
205  std::shared_ptr<EcalPedestals> payload = fetchPayload(std::get<1>(iov));
206  unsigned int run = std::get<0>(iov);
207  if (payload.get()) {
208  // looping over the EB channels, via the dense-index, mapped into EBDetId's
209  if (payload->barrelItems().empty())
210  return false;
211  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) { // loop on EE cells
212  uint32_t rawid = EBDetId::unhashIndex(cellid);
213  if (payload->find(rawid) == payload->end())
214  continue;
215  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
216  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
217  if (eta > 0.)
218  eta = eta - 0.5; // 0.5 to 84.5
219  else
220  eta = eta + 0.5; // -84.5 to -0.5
221  barrel_m[0]->Fill(phi, eta, (*payload)[rawid].mean_x12);
222  Double_t val = (*payload)[rawid].rms_x12;
223  barrel_r[0]->Fill(phi, eta, val);
224  if (val < 10) {
225  EBmean[0] = EBmean[0] + val;
226  EBrms[0] = EBrms[0] + val * val;
227  EBtot[0]++;
228  }
229  // else std::cout << " gain 12 chan " << cellid << " val " << val << std::endl;
230  barrel_m[1]->Fill(phi, eta, (*payload)[rawid].mean_x6);
231  val = (*payload)[rawid].rms_x6;
232  barrel_r[1]->Fill(phi, eta, val);
233  if (val < 10) {
234  EBmean[1] = EBmean[1] + val;
235  EBrms[1] = EBrms[1] + val * val;
236  EBtot[1]++;
237  }
238  // else std::cout << " gain 6 chan " << cellid << " val " << val << std::endl;
239  barrel_m[2]->Fill(phi, eta, (*payload)[rawid].mean_x1);
240  val = (*payload)[rawid].rms_x1;
241  barrel_r[2]->Fill(phi, eta, val);
242  if (val < 10) {
243  EBmean[2] = EBmean[2] + val;
244  EBrms[2] = EBrms[2] + val * val;
245  EBtot[2]++;
246  }
247  // else std::cout << " gain 1 chan " << cellid << " val " << val << std::endl;
248  } // loop over cellid
249  if (payload->endcapItems().empty())
250  return false;
251 
252  // looping over the EE channels
253  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
254  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
255  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
256  if (EEDetId::validDetId(ix, iy, iz)) {
257  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
258  uint32_t rawid = myEEId.rawId();
259  if (payload->find(rawid) == payload->end())
260  continue;
261  if (iz == 1) {
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);
265  if (val < 10) {
266  EEmean[0] = EEmean[0] + val;
267  EErms[0] = EErms[0] + val * val;
268  EEtot[0]++;
269  }
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);
273  if (val < 10) {
274  EEmean[1] = EEmean[1] + val;
275  EErms[1] = EErms[1] + val * val;
276  EEtot[1]++;
277  }
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);
281  if (val < 10) {
282  EEmean[2] = EEmean[2] + val;
283  EErms[2] = EErms[2] + val * val;
284  EEtot[2]++;
285  }
286  } else {
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);
290  if (val < 10) {
291  EEmean[0] = EEmean[0] + val;
292  EErms[0] = EErms[0] + val * val;
293  EEtot[0]++;
294  }
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);
298  if (val < 10) {
299  EEmean[1] = EEmean[1] + val;
300  EErms[1] = EErms[1] + val * val;
301  EEtot[1]++;
302  }
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);
306  if (val < 10) {
307  EEmean[2] = EEmean[2] + val;
308  EErms[2] = EErms[2] + val * val;
309  EEtot[2]++;
310  }
311  }
312  } // validDetId
313  } // if payload.get()
314  else
315  return false;
316 
317  gStyle->SetPalette(1);
318  gStyle->SetOptStat(0);
319  TCanvas canvas("CC map", "CC map", 1600, 2600);
320  TLatex t1;
321  t1.SetNDC();
322  t1.SetTextAlign(26);
323  t1.SetTextSize(0.05);
324  t1.DrawLatex(0.5, 0.96, Form("Ecal Pedestals, IOV %i", run));
325 
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];
329  int view = 0;
330  for (int gId = 0; gId < kGains; gId++) {
331  for (int val = 0; val < 2; val++) { // mean and sigma
332  pad[view] = new TPad*[3];
333  for (int obj = 0; obj < 3; obj++) {
334  float yma = 0.94 - (0.16 * view);
335  float ymi = yma - 0.14;
336  pad[view][obj] =
337  new TPad(Form("p_%i_%i", obj, view), Form("p_%i_%i", obj, view), xmi[obj], ymi, xma[obj], yma);
338  pad[view][obj]->Draw();
339  }
340  view++;
341  }
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.)
347  EBrms[gId] = 0.001;
348  pEBmin[gId] = EBmean[gId] - kRMS * EBrms[gId];
349  pEBmax[gId] = EBmean[gId] + kRMS * EBrms[gId];
350  // std::cout << " mean " << EBmean[gId] << " rms " << EBrms[gId] << " entries " << EBtot[gId] << " min " << pEBmin[gId]
351  // << " max " << pEBmax[gId] << std::endl;
352  if (pEBmin[gId] < 0.)
353  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.)
359  EErms[gId] = 0.001;
360  pEEmin[gId] = EEmean[gId] - kRMS * EErms[gId];
361  pEEmax[gId] = EEmean[gId] + kRMS * EErms[gId];
362  // std::cout << " mean " << EEmean[gId] << " rms " << EErms[gId] << " entries " << EEtot[gId] << " min " << pEEmin[gId]
363  // << " max " << pEEmax[gId] << std::endl;
364  if (pEEmin[gId] < 0.)
365  pEEmin[gId] = 0.;
366  }
367  //float bmin[kGains] ={0.7, 0.5, 0.4};
368  //float bmax[kGains] ={2.2, 1.3, 0.7};
369  //float emin[kGains] ={1.5, 0.8, 0.4};
370  //float emax[kGains] ={2.5, 1.5, 0.8};
371  // TLine* l = new TLine(0., 0., 0., 0.);
372  // l->SetLineWidth(1);
373  for (int gId = 0; gId < kGains; gId++) {
374  pad[gId][0]->cd();
375  DrawEE(endc_m_m[gId], 180., 300.); // 11/11/2023
376  pad[gId + kGains][0]->cd();
377  DrawEE(endc_m_r[gId], pEEmin[gId], pEEmax[gId]);
378  pad[gId][1]->cd();
379  DrawEB(barrel_m[gId], 180., 240.); // 11/11/2023
380  pad[gId + kGains][1]->cd();
381  DrawEB(barrel_r[gId], pEBmin[gId], pEBmax[gId]);
382  pad[gId][2]->cd();
383  DrawEE(endc_p_m[gId], 180., 300.); // 11/11/2023
384  pad[gId + kGains][2]->cd();
385  DrawEE(endc_p_r[gId], pEEmin[gId], pEEmax[gId]);
386  }
387 
388  std::string ImageName(m_imageFileName);
389  canvas.SaveAs(ImageName.c_str());
390  return true;
391  } // fill method
392 
393  }; // class EcalPedestalsPlot
394 
395  /*****************************************************************
396  2d plot of ECAL pedestals difference or ratio between 2 IOVs
397  ******************************************************************/
398  template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags, int method>
399  class EcalPedestalsBase : public cond::payloadInspector::PlotImage<EcalPedestals, nIOVs, ntags> {
400  public:
401  EcalPedestalsBase() : cond::payloadInspector::PlotImage<EcalPedestals, nIOVs, ntags>("ECAL pedestals comparison") {}
402  bool fill() override {
403  uint32_t gainValues[kGains] = {12, 6, 1};
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];
410  double EBmean[kGains], EBrms[kGains], EEmean[kGains], EErms[kGains], pEBmin[kGains], pEBmax[kGains],
411  pEEmin[kGains], pEEmax[kGains];
412  int EBtot[kGains], EEtot[kGains];
413  for (int gId = 0; gId < kGains; gId++) {
414  barrel_m[gId] = new TH2F(Form("EBm%i", gId),
415  Form("mean %i EB", gainValues[gId]),
416  MAX_IPHI,
417  0,
418  MAX_IPHI,
419  2 * MAX_IETA,
420  -MAX_IETA,
421  MAX_IETA);
422  endc_p_m[gId] = new TH2F(Form("EE+m%i", gId),
423  Form("mean %i EE+", gainValues[gId]),
424  IX_MAX,
425  IX_MIN,
426  IX_MAX + 1,
427  IY_MAX,
428  IY_MIN,
429  IY_MAX + 1);
430  endc_m_m[gId] = new TH2F(Form("EE-m%i", gId),
431  Form("mean %i EE-", gainValues[gId]),
432  IX_MAX,
433  IX_MIN,
434  IX_MAX + 1,
435  IY_MAX,
436  IY_MIN,
437  IY_MAX + 1);
438  barrel_r[gId] = new TH2F(Form("EBr%i", gId),
439  Form("rms %i EB", gainValues[gId]),
440  MAX_IPHI,
441  0,
442  MAX_IPHI,
443  2 * MAX_IETA,
444  -MAX_IETA,
445  MAX_IETA);
446  endc_p_r[gId] = new TH2F(Form("EE+r%i", gId),
447  Form("rms %i EE+", gainValues[gId]),
448  IX_MAX,
449  IX_MIN,
450  IX_MAX + 1,
451  IY_MAX,
452  IY_MIN,
453  IY_MAX + 1);
454  endc_m_r[gId] = new TH2F(Form("EE-r%i", gId),
455  Form("rms %i EE-", gainValues[gId]),
456  IX_MAX,
457  IX_MIN,
458  IX_MAX + 1,
459  IY_MAX,
460  IY_MIN,
461  IY_MAX + 1);
462  EBmean[gId] = 0.;
463  EBrms[gId] = 0.;
464  EEmean[gId] = 0.;
465  EErms[gId] = 0.;
466  EBtot[gId] = 0;
467  EEtot[gId] = 0;
468  }
469  unsigned int run[2] = {0, 0};
470  std::string l_tagname[2];
471  double meanEB[kGains][kEBChannels], rmsEB[kGains][kEBChannels], meanEE[kGains][kEEChannels],
472  rmsEE[kGains][kEEChannels];
473 
474  // std::cout << " running with " << nIOVs << " IOVs and " << ntags << " tags " << std::endl;
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;
480  if (ntags == 2) {
481  auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
482  l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
483  lastiov = tag2iovs.front();
484  } else {
485  lastiov = iovs.back();
486  l_tagname[1] = l_tagname[0];
487  }
488  run[1] = std::get<0>(lastiov);
489  for (int irun = 0; irun < nIOVs; irun++) {
490  std::shared_ptr<EcalPedestals> payload;
491  if (irun == 0) {
492  payload = this->fetchPayload(std::get<1>(firstiov));
493  } else {
494  payload = this->fetchPayload(std::get<1>(lastiov));
495  }
496  // std::cout << " irun " << irun << " tag " << l_tagname[irun] << " IOV " << run[irun] << std ::endl;
497  if (payload.get()) {
498  if (!payload->barrelItems().empty()) {
499  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
500  uint32_t rawid = EBDetId::unhashIndex(cellid);
501  if (payload->find(rawid) == payload->end())
502  continue;
503 
504  if (irun == 0) {
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;
511  } else {
512  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
513  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
514  if (eta > 0.)
515  eta = eta - 0.5; // 0.5 to 84.5
516  else
517  eta = eta + 0.5; // -84.5 to -0.5
518  double dr, drms;
519  // gain 12
520  float val = (*payload)[rawid].mean_x12;
521  float valr = (*payload)[rawid].rms_x12;
522  if (method == 0) {
523  dr = val - meanEB[0][cellid];
524  drms = valr - rmsEB[0][cellid];
525  } else { // ratio
526  if (meanEB[0][cellid] == 0) {
527  if (val == 0.)
528  dr = 1.;
529  else
530  dr = 9999.; // use a large value
531  } else
532  dr = val / meanEB[0][cellid];
533  if (rmsEB[0][cellid] == 0) {
534  if (valr == 0.)
535  drms = 1.;
536  else
537  drms = 9999.; // use a large value
538  } else
539  drms = valr / rmsEB[0][cellid];
540  }
541  barrel_m[0]->Fill(phi, eta, dr);
542  barrel_r[0]->Fill(phi, eta, drms);
543  if (std::abs(drms) < 1.) {
544  EBmean[0] = EBmean[0] + drms;
545  EBrms[0] = EBrms[0] + drms * drms;
546  EBtot[0]++;
547  }
548  // gain 6
549  val = (*payload)[rawid].mean_x6;
550  valr = (*payload)[rawid].rms_x6;
551  if (method == 0) {
552  dr = val - meanEB[1][cellid];
553  drms = valr - rmsEB[1][cellid];
554  } else { // ratio
555  if (meanEB[1][cellid] == 0) {
556  if (val == 0.)
557  dr = 1.;
558  else
559  dr = 9999.; // use a large value
560  } else
561  dr = val / meanEB[1][cellid];
562  if (rmsEB[1][cellid] == 0) {
563  if (valr == 0.)
564  drms = 1.;
565  else
566  drms = 9999.; // use a large value
567  } else
568  drms = valr / rmsEB[1][cellid];
569  }
570  barrel_m[1]->Fill(phi, eta, dr);
571  barrel_r[1]->Fill(phi, eta, drms);
572  if (std::abs(drms) < 1.) {
573  EBmean[1] = EBmean[1] + drms;
574  EBrms[1] = EBrms[1] + drms * drms;
575  EBtot[1]++;
576  }
577  // gain 1
578  val = (*payload)[rawid].mean_x1;
579  valr = (*payload)[rawid].rms_x1;
580  if (method == 0) {
581  dr = val - meanEB[2][cellid];
582  drms = valr - rmsEB[2][cellid];
583  } else { // ratio
584  if (meanEB[2][cellid] == 0) {
585  if (val == 0.)
586  dr = 1.;
587  else
588  dr = 9999.; // use a large value
589  } else
590  dr = val / meanEB[2][cellid];
591  if (rmsEB[2][cellid] == 0) {
592  if (valr == 0.)
593  drms = 1.;
594  else
595  drms = 9999.; // use a large value
596  } else
597  drms = valr / rmsEB[2][cellid];
598  }
599  barrel_m[2]->Fill(phi, eta, dr);
600  barrel_r[2]->Fill(phi, eta, drms);
601  if (std::abs(drms) < 1.) {
602  EBmean[2] = EBmean[2] + drms;
603  EBrms[2] = EBrms[2] + drms * drms;
604  EBtot[2]++;
605  }
606  }
607  } // loop over cellid
608  } // barrel data present
609  if (payload->endcapItems().empty()) {
610  // looping over the EE channels
611  for (int iz = -1; iz < 2; iz = iz + 2) { // -1 or +1
612  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++) {
613  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++) {
614  if (EEDetId::validDetId(ix, iy, iz)) {
615  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
616  uint32_t rawid = myEEId.rawId();
617  uint32_t index = myEEId.hashedIndex();
618  if (payload->find(rawid) == payload->end())
619  continue;
620  if (irun == 0) {
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;
627  } // fist run
628  else {
629  double dr, drms;
630  // gain 12
631  float val = (*payload)[rawid].mean_x12;
632  float valr = (*payload)[rawid].rms_x12;
633  if (method == 0) {
634  dr = val - meanEE[0][index];
635  drms = valr - rmsEE[0][index];
636  } else { // ratio
637  if (meanEE[0][index] == 0) {
638  if (val == 0.)
639  dr = 1.;
640  else
641  dr = 9999.; // use a large value
642  } else
643  dr = val / meanEE[0][index];
644  if (rmsEE[0][index] == 0) {
645  if (valr == 0.)
646  drms = 1.;
647  else
648  drms = 9999.; // use a large value
649  } else
650  drms = valr / rmsEE[0][index];
651  }
652  if (iz == 1) { // EE+
653  endc_p_m[0]->Fill(ix, iy, dr);
654  endc_p_r[0]->Fill(ix, iy, drms);
655  } else { // EE-
656  endc_m_m[0]->Fill(ix, iy, dr);
657  endc_m_r[0]->Fill(ix, iy, drms);
658  }
659  if (std::abs(drms) < 1.) {
660  EEmean[0] = EEmean[0] + drms;
661  EErms[0] = EErms[0] + drms * drms;
662  EEtot[0]++;
663  }
664  // gain 6
665  val = (*payload)[rawid].mean_x6;
666  valr = (*payload)[rawid].rms_x6;
667  if (method == 0) {
668  dr = val - meanEE[1][index];
669  drms = valr - rmsEE[1][index];
670  } else { // ratio
671  if (meanEE[1][index] == 0) {
672  if (val == 0.)
673  dr = 1.;
674  else
675  dr = 9999.; // use a large value
676  } else
677  dr = val / meanEE[1][index];
678  if (rmsEE[1][index] == 0) {
679  if (valr == 0.)
680  drms = 1.;
681  else
682  drms = 9999.; // use a large value
683  } else
684  drms = valr / rmsEE[1][index];
685  }
686  if (iz == 1) { // EE+
687  endc_p_m[1]->Fill(ix, iy, dr);
688  endc_p_r[1]->Fill(ix, iy, drms);
689  } else { // EE-
690  endc_m_m[1]->Fill(ix, iy, dr);
691  endc_m_r[1]->Fill(ix, iy, drms);
692  }
693  if (std::abs(drms) < 1.) {
694  EEmean[1] = EEmean[1] + drms;
695  EErms[1] = EErms[1] + drms * drms;
696  EEtot[1]++;
697  }
698  // gain 1
699  val = (*payload)[rawid].mean_x1;
700  valr = (*payload)[rawid].rms_x1;
701  if (method == 0) {
702  dr = val - meanEE[2][index];
703  drms = valr - rmsEE[2][index];
704  } else { // ratio
705  if (meanEE[2][index] == 0) {
706  if (val == 0.)
707  dr = 1.;
708  else
709  dr = 9999.; // use a large value
710  } else
711  dr = val / meanEE[2][index];
712  if (rmsEE[2][index] == 0) {
713  if (valr == 0.)
714  drms = 1.;
715  else
716  drms = 9999.; // use a large value
717  } else
718  drms = valr / rmsEE[2][index];
719  }
720  if (iz == 1) { // EE+
721  endc_p_m[2]->Fill(ix, iy, dr);
722  endc_p_r[2]->Fill(ix, iy, drms);
723  } else { // EE-
724  endc_m_m[2]->Fill(ix, iy, dr);
725  endc_m_r[2]->Fill(ix, iy, drms);
726  }
727  if (std::abs(drms) < 1.) {
728  EEmean[2] = EEmean[2] + drms;
729  EErms[2] = EErms[2] + drms * drms;
730  EEtot[2]++;
731  }
732  } // second run
733  } // validDetId
734  } // loop over ix
735  } // loop over iy
736  } // loop over iz
737  } // endcap data present
738  } // if payload.get()
739  else
740  return false;
741  } // loop over IOVs
742 
743  gStyle->SetPalette(1);
744  gStyle->SetOptStat(0);
745  TCanvas canvas("CC map", "CC map", 1600, 2600);
746  TLatex t1;
747  t1.SetNDC();
748  t1.SetTextAlign(26);
749  int len = l_tagname[0].length() + l_tagname[1].length();
750  std::string dr[2] = {"-", "/"};
751  if (ntags == 2) {
752  if (len < 58) {
753  t1.SetTextSize(0.025);
754  t1.DrawLatex(0.5,
755  0.96,
756  Form("%s IOV %i %s %s IOV %i",
757  l_tagname[1].c_str(),
758  run[1],
759  dr[method].c_str(),
760  l_tagname[0].c_str(),
761  run[0]));
762  } else {
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]));
765  }
766  } else {
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]));
769  }
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];
773  int view = 0;
774  for (int gId = 0; gId < kGains; gId++) {
775  for (int val = 0; val < 2; val++) { // mean and sigma
776  pad[view] = new TPad*[3];
777  for (int obj = 0; obj < 3; obj++) {
778  float yma = 0.94 - (0.16 * view);
779  float ymi = yma - 0.14;
780  pad[view][obj] =
781  new TPad(Form("p_%i_%i", obj, view), Form("p_%i_%i", obj, view), xmi[obj], ymi, xma[obj], yma);
782  pad[view][obj]->Draw();
783  }
784  view++;
785  }
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.)
791  EBrms[gId] = 0.001;
792  pEBmin[gId] = EBmean[gId] - kRMS * EBrms[gId];
793  pEBmax[gId] = EBmean[gId] + kRMS * EBrms[gId];
794  // std::cout << " mean " << EBmean[gId] << " rms " << EBrms[gId] << " entries " << EBtot[gId] << " min " << pEBmin[gId]
795  // << " max " << pEBmax[gId] << std::endl;
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.)
801  EErms[gId] = 0.001;
802  pEEmin[gId] = EEmean[gId] - kRMS * EErms[gId];
803  pEEmax[gId] = EEmean[gId] + kRMS * EErms[gId];
804  // std::cout << " mean " << EEmean[gId] << " rms " << EErms[gId] << " entries " << EEtot[gId] << " min " << pEEmin[gId]
805  // << " max " << pEEmax[gId] << std::endl;
806  }
807  for (int gId = 0; gId < kGains; gId++) {
808  pad[gId][0]->cd();
809  DrawEE(endc_m_m[gId], -2., 2.);
810  pad[gId + kGains][0]->cd();
811  DrawEE(endc_m_r[gId], pEEmin[gId], pEEmax[gId]);
812  pad[gId][1]->cd();
813  DrawEB(barrel_m[gId], -2., 2.);
814  pad[gId + kGains][1]->cd();
815  DrawEB(barrel_r[gId], pEBmin[gId], pEBmax[gId]);
816  pad[gId][2]->cd();
817  DrawEE(endc_p_m[gId], -2., 2.);
818  pad[gId + kGains][2]->cd();
819  DrawEE(endc_p_r[gId], pEEmin[gId], pEEmax[gId]);
820  }
821 
822  std::string ImageName(this->m_imageFileName);
823  canvas.SaveAs(ImageName.c_str());
824  return true;
825  } // fill method
826  }; // class EcalPedestalsBase
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>;
831 
832  /*************************************************
833  2d histogram of ECAL barrel pedestal of 1 IOV
834  *************************************************/
835 
836  // inherit from one of the predefined plot class: Histogram2D
837  class EcalPedestalsEBMean12Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
838  public:
839  EcalPedestalsEBMean12Map()
840  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel pedestal gain12 - map",
841  "iphi",
842  MAX_IPHI,
843  MIN_IPHI,
844  MAX_IPHI + MIN_IPHI,
845  "ieta",
846  2 * MAX_IETA + 1,
847  -1 * MAX_IETA,
848  MAX_IETA + 1) {
849  Base::setSingleIov(true);
850  }
851 
852  // Histogram2D::fill (virtual) needs be overridden - the implementation should use fillWithValue
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));
857  if (payload.get()) {
858  // looping over the EB channels, via the dense-index, mapped into EBDetId's
859  if (payload->barrelItems().empty())
860  return false;
861  // set to 200 for ieta 0 (no crystal)
862  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
863  fillWithValue(iphi, 0, 200);
864  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
865  uint32_t rawid = EBDetId::unhashIndex(cellid);
866 
867  // check the existence of ECAL pedestal, for a given ECAL barrel channel
868  if (payload->find(rawid) == payload->end())
869  continue;
870  if (!(*payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
871  continue;
872 
873  // there's no ieta==0 in the EB numbering
874  // int delta = (EBDetId(rawid)).ieta() > 0 ? -1 : 0 ;
875  // fill the Histogram2D here
876  // fillWithValue( (EBDetId(rawid)).iphi() , (EBDetId(rawid)).ieta()+0.5+delta, (*payload)[rawid].mean_x12 );
877  // set min and max on 2d plots
878  float valped = (*payload)[rawid].mean_x12;
879  if (valped > 250.)
880  valped = 250.;
881  // if(valped < 150.) valped = 150.;
882  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valped);
883  } // loop over cellid
884  } // if payload.get()
885  } // loop over IOV's (1 in this case)
886  return true;
887  } // fill method
888  };
889 
890  class EcalPedestalsEBMean6Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
891  public:
892  EcalPedestalsEBMean6Map()
893  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel pedestal gain6 - map",
894  "iphi",
895  MAX_IPHI,
896  MIN_IPHI,
897  MAX_IPHI + MIN_IPHI,
898  "ieta",
899  2 * MAX_IETA + 1,
900  -MAX_IETA,
901  MAX_IETA + 1) {
902  Base::setSingleIov(true);
903  }
904 
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));
909  if (payload.get()) {
910  // looping over the EB channels, via the dense-index, mapped into EBDetId's
911  if (payload->barrelItems().empty())
912  return false;
913  // set to 200 for ieta 0 (no crystal)
914  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
915  fillWithValue(iphi, 0, 200);
916  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
917  uint32_t rawid = EBDetId::unhashIndex(cellid);
918 
919  // check the existence of ECAL pedestal, for a given ECAL barrel channel
920  if (payload->find(rawid) == payload->end())
921  continue;
922  if (!(*payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
923  continue;
924 
925  // set min and max on 2d plots
926  float valped = (*payload)[rawid].mean_x6;
927  if (valped > 250.)
928  valped = 250.;
929  // if(valped < 150.) valped = 150.;
930  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valped);
931  } // loop over cellid
932  } // if payload.get()
933  } // loop over IOV's (1 in this case)
934  return true;
935  } // fill method
936  };
937 
938  class EcalPedestalsEBMean1Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
939  public:
940  EcalPedestalsEBMean1Map()
941  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel pedestal gain1 - map",
942  "iphi",
943  MAX_IPHI,
944  MIN_IPHI,
945  MAX_IPHI + MIN_IPHI,
946  "ieta",
947  2 * MAX_IETA + 1,
948  -MAX_IETA,
949  MAX_IETA + 1) {
950  Base::setSingleIov(true);
951  }
952 
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));
957  if (payload.get()) {
958  // looping over the EB channels, via the dense-index, mapped into EBDetId's
959  if (payload->barrelItems().empty())
960  return false;
961  // set to 200 for ieta 0 (no crystal)
962  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
963  fillWithValue(iphi, 0, 200);
964  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
965  uint32_t rawid = EBDetId::unhashIndex(cellid);
966 
967  // check the existence of ECAL pedestal, for a given ECAL barrel channel
968  if (payload->find(rawid) == payload->end())
969  continue;
970  if (!(*payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
971  continue;
972 
973  // set min and max on 2d plots
974  float valped = (*payload)[rawid].mean_x1;
975  if (valped > 250.)
976  valped = 250.;
977  // if(valped < 150.) valped = 150.;
978  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valped);
979  } // loop over cellid
980  } // if payload.get()
981  } // loop over IOV's (1 in this case)
982  return true;
983  } // fill method
984  };
985 
986  class EcalPedestalsEEMean12Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
987  public:
988  EcalPedestalsEEMean12Map()
989  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap pedestal gain12 - map",
990  "ix",
991  2.2 * IX_MAX,
992  IX_MIN,
993  2.2 * IX_MAX + 1,
994  "iy",
995  IY_MAX,
996  IY_MIN,
997  IY_MAX + IY_MIN) {
998  Base::setSingleIov(true);
999  }
1000 
1001  // Histogram2D::fill (virtual) needs be overridden - the implementation should use fillWithValue
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));
1006  if (payload.get()) {
1007  if (payload->endcapItems().empty())
1008  return false;
1009 
1010  // looping over the EE channels
1011  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1012  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1013  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1014  if (EEDetId::validDetId(ix, iy, iz)) {
1015  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1016  uint32_t rawid = myEEId.rawId();
1017  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1018  if (payload->find(rawid) == payload->end())
1019  continue;
1020  if (!(*payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1021  continue;
1022  // set min and max on 2d plots
1023  float valped = (*payload)[rawid].mean_x12;
1024  if (valped > 250.)
1025  valped = 250.;
1026  // if(valped < 150.) valped = 150.;
1027  if (iz == -1)
1028  fillWithValue(ix, iy, valped);
1029  else
1030  fillWithValue(ix + IX_MAX + 20, iy, valped);
1031 
1032  } // validDetId
1033  } // payload
1034  } // loop over IOV's (1 in this case)
1035  return true;
1036  } // fill method
1037  };
1038 
1039  class EcalPedestalsEEMean6Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1040  public:
1041  EcalPedestalsEEMean6Map()
1042  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap pedestal gain6 - map",
1043  "ix",
1044  2.2 * IX_MAX,
1045  IX_MIN,
1046  2.2 * IX_MAX + 1,
1047  "iy",
1048  IY_MAX,
1049  IY_MIN,
1050  IY_MAX + IY_MIN) {
1051  Base::setSingleIov(true);
1052  }
1053 
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));
1058  if (payload.get()) {
1059  if (payload->endcapItems().empty())
1060  return false;
1061 
1062  // looping over the EE channels
1063  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1064  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1065  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1066  if (EEDetId::validDetId(ix, iy, iz)) {
1067  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1068  uint32_t rawid = myEEId.rawId();
1069  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1070  if (payload->find(rawid) == payload->end())
1071  continue;
1072  if (!(*payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1073  continue;
1074  // set min and max on 2d plots
1075  float valped = (*payload)[rawid].mean_x6;
1076  if (valped > 250.)
1077  valped = 250.;
1078  // if(valped < 150.) valped = 150.;
1079  if (iz == -1)
1080  fillWithValue(ix, iy, valped);
1081  else
1082  fillWithValue(ix + IX_MAX + 20, iy, valped);
1083  } // validDetId
1084  } // payload
1085  } // loop over IOV's (1 in this case)
1086  return true;
1087  } // fill method
1088  };
1089 
1090  class EcalPedestalsEEMean1Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1091  public:
1092  EcalPedestalsEEMean1Map()
1093  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap pedestal gain1 - map",
1094  "ix",
1095  2.2 * IX_MAX,
1096  IX_MIN,
1097  2.2 * IX_MAX + 1,
1098  "iy",
1099  IY_MAX,
1100  IY_MIN,
1101  IY_MAX + IY_MIN) {
1102  Base::setSingleIov(true);
1103  }
1104 
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));
1109  if (payload.get()) {
1110  if (payload->endcapItems().empty())
1111  return false;
1112 
1113  // looping over the EE channels
1114  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1115  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1116  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1117  if (EEDetId::validDetId(ix, iy, iz)) {
1118  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1119  uint32_t rawid = myEEId.rawId();
1120  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1121  if (payload->find(rawid) == payload->end())
1122  continue;
1123  if (!(*payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1124  continue;
1125  // set min and max on 2d plots
1126  float valped = (*payload)[rawid].mean_x1;
1127  if (valped > 250.)
1128  valped = 250.;
1129  // if(valped < 150.) valped = 150.;
1130  if (iz == -1)
1131  fillWithValue(ix, iy, valped);
1132  else
1133  fillWithValue(ix + IX_MAX + 20, iy, valped);
1134  } // validDetId
1135  } // if payload.get()
1136  } // loop over IOV's (1 in this case)
1137  return true;
1138  } // fill method
1139  };
1140 
1141  class EcalPedestalsEBRMS12Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1142  public:
1143  EcalPedestalsEBRMS12Map()
1144  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel noise gain12 - map",
1145  "iphi",
1146  MAX_IPHI,
1147  MIN_IPHI,
1148  MAX_IPHI + MIN_IPHI,
1149  "ieta",
1150  2 * MAX_IETA + 1,
1151  -1 * MAX_IETA,
1152  MAX_IETA + 1) {
1153  Base::setSingleIov(true);
1154  }
1155 
1156  // Histogram2D::fill (virtual) needs be overridden - the implementation should use fillWithValue
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));
1161  if (payload.get()) {
1162  // looping over the EB channels, via the dense-index, mapped into EBDetId's
1163  if (payload->barrelItems().empty())
1164  return false;
1165  // set to 2 for ieta 0 (no crystal)
1166  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
1167  fillWithValue(iphi, 0, 2);
1168  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
1169  uint32_t rawid = EBDetId::unhashIndex(cellid);
1170 
1171  // check the existence of ECAL pedestal, for a given ECAL barrel channel
1172  if (payload->find(rawid) == payload->end())
1173  continue;
1174  if (!(*payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1175  continue;
1176 
1177  // there's no ieta==0 in the EB numbering
1178  // int delta = (EBDetId(rawid)).ieta() > 0 ? -1 : 0 ;
1179  // fill the Histogram2D here
1180  // fillWithValue( (EBDetId(rawid)).iphi() , (EBDetId(rawid)).ieta()+0.5+delta, (*payload)[rawid].mean_x12 );
1181  // set max on noise 2d plots
1182  float valrms = (*payload)[rawid].rms_x12;
1183  if (valrms > 4.0)
1184  valrms = 4.0;
1185  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valrms);
1186  } // loop over cellid
1187  } // if payload.get()
1188  } // loop over IOV's (1 in this case)
1189  return true;
1190  } // fill method
1191  };
1192 
1193  class EcalPedestalsEBRMS6Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1194  public:
1195  EcalPedestalsEBRMS6Map()
1196  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel noise gain6 - map",
1197  "iphi",
1198  MAX_IPHI,
1199  MIN_IPHI,
1200  MAX_IPHI + MIN_IPHI,
1201  "ieta",
1202  2 * MAX_IETA + 1,
1203  -1 * MAX_IETA,
1204  MAX_IETA + 1) {
1205  Base::setSingleIov(true);
1206  }
1207 
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));
1212  if (payload.get()) {
1213  // looping over the EB channels, via the dense-index, mapped into EBDetId's
1214  if (payload->barrelItems().empty())
1215  return false;
1216  // set to 1 for ieta 0 (no crystal)
1217  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
1218  fillWithValue(iphi, 0, 1);
1219  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
1220  uint32_t rawid = EBDetId::unhashIndex(cellid);
1221 
1222  // check the existence of ECAL pedestal, for a given ECAL barrel channel
1223  if (payload->find(rawid) == payload->end())
1224  continue;
1225  if (!(*payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1226  continue;
1227 
1228  // set max on noise 2d plots
1229  float valrms = (*payload)[rawid].rms_x6;
1230  if (valrms > 2.5)
1231  valrms = 2.5;
1232  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valrms);
1233  } // loop over cellid
1234  } // if payload.get()
1235  } // loop over IOV's (1 in this case)
1236  return true;
1237  } // fill method
1238  };
1239 
1240  class EcalPedestalsEBRMS1Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1241  public:
1242  EcalPedestalsEBRMS1Map()
1243  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Barrel noise gain1 - map",
1244  "iphi",
1245  MAX_IPHI,
1246  MIN_IPHI,
1247  MAX_IPHI + MIN_IPHI,
1248  "ieta",
1249  2 * MAX_IETA + 1,
1250  -1 * MAX_IETA,
1251  MAX_IETA + 1) {
1252  Base::setSingleIov(true);
1253  }
1254 
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));
1259  if (payload.get()) {
1260  // looping over the EB channels, via the dense-index, mapped into EBDetId's
1261  if (payload->barrelItems().empty())
1262  return false;
1263  // set to 0.5 for ieta 0 (no crystal)
1264  for (int iphi = MIN_IPHI; iphi < MAX_IPHI + 1; iphi++)
1265  fillWithValue(iphi, 0, 0.5);
1266  for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
1267  uint32_t rawid = EBDetId::unhashIndex(cellid);
1268 
1269  // check the existence of ECAL pedestal, for a given ECAL barrel channel
1270  if (payload->find(rawid) == payload->end())
1271  continue;
1272  if (!(*payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x1)
1273  continue;
1274 
1275  // set max on noise 2d plots
1276  float valrms = (*payload)[rawid].rms_x1;
1277  if (valrms > 1.2)
1278  valrms = 1.2;
1279  fillWithValue((EBDetId(rawid)).iphi(), (EBDetId(rawid)).ieta(), valrms);
1280  } // loop over cellid
1281  } // if payload.get()
1282  } // loop over IOV's (1 in this case)
1283  return true;
1284  } // fill method
1285  };
1286 
1287  class EcalPedestalsEERMS12Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1288  public:
1289  EcalPedestalsEERMS12Map()
1290  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap noise gain12 - map",
1291  "ix",
1292  2.2 * IX_MAX,
1293  IX_MIN,
1294  2.2 * IX_MAX + 1,
1295  "iy",
1296  IY_MAX,
1297  IY_MIN,
1298  IY_MAX + IY_MIN) {
1299  Base::setSingleIov(true);
1300  }
1301 
1302  // Histogram2D::fill (virtual) needs be overridden - the implementation should use fillWithValue
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));
1307  if (payload.get()) {
1308  if (payload->endcapItems().empty())
1309  return false;
1310 
1311  // looping over the EE channels
1312  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1313  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1314  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1315  if (EEDetId::validDetId(ix, iy, iz)) {
1316  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1317  uint32_t rawid = myEEId.rawId();
1318  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1319  if (payload->find(rawid) == payload->end())
1320  continue;
1321  if (!(*payload)[rawid].mean_x12 && !(*payload)[rawid].rms_x12)
1322  continue;
1323  // set max on noise 2d plots
1324  float valrms = (*payload)[rawid].rms_x12;
1325  if (valrms > 4.0)
1326  valrms = 4.0;
1327  if (iz == -1)
1328  fillWithValue(ix, iy, valrms);
1329  else
1330  fillWithValue(ix + IX_MAX + 20, iy, valrms);
1331 
1332  } // validDetId
1333  } // payload
1334  } // loop over IOV's (1 in this case)
1335  return true;
1336  } // fill method
1337  };
1338 
1339  class EcalPedestalsEERMS6Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1340  public:
1341  EcalPedestalsEERMS6Map()
1342  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap noise gain6 - map",
1343  "ix",
1344  2.2 * IX_MAX,
1345  IX_MIN,
1346  2.2 * IX_MAX + 1,
1347  "iy",
1348  IY_MAX,
1349  IY_MIN,
1350  IY_MAX + IY_MIN) {
1351  Base::setSingleIov(true);
1352  }
1353 
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));
1358  if (payload.get()) {
1359  if (payload->endcapItems().empty())
1360  return false;
1361 
1362  // looping over the EE channels
1363  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1364  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1365  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1366  if (EEDetId::validDetId(ix, iy, iz)) {
1367  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1368  uint32_t rawid = myEEId.rawId();
1369  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1370  if (payload->find(rawid) == payload->end())
1371  continue;
1372  if (!(*payload)[rawid].mean_x6 && !(*payload)[rawid].rms_x6)
1373  continue;
1374  // set max on noise 2d plots
1375  float valrms = (*payload)[rawid].rms_x6;
1376  if (valrms > 2.5)
1377  valrms = 2.5;
1378  if (iz == -1)
1379  fillWithValue(ix, iy, valrms);
1380  else
1381  fillWithValue(ix + IX_MAX + 20, iy, valrms);
1382  } // validDetId
1383  } // payload
1384  } // loop over IOV's (1 in this case)
1385  return true;
1386  } // fill method
1387  };
1388 
1389  class EcalPedestalsEERMS1Map : public cond::payloadInspector::Histogram2D<EcalPedestals> {
1390  public:
1391  EcalPedestalsEERMS1Map()
1392  : cond::payloadInspector::Histogram2D<EcalPedestals>("ECAL Endcap noise gain1 - map",
1393  "ix",
1394  2.2 * IX_MAX,
1395  IX_MIN,
1396  2.2 * IX_MAX + 1,
1397  "iy",
1398  IY_MAX,
1399  IY_MIN,
1400  IY_MAX + IY_MIN) {
1401  Base::setSingleIov(true);
1402  }
1403 
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));
1408  if (payload.get()) {
1409  if (payload->endcapItems().empty())
1410  return false;
1411 
1412  // looping over the EE channels
1413  for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
1414  for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
1415  for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
1416  if (EEDetId::validDetId(ix, iy, iz)) {
1417  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
1418  uint32_t rawid = myEEId.rawId();
1419  // check the existence of ECAL pedestal, for a given ECAL endcap channel
1420  if (payload->find(rawid) == payload->end())
1421  continue;
1422  if (!(*payload)[rawid].mean_x1 && !(*payload)[rawid].rms_x12)
1423  continue;
1424  // set max on noise 2d plots
1425  float valrms = (*payload)[rawid].rms_x1;
1426  if (valrms > 1.2)
1427  valrms = 1.2;
1428  if (iz == -1)
1429  fillWithValue(ix, iy, valrms);
1430  else
1431  fillWithValue(ix + IX_MAX + 20, iy, valrms);
1432  } // validDetId
1433  } // if payload.get()
1434  } // loop over IOV's (1 in this case)
1435  return true;
1436  } // fill method
1437  };
1438 
1439  /*****************************************
1440  2d plot of Ecal Pedestals Summary of 1 IOV
1441  ******************************************/
1442  class EcalPedestalsSummaryPlot : public cond::payloadInspector::PlotImage<EcalPedestals> {
1443  public:
1444  EcalPedestalsSummaryPlot() : cond::payloadInspector::PlotImage<EcalPedestals>("Ecal Pedestals Summary - map ") {
1445  setSingleIov(true);
1446  }
1447 
1448  bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs) override {
1449  auto iov = iovs.front(); //get reference to 1st element in the vector iovs
1450  std::shared_ptr<EcalPedestals> payload =
1451  fetchPayload(std::get<1>(iov)); //std::get<1>(iov) refers to the Hash in the tuple iov
1452  unsigned int run = std::get<0>(iov); //referes to Time_t in iov.
1453  TH2F* align; //pointer to align which is a 2D histogram
1454 
1455  int NbRows = 6;
1456  int NbColumns = 5;
1457 
1458  if (payload.get()) { //payload is an iov retrieved from payload using hash.
1459 
1460  align = new TH2F("Ecal Pedestals Summary",
1461  "EB/EE Gain Mean RMS Total Items",
1462  NbColumns,
1463  0,
1464  NbColumns,
1465  NbRows,
1466  0,
1467  NbRows);
1468 
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};
1471 
1472  long unsigned int ebTotal = (payload->barrelItems()).size();
1473  long unsigned int eeTotal = (payload->endcapItems()).size();
1474 
1475  pedestalsSummary(payload->barrelItems(), ebVals, ebTotal);
1476  pedestalsSummary(payload->endcapItems(), eeVals, eeTotal);
1477 
1478  double row = NbRows - 0.5;
1479 
1480  //EB summary values
1481  align->Fill(1.5, row, 12); //Gain
1482  align->Fill(2.5, row, ebVals[0]); //mean12
1483  align->Fill(3.5, row, ebVals[1]); //rms12
1484 
1485  row--;
1486 
1487  align->Fill(0.5, row, 1);
1488  align->Fill(1.5, row, 6); //Gain
1489  align->Fill(2.5, row, ebVals[2]); //mean6
1490  align->Fill(3.5, row, ebVals[3]); //rms6
1491  align->Fill(4.5, row, ebTotal);
1492 
1493  row--;
1494 
1495  align->Fill(1.5, row, 1); //Gain
1496  align->Fill(2.5, row, ebVals[4]); //mean1
1497  align->Fill(3.5, row, ebVals[5]); //rms1
1498 
1499  row--;
1500 
1501  //EE summary values
1502  align->Fill(1.5, row, 12); //Gain
1503  align->Fill(2.5, row, eeVals[0]); //mean12
1504  align->Fill(3.5, row, eeVals[1]); //rms12
1505 
1506  row--;
1507 
1508  align->Fill(0.5, row, 2);
1509  align->Fill(1.5, row, 6); //Gain
1510  align->Fill(2.5, row, eeVals[2]); //mean6
1511  align->Fill(3.5, row, eeVals[3]); //rms6
1512  align->Fill(4.5, row, eeTotal);
1513 
1514  row--;
1515 
1516  align->Fill(1.5, row, 1); //Gain
1517  align->Fill(2.5, row, eeVals[4]); //mean1
1518  align->Fill(3.5, row, eeVals[5]); //rms1
1519 
1520  } // if payload.get()
1521  else
1522  return false;
1523 
1524  gStyle->SetPalette(1);
1525  gStyle->SetOptStat(0);
1526  TCanvas canvas("CC map", "CC map", 1000, 1000);
1527  TLatex t1;
1528  t1.SetNDC();
1529  t1.SetTextAlign(26);
1530  t1.SetTextSize(0.05);
1531  t1.SetTextColor(2);
1532  t1.DrawLatex(0.5, 0.96, Form("Ecal Pedestals Summary, IOV %i", run));
1533 
1534  TPad* pad = new TPad("pad", "pad", 0.0, 0.0, 1.0, 0.94);
1535  pad->Draw();
1536  pad->cd();
1537  align->Draw("TEXT");
1538  TLine* l = new TLine;
1539  l->SetLineWidth(1);
1540 
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);
1545  else
1546  l = new TLine(1., y, NbColumns - 1, y);
1547  l->Draw();
1548  }
1549 
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);
1554  l->Draw();
1555  }
1556 
1557  align->GetXaxis()->SetTickLength(0.);
1558  align->GetXaxis()->SetLabelSize(0.);
1559  align->GetYaxis()->SetTickLength(0.);
1560  align->GetYaxis()->SetLabelSize(0.);
1561 
1562  std::string ImageName(m_imageFileName);
1563  canvas.SaveAs(ImageName.c_str());
1564  return true;
1565  } // fill method
1566 
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) {
1569  //vals[0]=100;
1570  vals[0] += iItems->mean(1); //G12
1571  vals[1] += iItems->rms(1);
1572  vals[2] += iItems->mean(2); //G6
1573  vals[3] += iItems->rms(2);
1574  vals[4] += iItems->mean(3); //G1
1575  vals[5] += iItems->rms(3);
1576  }
1577 
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;
1584  }
1585  };
1586 
1587 } // namespace
1588 
1589 // Register the classes as boost python plugin
1591  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsHist);
1592  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsPlot);
1593  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsDiffOneTag);
1594  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsDiffTwoTags);
1595  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsRatioOneTag);
1596  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsRatioTwoTags);
1597  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBMean12Map);
1598  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBMean6Map);
1599  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBMean1Map);
1600  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEEMean12Map);
1601  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEEMean6Map);
1602  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEEMean1Map);
1603  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBRMS12Map);
1604  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBRMS6Map);
1605  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEBRMS1Map);
1606  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEERMS12Map);
1607  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEERMS6Map);
1608  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsEERMS1Map);
1609  PAYLOAD_INSPECTOR_CLASS(EcalPedestalsSummaryPlot);
1610 }
size
Write out results.
static const int XYMODE
Definition: EEDetId.h:335
const Int_t gainValues[kGains]
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)
T sqrt(T t)
Definition: SSEVec.h:19
static const int MIN_HASH
Definition: EBDetId.h:149
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#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
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
def canvas(sub, attr)
Definition: svgfig.py:482
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
int hashedIndex() const
Definition: EEDetId.h:183
const Int_t kGains