CMS 3D CMS Logo

SiPixelPayloadInspectorHelper.h
Go to the documentation of this file.
1 #ifndef CONDCORE_SIPIXELPLUGINS_SIPIXELPAYLOADINSPECTORHELPER_H
2 #define CONDCORE_SIPIXELPLUGINS_SIPIXELPAYLOADINSPECTORHELPER_H
3 
4 #include <vector>
5 #include <numeric>
6 #include <string>
7 #include <boost/tokenizer.hpp>
8 #include <boost/range/adaptor/indexed.hpp>
9 
10 #include "TGraph.h"
11 #include "TH1.h"
12 #include "TH2.h"
13 #include "TLatex.h"
14 #include "TLine.h"
15 #include "TPave.h"
16 #include "TPaveStats.h"
17 #include "TPaveText.h"
18 #include "TStyle.h"
19 #include "TCanvas.h"
20 
28 
29 //#define MMDEBUG
30 #ifdef MMDEBUG
31 #include <iostream>
32 #define COUT std::cout << "MM "
33 #else
34 #define COUT edm::LogVerbatim("")
35 #endif
36 
37 namespace SiPixelPI {
38 
39  // size of the phase-0 pixel detID list
40  static const unsigned int phase0size = 1440;
41  static const unsigned int phase1size = 1856;
42 
43  //============================================================================
44  std::pair<unsigned int, unsigned int> unpack(cond::Time_t since) {
45  auto kLowMask = 0XFFFFFFFF;
46  auto run = (since >> 32);
47  auto lumi = (since & kLowMask);
48  return std::make_pair(run, lumi);
49  }
50 
51  //============================================================================
52  // Taken from pixel naming classes
53  // BmO (-z-x) = 1, BmI (-z+x) = 2 , BpO (+z-x) = 3 , BpI (+z+x) = 4
54  int quadrant(const DetId& detid, const TrackerTopology* tTopo_, bool phase_) {
55  if (detid.subdetId() == PixelSubdetector::PixelBarrel) {
56  return PixelBarrelName(detid, tTopo_, phase_).shell();
57  } else {
58  return PixelEndcapName(detid, tTopo_, phase_).halfCylinder();
59  }
60  }
61 
62  //============================================================================
63  // Online ladder convention taken from pixel naming class for barrel
64  // Apply sign convention (- sign for BmO and BpO)
65  int signed_ladder(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
67  return -9999;
68  int signed_ladder = PixelBarrelName(detid, &tTopo_, phase_).ladderName();
69  if (quadrant(detid, &tTopo_, phase_) % 2)
70  signed_ladder *= -1;
71  return signed_ladder;
72  }
73 
74  //============================================================================
75  // Online mdoule convention taken from pixel naming class for barrel
76  // Apply sign convention (- sign for BmO and BmI)
77  int signed_module(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
79  return -9999;
80  int signed_module = PixelBarrelName(detid, &tTopo_, phase_).moduleName();
81  if (quadrant(detid, &tTopo_, phase_) < 3)
82  signed_module *= -1;
83  return signed_module;
84  }
85 
86  //============================================================================
87  // Phase 0: Ring was not an existing convention
88  // but the 7 plaquettes were split by HV group
89  // --> Derive Ring 1/2 for them
90  // Panel 1 plq 1-2, Panel 2, plq 1 = Ring 1
91  // Panel 1 plq 3-4, Panel 2, plq 2-3 = Ring 2
92  // Phase 1: Using pixel naming class for endcap
93  int ring(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
95  return -9999;
96  int ring = -9999;
97  if (phase_ == 0) {
98  ring = 1 + (tTopo_.pxfPanel(detid) + tTopo_.pxfModule(detid) > 3);
99  } else if (phase_ == 1) {
100  ring = PixelEndcapName(detid, &tTopo_, phase_).ringName();
101  }
102  return ring;
103  }
104 
105  //============================================================================
106  // Online blade convention taken from pixel naming class for endcap
107  // Apply sign convention (- sign for BmO and BpO)
108  int signed_blade(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
110  return -9999;
111  int signed_blade = PixelEndcapName(detid, &tTopo_, phase_).bladeName();
112  if (quadrant(detid, &tTopo_, phase_) % 2)
113  signed_blade *= -1;
114  return signed_blade;
115  }
116 
117  //============================================================================
118  int signed_blade_panel(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
120  return -9999;
121  int signed_blade_panel = signed_blade(detid, tTopo_, phase_) + (tTopo_.pxfPanel(detid) - 1);
122  return signed_blade_panel;
123  }
124 
125  //============================================================================
126  // Online disk convention
127  // Apply sign convention (- sign for BmO and BmI)
128  int signed_disk(const DetId& detid, const TrackerTopology& tTopo_, bool phase_) {
130  return -9999;
131  int signed_disk = tTopo_.pxfDisk(DetId(detid));
132  if (quadrant(detid, &tTopo_, phase_) < 3)
133  signed_disk *= -1;
134  return signed_disk;
135  }
136 
137  //============================================================================
138  void draw_line(double x1, double x2, double y1, double y2, int width = 2, int style = 1, int color = 1) {
139  TLine* l = new TLine(x1, y1, x2, y2);
140  l->SetBit(kCanDelete);
141  l->SetLineWidth(width);
142  l->SetLineStyle(style);
143  l->SetLineColor(color);
144  l->Draw();
145  }
146 
147  //============================================================================
148  void dress_occup_plot(TCanvas& canv,
149  TH2* h,
150  int lay,
151  int ring = 0,
152  int phase = 0,
153  bool half_shift = true,
154  bool mark_zero = true,
155  bool standard_palette = true) {
156  std::string s_title;
157 
158  if (lay > 0) {
159  canv.cd(lay);
160  s_title = "Barrel Pixel Layer" + std::to_string(lay);
161  } else {
162  canv.cd(ring);
163  s_title = "Forward Pixel Ring" + std::to_string(ring);
164  }
165 
166  gStyle->SetPadRightMargin(0.125);
167 
168  if (standard_palette) {
169  gStyle->SetPalette(1);
170  } else {
171  // this is the fine gradient palette
172  const Int_t NRGBs = 5;
173  const Int_t NCont = 255;
174 
175  Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
176  Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
177  Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
178  Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
179  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
180  gStyle->SetNumberContours(NCont);
181  }
182 
183  h->SetMarkerSize(0.7);
184  h->Draw("colz1");
185 
186  auto ltx = TLatex();
187  ltx.SetTextFont(62);
188  ltx.SetTextColor(1);
189  ltx.SetTextSize(0.06);
190  ltx.SetTextAlign(31);
191  ltx.DrawLatexNDC(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, (s_title).c_str());
192 
193  // Draw Lines around modules
194  if (lay > 0) {
195  std::vector<std::vector<int>> nladder = {{10, 16, 22}, {6, 14, 22, 32}};
196  int nlad = nladder[phase][lay - 1];
197  for (int xsign = -1; xsign <= 1; xsign += 2)
198  for (int ysign = -1; ysign <= 1; ysign += 2) {
199  float xlow = xsign * (half_shift * 0.5);
200  float xhigh = xsign * (half_shift * 0.5 + 4);
201  float ylow = ysign * (half_shift * 0.5 + (phase == 0) * 0.5);
202  float yhigh = ysign * (half_shift * 0.5 - (phase == 0) * 0.5 + nlad);
203  // Outside box
204  draw_line(xlow, xhigh, ylow, ylow, 1); // bottom
205  draw_line(xlow, xhigh, yhigh, yhigh, 1); // top
206  draw_line(xlow, xlow, ylow, yhigh, 1); // left
207  draw_line(xhigh, xhigh, ylow, yhigh, 1); // right
208  // Inner Horizontal lines
209  for (int lad = 1; lad < nlad; ++lad) {
210  float y = ysign * (lad + half_shift * 0.5);
211  draw_line(xlow, xhigh, y, y, 1);
212  }
213  for (int lad = 1; lad <= nlad; ++lad)
214  if (!(phase == 0 && (lad == 1 || lad == nlad))) {
215  float y = ysign * (lad + half_shift * 0.5 - 0.5);
216  draw_line(xlow, xhigh, y, y, 1, 3);
217  }
218  // Inner Vertical lines
219  for (int mod = 1; mod < 4; ++mod) {
220  float x = xsign * (mod + half_shift * 0.5);
221  draw_line(x, x, ylow, yhigh, 1);
222  }
223  // Make a BOX around ROC 0
224  // Phase 0 - ladder +1 is always non-flipped
225  // Phase 1 - ladder +1 is always flipped
226  if (mark_zero) {
227  for (int mod = 1; mod <= 4; ++mod)
228  for (int lad = 1; lad <= nlad; ++lad) {
229  bool flipped = ysign == 1 ? lad % 2 == 0 : lad % 2 == 1;
230  if (phase == 1)
231  flipped = !flipped;
232  int roc0_orientation = flipped ? -1 : 1;
233  if (xsign == -1)
234  roc0_orientation *= -1;
235  if (ysign == -1)
236  roc0_orientation *= -1;
237  float x1 = xsign * (mod + half_shift * 0.5);
238  float x2 = xsign * (mod + half_shift * 0.5 - 1. / 8);
239  float y1 = ysign * (lad + half_shift * 0.5 - 0.5);
240  float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 1. / 2);
241  if (!(phase == 0 && (lad == 1 || lad == nlad) && xsign == -1)) {
242  if (lay == 1 && xsign <= -1) {
243  float x1 = xsign * ((mod - 1) + half_shift * 0.5);
244  float x2 = xsign * ((mod - 1) + half_shift * 0.5 + 1. / 8);
245  float y1 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation);
246  float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 3. / 2);
247  draw_line(x1, x2, y1, y1, 1);
248  draw_line(x2, x2, y1, y2, 1);
249  } else {
250  draw_line(x1, x2, y1, y1, 1);
251  //draw_line(x1, x2, y2, y2, 1);
252  //draw_line(x1, x1, y1, y2, 1);
253  draw_line(x2, x2, y1, y2, 1);
254  }
255  }
256  }
257  }
258  }
259  } else {
260  // FPIX
261  for (int dsk = 1, ndsk = 2 + (phase == 1); dsk <= ndsk; ++dsk) {
262  for (int xsign = -1; xsign <= 1; xsign += 2)
263  for (int ysign = -1; ysign <= 1; ysign += 2) {
264  if (phase == 0) {
265  int first_roc = 3, nbin = 16;
266  for (int bld = 1, nbld = 12; bld <= nbld; ++bld) {
267  // Horizontal lines
268  for (int plq = 1, nplq = 7; plq <= nplq; ++plq) {
269  float xlow =
270  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (float)nbin);
271  float xhigh =
272  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * (plq + 1) - (plq == 7)) / (float)nbin);
273  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + plq / 2) * 0.1);
274  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + plq / 2) * 0.1);
275  draw_line(xlow, xhigh, ylow, ylow, 1); // bottom
276  draw_line(xlow, xhigh, yhigh, yhigh, 1); // top
277  }
278  // Vertical lines
279  for (int plq = 1, nplq = 7 + 1; plq <= nplq; ++plq) {
280  float x = xsign * (half_shift * 0.5 + dsk - 1 +
281  (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8)) / (float)nbin);
282  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
283  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
284  draw_line(x, x, ylow, yhigh, 1);
285  }
286  // Panel 2 has dashed mid-plane
287  for (int plq = 2, nplq = 6; plq <= nplq; ++plq)
288  if (plq % 2 == 0) {
289  float x = xsign * (half_shift * 0.5 + dsk - 1 +
290  (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8) + 1) / (float)nbin);
291  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
292  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
293  draw_line(x, x, ylow, yhigh, 1, 2);
294  }
295  // Make a BOX around ROC 0
296  for (int plq = 1, nplq = 7; plq <= nplq; ++plq) {
297  float x1 =
298  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (float)nbin);
299  float x2 =
300  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1) + 1) / (float)nbin);
301  int sign = xsign * ysign * ((plq % 2) ? 1 : -1);
302  float y1 = ysign * (half_shift * 0.5 + (bld - 0.5) + sign * (2 + plq / 2) * 0.1);
303  float y2 = ysign * (half_shift * 0.5 + (bld - 0.5) + sign * (plq / 2) * 0.1);
304  //draw_line(x1, x2, y1, y1, 1);
305  draw_line(x1, x2, y2, y2, 1);
306  //draw_line(x1, x1, y1, y2, 1);
307  draw_line(x2, x2, y1, y2, 1);
308  }
309  }
310  } else if (phase == 1) {
311  if (ring == 0) { // both
312  for (int ring = 1; ring <= 2; ++ring)
313  for (int bld = 1, nbld = 5 + ring * 6; bld <= nbld; ++bld) {
314  float scale = (ring == 1) ? 1.5 : 1;
315  Color_t p1_color = 1, p2_color = 1;
316  // Horizontal lines
317  // Panel 2 has dashed mid-plane
318  float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (ring - 1) * 0.5);
319  float x2 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5);
320  int sign = ysign;
321  float y1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.5);
322  //float yp1_mid = ysign * (half_shift*0.5 - 0.5 + scale*bld + sign*0.25);
323  float y2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld);
324  float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25);
325  float y3 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.5);
326  draw_line(x1, x2, y1, y1, 1, 1, p1_color);
327  //draw_line(x1, x2, yp1_mid, yp1_mid, 1, 3);
328  draw_line(x1, x2, y2, y2, 1, 1, p1_color);
329  draw_line(x1, x2, yp2_mid, yp2_mid, 1, 2);
330  draw_line(x1, x2, y3, y3, 1, 1, p2_color);
331  // Vertical lines
332  float x = xsign * (half_shift * 0.5 + dsk - 1 + (ring - 1) * 0.5);
333  draw_line(x, x, y1, y2, 1, 1, p1_color);
334  draw_line(x, x, y2, y3, 1, 1, p2_color);
335  if (ring == 2) {
336  //draw_line(x, x, y2, y3, 1, 1, p1_color);
337  x = xsign * (half_shift * 0.5 + dsk);
338  draw_line(x, x, y1, y2, 1, 1, p1_color);
339  draw_line(x, x, y2, y3, 1, 1, p2_color);
340  }
341  // Make a BOX around ROC 0
342  x1 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5 - 1 / 16.);
343  x2 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5);
344  float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.25);
345  float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.25 + xsign * ysign * 0.25);
346  draw_line(x1, x2, y1_p1, y1_p1, 1);
347  //draw_line(x1, x2, y2_p1, y2_p1, 1);
348  draw_line(x1, x1, y1_p1, y2_p1, 1);
349  //draw_line(x2, x2, y1_p1, y2_p1, 1);
350  float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25);
351  float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25 - xsign * ysign * 0.25);
352  draw_line(x1, x2, y1_p2, y1_p2, 1);
353  //draw_line(x1, x2, y2_p2, y2_p2, 1);
354  draw_line(x1, x1, y1_p2, y2_p2, 1);
355  //draw_line(x2, x2, y1_p2, y2_p2, 1);
356  }
357  } else { // only one ring, 1 or 2
358  for (int bld = 1, nbld = 5 + ring * 6; bld <= nbld; ++bld) {
359  Color_t p1_color = 1, p2_color = 1;
360  // Horizontal lines
361  // Panel 2 has dashed mid-plane
362  float x1 = xsign * (half_shift * 0.5 + dsk - 1);
363  float x2 = xsign * (half_shift * 0.5 + dsk);
364  int sign = ysign;
365  float y1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.5);
366  //float yp1_mid = ysign * (half_shift*0.5 - 0.5 + bld + sign*0.25);
367  float y2 = ysign * (half_shift * 0.5 - 0.5 + bld);
368  float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25);
369  float y3 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.5);
370  draw_line(x1, x2, y1, y1, 1, 1, p1_color);
371  //draw_line(x1, x2, yp1_mid, yp1_mid, 1, 3);
372  draw_line(x1, x2, y2, y2, 1, 1, p1_color);
373  draw_line(x1, x2, yp2_mid, yp2_mid, 1, 2);
374  draw_line(x1, x2, y3, y3, 1, 1, p2_color);
375  // Vertical lines
376  float x = xsign * (half_shift * 0.5 + dsk - 1);
377  draw_line(x, x, y1, y2, 1, 1, p1_color);
378  draw_line(x, x, y2, y3, 1, 1, p2_color);
379  if (ring == 2) {
380  //draw_line(x, x, y2, y3, 1, 1, p1_color);
381  x = xsign * (half_shift * 0.5 + dsk);
382  draw_line(x, x, y1, y2, 1, 1, p1_color);
383  draw_line(x, x, y2, y3, 1, 1, p2_color);
384  }
385  // Make a BOX around ROC 0
386  x1 = xsign * (half_shift * 0.5 + dsk - 1 / 8.);
387  x2 = xsign * (half_shift * 0.5 + dsk);
388  float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.25);
389  float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.25 + xsign * ysign * 0.25);
390  draw_line(x1, x2, y1_p1, y1_p1, 1);
391  //draw_line(x1, x2, y2_p1, y2_p1, 1);
392  draw_line(x1, x1, y1_p1, y2_p1, 1);
393  //draw_line(x2, x2, y1_p1, y2_p1, 1);
394  float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25);
395  float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25 - xsign * ysign * 0.25);
396  draw_line(x1, x2, y1_p2, y1_p2, 1);
397  //draw_line(x1, x2, y2_p2, y2_p2, 1);
398  draw_line(x1, x1, y1_p2, y2_p2, 1);
399  //draw_line(x2, x2, y1_p2, y2_p2, 1);
400  }
401  }
402  }
403  }
404  }
405  // Special shifted "rebin" for Phase 0
406  // Y axis should always have at least half-roc granularity because
407  // there are half-ROC size shifts implemented in the coordinates
408  // To remove this and show full ROC granularity
409  // We merge bin contents in each pair of bins corresponding to one ROC
410  // TODO: make sure this works for Profiles
411  if (phase == 0 && h->GetNbinsY() == 250 && h->GetNbinsX() == 80) {
412  int nentries = h->GetEntries();
413  for (int binx = 1; binx <= 80; ++binx) {
414  double sum = 0;
415  for (int biny = 1; biny <= 250; ++biny) {
416  bool odd_nrocy = (binx - 1 < 40) != (((binx - 1) / 4) % 2);
417  if (biny % 2 == odd_nrocy)
418  sum += h->GetBinContent(binx, biny);
419  else {
420  sum += h->GetBinContent(binx, biny);
421  if (sum) {
422  h->SetBinContent(binx, biny, sum);
423  h->SetBinContent(binx, biny - 1, sum);
424  }
425  sum = 0;
426  }
427  }
428  }
429  h->SetEntries(nentries);
430  }
431  }
432  }
433 
434  /*--------------------------------------------------------------------*/
435  void adjustCanvasMargins(TVirtualPad* pad, float top, float bottom, float left, float right)
436  /*--------------------------------------------------------------------*/
437  {
438  if (top > 0)
439  pad->SetTopMargin(top);
440  if (bottom > 0)
441  pad->SetBottomMargin(bottom);
442  if (left > 0)
443  pad->SetLeftMargin(left);
444  if (right > 0)
445  pad->SetRightMargin(right);
446  }
447 
448  /*--------------------------------------------------------------------*/
449  void adjustStats(TPaveStats* stats, float X1, float Y1, float X2, float Y2)
450  /*--------------------------------------------------------------------*/
451  {
452  stats->SetX1NDC(X1); //new x start position
453  stats->SetY1NDC(Y1); //new y start position
454  stats->SetX2NDC(X2); //new x end position
455  stats->SetY2NDC(Y2); //new y end position
456  }
457 
458  /*--------------------------------------------------------------------*/
459  std::pair<float, float> getExtrema(TH1* h1, TH1* h2)
460  /*--------------------------------------------------------------------*/
461  {
462  float theMax(-9999.);
463  float theMin(9999.);
464  theMax = h1->GetMaximum() > h2->GetMaximum() ? h1->GetMaximum() : h2->GetMaximum();
465  theMin = h1->GetMinimum() < h2->GetMaximum() ? h1->GetMinimum() : h2->GetMinimum();
466 
467  float add_min = theMin > 0. ? -0.05 : 0.05;
468  float add_max = theMax > 0. ? 0.05 : -0.05;
469 
470  auto result = std::make_pair(theMin * (1 + add_min), theMax * (1 + add_max));
471  return result;
472  }
473 
474  /*--------------------------------------------------------------------*/
476  /*--------------------------------------------------------------------*/
477  {
478  hist->SetStats(kFALSE);
479  hist->SetLineWidth(2);
480  hist->GetXaxis()->CenterTitle(true);
481  hist->GetYaxis()->CenterTitle(true);
482  hist->GetXaxis()->SetTitleFont(42);
483  hist->GetYaxis()->SetTitleFont(42);
484  hist->GetXaxis()->SetTitleSize(0.05);
485  hist->GetYaxis()->SetTitleSize(0.05);
486  hist->GetXaxis()->SetTitleOffset(1.1);
487  hist->GetYaxis()->SetTitleOffset(1.3);
488  hist->GetXaxis()->SetLabelFont(42);
489  hist->GetYaxis()->SetLabelFont(42);
490  hist->GetYaxis()->SetLabelSize(.05);
491  hist->GetXaxis()->SetLabelSize(.05);
492 
493  if (hist->InheritsFrom(TH2::Class())) {
494  hist->GetZaxis()->SetLabelFont(42);
495  hist->GetZaxis()->SetLabelFont(42);
496  hist->GetZaxis()->SetLabelSize(.05);
497  hist->GetZaxis()->SetLabelSize(.05);
498  }
499  }
500 
501  enum regions {
502  BPixL1o, //0 Barrel Pixel Layer 1 outer
503  BPixL1i, //1 Barrel Pixel Layer 1 inner
504  BPixL2o, //2 Barrel Pixel Layer 2 outer
505  BPixL2i, //3 Barrel Pixel Layer 2 inner
506  BPixL3o, //4 Barrel Pixel Layer 3 outer
507  BPixL3i, //5 Barrel Pixel Layer 3 inner
508  BPixL4o, //6 Barrel Pixel Layer 4 outer
509  BPixL4i, //7 Barrel Pixel Layer 4 inner
510  FPixmL1, //8 Forward Pixel Minus side Disk 1
511  FPixmL2, //9 Forward Pixel Minus side Disk 2
512  FPixmL3, //10 Forward Pixel Minus side Disk 3
513  FPixpL1, //11 Forward Pixel Plus side Disk 1
514  FPixpL2, //12 Forward Pixel Plus side Disk 2
515  FPixpL3, //13 Forward Pixel Plus side Disk 3
516  NUM_OF_REGIONS //14 -- default
517  };
518 
519  /*--------------------------------------------------------------------*/
521  /*--------------------------------------------------------------------*/
522  {
523  switch (e) {
524  case SiPixelPI::BPixL1o:
525  return "BPix L1/o";
526  case SiPixelPI::BPixL1i:
527  return "BPix L1/i";
528  case SiPixelPI::BPixL2o:
529  return "BPix L2/o";
530  case SiPixelPI::BPixL2i:
531  return "BPix L2/i";
532  case SiPixelPI::BPixL3o:
533  return "BPix L3/o";
534  case SiPixelPI::BPixL3i:
535  return "BPix L3/i";
536  case SiPixelPI::BPixL4o:
537  return "BPix L4/o";
538  case SiPixelPI::BPixL4i:
539  return "BPix L4/i";
540  case SiPixelPI::FPixmL1:
541  return "FPix- D1";
542  case SiPixelPI::FPixmL2:
543  return "FPix- D2";
544  case SiPixelPI::FPixmL3:
545  return "FPix- D3";
546  case SiPixelPI::FPixpL1:
547  return "FPix+ D1";
548  case SiPixelPI::FPixpL2:
549  return "FPix+ D2";
550  case SiPixelPI::FPixpL3:
551  return "FPix+ D3";
552  default:
553  edm::LogWarning("LogicError") << "Unknown partition: " << e;
554  return "";
555  }
556  }
557 
558  /*--------------------------------------------------------------------*/
559  bool isBPixOuterLadder(const DetId& detid, const TrackerTopology& tTopo, bool isPhase0)
560  /*--------------------------------------------------------------------*/
561  {
562  bool isOuter = false;
563  int layer = tTopo.pxbLayer(detid.rawId());
564  bool odd_ladder = tTopo.pxbLadder(detid.rawId()) % 2;
565  if (isPhase0) {
566  if (layer == 2)
567  isOuter = !odd_ladder;
568  else
569  isOuter = odd_ladder;
570  } else {
571  if (layer == 4)
572  isOuter = odd_ladder;
573  else
574  isOuter = !odd_ladder;
575  }
576  return isOuter;
577  }
578 
579  // ancillary struct to manage the topology
580  // info in a more compact way
581 
582  struct topolInfo {
583  private:
584  uint32_t m_rawid;
586  int m_layer;
587  int m_side;
588  int m_ring;
590 
591  public:
592  void init();
593  void fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, bool isPhase0);
595  bool sanityCheck();
596  void printAll();
597  virtual ~topolInfo() {}
598  };
599 
600  /*--------------------------------------------------------------------*/
602  /*--------------------------------------------------------------------*/
603  {
604  std::cout << " detId:" << m_rawid << " subdetid: " << m_subdetid << " layer: " << m_layer << " side: " << m_side
605  << " ring: " << m_ring << " isInternal:" << m_isInternal << std::endl;
606  }
607 
608  /*--------------------------------------------------------------------*/
610  /*--------------------------------------------------------------------*/
611  {
612  m_rawid = 0;
613  m_subdetid = -1;
614  m_layer = -1;
615  m_side = -1;
616  m_ring = -1;
617  m_isInternal = false;
618  };
619 
620  /*--------------------------------------------------------------------*/
622  /*--------------------------------------------------------------------*/
623  {
624  if (m_layer == 0 || (m_subdetid == 1 && m_layer > 4) || (m_subdetid == 2 && m_layer > 3)) {
625  return false;
626  } else {
627  return true;
628  }
629  }
630  /*--------------------------------------------------------------------*/
631  void topolInfo::fillGeometryInfo(const DetId& detId, const TrackerTopology& tTopo, bool isPhase0)
632  /*--------------------------------------------------------------------*/
633  {
634  unsigned int subdetId = static_cast<unsigned int>(detId.subdetId());
635 
636  m_rawid = detId.rawId();
637  m_subdetid = subdetId;
638  if (subdetId == PixelSubdetector::PixelBarrel) {
639  m_layer = tTopo.pxbLayer(detId.rawId());
640  m_isInternal = !SiPixelPI::isBPixOuterLadder(detId, tTopo, isPhase0);
641  } else if (subdetId == PixelSubdetector::PixelEndcap) {
642  m_layer = tTopo.pxfDisk(detId.rawId());
643  m_side = tTopo.pxfSide(detId.rawId());
644  } else
645  edm::LogWarning("LogicError") << "Unknown subdetid: " << subdetId;
646  }
647 
648  // ------------ method to assign a partition based on the topology struct info ---------------
649 
650  /*--------------------------------------------------------------------*/
652  /*--------------------------------------------------------------------*/
653  {
655 
656  // BPix
657  if (m_subdetid == 1) {
658  switch (m_layer) {
659  case 1:
661  break;
662  case 2:
664  break;
665  case 3:
667  break;
668  case 4:
670  break;
671  default:
672  edm::LogWarning("LogicError") << "Unknow BPix layer: " << m_layer;
673  break;
674  }
675  // FPix
676  } else if (m_subdetid == 2) {
677  switch (m_layer) {
678  case 1:
680  break;
681  case 2:
683  break;
684  case 3:
686  break;
687  default:
688  edm::LogWarning("LogicError") << "Unknow FPix disk: " << m_layer;
689  break;
690  }
691  }
692  return ret;
693  }
694 
695  // overloaded method: mask entire module
696  /*--------------------------------------------------------------------*/
697  std::vector<std::pair<int, int>> maskedBarrelRocsToBins(int layer, int ladder, int module)
698  /*--------------------------------------------------------------------*/
699  {
700  std::vector<std::pair<int, int>> rocsToMask;
701 
702  int nlad_list[4] = {6, 14, 22, 32};
703  int nlad = nlad_list[layer - 1];
704 
705  int start_x = module > 0 ? ((module + 4) * 8) + 1 : ((4 - (std::abs(module))) * 8) + 1;
706  int start_y = ladder > 0 ? ((ladder + nlad) * 2) + 1 : ((nlad - (std::abs(ladder))) * 2) + 1;
707 
708  int end_x = start_x + 7;
709  int end_y = start_y + 1;
710 
711  COUT << "module: " << module << " start_x:" << start_x << " end_x:" << end_x << std::endl;
712  COUT << "ladder: " << ladder << " start_y:" << start_y << " end_y:" << end_y << std::endl;
713  COUT << "==================================================================" << std::endl;
714 
715  for (int bin_x = 1; bin_x <= 72; bin_x++) {
716  for (int bin_y = 1; bin_y <= (nlad * 4 + 2); bin_y++) {
717  if (bin_x >= start_x && bin_x <= end_x && bin_y >= start_y && bin_y <= end_y) {
718  rocsToMask.push_back(std::make_pair(bin_x, bin_y));
719  }
720  }
721  }
722  return rocsToMask;
723  }
724 
725  // overloaded method: mask single ROCs
726  /*--------------------------------------------------------------------*/
727  std::vector<std::tuple<int, int, int>> maskedBarrelRocsToBins(
728  int layer, int ladder, int module, std::bitset<16> bad_rocs, bool isFlipped)
729  /*--------------------------------------------------------------------*/
730  {
731  std::vector<std::tuple<int, int, int>> rocsToMask;
732 
733  int nlad_list[4] = {6, 14, 22, 32};
734  int nlad = nlad_list[layer - 1];
735 
736  int start_x = module > 0 ? ((module + 4) * 8) + 1 : ((4 - (std::abs(module))) * 8) + 1;
737  int start_y = ladder > 0 ? ((ladder + nlad) * 2) + 1 : ((nlad - (std::abs(ladder))) * 2) + 1;
738 
739  int roc0_x = ((layer == 1) || (layer > 1 && module > 0)) ? start_x + 7 : start_x;
740  int roc0_y = start_y - 1;
741 
742  size_t idx = 0;
743  while (idx < bad_rocs.size()) {
744  if (bad_rocs.test(idx)) {
746  // | //
747  // In BPix Layer1 and module>0 in L2,3,4 | In BPix Layer 2,3,4 module > 0 //
748  // | //
749  // ROCs are ordered in the following | ROCs are ordered in the following //
750  // fashion for unplipped modules | fashion for unplipped modules //
751  // | //
752  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
753  // | 8 |9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
754  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
755  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
756  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
757  // | //
758  // if the module is flipped the ordering | if the module is flipped the ordering //
759  // is reveresed | is reversed //
760  // | //
761  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
762  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
763  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
764  // | 8 | 9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
765  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
767 
768  int roc_x(0), roc_y(0);
769 
770  if ((layer == 1) || (layer > 1 && module > 0)) {
771  if (!isFlipped) {
772  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
773  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
774  } else {
775  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
776  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
777  }
778  } else {
779  if (!isFlipped) {
780  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
781  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
782  } else {
783  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
784  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
785  }
786  }
787 
788  COUT << bad_rocs << " : (idx)= " << idx << std::endl;
789  COUT << " layer: " << layer << std::endl;
790  COUT << "module: " << module << " roc_x:" << roc_x << std::endl;
791  COUT << "ladder: " << ladder << " roc_y:" << roc_y << std::endl;
792  COUT << "==================================================================" << std::endl;
793 
794  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
795  }
796  ++idx;
797  }
798  return rocsToMask;
799  }
800 
801  // overloaded method: mask entire module
802  /*--------------------------------------------------------------------*/
803  std::vector<std::pair<int, int>> maskedForwardRocsToBins(int ring, int blade, int panel, int disk)
804  /*--------------------------------------------------------------------*/
805  {
806  std::vector<std::pair<int, int>> rocsToMask;
807  int nybins_list[2] = {92, 140};
808  int nybins = nybins_list[ring - 1];
809 
810  int start_x = disk > 0 ? ((disk + 3) * 8) + 1 : ((3 - (std::abs(disk))) * 8) + 1;
811  int start_y = blade > 0 ? (nybins / 2) + (blade * 4) - (panel * 2) + 3
812  : ((nybins / 2) - (std::abs(blade) * 4) - panel * 2) + 3;
813 
814  int end_x = start_x + 7;
815  int end_y = start_y + 1;
816 
817  COUT << "==================================================================" << std::endl;
818  COUT << "disk: " << disk << " start_x:" << start_x << " end_x:" << end_x << std::endl;
819  COUT << "blade: " << blade << " start_y:" << start_y << " end_y:" << end_y << std::endl;
820 
821  for (int bin_x = 1; bin_x <= 56; bin_x++) {
822  for (int bin_y = 1; bin_y <= nybins; bin_y++) {
823  if (bin_x >= start_x && bin_x <= end_x && bin_y >= start_y && bin_y <= end_y) {
824  rocsToMask.push_back(std::make_pair(bin_x, bin_y));
825  }
826  }
827  }
828  return rocsToMask;
829  }
830 
831  // overloaded method: mask single ROCs
832  /*--------------------------------------------------------------------*/
833  std::vector<std::tuple<int, int, int>> maskedForwardRocsToBins(
834  int ring, int blade, int panel, int disk, std::bitset<16> bad_rocs, bool isFlipped)
835  /*--------------------------------------------------------------------*/
836  {
837  std::vector<std::tuple<int, int, int>> rocsToMask;
838  int nybins_list[2] = {92, 140};
839  int nybins = nybins_list[ring - 1];
840 
841  int start_x = disk > 0 ? ((disk + 3) * 8) + 1 : ((3 - (std::abs(disk))) * 8) + 1;
842  int start_y = blade > 0 ? (nybins / 2) + (blade * 4) - (panel * 2) + 3
843  : ((nybins / 2) - (std::abs(blade) * 4) - panel * 2) + 3;
844 
845  int roc0_x = disk > 0 ? start_x + 7 : start_x;
846  int roc0_y = start_y - 1;
847 
848  size_t idx = 0;
849  while (idx < bad_rocs.size()) {
850  if (bad_rocs.test(idx)) {
851  int roc_x(0), roc_y(0);
852 
854  // | //
855  // In FPix + (Disk 1,2,3) | In FPix - (Disk -1,-2,-3) //
856  // | //
857  // ROCs are ordered in the following | ROCs are ordered in the following //
858  // fashion for unplipped modules | fashion for unplipped modules //
859  // | //
860  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
861  // | 8 |9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
862  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
863  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
864  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
865  // | //
866  // if the module is flipped the ordering | if the module is flipped the ordering //
867  // is reveresed | is reversed //
868  // | //
869  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
870  // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | //
871  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
872  // | 8 | 9 |10 |11 |12 |13 |14 |15 | | |15 |14 |13 |12 |11 |10 | 9 | 8 | //
873  // +---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ //
875 
876  if (disk > 0) {
877  if (!isFlipped) {
878  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
879  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
880  } else {
881  roc_x = idx < 8 ? roc0_x - idx : (start_x - 8) + idx;
882  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
883  }
884  } else {
885  if (!isFlipped) {
886  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
887  roc_y = idx < 8 ? roc0_y + 1 : roc0_y + 2;
888  } else {
889  roc_x = idx < 8 ? roc0_x + idx : (roc0_x + 7) - (idx - 8);
890  roc_y = idx < 8 ? roc0_y + 2 : roc0_y + 1;
891  }
892  }
893 
894  COUT << bad_rocs << " : (idx)= " << idx << std::endl;
895  COUT << " panel: " << panel << " isFlipped: " << isFlipped << std::endl;
896  COUT << " disk: " << disk << " roc_x:" << roc_x << std::endl;
897  COUT << " blade: " << blade << " roc_y:" << roc_y << std::endl;
898  COUT << "===============================" << std::endl;
899 
900  rocsToMask.push_back(std::make_tuple(roc_x, roc_y, idx));
901  }
902  ++idx;
903  }
904  return rocsToMask;
905  }
906 
907  using indexedCorners = std::map<unsigned int, std::pair<std::vector<float>, std::vector<float>>>;
908 
909  /*--------------------------------------------------------------------*/
910  const indexedCorners retrieveCorners(const std::vector<edm::FileInPath>& cornerFiles, const unsigned int reads)
911  /*--------------------------------------------------------------------*/
912  {
913  indexedCorners theOutMap;
914 
915  for (const auto& file : cornerFiles) {
916  auto cornerFileName = file.fullPath();
917  std::ifstream cornerFile(cornerFileName.c_str());
918  if (!cornerFile.good()) {
919  throw cms::Exception("FileError") << "Problem opening corner file: " << cornerFileName;
920  }
922  while (std::getline(cornerFile, line)) {
923  if (!line.empty()) {
924  std::istringstream iss(line);
925  unsigned int id;
927  std::vector<std::string> corners(reads, "");
928  std::vector<float> xP, yP;
929 
930  iss >> id >> name;
931  for (unsigned int i = 0; i < reads; ++i) {
932  iss >> corners.at(i);
933  }
934 
935  COUT << id << " : ";
936  for (unsigned int i = 0; i < reads; i++) {
937  // remove the leading and trailing " signs in the corners list
938  (corners[i]).erase(std::remove(corners[i].begin(), corners[i].end(), '"'), corners[i].end());
939  COUT << corners.at(i) << " ";
940  typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
941  boost::char_separator<char> sep{","};
942  tokenizer tok{corners.at(i), sep};
943  for (const auto& t : tok | boost::adaptors::indexed(0)) {
944  if (t.index() == 0) {
945  xP.push_back(atof((t.value()).c_str()));
946  } else if (t.index() == 1) {
947  yP.push_back(atof((t.value()).c_str()));
948  } else {
949  edm::LogError("LogicError") << "There should not be any token with index " << t.index() << std::endl;
950  }
951  }
952  }
953  COUT << std::endl;
954 
955  xP.push_back(xP.front());
956  yP.push_back(yP.front());
957 
958  for (unsigned int i = 0; i < xP.size(); i++) {
959  COUT << "x[" << i << "]=" << xP[i] << " y[" << i << "]" << yP[i] << std::endl;
960  }
961 
962  theOutMap[id] = std::make_pair(xP, yP);
963 
964  } // if line is empty
965  } // loop on lines
966  } // loop on files
967  return theOutMap;
968  }
969 
970  /*--------------------------------------------------------------------*/
971  void displayNotSupported(TCanvas& canv, const unsigned int size)
972  /*--------------------------------------------------------------------*/
973  {
974  std::string phase = (size < SiPixelPI::phase1size) ? "Phase-0" : "Phase-2";
975  canv.cd();
976  TLatex t2;
977  t2.SetTextAlign(21);
978  t2.SetTextSize(0.1);
979  t2.SetTextAngle(45);
980  t2.SetTextColor(kRed);
981  t2.DrawLatexNDC(0.6, 0.50, Form("%s NOT SUPPORTED!", phase.c_str()));
982  }
983 
984  /*--------------------------------------------------------------------*/
985  template <typename T>
986  std::pair<T, T> findMinMaxInMap(const std::map<unsigned int, T>& theMap)
987  /*--------------------------------------------------------------------*/
988  {
989  using pairtype = std::pair<unsigned int, T>;
990  auto max = *std::max_element(
991  theMap.begin(), theMap.end(), [](const pairtype& p1, const pairtype& p2) { return p1.second < p2.second; });
992  auto min = *std::min_element(
993  theMap.begin(), theMap.end(), [](const pairtype& p1, const pairtype& p2) { return p1.second < p2.second; });
994  return std::make_pair(min.second, max.second);
995  }
996 
997  /*--------------------------------------------------------------------*/
999  /*--------------------------------------------------------------------*/
1000  {
1001  std::transform(answer.begin(), answer.end(), answer.begin(), [](unsigned char x) { return ::tolower(x); });
1002 
1003  bool answer_valid = (answer == "y") || (answer == "n") || (answer == "yes") || (answer == "no") ||
1004  (answer == "true") || (answer == "false") || (answer == "1") || (answer == "0");
1005 
1006  result = answer_valid && (answer[0] == 'y' || answer[0] == 't' || answer[0] == '1');
1007  return answer_valid;
1008  }
1009 }; // namespace SiPixelPI
1010 #endif
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
SiPixelPI::unpack
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
Definition: SiPixelPayloadInspectorHelper.h:44
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
SiPixelPI::topolInfo::m_subdetid
int m_subdetid
Definition: SiPixelPayloadInspectorHelper.h:585
mps_fire.i
i
Definition: mps_fire.py:355
PixelSubdetector.h
PixelBarrelName.h
SiPixelPI::signed_disk
int signed_disk(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:128
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
SiPixelPI::BPixL4i
Definition: SiPixelPayloadInspectorHelper.h:509
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
SiPixelPI::topolInfo::m_layer
int m_layer
Definition: SiPixelPayloadInspectorHelper.h:586
SiPixelPI::ring
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:93
SiPixelPI
Definition: SiPixelPayloadInspectorHelper.h:37
min
T min(T a, T b)
Definition: MathUtil.h:58
SiPixelPI::topolInfo::m_isInternal
bool m_isInternal
Definition: SiPixelPayloadInspectorHelper.h:589
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
TrackerTopology
Definition: TrackerTopology.h:16
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SiPixelPI::getStringFromRegionEnum
std::string getStringFromRegionEnum(SiPixelPI::regions e)
Definition: SiPixelPayloadInspectorHelper.h:520
SiPixelPI::FPixpL3
Definition: SiPixelPayloadInspectorHelper.h:515
SiPixelPI::topolInfo::~topolInfo
virtual ~topolInfo()
Definition: SiPixelPayloadInspectorHelper.h:597
PixelBarrelName
Definition: PixelBarrelName.h:16
SiPixelPI::BPixL1i
Definition: SiPixelPayloadInspectorHelper.h:503
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
SiPixelPI::draw_line
void draw_line(double x1, double x2, double y1, double y2, int width=2, int style=1, int color=1)
Definition: SiPixelPayloadInspectorHelper.h:138
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
HLT_2018_cff.Class
Class
Definition: HLT_2018_cff.py:7110
HLT_2018_cff.phase
phase
Definition: HLT_2018_cff.py:5346
SiPixelPI::displayNotSupported
void displayNotSupported(TCanvas &canv, const unsigned int size)
Definition: SiPixelPayloadInspectorHelper.h:971
SiPixelPI::topolInfo::printAll
void printAll()
Definition: SiPixelPayloadInspectorHelper.h:601
training_settings.idx
idx
Definition: training_settings.py:16
COUT
#define COUT
Definition: SiPixelPayloadInspectorHelper.h:34
SiPixelPI::phase0size
static const unsigned int phase0size
Definition: SiPixelPayloadInspectorHelper.h:40
PixelEndcapName::bladeName
int bladeName() const
blade id
Definition: PixelEndcapName.h:48
electronCompare.red
red
Definition: electronCompare.py:135
end
#define end
Definition: vmac.h:39
SiPixelPI::checkAnswerOK
bool checkAnswerOK(std::string &answer, bool &result)
Definition: SiPixelPayloadInspectorHelper.h:998
FileInPath.h
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
SiPixelPI::BPixL3i
Definition: SiPixelPayloadInspectorHelper.h:507
DetId
Definition: DetId.h:17
TrackerTopology.h
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
SiPixelPI::BPixL3o
Definition: SiPixelPayloadInspectorHelper.h:506
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
SiPixelPI::isBPixOuterLadder
bool isBPixOuterLadder(const DetId &detid, const TrackerTopology &tTopo, bool isPhase0)
Definition: SiPixelPayloadInspectorHelper.h:559
PixelEndcapName
Definition: PixelEndcapName.h:16
SiPixelPI::quadrant
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:54
SiPixelPI::signed_blade
int signed_blade(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:108
SiPixelPI::topolInfo::m_rawid
uint32_t m_rawid
Definition: SiPixelPayloadInspectorHelper.h:584
compare.hist
hist
Definition: compare.py:376
SiPixelPI::retrieveCorners
const indexedCorners retrieveCorners(const std::vector< edm::FileInPath > &cornerFiles, const unsigned int reads)
Definition: SiPixelPayloadInspectorHelper.h:910
p2
double p2[4]
Definition: TauolaWrapper.h:90
SiPixelPI::BPixL1o
Definition: SiPixelPayloadInspectorHelper.h:502
writeEcalDQMStatus.since
since
Definition: writeEcalDQMStatus.py:53
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
h
OrderedSet.t
t
Definition: OrderedSet.py:90
SiPixelPI::FPixmL1
Definition: SiPixelPayloadInspectorHelper.h:510
SiPixelPI::topolInfo::filterThePartition
SiPixelPI::regions filterThePartition()
Definition: SiPixelPayloadInspectorHelper.h:651
PixelBarrelName::ladderName
int ladderName() const
ladder id (index in phi)
Definition: PixelBarrelName.h:49
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
style
Definition: style.py:1
SiPixelPI::FPixpL1
Definition: SiPixelPayloadInspectorHelper.h:513
submit.answer
answer
Definition: submit.py:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
SiPixelPI::FPixpL2
Definition: SiPixelPayloadInspectorHelper.h:514
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
Time.h
edm::LogError
Definition: MessageLogger.h:183
SiPixelPI::maskedBarrelRocsToBins
std::vector< std::pair< int, int > > maskedBarrelRocsToBins(int layer, int ladder, int module)
Definition: SiPixelPayloadInspectorHelper.h:697
SiPixelPI::FPixmL2
Definition: SiPixelPayloadInspectorHelper.h:511
PixelBarrelName::shell
Shell shell() const
Definition: PixelBarrelName.h:40
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SiPixelPI::phase1size
static const unsigned int phase1size
Definition: SiPixelPayloadInspectorHelper.h:41
cond::time::kLowMask
const Time_t kLowMask(0xFFFFFFFF)
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
SiPixelPI::BPixL4o
Definition: SiPixelPayloadInspectorHelper.h:508
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
TrackerTopology::pxfModule
unsigned int pxfModule(const DetId &id) const
Definition: TrackerTopology.h:163
electronCompare.blue
blue
Definition: electronCompare.py:137
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
p1
double p1[4]
Definition: TauolaWrapper.h:89
SiPixelPI::signed_blade_panel
int signed_blade_panel(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:118
SiPixelPI::regions
regions
Definition: SiPixelPayloadInspectorHelper.h:501
dqmMemoryStats.stats
stats
Definition: dqmMemoryStats.py:134
SiPixelPI::topolInfo::sanityCheck
bool sanityCheck()
Definition: SiPixelPayloadInspectorHelper.h:621
PixelBarrelName::moduleName
int moduleName() const
module id (index in z)
Definition: PixelBarrelName.h:46
module
Definition: vlib.h:198
SiPixelPI::indexedCorners
std::map< unsigned int, std::pair< std::vector< float >, std::vector< float > >> indexedCorners
Definition: SiPixelPayloadInspectorHelper.h:907
SiPixelPI::adjustStats
void adjustStats(TPaveStats *stats, float X1, float Y1, float X2, float Y2)
Definition: SiPixelPayloadInspectorHelper.h:449
SiPixelPI::NUM_OF_REGIONS
Definition: SiPixelPayloadInspectorHelper.h:516
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
SiPixelPI::signed_module
int signed_module(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:77
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
writedatasetfile.run
run
Definition: writedatasetfile.py:27
SiPixelPI::topolInfo
Definition: SiPixelPayloadInspectorHelper.h:582
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:212
ZMuMuCategoriesSequences_cff.nbin
nbin
Definition: ZMuMuCategoriesSequences_cff.py:25
PVValHelper::ladder
Definition: PVValidationHelpers.h:72
SiPixelPI::makeNicePlotStyle
void makeNicePlotStyle(TH1 *hist)
Definition: SiPixelPayloadInspectorHelper.h:475
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiPixelPI::FPixmL3
Definition: SiPixelPayloadInspectorHelper.h:512
SiPixelPI::getExtrema
std::pair< float, float > getExtrema(TH1 *h1, TH1 *h2)
Definition: SiPixelPayloadInspectorHelper.h:459
SiPixelPI::dress_occup_plot
void dress_occup_plot(TCanvas &canv, TH2 *h, int lay, int ring=0, int phase=0, bool half_shift=true, bool mark_zero=true, bool standard_palette=true)
Definition: SiPixelPayloadInspectorHelper.h:148
SiPixelPI::topolInfo::m_side
int m_side
Definition: SiPixelPayloadInspectorHelper.h:587
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiPixelPI::BPixL2i
Definition: SiPixelPayloadInspectorHelper.h:505
SiPixelPI::topolInfo::init
void init()
Definition: SiPixelPayloadInspectorHelper.h:609
mps_splice.line
line
Definition: mps_splice.py:76
lumi
Definition: LumiSectionData.h:20
SiPixelPI::topolInfo::m_ring
int m_ring
Definition: SiPixelPayloadInspectorHelper.h:588
SiPixelPI::topolInfo::fillGeometryInfo
void fillGeometryInfo(const DetId &detId, const TrackerTopology &tTopo, bool isPhase0)
Definition: SiPixelPayloadInspectorHelper.h:631
SiPixelPI::signed_ladder
int signed_ladder(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:65
begin
#define begin
Definition: vmac.h:32
SiPixelPI::maskedForwardRocsToBins
std::vector< std::pair< int, int > > maskedForwardRocsToBins(int ring, int blade, int panel, int disk)
Definition: SiPixelPayloadInspectorHelper.h:803
SiPixelPI::adjustCanvasMargins
void adjustCanvasMargins(TVirtualPad *pad, float top, float bottom, float left, float right)
Definition: SiPixelPayloadInspectorHelper.h:435
PixelEndcapName::ringName
int ringName() const
ring Id
Definition: PixelEndcapName.h:57
SiPixelPI::BPixL2o
Definition: SiPixelPayloadInspectorHelper.h:504
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PixelEndcapName.h
SiPixelPI::findMinMaxInMap
std::pair< T, T > findMinMaxInMap(const std::map< unsigned int, T > &theMap)
Definition: SiPixelPayloadInspectorHelper.h:986