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

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

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

Function Documentation

◆ calculatePosition()

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

Definition at line 822 of file AlignmentPayloadInspectorHelper.h.

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

Referenced by HGCalImagingAlgo::getClusters().

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

◆ displayNotSupported()

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

Definition at line 42 of file AlignmentPayloadInspectorHelper.h.

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

44  {
45  std::string phase = (size < AlignmentPI::phase1size) ? "Phase-0" : "Phase-2";
46  canv.cd();
47  TLatex t2;
48  t2.SetTextAlign(21);
49  t2.SetTextSize(0.1);
50  t2.SetTextAngle(45);
51  t2.SetTextColor(kRed);
53  t2.DrawLatexNDC(0.6, 0.50, Form("%s NOT SUPPORTED!", phase.c_str()));
54  } else {
55  t2.DrawLatexNDC(0.6, 0.50, "MISMATCHED PAYLOAD SIZE!");
56  }
57  }
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 1031 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.

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

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

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

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

◆ getStringFromCoordinate()

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

Definition at line 651 of file AlignmentPayloadInspectorHelper.h.

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

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

◆ getStringFromIndex()

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

Definition at line 673 of file AlignmentPayloadInspectorHelper.h.

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

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

◆ getStringFromPart()

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

Definition at line 695 of file AlignmentPayloadInspectorHelper.h.

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

Referenced by makeNiceStats().

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

◆ getStringFromRegionEnum()

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

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

203  {
204  switch (e) {
206  return "BPixL1o";
208  return "BPixL1i";
210  return "BPixL2o";
212  return "BPixL2i";
214  return "BPixL3o";
216  return "BPixL3i";
218  return "BPixL4o";
220  return "BPixL4i";
222  return "FPixmL1";
224  return "FPixmL2";
226  return "FPixmL3";
228  return "FPixpL1";
230  return "FPixpL2";
232  return "FPixpL3";
234  return "TIBL1Ro";
236  return "TIBL1Ri";
238  return "TIBL1So";
240  return "TIBL1Si";
242  return "TIBL2Ro";
244  return "TIBL2Ri";
246  return "TIBL2So";
248  return "TIBL2Si";
249  case AlignmentPI::TIBL3o:
250  return "TIBL3o";
251  case AlignmentPI::TIBL3i:
252  return "TIBL3i";
253  case AlignmentPI::TIBL4o:
254  return "TIBL4o";
255  case AlignmentPI::TIBL4i:
256  return "TIBL4i";
258  return "TOBL1Ro";
260  return "TOBL1Ri";
262  return "TOBL1So";
264  return "TOBL1Si";
266  return "TOBL2Ro";
268  return "TOBL2Ri";
270  return "TOBL2So";
272  return "TOBL2Si";
273  case AlignmentPI::TOBL3o:
274  return "TOBL3o";
275  case AlignmentPI::TOBL3i:
276  return "TOBL3i";
277  case AlignmentPI::TOBL4o:
278  return "TOBL4o";
279  case AlignmentPI::TOBL4i:
280  return "TOBL4i";
281  case AlignmentPI::TOBL5o:
282  return "TOBL5o";
283  case AlignmentPI::TOBL5i:
284  return "TOBL5i";
285  case AlignmentPI::TOBL6o:
286  return "TOBL6o";
287  case AlignmentPI::TOBL6i:
288  return "TOBL6i";
290  return "TIDmR1R";
292  return "TIDmR1S";
294  return "TIDmR2R";
296  return "TIDmR2S";
297  case AlignmentPI::TIDmR3:
298  return "TIDmR3";
300  return "TIDpR1R";
302  return "TIDpR1S";
304  return "TIDpR2R";
306  return "TIDpR2S";
307  case AlignmentPI::TIDpR3:
308  return "TIDpR3";
310  return "TECmR1R";
312  return "TECmR1S";
314  return "TECmR2R";
316  return "TECmR2S";
317  case AlignmentPI::TECmR3:
318  return "TECmR3";
319  case AlignmentPI::TECmR4:
320  return "TECmR4";
321  case AlignmentPI::TECmR5:
322  return "TECmR5";
323  case AlignmentPI::TECmR6:
324  return "TECmR6";
325  case AlignmentPI::TECmR7:
326  return "TECmR7";
328  return "TECpR1R";
330  return "TECpR1S";
332  return "TECpR2R";
334  return "TECpR2S";
335  case AlignmentPI::TECpR3:
336  return "TECpR3";
337  case AlignmentPI::TECpR4:
338  return "TECpR4";
339  case AlignmentPI::TECpR5:
340  return "TECpR5";
341  case AlignmentPI::TECpR6:
342  return "TECpR6";
343  case AlignmentPI::TECpR7:
344  return "TECpR7";
345  default:
346  edm::LogWarning("LogicError") << "Unknown partition: " << e;
347  return "";
348  }
349  }
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 797 of file AlignmentPayloadInspectorHelper.h.

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

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

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

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

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

References compareTotals::hist.

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

◆ makeNiceStats()

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

Definition at line 764 of file AlignmentPayloadInspectorHelper.h.

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

766  {
767  char buffer[255];
768  TPaveText* stat = new TPaveText(0.71, 0.75, 0.95, 0.88, "NDC");
769  sprintf(buffer, "%s \n", AlignmentPI::getStringFromPart(part).c_str());
770  stat->AddText(buffer);
771 
772  sprintf(buffer, "Entries : %i\n", (int)hist->GetEntries());
773  stat->AddText(buffer);
774 
775  if (std::abs(hist->GetMean()) > 0.01) {
776  sprintf(buffer, "Mean : %6.2f\n", hist->GetMean());
777  } else {
778  sprintf(buffer, "Mean : %6.2f e-2\n", 100 * hist->GetMean());
779  }
780  stat->AddText(buffer);
781 
782  if (std::abs(hist->GetRMS()) > 0.01) {
783  sprintf(buffer, "RMS : %6.2f\n", hist->GetRMS());
784  } else {
785  sprintf(buffer, "RMS : %6.2f e-2\n", 100 * hist->GetRMS());
786  }
787  stat->AddText(buffer);
788 
789  stat->SetLineColor(0);
790  stat->SetTextColor(color);
791  stat->SetFillColor(10);
792  stat->SetShadowColor(10);
793  stat->Draw();
794  }
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 121 of file AlignmentPayloadInspectorHelper.h.

References x.

◆ returnZeroIfNear2PI()

double AlignmentPI::returnZeroIfNear2PI ( const double  phi)
inline

Definition at line 61 of file AlignmentPayloadInspectorHelper.h.

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

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

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

72  {
73  if (std::abs((std::abs(phi) - 2 * M_PI) * tomRad) < tolerance) {
74  return (std::abs(phi) - 2 * M_PI);
75  } else {
76  return phi;
77  }
78  }
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 37 of file AlignmentPayloadInspectorHelper.h.

Referenced by displayNotSupported().

◆ PARTITIONS

const PARTITION AlignmentPI::PARTITIONS

◆ phase0size

const unsigned int AlignmentPI::phase0size = 19876
static

Definition at line 35 of file AlignmentPayloadInspectorHelper.h.

◆ phase1size

const unsigned int AlignmentPI::phase1size = 20292
static

Definition at line 36 of file AlignmentPayloadInspectorHelper.h.

Referenced by displayNotSupported().

◆ tomRad

const float AlignmentPI::tomRad = 1000.f
static