ATLAS Offline Software
Loading...
Searching...
No Matches
SurfaceBounds.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// SurfaceBounds.h, (c) ATLAS Detector software
8
9#ifndef TRKSURFACES_SURFACEBOUNDS_H
10#define TRKSURFACES_SURFACEBOUNDS_H
11
12// STD
13#include <iomanip>
14#include <iostream>
15
16// GaudiKernel
17#include "GaudiKernel/MsgStream.h"
18
19// Geo & Math library
21
22// Trk included
24
25#ifdef TRKDETDESCR_USEFLOATPRECISON
26typedef float TDD_real_t;
27#else
28typedef double TDD_real_t;
29#endif
30
31namespace Trk {
32
45
47{
48
49public:
74
76 SurfaceBounds() = default;
77
78 SurfaceBounds(const SurfaceBounds&) = default;
80 SurfaceBounds(SurfaceBounds&&) noexcept = default;
81 SurfaceBounds& operator=(SurfaceBounds&&) noexcept = default;
83 virtual ~SurfaceBounds() = default;
84
87 virtual SurfaceBounds* clone() const = 0;
88
90 virtual bool operator==(const SurfaceBounds& sb) const = 0;
91
93 virtual bool operator!=(const SurfaceBounds& sb) const;
94
96 virtual BoundsType type() const = 0;
97
100 virtual bool inside(const Amg::Vector2D& locpo, double tol1 = 0., double tol2 = 0.) const = 0;
101 virtual bool inside(const Amg::Vector2D& locpo, const BoundaryCheck& bchk) const = 0;
105 virtual bool insideLoc1(const Amg::Vector2D& locpo, double tol1 = 0.) const = 0;
106
110 virtual bool insideLoc2(const Amg::Vector2D& locpo, double tol2 = 0.) const = 0;
111
113 virtual double minDistance(const Amg::Vector2D& pos) const = 0;
114
116 virtual double r() const = 0;
117
119 virtual MsgStream& dump(MsgStream& sl) const = 0;
120
122 virtual std::ostream& dump(std::ostream& sl) const = 0;
123
126 void swap(double& b1, double& b2);
127
129 virtual void initCache() {}
130};
131
132inline void
133SurfaceBounds::swap(double& b1, double& b2)
134{
135 double tmp = b1;
136 b1 = b2;
137 b2 = tmp;
138}
139
140inline bool
142{
143 return !((*this) == sb);
144}
145
147MsgStream&
148operator<<(MsgStream& sl, const SurfaceBounds& sb);
149std::ostream&
150operator<<(std::ostream& sl, const SurfaceBounds& sb);
151
152} // end of namespace
153
154#endif // TRKSURFACES_SURFACEBOUNDS_H
double TDD_real_t
#define protected
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Abstract base class for surface bounds to be specified.
void swap(double &b1, double &b2)
Swap method to be called from DiscBounds or TrapezoidalBounds.
SurfaceBounds()=default
Default Constructor.
virtual bool insideLoc1(const Amg::Vector2D &locpo, double tol1=0.) const =0
Extend the interface to for single inside Loc 1 / Loc2 tests.
virtual double r() const =0
Interface method for the maximal extension or the radius.
virtual void initCache()
virtual initCache method for object persistency
virtual double minDistance(const Amg::Vector2D &pos) const =0
Minimal distance to boundary ( > 0 if outside and <=0 if inside)
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const =0
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
SurfaceBounds(const SurfaceBounds &)=default
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const =0
Extend the interface to for single inside Loc 1 / Loc2 tests.
virtual BoundsType type() const =0
Return the bounds type - for persistency optimization.
SurfaceBounds & operator=(const SurfaceBounds &)=default
BoundsType
This enumerator simplifies the persistency, by saving a dynamic_cast to happen.
virtual SurfaceBounds * clone() const =0
clone() method to make deep copy in Surface copy constructor and for assigment operator of the Surfac...
virtual bool operator!=(const SurfaceBounds &sb) const
Non-Equality operator.
SurfaceBounds(SurfaceBounds &&) noexcept=default
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
-event-from-file
STL namespace.