|
ATLAS Offline Software
|
Class that implements the asymmetric shape of the ITk strip endcap modules.
More...
#include <AnnulusBoundsPC.h>
|
enum | BoundValues {
bv_minR,
bv_maxR,
bv_phiMin,
bv_phiMax,
bv_phiAvg,
bv_originX,
bv_originY
} |
|
enum | BoundsType {
Cone = 0,
Cylinder = 1,
Diamond = 2,
Disc = 3,
Ellipse = 5,
Rectangle = 6,
RotatedTrapezoid = 7,
Trapezoid = 8,
Triangle = 9,
DiscTrapezoidal = 10,
Annulus = 11,
Other = 12
} |
|
|
| AnnulusBoundsPC (double minR, double maxR, double phiMin, double phiMax, Amg::Vector2D moduleOrigin={0, 0}, double phiAvg=0) |
| Default constructor from parameters. More...
|
|
| AnnulusBoundsPC (const AnnulusBoundsPC &annbo)=default |
| Copy constructor. More...
|
|
AnnulusBoundsPC & | operator= (const AnnulusBoundsPC &sbo)=default |
| Assignment operator. More...
|
|
| AnnulusBoundsPC (AnnulusBoundsPC &&annbo)=default |
| Move constructor. More...
|
|
AnnulusBoundsPC & | operator= (AnnulusBoundsPC &&sbo)=default |
| Move assignment. More...
|
|
virtual AnnulusBoundsPC * | clone () const override |
| clone() method to make deep copy in Surface copy constructor and for assigment operator of the Surface class. More...
|
|
bool | operator== (const SurfaceBounds &sb) const override |
| Equality operator. More...
|
|
SurfaceBounds::BoundsType | type () const override |
| Return the bounds type - for persistency optimization. More...
|
|
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. More...
|
|
bool | inside (const Amg::Vector2D &locpo, const BoundaryCheck &bchk) const override final |
| Returns if a point in local coordinates is inside the bounds. More...
|
|
bool | insideLoc1 (const Amg::Vector2D &locpo, double tol1=0.) const override final |
| Check if local point is inside of r bounds. More...
|
|
bool | insideLoc2 (const Amg::Vector2D &locpo, double tol2=0.) const override final |
| Check if local point is inside of phi bounds. More...
|
|
double | minDistance (const Amg::Vector2D &locpo) const override final |
| Return minimum distance a point is away from the bounds. More...
|
|
double | r () const override |
| Returns middle radius. More...
|
|
double | rMin () const |
| Returns inner radial bounds (module system) More...
|
|
double | rMax () const |
| Returns outer radial bounds (module system) More...
|
|
double | phiMin () const |
| Returns the right angular edge of the module. More...
|
|
double | phiMax () const |
| Returns the left angular edge of the module. More...
|
|
Amg::Vector2D | moduleOrigin () const |
| Returns moduleOrigin, but rotated out, so avgPhi is already considered. More...
|
|
MsgStream & | dump (MsgStream &sl) const override |
| helper which dumps the configuration into a stream. More...
|
|
std::ostream & | dump (std::ostream &sl) const override |
| Output Method for std::ostream, to be overloaded by child classes. More...
|
|
std::array< std::pair< double, double >, 4 > | corners () const |
| Returns the four corners of the bounds. More...
|
|
virtual bool | operator!= (const SurfaceBounds &sb) const |
| Non-Equality operator. More...
|
|
|
void | swap (double &b1, double &b2) |
| Swap method to be called from DiscBounds or TrapezoidalBounds. More...
|
|
virtual void | initCache () |
| virtual initCache method for object persistency More...
|
|
Class that implements the asymmetric shape of the ITk strip endcap modules.
Definition at line 30 of file AnnulusBoundsPC.h.
◆ Matrix2D
◆ Rotation2D
◆ Transform2D
◆ BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
Other is reserved for the GeometrySurfaces implementation.
Enumerator |
---|
Cone | |
Cylinder | |
Diamond | |
Disc | |
Ellipse | |
Rectangle | |
RotatedTrapezoid | |
Trapezoid | |
Triangle | |
DiscTrapezoidal | |
Annulus | |
Other | |
Definition at line 58 of file SurfaceBounds.h.
◆ BoundValues
Enumerator |
---|
bv_minR | |
bv_maxR | |
bv_phiMin | |
bv_phiMax | |
bv_phiAvg | |
bv_originX | |
bv_originY | |
Definition at line 40 of file AnnulusBoundsPC.h.
◆ AnnulusBoundsPC() [1/3]
Trk::AnnulusBoundsPC::AnnulusBoundsPC |
( |
double |
minR, |
|
|
double |
maxR, |
|
|
double |
phiMin, |
|
|
double |
phiMax, |
|
|
Amg::Vector2D |
moduleOrigin = {0, 0} , |
|
|
double |
phiAvg = 0 |
|
) |
| |
Default constructor from parameters.
- Parameters
-
minR | inner radius, in module system |
maxR | outer radius, in module system |
phiMin | right angular edge, in strip system |
phiMax | left angular edge, in strip system |
moduleOrigin | The origin offset between the two systems. |
phiAvg | (Optional) internal rotation of this bounds object's local frame |
- Note
- For
moduleOrigin
you need to actually calculate the cartesian offset
Definition at line 11 of file AnnulusBoundsPC.cxx.
44 auto circIx = [](
double O_x,
double O_y,
double r,
double phi)
61 if(v1.dot(
dir) > 0)
return v1;
◆ AnnulusBoundsPC() [2/3]
◆ AnnulusBoundsPC() [3/3]
◆ clone()
◆ closestOnSegment()
◆ corners()
std::array< std::pair< double, double >, 4 > Trk::AnnulusBoundsPC::corners |
( |
| ) |
const |
Returns the four corners of the bounds.
Returns the module corners starting from the upper right (max R, pos locPhi) and proceding clock-wise, i.e. (max R; pos locPhi), (min R; pos locPhi), (min R; neg loc X), (max R; neg locPhi).
This method is only intended for debug purposes. If used for production code, this should be changed to a return-by-reference. This will necessitate the vector being stored in the class.
- Returns
- array of pairs of doubles giving the (R, phi) of each corner clockwise from upper-right
Definition at line 479 of file AnnulusBoundsPC.cxx.
482 auto to_pair = [](
const Amg::Vector2D&
v) -> std::pair<double, double>
◆ dump() [1/2]
MsgStream & Trk::AnnulusBoundsPC::dump |
( |
MsgStream & |
sl | ) |
const |
|
overridevirtual |
◆ dump() [2/2]
std::ostream & Trk::AnnulusBoundsPC::dump |
( |
std::ostream & |
sl | ) |
const |
|
overridevirtual |
Output Method for std::ostream, to be overloaded by child classes.
Implements Trk::SurfaceBounds.
Definition at line 461 of file AnnulusBoundsPC.cxx.
463 sl << std::setiosflags(std::ios::fixed);
464 sl << std::setprecision(7);
465 sl <<
"Trk::AnnulusBoundsPC: (minR, maxR, phiMin, phiMax, phiAvg, origin(x, y)) = " <<
"(" ;
474 sl << std::setprecision(-1);
◆ fromCartesian()
Static factory method to produce an instance of this class from the cartesian implementation.
- Parameters
-
annbo | A reference to the original cartesian bounds object |
- Returns
- pair containing the PC bounds, and an angular shift
phiShift
- Note
- The local frame of the cartesian implementation is such that the module sits around the y-axis. This implementation sits around the x axis. The local frame needs to be rotated to account for this.
phiShift
contains necessary information to (re)construct a transform that will perform this rotation.
Definition at line 83 of file AnnulusBoundsPC.cxx.
87 double O_x = (d_L - d_R) / (k_R - k_L);
88 double O_y = std::fma(O_x, k_L, d_L);
104 double phiShift = M_PI_2 - phiS;
109 Amg::Vector2D originStripXYRotated = avgPhiRotation * originStripXY;
115 originStripXYRotated,
118 return std::make_pair(std::move(abpc), phiShift);
◆ initCache()
virtual void Trk::SurfaceBounds::initCache |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ inside() [1/2]
Returns if a point in local coordinates is inside the bounds.
- Parameters
-
locpo | Local position |
bchk | The boundary check object to consult for inside checks |
- Returns
- true if is inside, false if not
Implements Trk::SurfaceBounds.
Definition at line 160 of file AnnulusBoundsPC.cxx.
167 if(bchk.checkLoc1 && bchk.checkLoc2) {
168 return inside(locpo, bchk.toleranceLoc1, bchk.toleranceLoc2);
195 double r_strip = locpo_rotated[
Trk::locR];
254 double cosDPhiPhiStrip =
std::cos(dphi - phi_strip);
255 double sinDPhiPhiStrip =
std::sin(dphi - phi_strip);
257 double A = O_x*O_x + 2*O_x*r_strip*cosDPhiPhiStrip
258 + O_y*O_y - 2*O_y*r_strip*sinDPhiPhiStrip
260 double sqrtA = std::sqrt(
A);
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;
272 Matrix2D covStripPC = bchk.lCovariance;
275 covModulePC = jacobianStripPCToModulePC * covStripPC * jacobianStripPCToModulePC.transpose();
278 Matrix2D weightStripPC = covStripPC.inverse();
279 Matrix2D weightModulePC = covModulePC.inverse();
285 double currentDist{0.0};
291 currentDist =
squaredNorm(locpo_rotated-currentClosest, weightStripPC);
292 minDist = currentDist;
295 currentDist =
squaredNorm(locpo_rotated-currentClosest, weightStripPC);
296 if(currentDist < minDist) {
297 minDist = currentDist;
311 currentDist =
squaredNorm(locpoModulePC-currentClosest, weightModulePC);
312 if(currentDist < minDist) {
313 minDist = currentDist;
317 currentDist =
squaredNorm(locpoModulePC-currentClosest, weightModulePC);
318 if(currentDist < minDist) {
319 minDist = currentDist;
325 return minDist < bchk.nSigmas*bchk.nSigmas;
◆ inside() [2/2]
bool Trk::AnnulusBoundsPC::inside |
( |
const Amg::Vector2D & |
locpo, |
|
|
double |
tol1 = 0. , |
|
|
double |
tol2 = 0. |
|
) |
| const |
|
finaloverridevirtual |
Returns if a point in local coordinates is inside the bounds.
- Parameters
-
locpo | Local position |
tol1 | Tolerance in r |
tol2 | Tolerance in phi |
- Returns
- true if is inside, false if not
Implements Trk::SurfaceBounds.
Definition at line 122 of file AnnulusBoundsPC.cxx.
127 double tolR = tol1, tolPhi = tol2;
150 if (r_mod < (
m_minR - tolR) || r_mod > (
m_maxR + tolR)) {
◆ insideLoc1()
bool Trk::AnnulusBoundsPC::insideLoc1 |
( |
const Amg::Vector2D & |
locpo, |
|
|
double |
tol1 = 0. |
|
) |
| const |
|
finaloverridevirtual |
Check if local point is inside of r bounds.
- Parameters
-
locpo | Local position |
tol1 | Tolerance in r |
- Returns
- true if is inside, false if not
Implements Trk::SurfaceBounds.
Definition at line 341 of file AnnulusBoundsPC.cxx.
365 if (r_mod < (
m_minR - tolR) || r_mod > (
m_maxR + tolR)) {
◆ insideLoc2()
bool Trk::AnnulusBoundsPC::insideLoc2 |
( |
const Amg::Vector2D & |
locpo, |
|
|
double |
tol2 = 0. |
|
) |
| const |
|
finaloverridevirtual |
Check if local point is inside of phi bounds.
- Parameters
-
locpo | Local position |
tol2 | Tolerance in phi |
- Returns
- true if is inside, false if not
Implements Trk::SurfaceBounds.
Definition at line 330 of file AnnulusBoundsPC.cxx.
335 double tolPhi = tol2;
◆ minDistance()
Return minimum distance a point is away from the bounds.
- Parameters
-
- Note
- Even though
locpo
is considered in STRIP system, the distance will be calculated with cartesian metric.
Implements Trk::SurfaceBounds.
Definition at line 374 of file AnnulusBoundsPC.cxx.
383 double rStrip = locpo_rotated[
Trk::locR];
387 double rMod = locpoModuleXY.norm();
388 double phiMod = locpoModuleXY.phi();
398 curDist = std::abs(
m_minR - rMod);
399 minDist =
std::min(minDist, curDist);
406 minDist =
std::min(minDist, curDist);
410 minDist =
std::min(minDist, curDist);
415 curDist = std::abs(
m_maxR - rMod);
416 minDist =
std::min(minDist, curDist);
421 minDist =
std::min(minDist, curDist);
425 minDist =
std::min(minDist, curDist);
432 curDist = (closestLeft - locpoStripXY).
norm();
433 if (curDist < minDist) {
439 curDist = (closestRight - locpoStripXY).
norm();
440 if (curDist < minDist) {
◆ moduleOrigin()
Returns moduleOrigin, but rotated out, so avgPhi
is already considered.
The module origin needs to consider the rotation introduced by avgPhi
- Returns
- The origin of the local frame
Definition at line 526 of file AnnulusBoundsPC.cxx.
◆ operator!=()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
◆ phiMax()
double Trk::AnnulusBoundsPC::phiMax |
( |
| ) |
const |
|
inline |
Returns the left angular edge of the module.
- Returns
- The left side angle
Definition at line 143 of file AnnulusBoundsPC.h.
◆ phiMin()
double Trk::AnnulusBoundsPC::phiMin |
( |
| ) |
const |
|
inline |
Returns the right angular edge of the module.
- Returns
- The right side angle
Definition at line 139 of file AnnulusBoundsPC.h.
◆ r()
double Trk::AnnulusBoundsPC::r |
( |
| ) |
const |
|
overridevirtual |
◆ rMax()
double Trk::AnnulusBoundsPC::rMax |
( |
| ) |
const |
|
inline |
Returns outer radial bounds (module system)
- Returns
- The outer radius
Definition at line 135 of file AnnulusBoundsPC.h.
◆ rMin()
double Trk::AnnulusBoundsPC::rMin |
( |
| ) |
const |
|
inline |
Returns inner radial bounds (module system)
- Returns
- The inner radius
Definition at line 131 of file AnnulusBoundsPC.h.
◆ squaredNorm()
◆ stripXYToModulePC()
◆ swap()
void Trk::SurfaceBounds::swap |
( |
double & |
b1, |
|
|
double & |
b2 |
|
) |
| |
|
inlineprotectedinherited |
◆ type()
◆ AnnulusTestAlg
friend Trk::AnnulusBoundsPC::AnnulusTestAlg |
|
private |
◆ m_boundValues
std::vector<TDD_real_t> Trk::AnnulusBoundsPC::m_boundValues |
|
private |
◆ m_inLeftModulePC
◆ m_inLeftStripPC
◆ m_inLeftStripXY
◆ m_inRightModulePC
◆ m_inRightStripPC
◆ m_inRightStripXY
◆ m_maxR
double Trk::AnnulusBoundsPC::m_maxR |
|
private |
◆ m_minR
double Trk::AnnulusBoundsPC::m_minR |
|
private |
◆ m_moduleOrigin
◆ m_outLeftModulePC
◆ m_outLeftStripPC
◆ m_outLeftStripXY
◆ m_outRightModulePC
◆ m_outRightStripPC
◆ m_outRightStripXY
◆ m_phiAvg
double Trk::AnnulusBoundsPC::m_phiAvg |
|
private |
◆ m_phiMax
double Trk::AnnulusBoundsPC::m_phiMax |
|
private |
◆ m_phiMin
double Trk::AnnulusBoundsPC::m_phiMin |
|
private |
◆ m_rotationStripPC
◆ m_shiftPC
◆ m_shiftXY
◆ m_translation
The documentation for this class was generated from the following files:
Amg::Vector2D m_inLeftStripXY
Transform2D m_translation
double rMin() const
Returns inner radial bounds (module system)
MsgStream & dump(MsgStream &sl) const override
helper which dumps the configuration into a stream.
Amg::Vector2D m_outRightStripXY
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Rotation2D< double > Rotation2D
std::vector< TDD_real_t > m_boundValues
bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
Check if local point is inside of r bounds.
@ u
Enums for curvilinear frames.
Amg::Vector2D m_inLeftStripPC
Amg::Vector2D stripXYToModulePC(const Amg::Vector2D &vStripXY) const
Amg::Vector2D m_inRightStripXY
Amg::Vector2D m_outLeftStripXY
double rMax() const
Returns outer radial bounds (module system)
Amg::Vector2D m_moduleOrigin
Eigen::Matrix< double, 2, 2 > Matrix2D
double phiMin() const
Returns the right angular edge of the module.
Amg::Vector2D m_inLeftModulePC
Amg::Vector2D moduleOrigin() const
Returns moduleOrigin, but rotated out, so avgPhi is already considered.
Amg::Vector2D m_outLeftModulePC
static double squaredNorm(const Amg::Vector2D &v, const Eigen::Matrix< double, 2, 2 > &weight)
Amg::Vector2D m_inRightModulePC
Amg::Vector2D m_outLeftStripPC
Amg::Vector2D m_outRightStripPC
double phiMax() const
Returns the left angular edge of the module.
static Amg::Vector2D closestOnSegment(const Amg::Vector2D &a, const Amg::Vector2D &b, const Amg::Vector2D &p, const Eigen::Matrix< double, 2, 2 > &weight)
AnnulusBoundsPC(double minR, double maxR, double phiMin, double phiMax, Amg::Vector2D moduleOrigin={0, 0}, double phiAvg=0)
Default constructor from parameters.
bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
Check if local point is inside of phi bounds.
std::array< TDD_real_t, 4 > getEdgeLines() const
Returns the gradient and y-intercept of the left and right module edges.
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.
const std::vector< TDD_real_t > & getBoundsValues()
@ absolute
absolute check including tolerances
Eigen::Transform< double, 2, Eigen::Affine > Transform2D
Transform2D m_rotationStripPC
Amg::Vector2D m_outRightModulePC
Amg::Vector2D m_inRightStripPC
double r() const override
Returns middle radius.