ATLAS Offline Software
Loading...
Searching...
No Matches
AnnulusBoundsPC.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRKSURFACES_ANNULUSBOUNDSPC_H
6#define TRKSURFACES_ANNULUSBOUNDSPC_H
7
10
11#include <iosfwd>
12
13class BoundaryCheck;
14class MsgStream;
15
16#ifdef TRKDETDESCR_USEFLOATPRECISON
17typedef float TDD_real_t;
18#else
19typedef double TDD_real_t;
20#endif
21
22class AnnulusTestAlg;
23
24namespace Trk {
25
26class AnnulusBounds;
27
30class AnnulusBoundsPC final : public SurfaceBounds {
31
32 using Rotation2D = Eigen::Rotation2D<double>;
33 using Transform2D = Eigen::Transform<double, 2, Eigen::Affine>;
34 using Matrix2D = Eigen::Matrix<double, 2, 2>;
35
37
38public:
39
49
58 AnnulusBoundsPC(double minR,
59 double maxR,
60 double phiMin,
61 double phiMax,
63 double phiAvg = 0);
64
66 AnnulusBoundsPC(const AnnulusBoundsPC& annbo) = default;
70 AnnulusBoundsPC(AnnulusBoundsPC&& annbo) = default;
73
74
75
86 static
87 std::pair<AnnulusBoundsPC, double> fromCartesian(const AnnulusBounds& annbo);
88
89 virtual AnnulusBoundsPC* clone() const override;
90 bool operator==(const SurfaceBounds& sb) const override;
91
93
99 bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
100
105 bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
106
111 bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
112
117 bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
118
123 double minDistance(const Amg::Vector2D& locpo) const override final;
124
127 double r() const override;
128
131 double rMin() const { return m_minR; }
132
135 double rMax() const { return m_maxR; }
136
139 double phiMin() const { return m_phiMin + m_phiAvg; }
140
143 double phiMax() const { return m_phiMax + m_phiAvg; }
144
149
153 MsgStream& dump(MsgStream& sl) const override;
154 std::ostream& dump(std::ostream& sl) const override;
155
167 std::array<std::pair<double, double>, 4> corners() const;
168
169private:
170 double m_minR;
171 double m_maxR;
172 double m_phiMin;
173 double m_phiMax;
174 // @TODO: Does this need to be in bound values?
176 Amg::Vector2D m_shiftXY; // == -m_moduleOrigin
178 double m_phiAvg;
181
182 // vectors needed for inside checking
187
192
197
198 std::vector<TDD_real_t> m_boundValues;
199
200 Amg::Vector2D stripXYToModulePC(const Amg::Vector2D& vStripXY) const;
201 static Amg::Vector2D
203 const Amg::Vector2D& b,
204 const Amg::Vector2D& p,
205 const Eigen::Matrix<double, 2, 2>& weight) ;
206 static double
207 squaredNorm(const Amg::Vector2D& v, const Eigen::Matrix<double, 2, 2>& weight) ;
208};
209
210} // End of Trk Namespace
211
213
214#endif
double TDD_real_t
static Double_t a
double phiMax() const
Returns the left angular edge of the module.
static double squaredNorm(const Amg::Vector2D &v, const Eigen::Matrix< double, 2, 2 > &weight)
Eigen::Matrix< double, 2, 2 > Matrix2D
Amg::Vector2D m_outLeftModulePC
Amg::Vector2D stripXYToModulePC(const Amg::Vector2D &vStripXY) const
Amg::Vector2D m_inRightStripPC
AnnulusBoundsPC & operator=(const AnnulusBoundsPC &sbo)=default
Assignment operator.
Transform2D m_rotationStripPC
Amg::Vector2D m_outRightStripPC
AnnulusBoundsPC(AnnulusBoundsPC &&annbo)=default
Move constructor.
Eigen::Transform< double, 2, Eigen::Affine > Transform2D
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.
Amg::Vector2D m_outLeftStripPC
SurfaceBounds::BoundsType type() const override
Return the bounds type - for persistency optimization.
double rMin() const
Returns inner radial bounds (module system)
AnnulusBoundsPC & operator=(AnnulusBoundsPC &&sbo)=default
Move assignment.
Amg::Vector2D m_inRightModulePC
Amg::Vector2D m_inLeftStripPC
static std::pair< AnnulusBoundsPC, double > fromCartesian(const AnnulusBounds &annbo)
Static factory method to produce an instance of this class from the cartesian implementation.
double phiMin() const
Returns the right angular edge of the module.
Amg::Vector2D m_inRightStripXY
bool operator==(const SurfaceBounds &sb) const override
Equality operator.
Amg::Vector2D m_outRightModulePC
Eigen::Rotation2D< double > Rotation2D
Amg::Vector2D m_inLeftModulePC
Amg::Vector2D m_inLeftStripXY
AnnulusBoundsPC(double minR, double maxR, double phiMin, double phiMax, Amg::Vector2D moduleOrigin={0, 0}, double phiAvg=0)
Default constructor from parameters.
std::vector< TDD_real_t > m_boundValues
Amg::Vector2D m_outRightStripXY
AnnulusBoundsPC(const AnnulusBoundsPC &annbo)=default
Copy constructor.
Amg::Vector2D moduleOrigin() const
Returns moduleOrigin, but rotated out, so avgPhi is already considered.
virtual AnnulusBoundsPC * clone() const override
clone() method to make deep copy in Surface copy constructor and for assigment operator of the Surfac...
bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
Check if local point is inside of phi bounds.
double r() const override
Returns middle radius.
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
double rMax() const
Returns outer radial bounds (module system)
Amg::Vector2D m_moduleOrigin
double minDistance(const Amg::Vector2D &locpo) const override final
Return minimum distance a point is away from the bounds.
static Amg::Vector2D closestOnSegment(const Amg::Vector2D &a, const Amg::Vector2D &b, const Amg::Vector2D &p, const Eigen::Matrix< double, 2, 2 > &weight)
bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
Check if local point is inside of r bounds.
Amg::Vector2D m_outLeftStripXY
Bounds for a annulus-like, planar Surface.
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
SurfaceBounds()=default
Default Constructor.
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 2, 1 > Vector2D
Ensure that the ATLAS eigen extensions are properly loaded.
@ v
Definition ParamDefs.h:78
-event-from-file