ATLAS Offline Software
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 
13 class BoundaryCheck;
14 class MsgStream;
15 
16 #ifdef TRKDETDESCR_USEFLOATPRECISON
17 typedef float TDD_real_t;
18 #else
19 typedef double TDD_real_t;
20 #endif
21 
22 class AnnulusTestAlg;
23 
24 namespace Trk {
25 
26 class AnnulusBounds;
27 
30 class 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 
38 public:
39 
40  enum BoundValues {
48  };
49 
58  AnnulusBoundsPC(double minR,
59  double maxR,
60  double phiMin,
61  double phiMax,
62  Amg::Vector2D moduleOrigin = {0, 0},
63  double phiAvg = 0);
64 
66  AnnulusBoundsPC(const AnnulusBoundsPC& annbo) = default;
68  AnnulusBoundsPC& operator=(const AnnulusBoundsPC& sbo) = default;
70  AnnulusBoundsPC(AnnulusBoundsPC&& annbo) = default;
73 
74 
75 
86  static
87  std::pair<AnnulusBoundsPC, double> fromCartesian(AnnulusBounds& annbo);
88 
89  virtual AnnulusBoundsPC* clone() const override;
90  bool operator==(const SurfaceBounds& sb) const override;
91 
92  SurfaceBounds::BoundsType type() const override;
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 
148  Amg::Vector2D moduleOrigin() const;
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 
169 private:
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
Trk::AnnulusBoundsPC::AnnulusBoundsPC
AnnulusBoundsPC(const AnnulusBoundsPC &annbo)=default
Copy constructor.
TDD_real_t
double TDD_real_t
Definition: AnnulusBoundsPC.h:14
Trk::SurfaceBounds::BoundsType
BoundsType
Definition: SurfaceBounds.h:59
Trk::AnnulusBoundsPC::m_inLeftStripXY
Amg::Vector2D m_inLeftStripXY
Definition: AnnulusBoundsPC.h:194
Trk::AnnulusBoundsPC::m_minR
double m_minR
Definition: AnnulusBoundsPC.h:170
Trk::AnnulusBoundsPC::m_translation
Transform2D m_translation
Definition: AnnulusBoundsPC.h:180
Trk::AnnulusBoundsPC::rMin
double rMin() const
Returns inner radial bounds (module system)
Definition: AnnulusBoundsPC.h:131
Trk::AnnulusBoundsPC::dump
MsgStream & dump(MsgStream &sl) const override
helper which dumps the configuration into a stream.
Definition: AnnulusBoundsPC.cxx:453
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::AnnulusBoundsPC::m_maxR
double m_maxR
Definition: AnnulusBoundsPC.h:171
Trk::AnnulusBoundsPC::m_outRightStripXY
Amg::Vector2D m_outRightStripXY
Definition: AnnulusBoundsPC.h:195
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::AnnulusBoundsPC::Rotation2D
Eigen::Rotation2D< double > Rotation2D
Definition: AnnulusBoundsPC.h:32
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::AnnulusBoundsPC::operator==
bool operator==(const SurfaceBounds &sb) const override
Equality operator.
Trk::AnnulusBounds
Definition: AnnulusBounds.h:45
AnnulusBoundsPC.icc
Trk::AnnulusBoundsPC::AnnulusTestAlg
friend AnnulusTestAlg
Definition: AnnulusBoundsPC.h:36
Trk::AnnulusBoundsPC::BoundValues
BoundValues
Definition: AnnulusBoundsPC.h:40
Trk::AnnulusBoundsPC::m_phiMax
double m_phiMax
Definition: AnnulusBoundsPC.h:173
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
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::AnnulusBoundsPC::m_inLeftStripPC
Amg::Vector2D m_inLeftStripPC
Definition: AnnulusBoundsPC.h:184
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
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
Trk::AnnulusBoundsPC::m_outLeftStripXY
Amg::Vector2D m_outLeftStripXY
Definition: AnnulusBoundsPC.h:193
Trk::AnnulusBoundsPC::bv_maxR
@ bv_maxR
Definition: AnnulusBoundsPC.h:42
GeoPrimitives.h
SurfaceBounds.h
Trk::AnnulusBoundsPC::rMax
double rMax() const
Returns outer radial bounds (module system)
Definition: AnnulusBoundsPC.h:135
Trk::AnnulusBoundsPC::corners
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
Definition: AnnulusBoundsPC.cxx:479
Trk::AnnulusBoundsPC::type
SurfaceBounds::BoundsType type() const override
Return the bounds type - for persistency optimization.
Trk::AnnulusBoundsPC::m_moduleOrigin
Amg::Vector2D m_moduleOrigin
Definition: AnnulusBoundsPC.h:175
Trk::AnnulusBoundsPC::operator=
AnnulusBoundsPC & operator=(const AnnulusBoundsPC &sbo)=default
Assignment operator.
Trk::AnnulusBoundsPC::Matrix2D
Eigen::Matrix< double, 2, 2 > Matrix2D
Definition: AnnulusBoundsPC.h:34
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::AnnulusBoundsPC::moduleOrigin
Amg::Vector2D moduleOrigin() const
Returns moduleOrigin, but rotated out, so avgPhi is already considered.
Definition: AnnulusBoundsPC.cxx:526
Trk::AnnulusBoundsPC::m_outLeftModulePC
Amg::Vector2D m_outLeftModulePC
Definition: AnnulusBoundsPC.h:188
Trk::AnnulusBoundsPC::AnnulusBoundsPC
AnnulusBoundsPC(AnnulusBoundsPC &&annbo)=default
Move constructor.
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::operator=
AnnulusBoundsPC & operator=(AnnulusBoundsPC &&sbo)=default
Move assignment.
Trk::AnnulusBoundsPC::bv_phiMin
@ bv_phiMin
Definition: AnnulusBoundsPC.h:43
Trk::AnnulusBoundsPC::m_outRightStripPC
Amg::Vector2D m_outRightStripPC
Definition: AnnulusBoundsPC.h:185
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::AnnulusBoundsPC::phiMax
double phiMax() const
Returns the left angular edge of the module.
Definition: AnnulusBoundsPC.h:143
keylayer_zslicemap.sb
sb
Definition: keylayer_zslicemap.py:192
Trk::AnnulusBoundsPC::m_phiAvg
double m_phiAvg
Definition: AnnulusBoundsPC.h:178
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
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::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::AnnulusBoundsPC::clone
virtual AnnulusBoundsPC * clone() const override
clone() method to make deep copy in Surface copy constructor and for assigment operator of the Surfac...
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::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::AnnulusBoundsPC::Transform2D
Eigen::Transform< double, 2, Eigen::Affine > Transform2D
Definition: AnnulusBoundsPC.h:33
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
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::AnnulusBoundsPC::m_inRightStripPC
Amg::Vector2D m_inRightStripPC
Definition: AnnulusBoundsPC.h:186
Trk::AnnulusBoundsPC::bv_phiAvg
@ bv_phiAvg
Definition: AnnulusBoundsPC.h:45
Trk::v
@ v
Definition: ParamDefs.h:84
Trk::AnnulusBoundsPC::r
double r() const override
Returns middle radius.
Definition: AnnulusBoundsPC.cxx:448