ATLAS Offline Software
AnnulusBoundsPC.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include <cmath>
8 
9 #include <iostream>
10 
12  double maxR,
13  double phiMin,
14  double phiMax,
15  Amg::Vector2D moduleOrigin,
16  double phiAvg)
17  : m_minR(minR),
18  m_maxR(maxR),
19  m_phiMin(phiMin),
20  m_phiMax(phiMax),
21  m_moduleOrigin(moduleOrigin),
22  m_phiAvg(phiAvg)
23 {
24 
25  m_boundValues.resize(7);
33 
34  m_rotationStripPC = Eigen::Translation<double, 2>(Amg::Vector2D(0, -m_phiAvg));
35  m_translation = Eigen::Translation<double, 2>(m_moduleOrigin);
36 
38  m_shiftPC = Amg::Vector2D(m_shiftXY.perp(), m_shiftXY.phi());
39 
40  // we need the corner points of the module to do the inside
41  // checking, calculate them here once, they don't change
42 
43  // find inner outter radius at edges in STRIP PC
44  auto circIx = [](double O_x, double O_y, double r, double phi)
45  -> Amg::Vector2D {
46  // _____________________________________________
47  // / 2 2 2 2 2 2
48  // O_x + O_y*m - \/ - O_x *m + 2*O_x*O_y*m - O_y + m *r + r
49  // x = --------------------------------------------------------------
50  // 2
51  // m + 1
52  //
53  // y = m*x
54  //
55  double m = std::tan(phi);
57  double x1 = (O_x + O_y*m - std::sqrt(-std::pow(O_x, 2)*std::pow(m, 2) + 2*O_x*O_y*m - std::pow(O_y, 2) + std::pow(m, 2)*std::pow(r, 2) + std::pow(r, 2)))/(std::pow(m, 2) + 1);
58  double x2 = (O_x + O_y*m + std::sqrt(-std::pow(O_x, 2)*std::pow(m, 2) + 2*O_x*O_y*m - std::pow(O_y, 2) + std::pow(m, 2)*std::pow(r, 2) + std::pow(r, 2)))/(std::pow(m, 2) + 1);
59 
60  Amg::Vector2D v1(x1, m*x1);
61  if(v1.dot(dir) > 0) return v1;
62  return {x2, m*x2};
63  };
64 
65  // calculate corners in STRIP XY, keep them we need them for minDistance()
70 
75 
80 }
81 
82 std::pair<Trk::AnnulusBoundsPC, double>
83 Trk::AnnulusBoundsPC::fromCartesian(Trk::AnnulusBounds& annbo) //TODO: Removed const, check that this is OK
84 {
85  auto [k_L, k_R, d_L, d_R] = annbo.getEdgeLines();
86 
87  double O_x = (d_L - d_R) / (k_R - k_L);
88  double O_y = std::fma(O_x, k_L, d_L); // O_x * k_L + d_L
89  Amg::Vector2D originStripXY(-O_x, -O_y);
90 
91  auto bounds = annbo.getBoundsValues();
92 
93  double minR = bounds[AnnulusBounds::bv_minR];
94  double maxR = bounds[AnnulusBounds::bv_maxR];
95  double phi = bounds[AnnulusBounds::bv_phi];
96  double phiS = bounds[AnnulusBounds::bv_phiS];
97  double phiAvg = 0; // phiAvg is the bounds-internal local rotation. We don't want one
98 
99  // phi is the total opening angle, set up symmetric phi bounds
100  double phiMax = phi/2.0;
101  double phiMin = -phiMax;
102 
103  // need to rotate pi/2 to reproduce ABCartesian orientation, phiS so that phi=0 is center and symmetric
104  double phiShift = M_PI_2 - phiS;
105 
106  // we need to rotate the origin into the bounds local coordinate system
107  Transform2D avgPhiRotation;
108  avgPhiRotation = Rotation2D(-phiShift);
109  Amg::Vector2D originStripXYRotated = avgPhiRotation * originStripXY;
110 
111  AnnulusBoundsPC abpc(minR,
112  maxR,
113  phiMin,
114  phiMax,
115  originStripXYRotated,
116  phiAvg);
117 
118  return std::make_pair(std::move(abpc), phiShift);
119 }
120 
121 bool
122 Trk::AnnulusBoundsPC::inside(const Amg::Vector2D& locpo, double tol1, double tol2) const
123 {
124  // locpo is PC in STRIP SYSTEM
125  // need to perform internal rotation induced by m_phiAvg
126  Amg::Vector2D locpo_rotated = m_rotationStripPC * locpo;
127  double tolR = tol1, tolPhi = tol2;
128  double phiLoc = locpo_rotated[Trk::locPhi];
129  double rLoc = locpo_rotated[Trk::locR];
130 
131  if (phiLoc < (m_phiMin - tolPhi) || phiLoc > (m_phiMax + tolPhi)) {
132  return false;
133  }
134 
135  // calculate R in MODULE SYSTEM to evaluate R-bounds
136  if (tolR == 0.) {
137  // don't need R, can use R^2
138  double r_mod2 = m_shiftPC[Trk::locR]*m_shiftPC[Trk::locR]
139  + rLoc*rLoc + 2*m_shiftPC[Trk::locR]*rLoc * std::cos(phiLoc - m_shiftPC[Trk::locPhi]);
140 
141  if (r_mod2 < m_minR*m_minR || r_mod2 > m_maxR*m_maxR) {
142  return false;
143  }
144  }
145  else {
146  // use R
147  double r_mod = std::sqrt(m_shiftPC[Trk::locR]*m_shiftPC[Trk::locR]
148  + rLoc*rLoc + 2*m_shiftPC[Trk::locR]*rLoc * cos(phiLoc - m_shiftPC[Trk::locPhi]));
149 
150  if (r_mod < (m_minR - tolR) || r_mod > (m_maxR + tolR)) {
151  return false;
152  }
153  }
154 
155  return true;
156 }
157 
158 
159 bool
161 {
162 
163  // locpo is PC in STRIP SYSTEM
164 
165  if(bchk.bcType == BoundaryCheck::absolute) {
166  // unpack tolerances and use other methods
167  if(bchk.checkLoc1 && bchk.checkLoc2) {
168  return inside(locpo, bchk.toleranceLoc1, bchk.toleranceLoc2);
169  }
170  else {
171  if(bchk.checkLoc1) {
172  return insideLoc1(locpo, bchk.toleranceLoc1);
173  }
174  else /* bchk.checkLoc2 */ {
175  return insideLoc2(locpo, bchk.toleranceLoc2);
176  }
177  }
178  }
179  else {
180  // first check if inside. We don't need to look into the covariance if inside
181  if(inside(locpo)) {
182  return true;
183  }
184 
185  // we need to rotated the locpo
186  Amg::Vector2D locpo_rotated = m_rotationStripPC * locpo;
187 
188  // covariance is given in STRIP SYSTEM in PC
189  // we need to convert the covariance to the MODULE SYSTEM in PC
190  // via jacobian.
191  // The following transforms into STRIP XY, does the shift into MODULE XY,
192  // and then transforms into MODULE PC
193  double dphi = m_phiAvg;
194  double phi_strip = locpo_rotated[Trk::locPhi];
195  double r_strip = locpo_rotated[Trk::locR];
196  double O_x = m_shiftXY[Trk::locX];
197  double O_y = m_shiftXY[Trk::locY];
198 
199  // For a transformation from cartesian into polar coordinates
200  //
201  // [ _________ ]
202  // [ / 2 2 ]
203  // [ \/ x + y ]
204  // [ r' ] [ ]
205  // v = [ ] = [ / y \]
206  // [phi'] [2*atan|----------------|]
207  // [ | _________|]
208  // [ | / 2 2 |]
209  // [ \x + \/ x + y /]
210  //
211  // Where x, y are polar coordinates that can be rotated by dPhi
212  //
213  // [x] [O_x + r*cos(dPhi - phi)]
214  // [ ] = [ ]
215  // [y] [O_y - r*sin(dPhi - phi)]
216  //
217  // The general jacobian is:
218  //
219  // [d d ]
220  // [--(f_x) --(f_x)]
221  // [dx dy ]
222  // Jgen = [ ]
223  // [d d ]
224  // [--(f_y) --(f_y)]
225  // [dx dy ]
226  //
227  // which means in this case:
228  //
229  // [ d d ]
230  // [ ----------(rMod) ---------(rMod) ]
231  // [ dr_{strip} dphiStrip ]
232  // J = [ ]
233  // [ d d ]
234  // [----------(phiMod) ---------(phiMod)]
235  // [dr_{strip} dphiStrip ]
236  //
237  // Performing the derivative one gets:
238  //
239  // [B*O_x + C*O_y + rStrip rStrip*(B*O_y + O_x*sin(dPhi - phiStrip))]
240  // [---------------------- -----------------------------------------]
241  // [ ___ ___ ]
242  // [ \/ A \/ A ]
243  // J = [ ]
244  // [ -(B*O_y - C*O_x) rStrip*(B*O_x + C*O_y + rStrip) ]
245  // [ ----------------- ------------------------------- ]
246  // [ A A ]
247  //
248  // where
249  // 2 2 2
250  // A = O_x + 2*O_x*rStrip*cos(dPhi - phiStrip) + O_y - 2*O_y*rStrip*sin(dPhi - phiStrip) + rStrip
251  // B = cos(dPhi - phiStrip)
252  // C = -sin(dPhi - phiStrip)
253 
254  double cosDPhiPhiStrip = std::cos(dphi - phi_strip);
255  double sinDPhiPhiStrip = std::sin(dphi - phi_strip);
256 
257  double A = O_x*O_x + 2*O_x*r_strip*cosDPhiPhiStrip
258  + O_y*O_y - 2*O_y*r_strip*sinDPhiPhiStrip
259  + r_strip*r_strip;
260  double sqrtA = std::sqrt(A);
261 
262 
263  double B = cosDPhiPhiStrip;
264  double C = -sinDPhiPhiStrip;
265  Eigen::Matrix<double, 2, 2> jacobianStripPCToModulePC;
266  jacobianStripPCToModulePC(0, 0) = (B*O_x + C*O_y + r_strip)/sqrtA;
267  jacobianStripPCToModulePC(0, 1) = r_strip*(B*O_y + O_x*sinDPhiPhiStrip)/sqrtA;
268  jacobianStripPCToModulePC(1, 0) = -(B*O_y - C*O_x)/A;
269  jacobianStripPCToModulePC(1, 1) = r_strip*(B*O_x + C*O_y + r_strip)/A;
270 
271  // covariance is given in STRIP PC
272  Matrix2D covStripPC = bchk.lCovariance;
273  // calculate covariance in MODULE PC using jacobian from above
274  Matrix2D covModulePC;
275  covModulePC = jacobianStripPCToModulePC * covStripPC * jacobianStripPCToModulePC.transpose();
276 
277  // Mahalanobis distance uses inverse covariance as weights
278  Matrix2D weightStripPC = covStripPC.inverse();
279  Matrix2D weightModulePC = covModulePC.inverse();
280 
281 
282  double minDist = std::numeric_limits<double>::max();
283 
284  Amg::Vector2D currentClosest;
285  double currentDist{0.0}; // initialise to zero
286 
287  // do projection in STRIP PC
288 
289  // first: STRIP system. locpo is in STRIP PC already
290  currentClosest = closestOnSegment(m_inLeftStripPC, m_outLeftStripPC, locpo_rotated, weightStripPC);
291  currentDist = squaredNorm(locpo_rotated-currentClosest, weightStripPC);
292  minDist = currentDist;
293 
294  currentClosest = closestOnSegment(m_inRightStripPC, m_outRightStripPC, locpo_rotated, weightStripPC);
295  currentDist = squaredNorm(locpo_rotated-currentClosest, weightStripPC);
296  if(currentDist < minDist) {
297  minDist = currentDist;
298  }
299 
300  // now: MODULE system. Need to transform locpo to MODULE PC
301  // transform is STRIP PC -> STRIP XY -> MODULE XY -> MODULE PC
302  Amg::Vector2D locpoStripXY(locpo_rotated[Trk::locR]*std::cos(locpo_rotated[Trk::locPhi]),
303  locpo_rotated[Trk::locR]*std::sin(locpo_rotated[Trk::locPhi]));
304  Amg::Vector2D locpoModulePC = stripXYToModulePC(locpoStripXY);
305 
306 
307  // now check edges in MODULE PC (inner and outer circle)
308  // assuming Mahalanobis distances are of same unit if covariance
309  // is correctly transformed
310  currentClosest = closestOnSegment(m_inLeftModulePC, m_inRightModulePC, locpoModulePC, weightModulePC);
311  currentDist = squaredNorm(locpoModulePC-currentClosest, weightModulePC);
312  if(currentDist < minDist) {
313  minDist = currentDist;
314  }
315 
316  currentClosest = closestOnSegment(m_outLeftModulePC, m_outRightModulePC, locpoModulePC, weightModulePC);
317  currentDist = squaredNorm(locpoModulePC-currentClosest, weightModulePC);
318  if(currentDist < minDist) {
319  minDist = currentDist;
320  }
321 
322  // compare resulting Mahalanobis distance to configured
323  // "number of sigmas"
324  // we square it b/c we never took the square root of the distance
325  return minDist < bchk.nSigmas*bchk.nSigmas;
326  }
327 }
328 
329 bool
330 Trk::AnnulusBoundsPC::insideLoc2(const Amg::Vector2D& locpo, double tol2) const
331 {
332  // locpo is PC in STRIP SYSTEM
333  // need to perform internal rotation induced by m_phiAvg
334  Amg::Vector2D locpo_rotated = m_rotationStripPC * locpo;
335  double tolPhi = tol2;
336  double phiLoc = locpo_rotated[Trk::locPhi];
337 
338  return phiLoc >= (m_phiMin - tolPhi) && phiLoc < (m_phiMax + tolPhi);
339 }
340 bool
341 Trk::AnnulusBoundsPC::insideLoc1(const Amg::Vector2D& locpo, double tol1) const
342 {
343  // locpo is PC in STRIP SYSTEM
344  // need to perform internal rotation induced by m_phiAvg
345  Amg::Vector2D locpo_rotated = m_rotationStripPC * locpo;
346  double tolR = tol1;
347  double phiLoc = locpo_rotated[Trk::locPhi];
348  double rLoc = locpo_rotated[Trk::locR];
349 
350  // calculate R in MODULE SYSTEM to evaluate R-bounds
351  if (tolR == 0.) {
352  // don't need R, can use R^2
353  double r_mod2 = m_shiftPC[Trk::locR]*m_shiftPC[Trk::locR]
354  + rLoc*rLoc + 2.0*m_shiftPC[Trk::locR]*rLoc * std::cos(phiLoc - m_shiftPC[Trk::locPhi]);
355 
356  if (r_mod2 < m_minR*m_minR || r_mod2 > m_maxR*m_maxR) {
357  return false;
358  }
359  }
360  else {
361  // use R
362  double r_mod = sqrt(m_shiftPC[Trk::locR]*m_shiftPC[Trk::locR]
363  + rLoc*rLoc + 2.0*m_shiftPC[Trk::locR]*rLoc * std::cos(phiLoc - m_shiftPC[Trk::locPhi]));
364 
365  if (r_mod < (m_minR - tolR) || r_mod > (m_maxR + tolR)) {
366  return false;
367  }
368  }
369 
370  return true;
371 }
372 
373 double
375 {
376  // find the closest point on all edges, calculate distance
377  // return smallest one
378  // closest distance is cartesian, we want the result in mm.
379 
380  Amg::Vector2D locpo_rotated = m_rotationStripPC * locpo;
381 
382  // locpo is given in STRIP PC, we need it in STRIP XY and possibly MODULE XY
383  double rStrip = locpo_rotated[Trk::locR];
384  double phiStrip = locpo_rotated[Trk::locPhi];
385  Amg::Vector2D locpoStripXY(rStrip*std::cos(phiStrip), rStrip*std::sin(phiStrip));
386  Amg::Vector2D locpoModuleXY = locpoStripXY + m_shiftXY;
387  double rMod = locpoModuleXY.norm();
388  double phiMod = locpoModuleXY.phi();
389 
390  Amg::Vector2D closestStripPC;
391  double minDist = std::numeric_limits<double>::max();;
392  double curDist{0.0}; // initialise to 0
393 
394  // for rmin
395  if (m_inRightModulePC[Trk::locPhi] <= phiMod && phiMod < m_inLeftModulePC[Trk::locPhi]) {
396  // is inside phi bounds, to comparison to rmin and r max
397  // r min
398  curDist = std::abs(m_minR - rMod);
399  minDist = std::min(minDist, curDist);
400  }
401  else {
402  // is outside phi bounds, closest can only be the edge points here
403 
404  // in left
405  curDist = (m_inLeftStripXY - locpoStripXY).norm();
406  minDist = std::min(minDist, curDist);
407 
408  // in right
409  curDist = (m_inRightStripXY - locpoStripXY).norm();
410  minDist = std::min(minDist, curDist);
411  }
412 
413  if (m_phiMin <= phiStrip && phiStrip < m_phiMax) {
414  // r max
415  curDist = std::abs(m_maxR - rMod);
416  minDist = std::min(minDist, curDist);
417  }
418  else {
419  // out left
420  curDist = (m_outLeftStripXY - locpoStripXY).norm();
421  minDist = std::min(minDist, curDist);
422 
423  // out right
424  curDist = (m_outRightStripXY - locpoStripXY).norm();
425  minDist = std::min(minDist, curDist);
426  }
427 
428  Matrix2D weight = Matrix2D::Identity();
429 
430  // phi left
431  Amg::Vector2D closestLeft = closestOnSegment(m_inLeftStripXY, m_outLeftStripXY, locpoStripXY, weight);
432  curDist = (closestLeft - locpoStripXY).norm();
433  if (curDist < minDist) {
434  minDist = curDist;
435  }
436 
437  // phi right
438  Amg::Vector2D closestRight = closestOnSegment(m_inRightStripXY, m_outRightStripXY, locpoStripXY, weight);
439  curDist = (closestRight - locpoStripXY).norm();
440  if (curDist < minDist) {
441  minDist = curDist;
442  }
443 
444  return minDist;
445 }
446 
447 double
449 {
450  return (rMax() + rMin()) * 0.5;
451 }
452 
453 MsgStream& Trk::AnnulusBoundsPC::dump( MsgStream& sl ) const
454 {
455  std::stringstream ss;
456  dump(ss);
457  sl << ss.str();
458  return sl;
459 }
460 
461 std::ostream& Trk::AnnulusBoundsPC::dump( std::ostream& sl ) const
462 {
463  sl << std::setiosflags(std::ios::fixed);
464  sl << std::setprecision(7);
465  sl << "Trk::AnnulusBoundsPC: (minR, maxR, phiMin, phiMax, phiAvg, origin(x, y)) = " << "(" ;
466  sl << m_boundValues[AnnulusBoundsPC::bv_minR] << ", ";
467  sl << m_boundValues[AnnulusBoundsPC::bv_maxR] << ", ";
468  sl << m_boundValues[AnnulusBoundsPC::bv_phiMin] << ", ";
469  sl << m_boundValues[AnnulusBoundsPC::bv_phiMax] << ", ";
470  sl << m_boundValues[AnnulusBoundsPC::bv_phiAvg] << ", ";
471  sl << m_boundValues[AnnulusBoundsPC::bv_originX] << ", ";
472  sl << m_boundValues[AnnulusBoundsPC::bv_originY];
473  sl << ")";
474  sl << std::setprecision(-1);
475  return sl;
476 }
477 
478 std::array<std::pair<double, double>,4 >
480  auto rot = m_rotationStripPC.inverse();
481 
482  auto to_pair = [](const Amg::Vector2D& v) -> std::pair<double, double>
483  {
484  return {v[0], v[1]};
485  };
486 
487  return {
488  to_pair(rot * m_outRightStripPC),
489  to_pair(rot * m_outLeftStripPC),
490  to_pair(rot * m_inLeftStripPC),
491  to_pair(rot * m_inRightStripPC)
492  };
493 
494 }
495 
498 {
499  Amg::Vector2D vecModuleXY = vStripXY + m_shiftXY;
500  return {vecModuleXY.norm(), vecModuleXY.phi()};
501 }
502 
505  const Amg::Vector2D& b,
506  const Amg::Vector2D& p,
507  const Eigen::Matrix<double, 2, 2>& weight)
508 {
509  // connecting vector
510  auto n = b - a;
511  // squared norm of line
512  auto f = (n.transpose() * weight * n).value();
513  // weighted scalar product of line to point and segment line
514  auto u = ((p - a).transpose() * weight * n).value() / f;
515  // clamp to [0, 1], convert to point
516  return std::min(std::max(u, 0.0), 1.0) * n + a;
517 }
518 
519 double
520 Trk::AnnulusBoundsPC::squaredNorm(const Amg::Vector2D& v, const Eigen::Matrix<double, 2, 2>& weight)
521 {
522  return (v.transpose() * weight * v).value();
523 }
524 
527 {
528  return Eigen::Rotation2D<double>(m_phiAvg) * m_moduleOrigin;
529 }
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
Trk::AnnulusBoundsPC::m_inLeftStripXY
Amg::Vector2D m_inLeftStripXY
Definition: AnnulusBoundsPC.h:194
Trk::AnnulusBoundsPC::m_minR
double m_minR
Definition: AnnulusBoundsPC.h:170
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
Trk::AnnulusBoundsPC::m_translation
Transform2D m_translation
Definition: AnnulusBoundsPC.h:180
Trk::AnnulusBoundsPC::dump
MsgStream & dump(MsgStream &sl) const override
helper which dumps the configuration into a stream.
Definition: AnnulusBoundsPC.cxx:453
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Trk::AnnulusBoundsPC::m_maxR
double m_maxR
Definition: AnnulusBoundsPC.h:171
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
Trk::AnnulusBoundsPC::m_outRightStripXY
Amg::Vector2D m_outRightStripXY
Definition: AnnulusBoundsPC.h:195
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
Trk::AnnulusBoundsPC::Rotation2D
Eigen::Rotation2D< double > Rotation2D
Definition: AnnulusBoundsPC.h:32
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
Trk::AnnulusBounds
Definition: AnnulusBounds.h:45
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
Trk::BoundaryCheck::checkLoc2
bool checkLoc2
check local 2 coordinate
Definition: BoundaryCheck.h:66
athena.value
value
Definition: athena.py:124
Trk::AnnulusBounds::bv_phi
@ bv_phi
Definition: AnnulusBounds.h:56
Trk::AnnulusBoundsPC::m_phiMax
double m_phiMax
Definition: AnnulusBoundsPC.h:173
Trk::locR
@ locR
Definition: ParamDefs.h:44
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::AnnulusBoundsPC::m_boundValues
std::vector< TDD_real_t > m_boundValues
Definition: AnnulusBoundsPC.h:198
Trk::AnnulusBoundsPC::insideLoc1
bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
Check if local point is inside of r bounds.
Definition: AnnulusBoundsPC.cxx:341
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
Trk::AnnulusBoundsPC::m_inLeftStripPC
Amg::Vector2D m_inLeftStripPC
Definition: AnnulusBoundsPC.h:184
AnnulusBoundsPC.h
Trk::AnnulusBoundsPC::m_shiftPC
Amg::Vector2D m_shiftPC
Definition: AnnulusBoundsPC.h:177
Trk::AnnulusBoundsPC::stripXYToModulePC
Amg::Vector2D stripXYToModulePC(const Amg::Vector2D &vStripXY) const
Definition: AnnulusBoundsPC.cxx:497
Trk::AnnulusBoundsPC::m_inRightStripXY
Amg::Vector2D m_inRightStripXY
Definition: AnnulusBoundsPC.h:196
Trk::AnnulusBoundsPC::m_shiftXY
Amg::Vector2D m_shiftXY
Definition: AnnulusBoundsPC.h:176
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:88
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
Trk::AnnulusBoundsPC::m_outLeftStripXY
Amg::Vector2D m_outLeftStripXY
Definition: AnnulusBoundsPC.h:193
Trk::AnnulusBoundsPC::bv_maxR
@ bv_maxR
Definition: AnnulusBoundsPC.h:42
Trk::BoundaryCheck::toleranceLoc1
double toleranceLoc1
absolute tolerance in local 1 coordinate
Definition: BoundaryCheck.h:68
A
Trk::AnnulusBoundsPC::corners
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
Definition: AnnulusBoundsPC.cxx:479
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Trk::AnnulusBoundsPC::m_moduleOrigin
Amg::Vector2D m_moduleOrigin
Definition: AnnulusBoundsPC.h:175
AnnulusBounds.h
Trk::AnnulusBoundsPC::Matrix2D
Eigen::Matrix< double, 2, 2 > Matrix2D
Definition: AnnulusBoundsPC.h:34
beamspotman.n
n
Definition: beamspotman.py:731
Trk::AnnulusBoundsPC::phiMin
double phiMin() const
Returns the right angular edge of the module.
Definition: AnnulusBoundsPC.h:139
Trk::AnnulusBoundsPC
Class that implements the asymmetric shape of the ITk strip endcap modules.
Definition: AnnulusBoundsPC.h:30
Trk::AnnulusBoundsPC::m_inLeftModulePC
Amg::Vector2D m_inLeftModulePC
Definition: AnnulusBoundsPC.h:189
Trk::BoundaryCheck::bcType
BoundaryCheckType bcType
Definition: BoundaryCheck.h:70
Trk::AnnulusBounds::bv_phiS
@ bv_phiS
Definition: AnnulusBounds.h:57
Trk::AnnulusBoundsPC::moduleOrigin
Amg::Vector2D moduleOrigin() const
Returns moduleOrigin, but rotated out, so avgPhi is already considered.
Definition: AnnulusBoundsPC.cxx:526
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Trk::AnnulusBoundsPC::m_outLeftModulePC
Amg::Vector2D m_outLeftModulePC
Definition: AnnulusBoundsPC.h:188
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::AnnulusBoundsPC::squaredNorm
static double squaredNorm(const Amg::Vector2D &v, const Eigen::Matrix< double, 2, 2 > &weight)
Definition: AnnulusBoundsPC.cxx:520
Trk::AnnulusBoundsPC::minDistance
double minDistance(const Amg::Vector2D &locpo) const override final
Return minimum distance a point is away from the bounds.
Definition: AnnulusBoundsPC.cxx:374
Trk::AnnulusBoundsPC::m_inRightModulePC
Amg::Vector2D m_inRightModulePC
Definition: AnnulusBoundsPC.h:191
Trk::AnnulusBoundsPC::m_outLeftStripPC
Amg::Vector2D m_outLeftStripPC
Definition: AnnulusBoundsPC.h:183
Trk::AnnulusBoundsPC::fromCartesian
static std::pair< AnnulusBoundsPC, double > fromCartesian(AnnulusBounds &annbo)
Static factory method to produce an instance of this class from the cartesian implementation.
Definition: AnnulusBoundsPC.cxx:83
Trk::AnnulusBoundsPC::bv_phiMin
@ bv_phiMin
Definition: AnnulusBoundsPC.h:43
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::AnnulusBoundsPC::m_outRightStripPC
Amg::Vector2D m_outRightStripPC
Definition: AnnulusBoundsPC.h:185
Trk::BoundaryCheck::nSigmas
int nSigmas
allowed sigmas for chi2 boundary check
Definition: BoundaryCheck.h:67
Trk::AnnulusBoundsPC::phiMax
double phiMax() const
Returns the left angular edge of the module.
Definition: AnnulusBoundsPC.h:143
Trk::AnnulusBoundsPC::m_phiAvg
double m_phiAvg
Definition: AnnulusBoundsPC.h:178
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Trk::AnnulusBoundsPC::closestOnSegment
static Amg::Vector2D closestOnSegment(const Amg::Vector2D &a, const Amg::Vector2D &b, const Amg::Vector2D &p, const Eigen::Matrix< double, 2, 2 > &weight)
Definition: AnnulusBoundsPC.cxx:504
Trk::locPhi
@ locPhi
local polar
Definition: ParamDefs.h:45
Trk::AnnulusBoundsPC::m_phiMin
double m_phiMin
Definition: AnnulusBoundsPC.h:172
Trk::AnnulusBoundsPC::bv_originY
@ bv_originY
Definition: AnnulusBoundsPC.h:47
Trk::AnnulusBoundsPC::AnnulusBoundsPC
AnnulusBoundsPC(double minR, double maxR, double phiMin, double phiMax, Amg::Vector2D moduleOrigin={0, 0}, double phiAvg=0)
Default constructor from parameters.
Definition: AnnulusBoundsPC.cxx:11
Trk::AnnulusBoundsPC::bv_minR
@ bv_minR
Definition: AnnulusBoundsPC.h:41
Trk::AnnulusBounds::bv_minR
@ bv_minR
Definition: AnnulusBounds.h:53
Trk::AnnulusBoundsPC::insideLoc2
bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
Check if local point is inside of phi bounds.
Definition: AnnulusBoundsPC.cxx:330
Trk::inside
@ inside
Definition: PropDirection.h:29
Trk::AnnulusBounds::getEdgeLines
std::array< TDD_real_t, 4 > getEdgeLines() const
Returns the gradient and y-intercept of the left and right module edges.
Definition: AnnulusBounds.cxx:659
Trk::AnnulusBoundsPC::bv_phiMax
@ bv_phiMax
Definition: AnnulusBoundsPC.h:44
Trk::AnnulusBoundsPC::inside
bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
Returns if a point in local coordinates is inside the bounds.
Definition: AnnulusBoundsPC.cxx:122
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::AnnulusBounds::getBoundsValues
const std::vector< TDD_real_t > & getBoundsValues()
Trk::BoundaryCheck::absolute
@ absolute
absolute check including tolerances
Definition: BoundaryCheck.h:60
Trk::AnnulusBoundsPC::Transform2D
Eigen::Transform< double, 2, Eigen::Affine > Transform2D
Definition: AnnulusBoundsPC.h:33
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::BoundaryCheck::checkLoc1
bool checkLoc1
check local 1 coordinate
Definition: BoundaryCheck.h:65
Trk::AnnulusBoundsPC::m_rotationStripPC
Transform2D m_rotationStripPC
Definition: AnnulusBoundsPC.h:179
Trk::AnnulusBoundsPC::bv_originX
@ bv_originX
Definition: AnnulusBoundsPC.h:46
Trk::AnnulusBoundsPC::m_outRightModulePC
Amg::Vector2D m_outRightModulePC
Definition: AnnulusBoundsPC.h:190
Trk::BoundaryCheck::toleranceLoc2
double toleranceLoc2
absolute tolerance in local 2 coordinate
Definition: BoundaryCheck.h:69
Trk::AnnulusBoundsPC::m_inRightStripPC
Amg::Vector2D m_inRightStripPC
Definition: AnnulusBoundsPC.h:186
Trk::phi
@ phi
Definition: ParamDefs.h:75
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Trk::AnnulusBounds::bv_maxR
@ bv_maxR
Definition: AnnulusBounds.h:54
Trk::AnnulusBoundsPC::bv_phiAvg
@ bv_phiAvg
Definition: AnnulusBoundsPC.h:45
Trk::v
@ v
Definition: ParamDefs.h:78
Trk::AnnulusBoundsPC::r
double r() const override
Returns middle radius.
Definition: AnnulusBoundsPC.cxx:448