ATLAS Offline Software
Loading...
Searching...
No Matches
DiamondBounds.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// DiamondBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_DIAMONDDBOUNDS_H
10#define TRKSURFACES_DIAMONDDBOUNDS_H
11
15
16#include <math.h>
17
18class MsgStream;
20
21#ifdef TRKDETDESCR_USEFLOATPRECISON
22typedef float TDD_real_t;
23#else
24typedef double TDD_real_t;
25#endif
26
27namespace Trk {
28
35
36class DiamondBounds final: public SurfaceBounds
37{
38
39public:
50
53
55 DiamondBounds(const DiamondBounds& diabo) = default;
56
58 DiamondBounds& operator=(const DiamondBounds& sbo) = default;
59
61 DiamondBounds(DiamondBounds&& diabo) noexcept = default;
62
64 DiamondBounds& operator=(DiamondBounds&& sbo) noexcept = default;
65
67 virtual ~DiamondBounds() = default;
68
70 DiamondBounds(double minhalex, double medhalex, double maxhalex, double haley1, double haley2);
71
73 DiamondBounds* clone() const override;
74
76 virtual bool operator==(const SurfaceBounds& diabo) const override;
77
79 virtual BoundsType type() const override final { return SurfaceBounds::Diamond; }
80
82 double minHalflengthX() const;
83
85 double medHalflengthX() const;
86
88 double maxHalflengthX() const;
89
91 double halflengthY1() const;
92 double halflengthY2() const;
93
95 virtual double r() const override final;
96
98 double alpha1() const;
99
101 double alpha2() const;
102
104 virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const override final;
105 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const override final;
106
112 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const override final;
113
119 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const override final;
120
122 virtual double minDistance(const Amg::Vector2D& pos) const override final;
123
125 virtual MsgStream& dump(MsgStream& sl) const override final;
126
128 virtual std::ostream& dump(std::ostream& sl) const override final;
129
130private:
131 friend class ::DiamondBoundsCnv_p1;
132
134 bool insideFull(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const;
135
137 virtual void initCache() override;
138
143};
144
145} // end of namespace
146
147#include "TrkSurfaces/DiamondBounds.icc"
148#endif // TRKSURFACES_DIAMONDBOUNDS_H
double TDD_real_t
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
BoundValues
BoundValues for better readability.
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const override final
The orientation of the Diamond is according to the figure.
virtual double r() const override final
This method returns the maximal extension on the local plane.
DiamondBounds & operator=(const DiamondBounds &sbo)=default
Assignment operator.
virtual bool operator==(const SurfaceBounds &diabo) const override
Equality operator.
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const override final
This method checks inside bounds in loc2.
double alpha1() const
This method returns the opening angle alpha in point A.
double minHalflengthX() const
This method returns the halflength in X at minimal Y (first coordinate of local surface frame)
DiamondBounds()
Default Constructor, needed for persistency.
friend class ::DiamondBoundsCnv_p1
DiamondBounds * clone() const override
Virtual constructor.
bool insideFull(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const
inside() method for a full symmetric diamond
std::vector< TDD_real_t > m_boundValues
Internal parameters stored in the geometry.
double maxHalflengthX() const
This method returns the halflength in X at maximal Y (first coordinate of local surface frame)
virtual void initCache() override
initialize the alpha1/2 cache - needed also for object persistency
virtual BoundsType type() const override final
Return the bounds type.
double medHalflengthX() const
This method returns the (maximal) halflength in X (first coordinate of local surface frame)
DiamondBounds & operator=(DiamondBounds &&sbo) noexcept=default
Assignment operator.
DiamondBounds(DiamondBounds &&diabo) noexcept=default
Copy constructor.
DiamondBounds(const DiamondBounds &diabo)=default
Copy constructor.
virtual double minDistance(const Amg::Vector2D &pos) const override final
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
double alpha2() const
This method returns the opening angle alpha in point A'.
double halflengthY1() const
This method returns the halflength in Y of trapezoid at negative/positive Y (second coordinate)
virtual ~DiamondBounds()=default
Destructor.
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const override final
This method checks inside bounds in loc1.
double halflengthY2() const
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)
Ensure that the ATLAS eigen extensions are properly loaded.
-event-from-file
STL namespace.
#define private