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 displayNotSupported (TCanvas &canv, const unsigned int size)
 
void fillComparisonHistogram (const AlignmentPI::coordinate &coord, std::map< int, AlignmentPI::partitions > &boundaries, const std::vector< AlignTransform > &ref_ali, const std::vector< AlignTransform > &target_ali, std::unique_ptr< TH1F > &compare)
 
void fillComparisonHistograms (std::map< int, AlignmentPI::partitions > &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, bool isPhase2=false)
 
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
 
static const unsigned int mismatched = 99999
 
const PARTITION PARTITIONS [(int) PARTITION::LAST+1]
 
static const unsigned int phase0size = 19876
 
static const unsigned int phase1size = 20292
 
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 96 of file AlignmentPayloadInspectorHelper.h.

96  {
97  BPIX, // 0 Barrel Pixel
98  FPIXp, // 1 Forward Pixel Plus
99  FPIXm, // 2 Forward Pixel Minus
100  TIB, // 3 Tracker Inner Barrel
101  TIDp, // 4 Tracker Inner Disks Plus
102  TIDm, // 5 Tracker Inner Disks Minus
103  TOB, // 6 Tracker Outer Barrel
104  TECp, // 7 Tracker Endcaps Plus
105  TECm, // 8 Tracker Endcaps Minus
106  LAST = TECm
107  };
#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 124 of file AlignmentPayloadInspectorHelper.h.

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

Function Documentation

◆ calculatePosition()

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

Definition at line 821 of file AlignmentPayloadInspectorHelper.h.

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

Referenced by HGCalImagingAlgo::getClusters().

823  {
824  int ix1;
825  int ix2;
826  int iw = myPad->GetWw();
827  int ih = myPad->GetWh();
828  double x1p, y1p, x2p, y2p;
829  myPad->GetPadPar(x1p, y1p, x2p, y2p);
830  ix1 = (int)(iw * x1p);
831  ix2 = (int)(iw * x2p);
832  double wndc = std::min(1., (double)iw / (double)ih);
833  double rw = wndc / (double)iw;
834  double x1ndc = (double)ix1 * rw;
835  double x2ndc = (double)ix2 * rw;
836  double rx1, ry1, rx2, ry2;
837  myPad->GetRange(rx1, ry1, rx2, ry2);
838  double rx = (x2ndc - x1ndc) / (rx2 - rx1);
839  double _sx;
840  _sx = rx * (boundary - rx1) + x1ndc;
841  double _dx = _sx + 0.05;
842 
843  return std::make_pair(_sx, _dx);
844  }

◆ displayNotSupported()

void AlignmentPI::displayNotSupported ( TCanvas &  canv,
const unsigned int  size 
)
inline

Definition at line 41 of file AlignmentPayloadInspectorHelper.h.

References mismatched, phase1size, AlCaHLTBitMon_QueryRunRegistry::string, and RandomServiceHelper::t2.

43  {
44  std::string phase = (size < AlignmentPI::phase1size) ? "Phase-0" : "Phase-2";
45  canv.cd();
46  TLatex t2;
47  t2.SetTextAlign(21);
48  t2.SetTextSize(0.1);
49  t2.SetTextAngle(45);
50  t2.SetTextColor(kRed);
52  t2.DrawLatexNDC(0.6, 0.50, Form("%s NOT SUPPORTED!", phase.c_str()));
53  } else {
54  t2.DrawLatexNDC(0.6, 0.50, "MISMATCHED PAYLOAD SIZE!");
55  }
56  }
size
Write out results.
static const unsigned int phase1size
static const unsigned int mismatched

◆ fillComparisonHistogram()

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

Definition at line 1030 of file AlignmentPayloadInspectorHelper.h.

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

1036  {
1037  int counter = 0; /* start the counter */
1039  for (unsigned int i = 0; i < ref_ali.size(); i++) {
1040  if (ref_ali[i].rawId() == target_ali[i].rawId()) {
1041  counter++;
1042  int subid = DetId(ref_ali[i].rawId()).subdetId();
1043 
1044  auto thePart = static_cast<AlignmentPI::partitions>(subid);
1045  if (thePart != currentPart) {
1046  currentPart = thePart;
1047  boundaries.insert({counter, thePart});
1048  }
1049 
1050  CLHEP::HepRotation target_rot(target_ali[i].rotation());
1051  CLHEP::HepRotation ref_rot(ref_ali[i].rotation());
1052 
1053  align::RotationType target_ROT(target_rot.xx(),
1054  target_rot.xy(),
1055  target_rot.xz(),
1056  target_rot.yx(),
1057  target_rot.yy(),
1058  target_rot.yz(),
1059  target_rot.zx(),
1060  target_rot.zy(),
1061  target_rot.zz());
1062 
1063  align::RotationType ref_ROT(ref_rot.xx(),
1064  ref_rot.xy(),
1065  ref_rot.xz(),
1066  ref_rot.yx(),
1067  ref_rot.yy(),
1068  ref_rot.yz(),
1069  ref_rot.zx(),
1070  ref_rot.zy(),
1071  ref_rot.zz());
1072 
1073  const std::vector<double> deltaRot = {::deltaPhi(align::toAngles(target_ROT)[0], align::toAngles(ref_ROT)[0]),
1074  ::deltaPhi(align::toAngles(target_ROT)[1], align::toAngles(ref_ROT)[1]),
1075  ::deltaPhi(align::toAngles(target_ROT)[2], align::toAngles(ref_ROT)[2])};
1076 
1077  const auto& deltaTrans = target_ali[i].translation() - ref_ali[i].translation();
1078 
1079  switch (coord) {
1080  case AlignmentPI::t_x:
1081  compare->SetBinContent(i + 1, deltaTrans.x() * AlignmentPI::cmToUm);
1082  break;
1083  case AlignmentPI::t_y:
1084  compare->SetBinContent(i + 1, deltaTrans.y() * AlignmentPI::cmToUm);
1085  break;
1086  case AlignmentPI::t_z:
1087  compare->SetBinContent(i + 1, deltaTrans.z() * AlignmentPI::cmToUm);
1088  break;
1090  compare->SetBinContent(i + 1, deltaRot[0] * AlignmentPI::tomRad);
1091  break;
1092  case AlignmentPI::rot_beta:
1093  compare->SetBinContent(i + 1, deltaRot[1] * AlignmentPI::tomRad);
1094  break;
1096  compare->SetBinContent(i + 1, deltaRot[2] * AlignmentPI::tomRad);
1097  break;
1098  default:
1099  edm::LogError("TrackerAlignment_PayloadInspector") << "Unrecognized coordinate " << coord << std::endl;
1100  break;
1101  } // switch on the coordinate
1102  } // check on the same detID
1103  } // loop on the components
1104  }
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
static std::atomic< unsigned int > counter

◆ fillComparisonHistograms()

void AlignmentPI::fillComparisonHistograms ( std::map< int, AlignmentPI::partitions > &  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 1107 of file AlignmentPayloadInspectorHelper.h.

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

1114  {
1115  int counter = 0; /* start the counter */
1117  for (unsigned int i = 0; i < ref_ali.size(); i++) {
1118  if (ref_ali[i].rawId() == target_ali[i].rawId()) {
1119  counter++;
1120  int subid = DetId(ref_ali[i].rawId()).subdetId();
1121 
1122  auto thePart = static_cast<AlignmentPI::partitions>(subid);
1123 
1124  // in case it has to be filtered
1125  if (checkPart > 0 && thePart != checkPart) {
1126  continue;
1127  }
1128 
1129  if (thePart != currentPart) {
1130  currentPart = thePart;
1131  boundaries.insert({counter, thePart});
1132  }
1133 
1134  CLHEP::HepRotation target_rot(target_ali[i].rotation());
1135  CLHEP::HepRotation ref_rot(ref_ali[i].rotation());
1136 
1137  align::RotationType target_ROT(target_rot.xx(),
1138  target_rot.xy(),
1139  target_rot.xz(),
1140  target_rot.yx(),
1141  target_rot.yy(),
1142  target_rot.yz(),
1143  target_rot.zx(),
1144  target_rot.zy(),
1145  target_rot.zz());
1146 
1147  align::RotationType ref_ROT(ref_rot.xx(),
1148  ref_rot.xy(),
1149  ref_rot.xz(),
1150  ref_rot.yx(),
1151  ref_rot.yy(),
1152  ref_rot.yz(),
1153  ref_rot.zx(),
1154  ref_rot.zy(),
1155  ref_rot.zz());
1156 
1157  const std::vector<double> deltaRot = {::deltaPhi(align::toAngles(target_ROT)[0], align::toAngles(ref_ROT)[0]),
1158  ::deltaPhi(align::toAngles(target_ROT)[1], align::toAngles(ref_ROT)[1]),
1159  ::deltaPhi(align::toAngles(target_ROT)[2], align::toAngles(ref_ROT)[2])};
1160 
1161  const auto& deltaTrans = target_ali[i].translation() - ref_ali[i].translation();
1162 
1163  // fill the histograms
1164  if (diff) {
1165  compare[AlignmentPI::t_x]->Fill(deltaTrans.x() * AlignmentPI::cmToUm);
1166  compare[AlignmentPI::t_y]->Fill(deltaTrans.y() * AlignmentPI::cmToUm);
1167  compare[AlignmentPI::t_z]->Fill(deltaTrans.z() * AlignmentPI::cmToUm);
1168 
1169  compare[AlignmentPI::rot_alpha]->Fill(deltaRot[0] * AlignmentPI::tomRad);
1170  compare[AlignmentPI::rot_beta]->Fill(deltaRot[1] * AlignmentPI::tomRad);
1171  compare[AlignmentPI::rot_gamma]->Fill(deltaRot[2] * AlignmentPI::tomRad);
1172  } else {
1173  compare[AlignmentPI::t_x]->SetBinContent(i + 1, deltaTrans.x() * AlignmentPI::cmToUm);
1174  compare[AlignmentPI::t_y]->SetBinContent(i + 1, deltaTrans.y() * AlignmentPI::cmToUm);
1175  compare[AlignmentPI::t_z]->SetBinContent(i + 1, deltaTrans.z() * AlignmentPI::cmToUm);
1176 
1177  compare[AlignmentPI::rot_alpha]->SetBinContent(i + 1, deltaRot[0] * AlignmentPI::tomRad);
1178  compare[AlignmentPI::rot_beta]->SetBinContent(i + 1, deltaRot[1] * AlignmentPI::tomRad);
1179  compare[AlignmentPI::rot_gamma]->SetBinContent(i + 1, deltaRot[2] * AlignmentPI::tomRad);
1180  }
1181 
1182  } // if it's the same detid
1183  } // loop on detids
1184  }
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
static std::atomic< unsigned int > counter

◆ getIndices()

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

Definition at line 716 of file AlignmentPayloadInspectorHelper.h.

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

718  {
719  switch (i) {
720  case XX:
721  return std::make_pair(0, 0);
722  case XY:
723  return std::make_pair(0, 1);
724  case XZ:
725  return std::make_pair(0, 2);
726  case YZ:
727  return std::make_pair(1, 0);
728  case YY:
729  return std::make_pair(1, 1);
730  case ZZ:
731  return std::make_pair(2, 2);
732  default:
733  return std::make_pair(-1, -1);
734  }
735  }

◆ getStringFromCoordinate()

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

Definition at line 650 of file AlignmentPayloadInspectorHelper.h.

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

652  {
653  switch (coord) {
654  case t_x:
655  return "x-translation";
656  case t_y:
657  return "y-translation";
658  case t_z:
659  return "z-translation";
660  case rot_alpha:
661  return "#alpha angle rotation";
662  case rot_beta:
663  return "#beta angle rotation";
664  case rot_gamma:
665  return "#gamma angle rotation";
666  default:
667  return "should never be here!";
668  }
669  }

◆ getStringFromIndex()

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

Definition at line 672 of file AlignmentPayloadInspectorHelper.h.

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

674  {
675  switch (i) {
676  case XX:
677  return "XX";
678  case XY:
679  return "XY";
680  case XZ:
681  return "XZ";
682  case YZ:
683  return "YX";
684  case YY:
685  return "YY";
686  case ZZ:
687  return "ZZ";
688  default:
689  return "should never be here!";
690  }
691  }

◆ getStringFromPart()

std::string AlignmentPI::getStringFromPart ( AlignmentPI::partitions  i,
bool  isPhase2 = false 
)
inline

Definition at line 694 of file AlignmentPayloadInspectorHelper.h.

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

Referenced by makeNiceStats().

696  {
697  switch (i) {
698  case BPix:
699  return "BPix";
700  case FPix:
701  return "FPix";
702  case TIB:
703  return (isPhase2 ? "TIB-invalid" : "TIB");
704  case TID:
705  return (isPhase2 ? "P2OTEC" : "TID");
706  case TOB:
707  return (isPhase2 ? "P2OTB" : "TOB");
708  case TEC:
709  return (isPhase2 ? "TEC-invalid" : "TEC");
710  default:
711  return "should never be here!";
712  }
713  }

◆ getStringFromRegionEnum()

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

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

202  {
203  switch (e) {
205  return "BPixL1o";
207  return "BPixL1i";
209  return "BPixL2o";
211  return "BPixL2i";
213  return "BPixL3o";
215  return "BPixL3i";
217  return "BPixL4o";
219  return "BPixL4i";
221  return "FPixmL1";
223  return "FPixmL2";
225  return "FPixmL3";
227  return "FPixpL1";
229  return "FPixpL2";
231  return "FPixpL3";
233  return "TIBL1Ro";
235  return "TIBL1Ri";
237  return "TIBL1So";
239  return "TIBL1Si";
241  return "TIBL2Ro";
243  return "TIBL2Ri";
245  return "TIBL2So";
247  return "TIBL2Si";
248  case AlignmentPI::TIBL3o:
249  return "TIBL3o";
250  case AlignmentPI::TIBL3i:
251  return "TIBL3i";
252  case AlignmentPI::TIBL4o:
253  return "TIBL4o";
254  case AlignmentPI::TIBL4i:
255  return "TIBL4i";
257  return "TOBL1Ro";
259  return "TOBL1Ri";
261  return "TOBL1So";
263  return "TOBL1Si";
265  return "TOBL2Ro";
267  return "TOBL2Ri";
269  return "TOBL2So";
271  return "TOBL2Si";
272  case AlignmentPI::TOBL3o:
273  return "TOBL3o";
274  case AlignmentPI::TOBL3i:
275  return "TOBL3i";
276  case AlignmentPI::TOBL4o:
277  return "TOBL4o";
278  case AlignmentPI::TOBL4i:
279  return "TOBL4i";
280  case AlignmentPI::TOBL5o:
281  return "TOBL5o";
282  case AlignmentPI::TOBL5i:
283  return "TOBL5i";
284  case AlignmentPI::TOBL6o:
285  return "TOBL6o";
286  case AlignmentPI::TOBL6i:
287  return "TOBL6i";
289  return "TIDmR1R";
291  return "TIDmR1S";
293  return "TIDmR2R";
295  return "TIDmR2S";
296  case AlignmentPI::TIDmR3:
297  return "TIDmR3";
299  return "TIDpR1R";
301  return "TIDpR1S";
303  return "TIDpR2R";
305  return "TIDpR2S";
306  case AlignmentPI::TIDpR3:
307  return "TIDpR3";
309  return "TECmR1R";
311  return "TECmR1S";
313  return "TECmR2R";
315  return "TECmR2S";
316  case AlignmentPI::TECmR3:
317  return "TECmR3";
318  case AlignmentPI::TECmR4:
319  return "TECmR4";
320  case AlignmentPI::TECmR5:
321  return "TECmR5";
322  case AlignmentPI::TECmR6:
323  return "TECmR6";
324  case AlignmentPI::TECmR7:
325  return "TECmR7";
327  return "TECpR1R";
329  return "TECpR1S";
331  return "TECpR2R";
333  return "TECpR2S";
334  case AlignmentPI::TECpR3:
335  return "TECpR3";
336  case AlignmentPI::TECpR4:
337  return "TECpR4";
338  case AlignmentPI::TECpR5:
339  return "TECpR5";
340  case AlignmentPI::TECpR6:
341  return "TECpR6";
342  case AlignmentPI::TECpR7:
343  return "TECpR7";
344  default:
345  edm::LogWarning("LogicError") << "Unknown partition: " << e;
346  return "";
347  }
348  }
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 796 of file AlignmentPayloadInspectorHelper.h.

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

798  {
799  float sum = std::accumulate(
800  std::begin(values), std::end(values), 0.0, [](float value, const std::map<uint32_t, float>::value_type& p) {
801  return value + p.second;
802  });
803 
804  float m = sum / values.size();
805 
806  float accum = 0.0;
807  std::for_each(std::begin(values), std::end(values), [&](const std::map<uint32_t, float>::value_type& p) {
808  accum += (p.second - m) * (p.second - m);
809  });
810 
811  float stdev = sqrt(accum / (values.size() - 1));
812 
813  if (stdev != 0.) {
814  return std::make_pair(m - nsigma * stdev, m + nsigma * stdev);
815  } else {
816  return std::make_pair(m > 0. ? 0.95 * m : 1.05 * m, m > 0 ? 1.05 * m : 0.95 * m);
817  }
818  }
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 351 of file AlignmentPayloadInspectorHelper.h.

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

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

353  {
354  // Using TrackerTopology
355  // Ladders have a staggered structure
356  // Non-flipped ladders are on the outer radius
357  // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
358  // Phase 1: Outer ladders are odd for layer 1,2,3 and even for layer 4
359  bool isOuter = false;
360  int layer = tTopo.pxbLayer(detid.rawId());
361  bool odd_ladder = tTopo.pxbLadder(detid.rawId()) % 2;
362  if (isPhase0) {
363  if (layer == 2)
364  isOuter = !odd_ladder;
365  else
366  isOuter = odd_ladder;
367  } else {
368  if (layer == 4)
369  isOuter = !odd_ladder;
370  else
371  isOuter = odd_ladder;
372  }
373  return isOuter;
374  }
unsigned int pxbLayer(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
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 738 of file AlignmentPayloadInspectorHelper.h.

References compareTotals::hist.

740  {
741  hist->SetStats(kFALSE);
742 
743  hist->GetXaxis()->SetTitleColor(color);
744  hist->SetLineColor(color);
745  hist->SetTitleSize(0.08);
746  hist->SetLineWidth(2);
747  hist->GetXaxis()->CenterTitle(true);
748  hist->GetYaxis()->CenterTitle(true);
749  hist->GetXaxis()->SetTitleFont(42);
750  hist->GetYaxis()->SetTitleFont(42);
751  hist->GetXaxis()->SetNdivisions(505);
752  hist->GetXaxis()->SetTitleSize(0.06);
753  hist->GetYaxis()->SetTitleSize(0.06);
754  hist->GetXaxis()->SetTitleOffset(1.0);
755  hist->GetYaxis()->SetTitleOffset(1.3);
756  hist->GetXaxis()->SetLabelFont(42);
757  hist->GetYaxis()->SetLabelFont(42);
758  hist->GetYaxis()->SetLabelSize(.05);
759  hist->GetXaxis()->SetLabelSize(.05);
760  }

◆ makeNiceStats()

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

Definition at line 763 of file AlignmentPayloadInspectorHelper.h.

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

765  {
766  char buffer[255];
767  TPaveText* stat = new TPaveText(0.71, 0.75, 0.95, 0.88, "NDC");
768  sprintf(buffer, "%s \n", AlignmentPI::getStringFromPart(part).c_str());
769  stat->AddText(buffer);
770 
771  sprintf(buffer, "Entries : %i\n", (int)hist->GetEntries());
772  stat->AddText(buffer);
773 
774  if (std::abs(hist->GetMean()) > 0.01) {
775  sprintf(buffer, "Mean : %6.2f\n", hist->GetMean());
776  } else {
777  sprintf(buffer, "Mean : %6.2f e-2\n", 100 * hist->GetMean());
778  }
779  stat->AddText(buffer);
780 
781  if (std::abs(hist->GetRMS()) > 0.01) {
782  sprintf(buffer, "RMS : %6.2f\n", hist->GetRMS());
783  } else {
784  sprintf(buffer, "RMS : %6.2f e-2\n", 100 * hist->GetRMS());
785  }
786  stat->AddText(buffer);
787 
788  stat->SetLineColor(0);
789  stat->SetTextColor(color);
790  stat->SetFillColor(10);
791  stat->SetShadowColor(10);
792  stat->Draw();
793  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
part
Definition: HCALResponse.h:20
std::string getStringFromPart(AlignmentPI::partitions i, bool isPhase2=false)

◆ operator<<()

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

Definition at line 120 of file AlignmentPayloadInspectorHelper.h.

References x.

◆ returnZeroIfNear2PI()

double AlignmentPI::returnZeroIfNear2PI ( const double  phi)
inline

Definition at line 60 of file AlignmentPayloadInspectorHelper.h.

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

60  {
61  const double tol = 2.e-7; // default tolerance 1.e-7 doesn't account for possible variations
62  if (cms_rounding::roundIfNear0(std::abs(phi) - 2 * M_PI, tol) == 0.f) {
63  return 0.f;
64  } else {
65  return phi;
66  }
67  }
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 71 of file AlignmentPayloadInspectorHelper.h.

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

71  {
72  if (std::abs((std::abs(phi) - 2 * M_PI) * tomRad) < tolerance) {
73  return (std::abs(phi) - 2 * M_PI);
74  } else {
75  return phi;
76  }
77  }
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

◆ mismatched

const unsigned int AlignmentPI::mismatched = 99999
static

Definition at line 36 of file AlignmentPayloadInspectorHelper.h.

Referenced by displayNotSupported().

◆ PARTITIONS

const PARTITION AlignmentPI::PARTITIONS

◆ phase0size

const unsigned int AlignmentPI::phase0size = 19876
static

Definition at line 34 of file AlignmentPayloadInspectorHelper.h.

◆ phase1size

const unsigned int AlignmentPI::phase1size = 20292
static

Definition at line 35 of file AlignmentPayloadInspectorHelper.h.

Referenced by displayNotSupported().

◆ tomRad

const float AlignmentPI::tomRad = 1000.f
static