ATLAS Offline Software
Loading...
Searching...
No Matches
RotatedTrapezoidBounds.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// RotatedTrapezoidBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_ROTATEDTRAPEZOIDBOUNDS_H
10#define TRKSURFACES_ROTATEDTRAPEZOIDBOUNDS_H
11
15
16#include <math.h>
17
18#ifdef TRKDETDESCR_USEFLOATPRECISON
19typedef float TDD_real_t;
20#else
21typedef double TDD_real_t;
22#endif
23
24class MsgStream;
26
27namespace Trk {
28
43
45{
46
47public:
56
59
62
65
68
71
73 virtual ~RotatedTrapezoidBounds() = default;
74
76 RotatedTrapezoidBounds(double halex, double minhalex, double maxhalex);
78 RotatedTrapezoidBounds(double halex, double minhalex, double maxhalex, double alpha);
79
80
82 virtual RotatedTrapezoidBounds* clone() const override;
83
85 virtual BoundsType type() const override { return SurfaceBounds::RotatedTrapezoid; }
86
88 virtual bool operator==(const SurfaceBounds& trabo) const override final;
89
91 double halflengthX() const;
92
94 double minHalflengthY() const;
95
97 double maxHalflengthY() const;
98
100 virtual double r() const override;
101
127 virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
128 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
129
134 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
135
140 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
141
143 virtual double minDistance(const Amg::Vector2D& pos) const override final;
144
146 virtual MsgStream& dump(MsgStream& sl) const override final;
147
149 virtual std::ostream& dump(std::ostream& sl) const override final;
150
151private:
153
155 bool isBelow(double locX, double fabsLocY, double tol1, double tol2) const;
156
158 virtual void initCache() override final;
159
166 AmgSymMatrix(2) m_rotMat{AmgSymMatrix(2)::Identity()};
167};
168} // end of namespace
169
171#endif // TRKSURFACES_TRAPEZOIDBOUNDS_H
double TDD_real_t
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
RotatedTrapezoidBounds & operator=(const RotatedTrapezoidBounds &sbo)=default
Assignment operator.
virtual double r() const override
This method returns the maximal extension on the local plane.
RotatedTrapezoidBounds(const RotatedTrapezoidBounds &trabo)=default
Copy constructor.
RotatedTrapezoidBounds & operator=(RotatedTrapezoidBounds &&sbo) noexcept=default
Move Assignment operator.
std::vector< TDD_real_t > m_boundValues
The internal storage of the bounds can be float/double.
virtual ~RotatedTrapezoidBounds()=default
Destructor.
double halflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
virtual RotatedTrapezoidBounds * clone() const override
Virtual constructor.
virtual BoundsType type() const override
Return the type of the bounds for persistency.
double maxHalflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
virtual void initCache() override final
Helper function for angle parameter initialization.
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
The orientation of the Trapezoid is according to the figure above, in words: the shorter of the two p...
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
RotatedTrapezoidBounds(RotatedTrapezoidBounds &&trabo) noexcept=default
Move constructor.
bool isBelow(double locX, double fabsLocY, double tol1, double tol2) const
isBelow() method for checking whether a point lies above or under a straight line
double minHalflengthY() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
RotatedTrapezoidBounds()
Default Constructor, needed for persistency.
virtual bool operator==(const SurfaceBounds &trabo) const override final
Equality operator.
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
AmgSymMatrix(2) m_rotMat
Transformation matrix to define surface bounds which are tilted w.r.t.
Abstract base class for surface bounds to be specified.
SurfaceBounds()=default
Default Constructor.
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 2, 1 > Vector2D
Ensure that the ATLAS eigen extensions are properly loaded.
@ locX
Definition ParamDefs.h:37
-event-from-file
STL namespace.
#define private