CMS 3D CMS Logo

Classes | Enumerations | Functions | Variables
AlignmentPI Namespace Reference

Classes

struct  topolInfo
 

Enumerations

enum  coordinate {
  t_x = 1, t_y = 2, t_z = 3, rot_alpha = 4,
  rot_beta = 5, rot_gamma = 6
}
 
enum  index {
  XX = 1, XY = 2, XZ = 3, YZ = 4,
  YY = 5, ZZ = 6
}
 
enum  partitions {
  BPix = 1, FPix = 2, TIB = 3, TID = 4,
  TOB = 5, TEC = 6
}
 
enum  regions {
  BPixL1o, BPixL1i, BPixL2o, BPixL2i,
  BPixL3o, BPixL3i, BPixL4o, BPixL4i,
  FPixmL1, FPixmL2, FPixmL3, FPixpL1,
  FPixpL2, FPixpL3, TIBL1Ro, TIBL1Ri,
  TIBL1So, TIBL1Si, TIBL2Ro, TIBL2Ri,
  TIBL2So, TIBL2Si, TIBL3o, TIBL3i,
  TIBL4o, TIBL4i, TOBL1Ro, TOBL1Ri,
  TOBL1So, TOBL1Si, TOBL2Ro, TOBL2Ri,
  TOBL2So, TOBL2Si, TOBL3o, TOBL3i,
  TOBL4o, TOBL4i, TOBL5o, TOBL5i,
  TOBL6o, TOBL6i, TIDmR1R, TIDmR1S,
  TIDmR2R, TIDmR2S, TIDmR3, TIDpR1R,
  TIDpR1S, TIDpR2R, TIDpR2S, TIDpR3,
  TECmR1R, TECmR1S, TECmR2R, TECmR2S,
  TECmR3, TECmR4, TECmR5, TECmR6,
  TECmR7, TECpR1R, TECpR1S, TECpR2R,
  TECpR2S, TECpR3, TECpR4, TECpR5,
  TECpR6, TECpR7, StripDoubleSide, NUM_OF_REGIONS
}
 

Functions

std::pair< double, double > calculatePosition (TVirtualPad *myPad, int boundary)
 
std::pair< int, int > getIndices (AlignmentPI::index i)
 
std::string getStringFromCoordinate (AlignmentPI::coordinate coord)
 
std::string getStringFromIndex (AlignmentPI::index i)
 
std::string getStringFromPart (AlignmentPI::partitions i)
 
std::string getStringFromRegionEnum (AlignmentPI::regions e)
 
std::pair< float, float > getTheRange (std::map< uint32_t, float > values, const float nsigma)
 
bool isBPixOuterLadder (const DetId &detid, const TrackerTopology &tTopo, bool isPhase0)
 
void makeNicePlotStyle (TH1 *hist, int color)
 
void makeNiceStats (TH1F *hist, AlignmentPI::partitions part, int color)
 

Variables

static const float cmToUm = 10000
 
static const unsigned int phase0size = 19876
 

Enumeration Type Documentation

Enumerator
BPix 
FPix 
TIB 
TID 
TOB 
TEC 

Definition at line 38 of file AlignmentPayloadInspectorHelper.h.

38  {
39  BPix = 1, // Barrel Pixel
40  FPix = 2, // Forward Pixel
41  TIB = 3, // Tracker Inner Barrel
42  TID = 4, // Tracker Inner Disks
43  TOB = 5, // Tracker Outer Barrel
44  TEC = 6 // Tracker Endcaps
45  };
Enumerator
BPixL1o 
BPixL1i 
BPixL2o 
BPixL2i 
BPixL3o 
BPixL3i 
BPixL4o 
BPixL4i 
FPixmL1 
FPixmL2 
FPixmL3 
FPixpL1 
FPixpL2 
FPixpL3 
TIBL1Ro 
TIBL1Ri 
TIBL1So 
TIBL1Si 
TIBL2Ro 
TIBL2Ri 
TIBL2So 
TIBL2Si 
TIBL3o 
TIBL3i 
TIBL4o 
TIBL4i 
TOBL1Ro 
TOBL1Ri 
TOBL1So 
TOBL1Si 
TOBL2Ro 
TOBL2Ri 
TOBL2So 
TOBL2Si 
TOBL3o 
TOBL3i 
TOBL4o 
TOBL4i 
TOBL5o 
TOBL5i 
TOBL6o 
TOBL6i 
TIDmR1R 
TIDmR1S 
TIDmR2R 
TIDmR2S 
TIDmR3 
TIDpR1R 
TIDpR1S 
TIDpR2R 
TIDpR2S 
TIDpR3 
TECmR1R 
TECmR1S 
TECmR2R 
TECmR2S 
TECmR3 
TECmR4 
TECmR5 
TECmR6 
TECmR7 
TECpR1R 
TECpR1S 
TECpR2R 
TECpR2S 
TECpR3 
TECpR4 
TECpR5 
TECpR6 
TECpR7 
StripDoubleSide 
NUM_OF_REGIONS 

Definition at line 47 of file AlignmentPayloadInspectorHelper.h.

47  {
48  BPixL1o, //0 Barrel Pixel Layer 1 outer
49  BPixL1i, //1 Barrel Pixel Layer 1 inner
50  BPixL2o, //2 Barrel Pixel Layer 2 outer
51  BPixL2i, //3 Barrel Pixel Layer 2 inner
52  BPixL3o, //4 Barrel Pixel Layer 3 outer
53  BPixL3i, //5 Barrel Pixel Layer 3 inner
54  BPixL4o, //6 Barrel Pixel Layer 4 outer
55  BPixL4i, //7 Barrel Pixel Layer 4 inner
56  FPixmL1, //8 Forward Pixel Minus side Disk 1
57  FPixmL2, //9 Forward Pixel Minus side Disk 2
58  FPixmL3, //10 Forward Pixel Minus side Disk 3
59  FPixpL1, //11 Forward Pixel Plus side Disk 1
60  FPixpL2, //12 Forward Pixel Plus side Disk 2
61  FPixpL3, //13 Forward Pixel Plus side Disk 3
62  TIBL1Ro, //14 Inner Barrel Layer 1 Rphi outer
63  TIBL1Ri, //15 Inner Barrel Layer 1 Rphi inner
64  TIBL1So, //16 Inner Barrel Layer 1 Stereo outer
65  TIBL1Si, //17 Inner Barrel Layer 1 Stereo inner
66  TIBL2Ro, //18 Inner Barrel Layer 2 Rphi outer
67  TIBL2Ri, //19 Inner Barrel Layer 2 Rphi inner
68  TIBL2So, //20 Inner Barrel Layer 2 Stereo outer
69  TIBL2Si, //21 Inner Barrel Layer 2 Stereo inner
70  TIBL3o, //22 Inner Barrel Layer 3 outer
71  TIBL3i, //23 Inner Barrel Layer 3 inner
72  TIBL4o, //24 Inner Barrel Layer 4 outer
73  TIBL4i, //25 Inner Barrel Layer 4 inner
74  TOBL1Ro, //26 Outer Barrel Layer 1 Rphi outer
75  TOBL1Ri, //27 Outer Barrel Layer 1 Rphi inner
76  TOBL1So, //28 Outer Barrel Layer 1 Stereo outer
77  TOBL1Si, //29 Outer Barrel Layer 1 Stereo inner
78  TOBL2Ro, //30 Outer Barrel Layer 2 Rphi outer
79  TOBL2Ri, //31 Outer Barrel Layer 2 Rphi inner
80  TOBL2So, //32 Outer Barrel Layer 2 Stereo outer
81  TOBL2Si, //33 Outer Barrel Layer 2 Stereo inner
82  TOBL3o, //34 Outer Barrel Layer 3 outer
83  TOBL3i, //35 Outer Barrel Layer 3 inner
84  TOBL4o, //36 Outer Barrel Layer 4 outer
85  TOBL4i, //37 Outer Barrel Layer 4 inner
86  TOBL5o, //38 Outer Barrel Layer 5 outer
87  TOBL5i, //39 Outer Barrel Layer 5 inner
88  TOBL6o, //40 Outer Barrel Layer 6 outer
89  TOBL6i, //41 Outer Barrel Layer 6 inner
90  TIDmR1R, //42 Inner Disk Minus side Ring 1 Rphi
91  TIDmR1S, //43 Inner Disk Minus side Ring 1 Stereo
92  TIDmR2R, //44 Inner Disk Minus side Ring 2 Rphi
93  TIDmR2S, //45 Inner Disk Minus side Ring 2 Stereo
94  TIDmR3, //46 Inner Disk Minus side Ring 3
95  TIDpR1R, //47 Inner Disk Plus side Ring 1 Rphi
96  TIDpR1S, //48 Inner Disk Plus side Ring 1 Stereo
97  TIDpR2R, //49 Inner Disk Plus side Ring 2 Rphi
98  TIDpR2S, //50 Inner Disk Plus side Ring 2 Stereo
99  TIDpR3, //51 Inner Disk Plus side Ring 3
100  TECmR1R, //52 Endcaps Minus side Ring 1 Rphi
101  TECmR1S, //53 Endcaps Minus side Ring 1 Stereo
102  TECmR2R, //54 Encdaps Minus side Ring 2 Rphi
103  TECmR2S, //55 Endcaps Minus side Ring 2 Stereo
104  TECmR3, //56 Endcaps Minus side Ring 3
105  TECmR4, //57 Endcaps Minus side Ring 4
106  TECmR5, //58 Endcaps Minus side Ring 5
107  TECmR6, //59 Endcaps Minus side Ring 6
108  TECmR7, //60 Endcaps Minus side Ring 7
109  TECpR1R, //61 Endcaps Plus side Ring 1 Rphi
110  TECpR1S, //62 Endcaps Plus side Ring 1 Stereo
111  TECpR2R, //63 Encdaps Plus side Ring 2 Rphi
112  TECpR2S, //64 Endcaps Plus side Ring 2 Stereo
113  TECpR3, //65 Endcaps Plus side Ring 3
114  TECpR4, //66 Endcaps Plus side Ring 4
115  TECpR5, //67 Endcaps Plus side Ring 5
116  TECpR6, //68 Endcaps Plus side Ring 6
117  TECpR7, //67 Endcaps Plus side Ring 7
118  StripDoubleSide, // 70 -- not to be considered
119  NUM_OF_REGIONS // 71 -- default
120  };

Function Documentation

std::pair<double, double> AlignmentPI::calculatePosition ( TVirtualPad *  myPad,
int  boundary 
)

Definition at line 739 of file AlignmentPayloadInspectorHelper.h.

References createfilelist::int, min(), and corrVsCorr::rx.

Referenced by HGCalCLUEAlgo::getClusters(), and HGCalImagingAlgo::getClusters().

741  {
742  int ix1;
743  int ix2;
744  int iw = myPad->GetWw();
745  int ih = myPad->GetWh();
746  double x1p, y1p, x2p, y2p;
747  myPad->GetPadPar(x1p, y1p, x2p, y2p);
748  ix1 = (int)(iw * x1p);
749  ix2 = (int)(iw * x2p);
750  double wndc = std::min(1., (double)iw / (double)ih);
751  double rw = wndc / (double)iw;
752  double x1ndc = (double)ix1 * rw;
753  double x2ndc = (double)ix2 * rw;
754  double rx1, ry1, rx2, ry2;
755  myPad->GetRange(rx1, ry1, rx2, ry2);
756  double rx = (x2ndc - x1ndc) / (rx2 - rx1);
757  double _sx;
758  _sx = rx * (boundary - rx1) + x1ndc;
759  double _dx = _sx + 0.05;
760 
761  return std::make_pair(_sx, _dx);
762  }
T min(T a, T b)
Definition: MathUtil.h:58
std::pair<int, int> AlignmentPI::getIndices ( AlignmentPI::index  i)

Definition at line 634 of file AlignmentPayloadInspectorHelper.h.

References XX, XY, XZ, YY, YZ, and ZZ.

636  {
637  switch (i) {
638  case XX:
639  return std::make_pair(0, 0);
640  case XY:
641  return std::make_pair(0, 1);
642  case XZ:
643  return std::make_pair(0, 2);
644  case YZ:
645  return std::make_pair(1, 0);
646  case YY:
647  return std::make_pair(1, 1);
648  case ZZ:
649  return std::make_pair(2, 2);
650  default:
651  return std::make_pair(-1, -1);
652  }
653  }
double XX[2]
Definition: herwig.h:145
std::string AlignmentPI::getStringFromCoordinate ( AlignmentPI::coordinate  coord)

Definition at line 568 of file AlignmentPayloadInspectorHelper.h.

References rot_alpha, rot_beta, rot_gamma, t_x, t_y, and t_z.

570  {
571  switch (coord) {
572  case t_x:
573  return "x-translation";
574  case t_y:
575  return "y-translation";
576  case t_z:
577  return "z-translation";
578  case rot_alpha:
579  return "#alpha angle rotation";
580  case rot_beta:
581  return "#beta angle rotation";
582  case rot_gamma:
583  return "#gamma angle rotation";
584  default:
585  return "should never be here!";
586  }
587  }
std::string AlignmentPI::getStringFromIndex ( AlignmentPI::index  i)

Definition at line 590 of file AlignmentPayloadInspectorHelper.h.

References XX, XY, XZ, YY, YZ, and ZZ.

592  {
593  switch (i) {
594  case XX:
595  return "XX";
596  case XY:
597  return "XY";
598  case XZ:
599  return "XZ";
600  case YZ:
601  return "YX";
602  case YY:
603  return "YY";
604  case ZZ:
605  return "ZZ";
606  default:
607  return "should never be here!";
608  }
609  }
double XX[2]
Definition: herwig.h:145
std::string AlignmentPI::getStringFromPart ( AlignmentPI::partitions  i)

Definition at line 612 of file AlignmentPayloadInspectorHelper.h.

References BPix, FPix, TEC, TIB, TID, and TOB.

Referenced by makeNiceStats().

614  {
615  switch (i) {
616  case BPix:
617  return "BPix";
618  case FPix:
619  return "FPix";
620  case TIB:
621  return "TIB";
622  case TID:
623  return "TID";
624  case TOB:
625  return "TOB";
626  case TEC:
627  return "TEC";
628  default:
629  return "should never be here!";
630  }
631  }
std::string AlignmentPI::getStringFromRegionEnum ( AlignmentPI::regions  e)

Definition at line 123 of file AlignmentPayloadInspectorHelper.h.

References BPixL1i, BPixL1o, BPixL2i, BPixL2o, BPixL3i, BPixL3o, BPixL4i, BPixL4o, MillePedeFileConverter_cfg::e, FPixmL1, FPixmL2, FPixmL3, FPixpL1, FPixpL2, FPixpL3, TECmR1R, TECmR1S, TECmR2R, TECmR2S, TECmR3, TECmR4, TECmR5, TECmR6, TECmR7, TECpR1R, TECpR1S, TECpR2R, TECpR2S, TECpR3, TECpR4, TECpR5, TECpR6, TECpR7, TIBL1Ri, TIBL1Ro, TIBL1Si, TIBL1So, TIBL2Ri, TIBL2Ro, TIBL2Si, TIBL2So, TIBL3i, TIBL3o, TIBL4i, TIBL4o, TIDmR1R, TIDmR1S, TIDmR2R, TIDmR2S, TIDmR3, TIDpR1R, TIDpR1S, TIDpR2R, TIDpR2S, TIDpR3, TOBL1Ri, TOBL1Ro, TOBL1Si, TOBL1So, TOBL2Ri, TOBL2Ro, TOBL2Si, TOBL2So, TOBL3i, TOBL3o, TOBL4i, TOBL4o, TOBL5i, TOBL5o, TOBL6i, and TOBL6o.

125  {
126  switch (e) {
128  return "BPixL1o";
130  return "BPixL1i";
132  return "BPixL2o";
134  return "BPixL2i";
136  return "BPixL3o";
138  return "BPixL3i";
140  return "BPixL4o";
142  return "BPixL4i";
144  return "FPixmL1";
146  return "FPixmL2";
148  return "FPixmL3";
150  return "FPixpL1";
152  return "FPixpL2";
154  return "FPixpL3";
156  return "TIBL1Ro";
158  return "TIBL1Ri";
160  return "TIBL1So";
162  return "TIBL1Si";
164  return "TIBL2Ro";
166  return "TIBL2Ri";
168  return "TIBL2So";
170  return "TIBL2Si";
171  case AlignmentPI::TIBL3o:
172  return "TIBL3o";
173  case AlignmentPI::TIBL3i:
174  return "TIBL3i";
175  case AlignmentPI::TIBL4o:
176  return "TIBL4o";
177  case AlignmentPI::TIBL4i:
178  return "TIBL4i";
180  return "TOBL1Ro";
182  return "TOBL1Ri";
184  return "TOBL1So";
186  return "TOBL1Si";
188  return "TOBL2Ro";
190  return "TOBL2Ri";
192  return "TOBL2So";
194  return "TOBL2Si";
195  case AlignmentPI::TOBL3o:
196  return "TOBL3o";
197  case AlignmentPI::TOBL3i:
198  return "TOBL3i";
199  case AlignmentPI::TOBL4o:
200  return "TOBL4o";
201  case AlignmentPI::TOBL4i:
202  return "TOBL4i";
203  case AlignmentPI::TOBL5o:
204  return "TOBL5o";
205  case AlignmentPI::TOBL5i:
206  return "TOBL5i";
207  case AlignmentPI::TOBL6o:
208  return "TOBL6o";
209  case AlignmentPI::TOBL6i:
210  return "TOBL6i";
212  return "TIDmR1R";
214  return "TIDmR1S";
216  return "TIDmR2R";
218  return "TIDmR2S";
219  case AlignmentPI::TIDmR3:
220  return "TIDmR3";
222  return "TIDpR1R";
224  return "TIDpR1S";
226  return "TIDpR2R";
228  return "TIDpR2S";
229  case AlignmentPI::TIDpR3:
230  return "TIDpR3";
232  return "TECmR1R";
234  return "TECmR1S";
236  return "TECmR2R";
238  return "TECmR2S";
239  case AlignmentPI::TECmR3:
240  return "TECmR3";
241  case AlignmentPI::TECmR4:
242  return "TECmR4";
243  case AlignmentPI::TECmR5:
244  return "TECmR5";
245  case AlignmentPI::TECmR6:
246  return "TECmR6";
247  case AlignmentPI::TECmR7:
248  return "TECmR7";
250  return "TECpR1R";
252  return "TECpR1S";
254  return "TECpR2R";
256  return "TECpR2S";
257  case AlignmentPI::TECpR3:
258  return "TECpR3";
259  case AlignmentPI::TECpR4:
260  return "TECpR4";
261  case AlignmentPI::TECpR5:
262  return "TECpR5";
263  case AlignmentPI::TECpR6:
264  return "TECpR6";
265  case AlignmentPI::TECpR7:
266  return "TECpR7";
267  default:
268  edm::LogWarning("LogicError") << "Unknown partition: " << e;
269  return "";
270  }
271  }
std::pair<float, float> AlignmentPI::getTheRange ( std::map< uint32_t, float >  values,
const float  nsigma 
)

Definition at line 714 of file AlignmentPayloadInspectorHelper.h.

References begin, end, visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), and plotscripts::stdev().

716  {
717  float sum = std::accumulate(
719  return value + p.second;
720  });
721 
722  float m = sum / values.size();
723 
724  float accum = 0.0;
725  std::for_each(std::begin(values), std::end(values), [&](const std::map<uint32_t, float>::value_type& p) {
726  accum += (p.second - m) * (p.second - m);
727  });
728 
729  float stdev = sqrt(accum / (values.size() - 1));
730 
731  if (stdev != 0.) {
732  return std::make_pair(m - nsigma * stdev, m + nsigma * stdev);
733  } else {
734  return std::make_pair(m > 0. ? 0.95 * m : 1.05 * m, m > 0 ? 1.05 * m : 0.95 * m);
735  }
736  }
T sqrt(T t)
Definition: SSEVec.h:19
#define end
Definition: vmac.h:39
Definition: value.py:1
#define begin
Definition: vmac.h:32
def stdev(xlist)
Definition: plotscripts.py:69
bool AlignmentPI::isBPixOuterLadder ( const DetId detid,
const TrackerTopology tTopo,
bool  isPhase0 
)

Definition at line 274 of file AlignmentPayloadInspectorHelper.h.

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

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

276  {
277  bool isOuter = false;
278  int layer = tTopo.pxbLayer(detid.rawId());
279  bool odd_ladder = tTopo.pxbLadder(detid.rawId()) % 2;
280  if (isPhase0) {
281  if (layer == 2)
282  isOuter = !odd_ladder;
283  else
284  isOuter = odd_ladder;
285  } else {
286  if (layer == 4)
287  isOuter = odd_ladder;
288  else
289  isOuter = !odd_ladder;
290  }
291  return isOuter;
292  }
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int pxbLayer(const DetId &id) const
void AlignmentPI::makeNicePlotStyle ( TH1 *  hist,
int  color 
)

Definition at line 656 of file AlignmentPayloadInspectorHelper.h.

658  {
659  hist->SetStats(kFALSE);
660 
661  hist->GetXaxis()->SetTitleColor(color);
662  hist->SetLineColor(color);
663  hist->SetTitleSize(0.08);
664  hist->SetLineWidth(2);
665  hist->GetXaxis()->CenterTitle(true);
666  hist->GetYaxis()->CenterTitle(true);
667  hist->GetXaxis()->SetTitleFont(42);
668  hist->GetYaxis()->SetTitleFont(42);
669  hist->GetXaxis()->SetNdivisions(505);
670  hist->GetXaxis()->SetTitleSize(0.06);
671  hist->GetYaxis()->SetTitleSize(0.06);
672  hist->GetXaxis()->SetTitleOffset(1.0);
673  hist->GetYaxis()->SetTitleOffset(1.3);
674  hist->GetXaxis()->SetLabelFont(42);
675  hist->GetYaxis()->SetLabelFont(42);
676  hist->GetYaxis()->SetLabelSize(.05);
677  hist->GetXaxis()->SetLabelSize(.05);
678  }
void AlignmentPI::makeNiceStats ( TH1F *  hist,
AlignmentPI::partitions  part,
int  color 
)

Definition at line 681 of file AlignmentPayloadInspectorHelper.h.

References funct::abs(), edmScanValgrind::buffer, and getStringFromPart().

683  {
684  char buffer[255];
685  TPaveText* stat = new TPaveText(0.60, 0.75, 0.95, 0.95, "NDC");
686  sprintf(buffer, "%s \n", AlignmentPI::getStringFromPart(part).c_str());
687  stat->AddText(buffer);
688 
689  sprintf(buffer, "Entries : %i\n", (int)hist->GetEntries());
690  stat->AddText(buffer);
691 
692  if (std::abs(hist->GetMean()) > 0.01) {
693  sprintf(buffer, "Mean : %6.2f\n", hist->GetMean());
694  } else {
695  sprintf(buffer, "Mean : %6.2f e-2\n", 100 * hist->GetMean());
696  }
697  stat->AddText(buffer);
698 
699  if (std::abs(hist->GetRMS()) > 0.01) {
700  sprintf(buffer, "RMS : %6.2f\n", hist->GetRMS());
701  } else {
702  sprintf(buffer, "RMS : %6.2f e-2\n", 100 * hist->GetRMS());
703  }
704  stat->AddText(buffer);
705 
706  stat->SetLineColor(color);
707  stat->SetTextColor(color);
708  stat->SetFillColor(10);
709  stat->SetShadowColor(10);
710  stat->Draw();
711  }
std::string getStringFromPart(AlignmentPI::partitions i)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20

Variable Documentation

const float AlignmentPI::cmToUm = 10000
static
const unsigned int AlignmentPI::phase0size = 19876
static

Definition at line 20 of file AlignmentPayloadInspectorHelper.h.