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