CMS 3D CMS Logo

Classes | Enumerations | Functions | Variables
AlignmentPI Namespace Reference

Classes

struct  TkAlBarycenters
 
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  PARTITION {
  PARTITION::BPIX, PARTITION::FPIXp, PARTITION::FPIXm, PARTITION::TIB,
  PARTITION::TIDp, PARTITION::TIDm, PARTITION::TOB, PARTITION::TECp,
  PARTITION::TECm, PARTITION::LAST = TECm
}
 
enum  partitions {
  INVALID = 0, 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)
 
void fillComparisonHistogram (const AlignmentPI::coordinate &coord, std::vector< int > &boundaries, const std::vector< AlignTransform > &ref_ali, const std::vector< AlignTransform > &target_ali, std::unique_ptr< TH1F > &compare)
 
void fillComparisonHistograms (std::vector< int > &boundaries, const std::vector< AlignTransform > &ref_ali, const std::vector< AlignTransform > &target_ali, std::unordered_map< AlignmentPI::coordinate, std::unique_ptr< TH1F > > &compare, bool diff=false, AlignmentPI::partitions checkPart=AlignmentPI::INVALID)
 
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)
 
std::ostream & operator<< (std::ostream &o, PARTITION x)
 
double returnZeroIfNear2PI (const double phi)
 
double trim2PIs (const double phi, const double tolerance=1.f)
 

Variables

static const float cmToUm = 10000.f
 
const PARTITION PARTITIONS [(int) PARTITION::LAST+1]
 
static const unsigned int phase0size = 19876
 
static const float tomRad = 1000.f
 

Enumeration Type Documentation

◆ coordinate

◆ index

◆ PARTITION

Enumerator
BPIX 
FPIXp 
FPIXm 
TIB 
TIDp 
TIDm 
TOB 
TECp 
TECm 
LAST 

Definition at line 75 of file AlignmentPayloadInspectorHelper.h.

75  {
76  BPIX, // 0 Barrel Pixel
77  FPIXp, // 1 Forward Pixel Plus
78  FPIXm, // 2 Forward Pixel Minus
79  TIB, // 3 Tracker Inner Barrel
80  TIDp, // 4 Tracker Inner Disks Plus
81  TIDm, // 5 Tracker Inner Disks Minus
82  TOB, // 6 Tracker Outer Barrel
83  TECp, // 7 Tracker Endcaps Plus
84  TECm, // 8 Tracker Endcaps Minus
85  LAST = TECm
86  };
#define BPIX

◆ partitions

◆ regions

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 103 of file AlignmentPayloadInspectorHelper.h.

103  {
104  BPixL1o, //0 Barrel Pixel Layer 1 outer
105  BPixL1i, //1 Barrel Pixel Layer 1 inner
106  BPixL2o, //2 Barrel Pixel Layer 2 outer
107  BPixL2i, //3 Barrel Pixel Layer 2 inner
108  BPixL3o, //4 Barrel Pixel Layer 3 outer
109  BPixL3i, //5 Barrel Pixel Layer 3 inner
110  BPixL4o, //6 Barrel Pixel Layer 4 outer
111  BPixL4i, //7 Barrel Pixel Layer 4 inner
112  FPixmL1, //8 Forward Pixel Minus side Disk 1
113  FPixmL2, //9 Forward Pixel Minus side Disk 2
114  FPixmL3, //10 Forward Pixel Minus side Disk 3
115  FPixpL1, //11 Forward Pixel Plus side Disk 1
116  FPixpL2, //12 Forward Pixel Plus side Disk 2
117  FPixpL3, //13 Forward Pixel Plus side Disk 3
118  TIBL1Ro, //14 Inner Barrel Layer 1 Rphi outer
119  TIBL1Ri, //15 Inner Barrel Layer 1 Rphi inner
120  TIBL1So, //16 Inner Barrel Layer 1 Stereo outer
121  TIBL1Si, //17 Inner Barrel Layer 1 Stereo inner
122  TIBL2Ro, //18 Inner Barrel Layer 2 Rphi outer
123  TIBL2Ri, //19 Inner Barrel Layer 2 Rphi inner
124  TIBL2So, //20 Inner Barrel Layer 2 Stereo outer
125  TIBL2Si, //21 Inner Barrel Layer 2 Stereo inner
126  TIBL3o, //22 Inner Barrel Layer 3 outer
127  TIBL3i, //23 Inner Barrel Layer 3 inner
128  TIBL4o, //24 Inner Barrel Layer 4 outer
129  TIBL4i, //25 Inner Barrel Layer 4 inner
130  TOBL1Ro, //26 Outer Barrel Layer 1 Rphi outer
131  TOBL1Ri, //27 Outer Barrel Layer 1 Rphi inner
132  TOBL1So, //28 Outer Barrel Layer 1 Stereo outer
133  TOBL1Si, //29 Outer Barrel Layer 1 Stereo inner
134  TOBL2Ro, //30 Outer Barrel Layer 2 Rphi outer
135  TOBL2Ri, //31 Outer Barrel Layer 2 Rphi inner
136  TOBL2So, //32 Outer Barrel Layer 2 Stereo outer
137  TOBL2Si, //33 Outer Barrel Layer 2 Stereo inner
138  TOBL3o, //34 Outer Barrel Layer 3 outer
139  TOBL3i, //35 Outer Barrel Layer 3 inner
140  TOBL4o, //36 Outer Barrel Layer 4 outer
141  TOBL4i, //37 Outer Barrel Layer 4 inner
142  TOBL5o, //38 Outer Barrel Layer 5 outer
143  TOBL5i, //39 Outer Barrel Layer 5 inner
144  TOBL6o, //40 Outer Barrel Layer 6 outer
145  TOBL6i, //41 Outer Barrel Layer 6 inner
146  TIDmR1R, //42 Inner Disk Minus side Ring 1 Rphi
147  TIDmR1S, //43 Inner Disk Minus side Ring 1 Stereo
148  TIDmR2R, //44 Inner Disk Minus side Ring 2 Rphi
149  TIDmR2S, //45 Inner Disk Minus side Ring 2 Stereo
150  TIDmR3, //46 Inner Disk Minus side Ring 3
151  TIDpR1R, //47 Inner Disk Plus side Ring 1 Rphi
152  TIDpR1S, //48 Inner Disk Plus side Ring 1 Stereo
153  TIDpR2R, //49 Inner Disk Plus side Ring 2 Rphi
154  TIDpR2S, //50 Inner Disk Plus side Ring 2 Stereo
155  TIDpR3, //51 Inner Disk Plus side Ring 3
156  TECmR1R, //52 Endcaps Minus side Ring 1 Rphi
157  TECmR1S, //53 Endcaps Minus side Ring 1 Stereo
158  TECmR2R, //54 Encdaps Minus side Ring 2 Rphi
159  TECmR2S, //55 Endcaps Minus side Ring 2 Stereo
160  TECmR3, //56 Endcaps Minus side Ring 3
161  TECmR4, //57 Endcaps Minus side Ring 4
162  TECmR5, //58 Endcaps Minus side Ring 5
163  TECmR6, //59 Endcaps Minus side Ring 6
164  TECmR7, //60 Endcaps Minus side Ring 7
165  TECpR1R, //61 Endcaps Plus side Ring 1 Rphi
166  TECpR1S, //62 Endcaps Plus side Ring 1 Stereo
167  TECpR2R, //63 Encdaps Plus side Ring 2 Rphi
168  TECpR2S, //64 Endcaps Plus side Ring 2 Stereo
169  TECpR3, //65 Endcaps Plus side Ring 3
170  TECpR4, //66 Endcaps Plus side Ring 4
171  TECpR5, //67 Endcaps Plus side Ring 5
172  TECpR6, //68 Endcaps Plus side Ring 6
173  TECpR7, //67 Endcaps Plus side Ring 7
174  StripDoubleSide, // 70 -- not to be considered
175  NUM_OF_REGIONS // 71 -- default
176  };

Function Documentation

◆ calculatePosition()

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

Definition at line 795 of file AlignmentPayloadInspectorHelper.h.

References createfilelist::int, SiStripPI::min, and corrVsCorr::rx.

Referenced by HGCalImagingAlgo::getClusters(), and HGCalCLUEAlgoT< TILE >::getClusters().

797  {
798  int ix1;
799  int ix2;
800  int iw = myPad->GetWw();
801  int ih = myPad->GetWh();
802  double x1p, y1p, x2p, y2p;
803  myPad->GetPadPar(x1p, y1p, x2p, y2p);
804  ix1 = (int)(iw * x1p);
805  ix2 = (int)(iw * x2p);
806  double wndc = std::min(1., (double)iw / (double)ih);
807  double rw = wndc / (double)iw;
808  double x1ndc = (double)ix1 * rw;
809  double x2ndc = (double)ix2 * rw;
810  double rx1, ry1, rx2, ry2;
811  myPad->GetRange(rx1, ry1, rx2, ry2);
812  double rx = (x2ndc - x1ndc) / (rx2 - rx1);
813  double _sx;
814  _sx = rx * (boundary - rx1) + x1ndc;
815  double _dx = _sx + 0.05;
816 
817  return std::make_pair(_sx, _dx);
818  }

◆ fillComparisonHistogram()

void AlignmentPI::fillComparisonHistogram ( const AlignmentPI::coordinate coord,
std::vector< int > &  boundaries,
const std::vector< AlignTransform > &  ref_ali,
const std::vector< AlignTransform > &  target_ali,
std::unique_ptr< TH1F > &  compare 
)
inline

Definition at line 995 of file AlignmentPayloadInspectorHelper.h.

References BPix, cmToUm, SiPixelRawToDigiRegional_cfi::deltaPhi, mps_fire::i, rot_alpha, rot_beta, rot_gamma, idealTransformation::rotation, DetId::subdetId(), t_x, t_y, t_z, align::toAngles(), and tomRad.

1001  {
1002  int counter = 0; /* start the counter */
1004  for (unsigned int i = 0; i < ref_ali.size(); i++) {
1005  if (ref_ali[i].rawId() == target_ali[i].rawId()) {
1006  counter++;
1007  int subid = DetId(ref_ali[i].rawId()).subdetId();
1008 
1009  auto thePart = static_cast<AlignmentPI::partitions>(subid);
1010  if (thePart != currentPart) {
1011  currentPart = thePart;
1012  boundaries.push_back(counter);
1013  }
1014 
1015  CLHEP::HepRotation target_rot(target_ali[i].rotation());
1016  CLHEP::HepRotation ref_rot(ref_ali[i].rotation());
1017 
1018  align::RotationType target_ROT(target_rot.xx(),
1019  target_rot.xy(),
1020  target_rot.xz(),
1021  target_rot.yx(),
1022  target_rot.yy(),
1023  target_rot.yz(),
1024  target_rot.zx(),
1025  target_rot.zy(),
1026  target_rot.zz());
1027 
1028  align::RotationType ref_ROT(ref_rot.xx(),
1029  ref_rot.xy(),
1030  ref_rot.xz(),
1031  ref_rot.yx(),
1032  ref_rot.yy(),
1033  ref_rot.yz(),
1034  ref_rot.zx(),
1035  ref_rot.zy(),
1036  ref_rot.zz());
1037 
1038  const std::vector<double> deltaRot = {::deltaPhi(align::toAngles(target_ROT)[0], align::toAngles(ref_ROT)[0]),
1039  ::deltaPhi(align::toAngles(target_ROT)[1], align::toAngles(ref_ROT)[1]),
1040  ::deltaPhi(align::toAngles(target_ROT)[2], align::toAngles(ref_ROT)[2])};
1041 
1042  const auto& deltaTrans = target_ali[i].translation() - ref_ali[i].translation();
1043 
1044  switch (coord) {
1045  case AlignmentPI::t_x:
1046  compare->SetBinContent(i + 1, deltaTrans.x() * AlignmentPI::cmToUm);
1047  break;
1048  case AlignmentPI::t_y:
1049  compare->SetBinContent(i + 1, deltaTrans.y() * AlignmentPI::cmToUm);
1050  break;
1051  case AlignmentPI::t_z:
1052  compare->SetBinContent(i + 1, deltaTrans.z() * AlignmentPI::cmToUm);
1053  break;
1055  compare->SetBinContent(i + 1, deltaRot[0] * AlignmentPI::tomRad);
1056  break;
1057  case AlignmentPI::rot_beta:
1058  compare->SetBinContent(i + 1, deltaRot[1] * AlignmentPI::tomRad);
1059  break;
1061  compare->SetBinContent(i + 1, deltaRot[2] * AlignmentPI::tomRad);
1062  break;
1063  default:
1064  edm::LogError("TrackerAlignment_PayloadInspector") << "Unrecognized coordinate " << coord << std::endl;
1065  break;
1066  } // switch on the coordinate
1067  } // check on the same detID
1068  } // loop on the components
1069  }
Log< level::Error, false > LogError
static const float cmToUm
static const float tomRad
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:8
Definition: DetId.h:17

◆ fillComparisonHistograms()

void AlignmentPI::fillComparisonHistograms ( std::vector< int > &  boundaries,
const std::vector< AlignTransform > &  ref_ali,
const std::vector< AlignTransform > &  target_ali,
std::unordered_map< AlignmentPI::coordinate, std::unique_ptr< TH1F > > &  compare,
bool  diff = false,
AlignmentPI::partitions  checkPart = AlignmentPI::INVALID 
)
inline

Definition at line 1072 of file AlignmentPayloadInspectorHelper.h.

References BPix, cmToUm, SiPixelRawToDigiRegional_cfi::deltaPhi, change_name::diff, mps_fire::i, rot_alpha, rot_beta, rot_gamma, idealTransformation::rotation, DetId::subdetId(), t_x, t_y, t_z, align::toAngles(), and tomRad.

1079  {
1080  int counter = 0; /* start the counter */
1082  for (unsigned int i = 0; i < ref_ali.size(); i++) {
1083  if (ref_ali[i].rawId() == target_ali[i].rawId()) {
1084  counter++;
1085  int subid = DetId(ref_ali[i].rawId()).subdetId();
1086 
1087  auto thePart = static_cast<AlignmentPI::partitions>(subid);
1088 
1089  // in case it has to be filtered
1090  if (checkPart > 0 && thePart != checkPart) {
1091  continue;
1092  }
1093 
1094  if (thePart != currentPart) {
1095  currentPart = thePart;
1096  boundaries.push_back(counter);
1097  }
1098 
1099  CLHEP::HepRotation target_rot(target_ali[i].rotation());
1100  CLHEP::HepRotation ref_rot(ref_ali[i].rotation());
1101 
1102  align::RotationType target_ROT(target_rot.xx(),
1103  target_rot.xy(),
1104  target_rot.xz(),
1105  target_rot.yx(),
1106  target_rot.yy(),
1107  target_rot.yz(),
1108  target_rot.zx(),
1109  target_rot.zy(),
1110  target_rot.zz());
1111 
1112  align::RotationType ref_ROT(ref_rot.xx(),
1113  ref_rot.xy(),
1114  ref_rot.xz(),
1115  ref_rot.yx(),
1116  ref_rot.yy(),
1117  ref_rot.yz(),
1118  ref_rot.zx(),
1119  ref_rot.zy(),
1120  ref_rot.zz());
1121 
1122  const std::vector<double> deltaRot = {::deltaPhi(align::toAngles(target_ROT)[0], align::toAngles(ref_ROT)[0]),
1123  ::deltaPhi(align::toAngles(target_ROT)[1], align::toAngles(ref_ROT)[1]),
1124  ::deltaPhi(align::toAngles(target_ROT)[2], align::toAngles(ref_ROT)[2])};
1125 
1126  const auto& deltaTrans = target_ali[i].translation() - ref_ali[i].translation();
1127 
1128  // fill the histograms
1129  if (diff) {
1130  compare[AlignmentPI::t_x]->Fill(deltaTrans.x() * AlignmentPI::cmToUm);
1131  compare[AlignmentPI::t_y]->Fill(deltaTrans.y() * AlignmentPI::cmToUm);
1132  compare[AlignmentPI::t_z]->Fill(deltaTrans.z() * AlignmentPI::cmToUm);
1133 
1134  compare[AlignmentPI::rot_alpha]->Fill(deltaRot[0] * AlignmentPI::tomRad);
1135  compare[AlignmentPI::rot_beta]->Fill(deltaRot[1] * AlignmentPI::tomRad);
1136  compare[AlignmentPI::rot_gamma]->Fill(deltaRot[2] * AlignmentPI::tomRad);
1137  } else {
1138  compare[AlignmentPI::t_x]->SetBinContent(i + 1, deltaTrans.x() * AlignmentPI::cmToUm);
1139  compare[AlignmentPI::t_y]->SetBinContent(i + 1, deltaTrans.y() * AlignmentPI::cmToUm);
1140  compare[AlignmentPI::t_z]->SetBinContent(i + 1, deltaTrans.z() * AlignmentPI::cmToUm);
1141 
1142  compare[AlignmentPI::rot_alpha]->SetBinContent(i + 1, deltaRot[0] * AlignmentPI::tomRad);
1143  compare[AlignmentPI::rot_beta]->SetBinContent(i + 1, deltaRot[1] * AlignmentPI::tomRad);
1144  compare[AlignmentPI::rot_gamma]->SetBinContent(i + 1, deltaRot[2] * AlignmentPI::tomRad);
1145  }
1146 
1147  } // if it's the same detid
1148  } // loop on detids
1149  }
static const float cmToUm
static const float tomRad
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:8
Definition: DetId.h:17

◆ getIndices()

std::pair<int, int> AlignmentPI::getIndices ( AlignmentPI::index  i)
inline

Definition at line 690 of file AlignmentPayloadInspectorHelper.h.

References mps_fire::i, XX, XY, XZ, YY, YZ, and ZZ.

692  {
693  switch (i) {
694  case XX:
695  return std::make_pair(0, 0);
696  case XY:
697  return std::make_pair(0, 1);
698  case XZ:
699  return std::make_pair(0, 2);
700  case YZ:
701  return std::make_pair(1, 0);
702  case YY:
703  return std::make_pair(1, 1);
704  case ZZ:
705  return std::make_pair(2, 2);
706  default:
707  return std::make_pair(-1, -1);
708  }
709  }

◆ getStringFromCoordinate()

std::string AlignmentPI::getStringFromCoordinate ( AlignmentPI::coordinate  coord)
inline

Definition at line 624 of file AlignmentPayloadInspectorHelper.h.

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

626  {
627  switch (coord) {
628  case t_x:
629  return "x-translation";
630  case t_y:
631  return "y-translation";
632  case t_z:
633  return "z-translation";
634  case rot_alpha:
635  return "#alpha angle rotation";
636  case rot_beta:
637  return "#beta angle rotation";
638  case rot_gamma:
639  return "#gamma angle rotation";
640  default:
641  return "should never be here!";
642  }
643  }

◆ getStringFromIndex()

std::string AlignmentPI::getStringFromIndex ( AlignmentPI::index  i)
inline

Definition at line 646 of file AlignmentPayloadInspectorHelper.h.

References mps_fire::i, XX, XY, XZ, YY, YZ, and ZZ.

648  {
649  switch (i) {
650  case XX:
651  return "XX";
652  case XY:
653  return "XY";
654  case XZ:
655  return "XZ";
656  case YZ:
657  return "YX";
658  case YY:
659  return "YY";
660  case ZZ:
661  return "ZZ";
662  default:
663  return "should never be here!";
664  }
665  }

◆ getStringFromPart()

std::string AlignmentPI::getStringFromPart ( AlignmentPI::partitions  i)
inline

Definition at line 668 of file AlignmentPayloadInspectorHelper.h.

References BPix, FPix, mps_fire::i, TEC, TIB, TID, and TOB.

Referenced by makeNiceStats().

670  {
671  switch (i) {
672  case BPix:
673  return "BPix";
674  case FPix:
675  return "FPix";
676  case TIB:
677  return "TIB";
678  case TID:
679  return "TID";
680  case TOB:
681  return "TOB";
682  case TEC:
683  return "TEC";
684  default:
685  return "should never be here!";
686  }
687  }

◆ getStringFromRegionEnum()

std::string AlignmentPI::getStringFromRegionEnum ( AlignmentPI::regions  e)
inline

Definition at line 179 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.

181  {
182  switch (e) {
184  return "BPixL1o";
186  return "BPixL1i";
188  return "BPixL2o";
190  return "BPixL2i";
192  return "BPixL3o";
194  return "BPixL3i";
196  return "BPixL4o";
198  return "BPixL4i";
200  return "FPixmL1";
202  return "FPixmL2";
204  return "FPixmL3";
206  return "FPixpL1";
208  return "FPixpL2";
210  return "FPixpL3";
212  return "TIBL1Ro";
214  return "TIBL1Ri";
216  return "TIBL1So";
218  return "TIBL1Si";
220  return "TIBL2Ro";
222  return "TIBL2Ri";
224  return "TIBL2So";
226  return "TIBL2Si";
227  case AlignmentPI::TIBL3o:
228  return "TIBL3o";
229  case AlignmentPI::TIBL3i:
230  return "TIBL3i";
231  case AlignmentPI::TIBL4o:
232  return "TIBL4o";
233  case AlignmentPI::TIBL4i:
234  return "TIBL4i";
236  return "TOBL1Ro";
238  return "TOBL1Ri";
240  return "TOBL1So";
242  return "TOBL1Si";
244  return "TOBL2Ro";
246  return "TOBL2Ri";
248  return "TOBL2So";
250  return "TOBL2Si";
251  case AlignmentPI::TOBL3o:
252  return "TOBL3o";
253  case AlignmentPI::TOBL3i:
254  return "TOBL3i";
255  case AlignmentPI::TOBL4o:
256  return "TOBL4o";
257  case AlignmentPI::TOBL4i:
258  return "TOBL4i";
259  case AlignmentPI::TOBL5o:
260  return "TOBL5o";
261  case AlignmentPI::TOBL5i:
262  return "TOBL5i";
263  case AlignmentPI::TOBL6o:
264  return "TOBL6o";
265  case AlignmentPI::TOBL6i:
266  return "TOBL6i";
268  return "TIDmR1R";
270  return "TIDmR1S";
272  return "TIDmR2R";
274  return "TIDmR2S";
275  case AlignmentPI::TIDmR3:
276  return "TIDmR3";
278  return "TIDpR1R";
280  return "TIDpR1S";
282  return "TIDpR2R";
284  return "TIDpR2S";
285  case AlignmentPI::TIDpR3:
286  return "TIDpR3";
288  return "TECmR1R";
290  return "TECmR1S";
292  return "TECmR2R";
294  return "TECmR2S";
295  case AlignmentPI::TECmR3:
296  return "TECmR3";
297  case AlignmentPI::TECmR4:
298  return "TECmR4";
299  case AlignmentPI::TECmR5:
300  return "TECmR5";
301  case AlignmentPI::TECmR6:
302  return "TECmR6";
303  case AlignmentPI::TECmR7:
304  return "TECmR7";
306  return "TECpR1R";
308  return "TECpR1S";
310  return "TECpR2R";
312  return "TECpR2S";
313  case AlignmentPI::TECpR3:
314  return "TECpR3";
315  case AlignmentPI::TECpR4:
316  return "TECpR4";
317  case AlignmentPI::TECpR5:
318  return "TECpR5";
319  case AlignmentPI::TECpR6:
320  return "TECpR6";
321  case AlignmentPI::TECpR7:
322  return "TECpR7";
323  default:
324  edm::LogWarning("LogicError") << "Unknown partition: " << e;
325  return "";
326  }
327  }
Log< level::Warning, false > LogWarning

◆ getTheRange()

std::pair<float, float> AlignmentPI::getTheRange ( std::map< uint32_t, float >  values,
const float  nsigma 
)
inline

Definition at line 770 of file AlignmentPayloadInspectorHelper.h.

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

772  {
773  float sum = std::accumulate(
774  std::begin(values), std::end(values), 0.0, [](float value, const std::map<uint32_t, float>::value_type& p) {
775  return value + p.second;
776  });
777 
778  float m = sum / values.size();
779 
780  float accum = 0.0;
781  std::for_each(std::begin(values), std::end(values), [&](const std::map<uint32_t, float>::value_type& p) {
782  accum += (p.second - m) * (p.second - m);
783  });
784 
785  float stdev = sqrt(accum / (values.size() - 1));
786 
787  if (stdev != 0.) {
788  return std::make_pair(m - nsigma * stdev, m + nsigma * stdev);
789  } else {
790  return std::make_pair(m > 0. ? 0.95 * m : 1.05 * m, m > 0 ? 1.05 * m : 0.95 * m);
791  }
792  }
T sqrt(T t)
Definition: SSEVec.h:19
Definition: value.py:1
def stdev(xlist)
Definition: plotscripts.py:69

◆ isBPixOuterLadder()

bool AlignmentPI::isBPixOuterLadder ( const DetId detid,
const TrackerTopology tTopo,
bool  isPhase0 
)
inline

Definition at line 330 of file AlignmentPayloadInspectorHelper.h.

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

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

332  {
333  bool isOuter = false;
334  int layer = tTopo.pxbLayer(detid.rawId());
335  bool odd_ladder = tTopo.pxbLadder(detid.rawId()) % 2;
336  if (isPhase0) {
337  if (layer == 2)
338  isOuter = !odd_ladder;
339  else
340  isOuter = odd_ladder;
341  } else {
342  if (layer == 4)
343  isOuter = odd_ladder;
344  else
345  isOuter = !odd_ladder;
346  }
347  return isOuter;
348  }
unsigned int pxbLayer(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ makeNicePlotStyle()

void AlignmentPI::makeNicePlotStyle ( TH1 *  hist,
int  color 
)
inline

Definition at line 712 of file AlignmentPayloadInspectorHelper.h.

References gpuVertexFinder::hist.

714  {
715  hist->SetStats(kFALSE);
716 
717  hist->GetXaxis()->SetTitleColor(color);
718  hist->SetLineColor(color);
719  hist->SetTitleSize(0.08);
720  hist->SetLineWidth(2);
721  hist->GetXaxis()->CenterTitle(true);
722  hist->GetYaxis()->CenterTitle(true);
723  hist->GetXaxis()->SetTitleFont(42);
724  hist->GetYaxis()->SetTitleFont(42);
725  hist->GetXaxis()->SetNdivisions(505);
726  hist->GetXaxis()->SetTitleSize(0.06);
727  hist->GetYaxis()->SetTitleSize(0.06);
728  hist->GetXaxis()->SetTitleOffset(1.0);
729  hist->GetYaxis()->SetTitleOffset(1.3);
730  hist->GetXaxis()->SetLabelFont(42);
731  hist->GetYaxis()->SetLabelFont(42);
732  hist->GetYaxis()->SetLabelSize(.05);
733  hist->GetXaxis()->SetLabelSize(.05);
734  }

◆ makeNiceStats()

void AlignmentPI::makeNiceStats ( TH1F *  hist,
AlignmentPI::partitions  part,
int  color 
)
inline

Definition at line 737 of file AlignmentPayloadInspectorHelper.h.

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

739  {
740  char buffer[255];
741  TPaveText* stat = new TPaveText(0.60, 0.75, 0.95, 0.95, "NDC");
742  sprintf(buffer, "%s \n", AlignmentPI::getStringFromPart(part).c_str());
743  stat->AddText(buffer);
744 
745  sprintf(buffer, "Entries : %i\n", (int)hist->GetEntries());
746  stat->AddText(buffer);
747 
748  if (std::abs(hist->GetMean()) > 0.01) {
749  sprintf(buffer, "Mean : %6.2f\n", hist->GetMean());
750  } else {
751  sprintf(buffer, "Mean : %6.2f e-2\n", 100 * hist->GetMean());
752  }
753  stat->AddText(buffer);
754 
755  if (std::abs(hist->GetRMS()) > 0.01) {
756  sprintf(buffer, "RMS : %6.2f\n", hist->GetRMS());
757  } else {
758  sprintf(buffer, "RMS : %6.2f e-2\n", 100 * hist->GetRMS());
759  }
760  stat->AddText(buffer);
761 
762  stat->SetLineColor(color);
763  stat->SetTextColor(color);
764  stat->SetFillColor(10);
765  stat->SetShadowColor(10);
766  stat->Draw();
767  }
std::string getStringFromPart(AlignmentPI::partitions i)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20

◆ operator<<()

std::ostream& AlignmentPI::operator<< ( std::ostream &  o,
PARTITION  x 
)
inline

Definition at line 99 of file AlignmentPayloadInspectorHelper.h.

References x.

◆ returnZeroIfNear2PI()

double AlignmentPI::returnZeroIfNear2PI ( const double  phi)
inline

Definition at line 39 of file AlignmentPayloadInspectorHelper.h.

References funct::abs(), f, M_PI, and cms_rounding::roundIfNear0().

39  {
40  const double tol = 2.e-7; // default tolerance 1.e-7 doesn't account for possible variations
41  if (cms_rounding::roundIfNear0(std::abs(phi) - 2 * M_PI, tol) == 0.f) {
42  return 0.f;
43  } else {
44  return phi;
45  }
46  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
#define M_PI

◆ trim2PIs()

double AlignmentPI::trim2PIs ( const double  phi,
const double  tolerance = 1.f 
)
inline

Definition at line 50 of file AlignmentPayloadInspectorHelper.h.

References funct::abs(), M_PI, tolerance, and tomRad.

50  {
51  if (std::abs((std::abs(phi) - 2 * M_PI) * tomRad) < tolerance) {
52  return (std::abs(phi) - 2 * M_PI);
53  } else {
54  return phi;
55  }
56  }
const double tolerance
static const float tomRad
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI

Variable Documentation

◆ cmToUm

const float AlignmentPI::cmToUm = 10000.f
static

◆ PARTITIONS

const PARTITION AlignmentPI::PARTITIONS

◆ phase0size

const unsigned int AlignmentPI::phase0size = 19876
static

Definition at line 33 of file AlignmentPayloadInspectorHelper.h.

◆ tomRad

const float AlignmentPI::tomRad = 1000.f
static