CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Enumerations | Functions | Variables
SiPixelPI Namespace Reference

Classes

struct  PhaseInfo
 
struct  topolInfo
 

Enumerations

enum  DetType { t_barrel = 0, t_forward = 1, t_all = 2 }
 
enum  phase { zero = 0, one = 1, two = 2 }
 
enum  regions {
  BPixL1o, BPixL1i, BPixL2o, BPixL2i,
  BPixL3o, BPixL3i, BPixL4o, BPixL4i,
  FPixmL1, FPixmL2, FPixmL3, FPixpL1,
  FPixpL2, FPixpL3, NUM_OF_REGIONS
}
 

Functions

void adjustCanvasMargins (TVirtualPad *pad, float top, float bottom, float left, float right)
 
void adjustStats (TPaveStats *stats, float X1, float Y1, float X2, float Y2)
 
bool checkAnswerOK (std::string &answer, bool &result)
 
void displayNotSupported (TCanvas &canv, const unsigned int size)
 
void draw_line (double x1, double x2, double y1, double y2, int width=2, int style=1, int color=1)
 
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)
 
template<typename T >
std::pair< T, TfindMinMaxInMap (const std::map< unsigned int, T > &theMap)
 
std::pair< float, float > getExtrema (TH1 *h1, TH1 *h2)
 
std::string getStringFromRegionEnum (SiPixelPI::regions e)
 
bool isBPixOuterLadder (const DetId &detid, const TrackerTopology &tTopo, bool isPhase0)
 
void makeNicePlotStyle (TH1 *hist)
 
int quadrant (const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
 
int ring (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
int signed_blade (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
int signed_blade_panel (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
int signed_disk (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
int signed_ladder (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
int signed_module (const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
 
std::pair< unsigned int,
unsigned int > 
unpack (cond::Time_t since)
 

Variables

const std::array< std::string, 3 > DetNames = {{"Barrel", "End Caps", "Whole"}}
 
static const unsigned int phase0size = 1440
 
static const unsigned int phase1size = 1856
 
static const unsigned int phase2size = 3892
 

Enumeration Type Documentation

Enumerator
BPixL1o 
BPixL1i 
BPixL2o 
BPixL2i 
BPixL3o 
BPixL3i 
BPixL4o 
BPixL4i 
FPixmL1 
FPixmL2 
FPixmL3 
FPixpL1 
FPixpL2 
FPixpL3 
NUM_OF_REGIONS 

Definition at line 577 of file SiPixelPayloadInspectorHelper.h.

577  {
578  BPixL1o, //0 Barrel Pixel Layer 1 outer
579  BPixL1i, //1 Barrel Pixel Layer 1 inner
580  BPixL2o, //2 Barrel Pixel Layer 2 outer
581  BPixL2i, //3 Barrel Pixel Layer 2 inner
582  BPixL3o, //4 Barrel Pixel Layer 3 outer
583  BPixL3i, //5 Barrel Pixel Layer 3 inner
584  BPixL4o, //6 Barrel Pixel Layer 4 outer
585  BPixL4i, //7 Barrel Pixel Layer 4 inner
586  FPixmL1, //8 Forward Pixel Minus side Disk 1
587  FPixmL2, //9 Forward Pixel Minus side Disk 2
588  FPixmL3, //10 Forward Pixel Minus side Disk 3
589  FPixpL1, //11 Forward Pixel Plus side Disk 1
590  FPixpL2, //12 Forward Pixel Plus side Disk 2
591  FPixpL3, //13 Forward Pixel Plus side Disk 3
592  NUM_OF_REGIONS //14 -- default
593  };

Function Documentation

void SiPixelPI::adjustCanvasMargins ( TVirtualPad *  pad,
float  top,
float  bottom,
float  left,
float  right 
)
inline
void SiPixelPI::adjustStats ( TPaveStats *  stats,
float  X1,
float  Y1,
float  X2,
float  Y2 
)
inline
bool SiPixelPI::checkAnswerOK ( std::string &  answer,
bool &  result 
)
inline

Definition at line 809 of file SiPixelPayloadInspectorHelper.h.

References HcalDetIdTransform::transform().

Referenced by gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill(), and gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >::fill().

811  {
812  std::transform(answer.begin(), answer.end(), answer.begin(), [](unsigned char x) { return ::tolower(x); });
813 
814  bool answer_valid = (answer == "y") || (answer == "n") || (answer == "yes") || (answer == "no") ||
815  (answer == "true") || (answer == "false") || (answer == "1") || (answer == "0");
816 
817  result = answer_valid && (answer[0] == 'y' || answer[0] == 't' || answer[0] == '1');
818  return answer_valid;
819  }
tuple result
Definition: mps_fire.py:311
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
unsigned transform(const HcalDetId &id, unsigned transformCode)
void SiPixelPI::displayNotSupported ( TCanvas &  canv,
const unsigned int  size 
)
inline
void SiPixelPI::draw_line ( double  x1,
double  x2,
double  y1,
double  y2,
int  width = 2,
int  style = 1,
int  color = 1 
)
inline

Definition at line 208 of file SiPixelPayloadInspectorHelper.h.

References cmsLHEtoEOSManager::l.

Referenced by dress_occup_plot(), and PixelROCMapHelper::dress_plot().

208  {
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  }
void SiPixelPI::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 
)
inline

Definition at line 218 of file SiPixelPayloadInspectorHelper.h.

References DivergingColor::blue, draw_line(), mod(), DivergingColor::red, ring(), pileupReCalc_HLTpaths::scale, jetcorrextractor::sign(), and AlCaHLTBitMon_QueryRunRegistry::string.

225  {
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  if (ring > 4) {
234  ring = ring - 4;
235  }
236  s_title = "Forward Pixel Ring " + std::to_string(ring);
237  }
238 
239  gStyle->SetPadRightMargin(0.125);
240 
241  if (standard_palette) {
242  gStyle->SetPalette(1);
243  } else {
244  // this is the fine gradient palette
245  const Int_t NRGBs = 5;
246  const Int_t NCont = 255;
247 
248  Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
249  Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
250  Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
251  Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
252  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
253  gStyle->SetNumberContours(NCont);
254  }
255 
256  h->SetMarkerSize(0.7);
257  h->Draw("colz1");
258 
259  auto ltx = TLatex();
260  ltx.SetTextFont(62);
261  ltx.SetTextColor(1);
262  ltx.SetTextSize(0.06);
263  ltx.SetTextAlign(31);
264  ltx.DrawLatexNDC(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, (s_title).c_str());
265 
266  // Draw Lines around modules
267  if (lay > 0) {
268  std::vector<std::vector<int>> nladder = {{10, 16, 22}, {6, 14, 22, 32}};
269  int nlad = nladder[phase][lay - 1];
270  for (int xsign = -1; xsign <= 1; xsign += 2)
271  for (int ysign = -1; ysign <= 1; ysign += 2) {
272  float xlow = xsign * (half_shift * 0.5);
273  float xhigh = xsign * (half_shift * 0.5 + 4);
274  float ylow = ysign * (half_shift * 0.5 + (phase == 0) * 0.5);
275  float yhigh = ysign * (half_shift * 0.5 - (phase == 0) * 0.5 + nlad);
276  // Outside box
277  draw_line(xlow, xhigh, ylow, ylow, 1); // bottom
278  draw_line(xlow, xhigh, yhigh, yhigh, 1); // top
279  draw_line(xlow, xlow, ylow, yhigh, 1); // left
280  draw_line(xhigh, xhigh, ylow, yhigh, 1); // right
281  // Inner Horizontal lines
282  for (int lad = 1; lad < nlad; ++lad) {
283  float y = ysign * (lad + half_shift * 0.5);
284  draw_line(xlow, xhigh, y, y, 1);
285  }
286  for (int lad = 1; lad <= nlad; ++lad)
287  if (!(phase == 0 && (lad == 1 || lad == nlad))) {
288  float y = ysign * (lad + half_shift * 0.5 - 0.5);
289  draw_line(xlow, xhigh, y, y, 1, 3);
290  }
291  // Inner Vertical lines
292  for (int mod = 1; mod < 4; ++mod) {
293  float x = xsign * (mod + half_shift * 0.5);
294  draw_line(x, x, ylow, yhigh, 1);
295  }
296  // Make a BOX around ROC 0
297  // Phase 0 - ladder +1 is always non-flipped
298  // Phase 1 - ladder +1 is always flipped
299  if (mark_zero) {
300  for (int mod = 1; mod <= 4; ++mod)
301  for (int lad = 1; lad <= nlad; ++lad) {
302  bool flipped = ysign == 1 ? lad % 2 == 0 : lad % 2 == 1;
303  if (phase == 1)
304  flipped = !flipped;
305  int roc0_orientation = flipped ? -1 : 1;
306  if (xsign == -1)
307  roc0_orientation *= -1;
308  if (ysign == -1)
309  roc0_orientation *= -1;
310  float x1 = xsign * (mod + half_shift * 0.5);
311  float x2 = xsign * (mod + half_shift * 0.5 - 1. / 8);
312  float y1 = ysign * (lad + half_shift * 0.5 - 0.5);
313  float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 1. / 2);
314  if (!(phase == 0 && (lad == 1 || lad == nlad) && xsign == -1)) {
315  if (lay == 1 && xsign <= -1) {
316  float x1 = xsign * ((mod - 1) + half_shift * 0.5);
317  float x2 = xsign * ((mod - 1) + half_shift * 0.5 + 1. / 8);
318  float y1 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation);
319  float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 3. / 2);
320  draw_line(x1, x2, y1, y1, 1);
321  draw_line(x2, x2, y1, y2, 1);
322  } else {
323  draw_line(x1, x2, y1, y1, 1);
324  //draw_line(x1, x2, y2, y2, 1);
325  //draw_line(x1, x1, y1, y2, 1);
326  draw_line(x2, x2, y1, y2, 1);
327  }
328  }
329  }
330  }
331  }
332  } else {
333  // FPIX
334  for (int dsk = 1, ndsk = 2 + (phase == 1); dsk <= ndsk; ++dsk) {
335  for (int xsign = -1; xsign <= 1; xsign += 2)
336  for (int ysign = -1; ysign <= 1; ysign += 2) {
337  if (phase == 0) {
338  int first_roc = 3, nbin = 16;
339  for (int bld = 1, nbld = 12; bld <= nbld; ++bld) {
340  // Horizontal lines
341  for (int plq = 1, nplq = 7; plq <= nplq; ++plq) {
342  float xlow =
343  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (float)nbin);
344  float xhigh =
345  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * (plq + 1) - (plq == 7)) / (float)nbin);
346  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + plq / 2) * 0.1);
347  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + plq / 2) * 0.1);
348  draw_line(xlow, xhigh, ylow, ylow, 1); // bottom
349  draw_line(xlow, xhigh, yhigh, yhigh, 1); // top
350  }
351  // Vertical lines
352  for (int plq = 1, nplq = 7 + 1; plq <= nplq; ++plq) {
353  float x = xsign * (half_shift * 0.5 + dsk - 1 +
354  (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8)) / (float)nbin);
355  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
356  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
357  draw_line(x, x, ylow, yhigh, 1);
358  }
359  // Panel 2 has dashed mid-plane
360  for (int plq = 2, nplq = 6; plq <= nplq; ++plq)
361  if (plq % 2 == 0) {
362  float x = xsign * (half_shift * 0.5 + dsk - 1 +
363  (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8) + 1) / (float)nbin);
364  float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
365  float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
366  draw_line(x, x, ylow, yhigh, 1, 2);
367  }
368  // Make a BOX around ROC 0
369  for (int plq = 1, nplq = 7; plq <= nplq; ++plq) {
370  float x1 =
371  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (float)nbin);
372  float x2 =
373  xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1) + 1) / (float)nbin);
374  int sign = xsign * ysign * ((plq % 2) ? 1 : -1);
375  float y1 = ysign * (half_shift * 0.5 + (bld - 0.5) + sign * (2 + plq / 2) * 0.1);
376  float y2 = ysign * (half_shift * 0.5 + (bld - 0.5) + sign * (plq / 2) * 0.1);
377  //draw_line(x1, x2, y1, y1, 1);
378  draw_line(x1, x2, y2, y2, 1);
379  //draw_line(x1, x1, y1, y2, 1);
380  draw_line(x2, x2, y1, y2, 1);
381  }
382  }
383  } else if (phase == 1) {
384  if (ring == 0) { // both
385  for (int ring = 1; ring <= 2; ++ring)
386  for (int bld = 1, nbld = 5 + ring * 6; bld <= nbld; ++bld) {
387  float scale = (ring == 1) ? 1.5 : 1;
388  Color_t p1_color = 1, p2_color = 1;
389  // Horizontal lines
390  // Panel 2 has dashed mid-plane
391  float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (ring - 1) * 0.5);
392  float x2 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5);
393  int sign = ysign;
394  float y1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.5);
395  //float yp1_mid = ysign * (half_shift*0.5 - 0.5 + scale*bld + sign*0.25);
396  float y2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld);
397  float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25);
398  float y3 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.5);
399  draw_line(x1, x2, y1, y1, 1, 1, p1_color);
400  //draw_line(x1, x2, yp1_mid, yp1_mid, 1, 3);
401  draw_line(x1, x2, y2, y2, 1, 1, p1_color);
402  draw_line(x1, x2, yp2_mid, yp2_mid, 1, 2);
403  draw_line(x1, x2, y3, y3, 1, 1, p2_color);
404  // Vertical lines
405  float x = xsign * (half_shift * 0.5 + dsk - 1 + (ring - 1) * 0.5);
406  draw_line(x, x, y1, y2, 1, 1, p1_color);
407  draw_line(x, x, y2, y3, 1, 1, p2_color);
408  if (ring == 2) {
409  //draw_line(x, x, y2, y3, 1, 1, p1_color);
410  x = xsign * (half_shift * 0.5 + dsk);
411  draw_line(x, x, y1, y2, 1, 1, p1_color);
412  draw_line(x, x, y2, y3, 1, 1, p2_color);
413  }
414  // Make a BOX around ROC 0
415  x1 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5 - 1 / 16.);
416  x2 = xsign * (half_shift * 0.5 + dsk - 1 + ring * 0.5);
417  float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.25);
418  float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + scale * bld + sign * 0.25 + xsign * ysign * 0.25);
419  draw_line(x1, x2, y1_p1, y1_p1, 1);
420  //draw_line(x1, x2, y2_p1, y2_p1, 1);
421  draw_line(x1, x1, y1_p1, y2_p1, 1);
422  //draw_line(x2, x2, y1_p1, y2_p1, 1);
423  float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25);
424  float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + scale * bld - sign * 0.25 - xsign * ysign * 0.25);
425  draw_line(x1, x2, y1_p2, y1_p2, 1);
426  //draw_line(x1, x2, y2_p2, y2_p2, 1);
427  draw_line(x1, x1, y1_p2, y2_p2, 1);
428  //draw_line(x2, x2, y1_p2, y2_p2, 1);
429  }
430  } else { // only one ring, 1 or 2
431  for (int bld = 1, nbld = 5 + ring * 6; bld <= nbld; ++bld) {
432  Color_t p1_color = 1, p2_color = 1;
433  // Horizontal lines
434  // Panel 2 has dashed mid-plane
435  float x1 = xsign * (half_shift * 0.5 + dsk - 1);
436  float x2 = xsign * (half_shift * 0.5 + dsk);
437  int sign = ysign;
438  float y1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.5);
439  //float yp1_mid = ysign * (half_shift*0.5 - 0.5 + bld + sign*0.25);
440  float y2 = ysign * (half_shift * 0.5 - 0.5 + bld);
441  float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25);
442  float y3 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.5);
443  draw_line(x1, x2, y1, y1, 1, 1, p1_color);
444  //draw_line(x1, x2, yp1_mid, yp1_mid, 1, 3);
445  draw_line(x1, x2, y2, y2, 1, 1, p1_color);
446  draw_line(x1, x2, yp2_mid, yp2_mid, 1, 2);
447  draw_line(x1, x2, y3, y3, 1, 1, p2_color);
448  // Vertical lines
449  float x = xsign * (half_shift * 0.5 + dsk - 1);
450  draw_line(x, x, y1, y2, 1, 1, p1_color);
451  draw_line(x, x, y2, y3, 1, 1, p2_color);
452  if (ring == 2) {
453  //draw_line(x, x, y2, y3, 1, 1, p1_color);
454  x = xsign * (half_shift * 0.5 + dsk);
455  draw_line(x, x, y1, y2, 1, 1, p1_color);
456  draw_line(x, x, y2, y3, 1, 1, p2_color);
457  }
458  // Make a BOX around ROC 0
459  x1 = xsign * (half_shift * 0.5 + dsk - 1 / 8.);
460  x2 = xsign * (half_shift * 0.5 + dsk);
461  float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.25);
462  float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + bld + sign * 0.25 + xsign * ysign * 0.25);
463  draw_line(x1, x2, y1_p1, y1_p1, 1);
464  //draw_line(x1, x2, y2_p1, y2_p1, 1);
465  draw_line(x1, x1, y1_p1, y2_p1, 1);
466  //draw_line(x2, x2, y1_p1, y2_p1, 1);
467  float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25);
468  float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + bld - sign * 0.25 - xsign * ysign * 0.25);
469  draw_line(x1, x2, y1_p2, y1_p2, 1);
470  //draw_line(x1, x2, y2_p2, y2_p2, 1);
471  draw_line(x1, x1, y1_p2, y2_p2, 1);
472  //draw_line(x2, x2, y1_p2, y2_p2, 1);
473  }
474  }
475  }
476  }
477  }
478  // Special shifted "rebin" for Phase 0
479  // Y axis should always have at least half-roc granularity because
480  // there are half-ROC size shifts implemented in the coordinates
481  // To remove this and show full ROC granularity
482  // We merge bin contents in each pair of bins corresponding to one ROC
483  // TODO: make sure this works for Profiles
484  if (phase == 0 && h->GetNbinsY() == 250 && h->GetNbinsX() == 80) {
485  int nentries = h->GetEntries();
486  for (int binx = 1; binx <= 80; ++binx) {
487  double sum = 0;
488  for (int biny = 1; biny <= 250; ++biny) {
489  bool odd_nrocy = (binx - 1 < 40) != (((binx - 1) / 4) % 2);
490  if (biny % 2 == odd_nrocy)
491  sum += h->GetBinContent(binx, biny);
492  else {
493  sum += h->GetBinContent(binx, biny);
494  if (sum) {
495  h->SetBinContent(binx, biny, sum);
496  h->SetBinContent(binx, biny - 1, sum);
497  }
498  sum = 0;
499  }
500  }
501  }
502  h->SetEntries(nentries);
503  }
504  }
505  }
double sign(double x)
if(conf_.getParameter< bool >("UseStripCablingDB"))
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
void draw_line(double x1, double x2, double y1, double y2, int width=2, int style=1, int color=1)
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
template<typename T >
std::pair<T, T> SiPixelPI::findMinMaxInMap ( const std::map< unsigned int, T > &  theMap)

Definition at line 797 of file SiPixelPayloadInspectorHelper.h.

References SiStripPI::max, min(), fireworks::p1, and fireworks::p2.

799  {
800  using pairtype = std::pair<unsigned int, T>;
801  auto max = *std::max_element(
802  theMap.begin(), theMap.end(), [](const pairtype& p1, const pairtype& p2) { return p1.second < p2.second; });
803  auto min = *std::min_element(
804  theMap.begin(), theMap.end(), [](const pairtype& p1, const pairtype& p2) { return p1.second < p2.second; });
805  return std::make_pair(min.second, max.second);
806  }
const TString p2
Definition: fwPaths.cc:13
const TString p1
Definition: fwPaths.cc:12
T min(T a, T b)
Definition: MathUtil.h:58
std::pair<float, float> SiPixelPI::getExtrema ( TH1 *  h1,
TH1 *  h2 
)
inline

Definition at line 532 of file SiPixelPayloadInspectorHelper.h.

References mps_fire::result.

Referenced by gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >::fill(), and PixelRegions::PixelRegionContainers::rescaleMax().

534  {
535  float theMax(-9999.);
536  float theMin(9999.);
537  theMax = h1->GetMaximum() > h2->GetMaximum() ? h1->GetMaximum() : h2->GetMaximum();
538  theMin = h1->GetMinimum() < h2->GetMaximum() ? h1->GetMinimum() : h2->GetMinimum();
539 
540  float add_min = theMin > 0. ? -0.05 : 0.05;
541  float add_max = theMax > 0. ? 0.05 : -0.05;
542 
543  auto result = std::make_pair(theMin * (1 + add_min), theMax * (1 + add_max));
544  return result;
545  }
tuple result
Definition: mps_fire.py:311
std::string SiPixelPI::getStringFromRegionEnum ( SiPixelPI::regions  e)
inline

Definition at line 596 of file SiPixelPayloadInspectorHelper.h.

References BPixL1i, BPixL1o, BPixL2i, BPixL2o, BPixL3i, BPixL3o, BPixL4i, BPixL4o, alignCSCRings::e, FPixmL1, FPixmL2, FPixmL3, FPixpL1, FPixpL2, and FPixpL3.

Referenced by gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >::fill().

598  {
599  switch (e) {
600  case SiPixelPI::BPixL1o:
601  return "BPix L1/o";
602  case SiPixelPI::BPixL1i:
603  return "BPix L1/i";
604  case SiPixelPI::BPixL2o:
605  return "BPix L2/o";
606  case SiPixelPI::BPixL2i:
607  return "BPix L2/i";
608  case SiPixelPI::BPixL3o:
609  return "BPix L3/o";
610  case SiPixelPI::BPixL3i:
611  return "BPix L3/i";
612  case SiPixelPI::BPixL4o:
613  return "BPix L4/o";
614  case SiPixelPI::BPixL4i:
615  return "BPix L4/i";
616  case SiPixelPI::FPixmL1:
617  return "FPix- D1";
618  case SiPixelPI::FPixmL2:
619  return "FPix- D2";
620  case SiPixelPI::FPixmL3:
621  return "FPix- D3";
622  case SiPixelPI::FPixpL1:
623  return "FPix+ D1";
624  case SiPixelPI::FPixpL2:
625  return "FPix+ D2";
626  case SiPixelPI::FPixpL3:
627  return "FPix+ D3";
628  default:
629  edm::LogWarning("LogicError") << "Unknown partition: " << e;
630  return "";
631  }
632  }
Log< level::Warning, false > LogWarning
bool SiPixelPI::isBPixOuterLadder ( const DetId detid,
const TrackerTopology tTopo,
bool  isPhase0 
)
inline

Definition at line 635 of file SiPixelPayloadInspectorHelper.h.

References phase1PixelTopology::layer, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), and DetId::rawId().

Referenced by SiPixelPI::topolInfo::fillGeometryInfo().

637  {
638  bool isOuter = false;
639  int layer = tTopo.pxbLayer(detid.rawId());
640  bool odd_ladder = tTopo.pxbLadder(detid.rawId()) % 2;
641  if (isPhase0) {
642  if (layer == 2)
643  isOuter = !odd_ladder;
644  else
645  isOuter = odd_ladder;
646  } else {
647  if (layer == 4)
648  isOuter = odd_ladder;
649  else
650  isOuter = !odd_ladder;
651  }
652  return isOuter;
653  }
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int pxbLayer(const DetId &id) const
void SiPixelPI::makeNicePlotStyle ( TH1 *  hist)
inline

Definition at line 548 of file SiPixelPayloadInspectorHelper.h.

Referenced by PixelRegions::PixelRegionContainers::beautify(), gainCalibHelper::SiPixelGainCalibrationValues< myType, PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibrationCorrelations< PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibrationValuesByPart< myType, PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibrationValueComparisonBase< myType, PayloadType >::fill(), gainCalibHelper::SiPixelGainCalibDiffAndRatioBase< myType, nIOVs, ntags, PayloadType >::fill(), and gainCalibHelper::SiPixelGainCalibrationByRegionComparisonBase< myType, PayloadType, nIOVs, ntags >::fill().

550  {
551  hist->SetStats(kFALSE);
552  hist->SetLineWidth(2);
553  hist->GetXaxis()->CenterTitle(true);
554  hist->GetYaxis()->CenterTitle(true);
555  hist->GetXaxis()->SetTitleFont(42);
556  hist->GetYaxis()->SetTitleFont(42);
557  hist->GetXaxis()->SetTitleSize(0.05);
558  hist->GetYaxis()->SetTitleSize(0.05);
559  hist->GetXaxis()->SetTitleOffset(1.1);
560  hist->GetYaxis()->SetTitleOffset(1.3);
561  hist->GetXaxis()->SetLabelFont(42);
562  hist->GetYaxis()->SetLabelFont(42);
563  hist->GetYaxis()->SetLabelSize(.05);
564  hist->GetXaxis()->SetLabelSize(.05);
565 
566  if (hist->InheritsFrom(TH2::Class())) {
567  hist->GetZaxis()->SetLabelFont(42);
568  hist->GetZaxis()->SetLabelFont(42);
569  hist->GetZaxis()->SetLabelSize(.05);
570  hist->GetZaxis()->SetLabelSize(.05);
571  }
572  }
__shared__ Hist hist
int SiPixelPI::quadrant ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline
int SiPixelPI::ring ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 163 of file SiPixelPayloadInspectorHelper.h.

References PixelSubdetector::PixelEndcap, TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), PixelEndcapName::ringName(), and DetId::subdetId().

Referenced by PixelRegions::detIdToPixelId(), dress_occup_plot(), and gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

163  {
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  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxfModule(const DetId &id) const
int ringName() const
ring Id
unsigned int pxfPanel(const DetId &id) const
int SiPixelPI::signed_blade ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 178 of file SiPixelPayloadInspectorHelper.h.

References PixelEndcapName::bladeName(), PixelSubdetector::PixelEndcap, quadrant(), and DetId::subdetId().

Referenced by signed_blade_panel().

178  {
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  }
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
int bladeName() const
blade id
int signed_blade(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int SiPixelPI::signed_blade_panel ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 188 of file SiPixelPayloadInspectorHelper.h.

References PixelSubdetector::PixelEndcap, TrackerTopology::pxfPanel(), signed_blade(), and DetId::subdetId().

188  {
190  return -9999;
191  int signed_blade_panel = signed_blade(detid, tTopo_, phase_) + (tTopo_.pxfPanel(detid) - 1);
192  return signed_blade_panel;
193  }
int signed_blade_panel(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
int signed_blade(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxfPanel(const DetId &id) const
int SiPixelPI::signed_disk ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 198 of file SiPixelPayloadInspectorHelper.h.

References PixelSubdetector::PixelEndcap, TrackerTopology::pxfDisk(), quadrant(), and DetId::subdetId().

198  {
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  }
unsigned int pxfDisk(const DetId &id) const
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
int signed_disk(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
int SiPixelPI::signed_ladder ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 135 of file SiPixelPayloadInspectorHelper.h.

References PixelBarrelName::ladderName(), PixelSubdetector::PixelBarrel, quadrant(), and DetId::subdetId().

135  {
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  }
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
int signed_ladder(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int ladderName() const
ladder id (index in phi)
int SiPixelPI::signed_module ( const DetId detid,
const TrackerTopology tTopo_,
bool  phase_ 
)
inline

Definition at line 147 of file SiPixelPayloadInspectorHelper.h.

References PixelBarrelName::moduleName(), PixelSubdetector::PixelBarrel, quadrant(), and DetId::subdetId().

147  {
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  }
int moduleName() const
module id (index in z)
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int signed_module(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
std::pair<unsigned int, unsigned int> SiPixelPI::unpack ( cond::Time_t  since)
inline

Definition at line 114 of file SiPixelPayloadInspectorHelper.h.

References cond::time::kLowMask(), dqmdumpme::lumi, and submitPVValidationJobs::run.

Referenced by gainCalibHelper::SiPixelGainCalibrationMap< myType, PayloadType, myDetType >::fill().

114  {
115  auto kLowMask = 0XFFFFFFFF;
116  auto run = (since >> 32);
117  auto lumi = (since & kLowMask);
118  return std::make_pair(run, lumi);
119  }
const Time_t kLowMask(0xFFFFFFFF)
list lumi
Definition: dqmdumpme.py:53

Variable Documentation

const std::array<std::string, 3> SiPixelPI::DetNames = {{"Barrel", "End Caps", "Whole"}}

Definition at line 575 of file SiPixelPayloadInspectorHelper.h.

const unsigned int SiPixelPI::phase0size = 1440
static
const unsigned int SiPixelPI::phase1size = 1856
static
const unsigned int SiPixelPI::phase2size = 3892
static

Definition at line 44 of file SiPixelPayloadInspectorHelper.h.

Referenced by SiPixelPI::PhaseInfo::PhaseInfo().