ATLAS Offline Software
DiscSurface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // DiscSurface.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_DISCSURFACE_H
10 #define TRKSURFACES_DISCSURFACE_H
11 
12 // Trk
16 #include "TrkSurfaces/NoBounds.h"
17 #include "TrkSurfaces/Surface.h"
19 // Amg
22 // std
23 #include <cmath> //for cos, sin etc
24 
25 class MsgStream;
26 template<class SURFACE, class BOUNDS_CNV>
27 class BoundSurfaceCnv_p1;
28 template<class SURFACE, class BOUNDS_CNV>
29 class BoundSurfaceCnv_p2;
30 
31 namespace Trk {
32 
33 class DiscBounds;
34 class DiscTrapezoidalBounds;
35 class AnnulusBounds;
36 class AnnulusBoundsPC;
37 class TrkDetElementBase;
38 class LocalParameters;
39 
40 template<int DIM, class T, class S>
41 class ParametersT;
42 
53 class DiscSurface : public Surface
54 {
55 
56 public:
59  DiscSurface();
60 
62  DiscSurface(const DiscSurface& psf);
63 
65  DiscSurface& operator=(const DiscSurface& dsf);
66 
68  DiscSurface(DiscSurface&& psf) noexcept = default;
69 
71  DiscSurface& operator=(DiscSurface&& dsf) noexcept = default;
72 
74  virtual ~DiscSurface() = default;
75 
78  DiscSurface(const Amg::Transform3D& htrans, double rmin, double rmax);
79 
82  DiscSurface(const Amg::Transform3D& htrans,
83  double rmin,
84  double rmax,
85  double hphisec);
86 
89  DiscSurface(const Amg::Transform3D& htrans,
90  double minhalfx,
91  double maxhalfx,
92  double maxR,
93  double minR,
94  double avephi,
95  double stereo = 0.);
96 
99  DiscSurface(const Amg::Transform3D& htrans, DiscBounds* dbounds);
100 
103  DiscSurface(const Amg::Transform3D& htrans, DiscTrapezoidalBounds* dtbounds);
104 
107  DiscSurface(const Amg::Transform3D& htrans, AnnulusBoundsPC* annpcbounds);
108 
121  DiscSurface(const Amg::Transform3D& htrans, std::unique_ptr<AnnulusBounds> annbounds, const TrkDetElementBase* detElem = nullptr);
122 
125  DiscSurface(const Amg::Transform3D& htrans);
126 
128  DiscSurface(const TrkDetElementBase& dmnt);
129 
131  DiscSurface(const DiscSurface& psf, const Amg::Transform3D& transf);
132 
134  virtual bool operator==(const Surface& sf) const override;
135  bool operator==(const DiscSurface& cf) const;
136 
138  virtual DiscSurface* clone() const override;
139 
143  double l1,
144  double l2,
145  double phi,
146  double theta,
147  double qop,
148  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
149 
153  const Amg::Vector3D& position,
154  const Amg::Vector3D& momentum,
155  double charge,
156  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
157 
161  double l1,
162  double l2,
163  double phi,
164  double theta,
165  double qop,
166  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
167 
171  const Amg::Vector3D& position,
172  const Amg::Vector3D& momentum,
173  double charge,
174  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
175 
177  template<int DIM, class T>
178  std::unique_ptr<ParametersT<DIM, T, DiscSurface>> createUniqueParameters(
179  double l1,
180  double l2,
181  double phi,
182  double theta,
183  double qop,
184  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
185 
187  template<int DIM, class T>
188  std::unique_ptr<ParametersT<DIM, T, DiscSurface>> createUniqueParameters(
189  const Amg::Vector3D& position,
190  const Amg::Vector3D& momentum,
191  double charge,
192  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
193 
195  constexpr virtual SurfaceType type() const override final;
196 
201  virtual const Amg::Vector3D& globalReferencePoint() const override final;
202 
204  const SurfaceBounds& bounds() const override final;
205 
207  virtual bool insideBounds(const Amg::Vector2D& locpos,
208  double tol1 = 0.,
209  double tol2 = 0.) const override;
210  virtual bool insideBoundsCheck(
211  const Amg::Vector2D& locpos,
212  const BoundaryCheck& bchk) const override final;
213 
217  virtual bool isOnSurface(const Amg::Vector3D& glopo,
218  const BoundaryCheck& bchk = true,
219  double tol1 = 0.,
220  double tol2 = 0.) const override;
221 
224  const LocalParameters& locpars) const override final;
225 
228  virtual void localToGlobal(const Amg::Vector2D& locp,
229  const Amg::Vector3D& mom,
230  Amg::Vector3D& glob) const override;
231 
235  virtual bool globalToLocal(const Amg::Vector3D& glob,
236  const Amg::Vector3D& mom,
237  Amg::Vector2D& loc) const override;
238 
260  const Amg::Vector3D& pos,
261  const Amg::Vector3D& dir,
262  bool forceDir = false,
263  Trk::BoundaryCheck bchk = false) const override final;
264 
267  const Amg::Vector3D& pos,
268  const Amg::Vector3D& dir) const override;
269 
272  const Amg::Vector3D& pos,
273  const Amg::Vector3D& dir,
274  bool Bound) const override;
275 
277  virtual std::string name() const override;
278 
279 protected:
280  template<class SURFACE, class BOUNDS_CNV>
281  friend class ::BoundSurfaceCnv_p1;
282  template<class SURFACE, class BOUNDS_CNV>
283  friend class ::BoundSurfaceCnv_p2;
290 };
291 
292 } // end of namespace
293 #include "TrkSurfaces/DiscSurface.icc"
294 
295 #endif // TRKSURFACES_DISCSURFACE_H
Trk::DiscSurface::insideBoundsCheck
virtual bool insideBoundsCheck(const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const override final
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::DiscSurface::localParametersToPosition
virtual Amg::Vector2D localParametersToPosition(const LocalParameters &locpars) const override final
Specialized for DiscSurface : LocalParameters to Vector2D.
Trk::DiscSurface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const override
This method calls the inside method of the bounds.
Trk::Intersection
Definition: Intersection.h:24
Trk::DiscSurface::operator=
DiscSurface & operator=(DiscSurface &&dsf) noexcept=default
Assignement operator.
CxxUtils::CachedUniquePtr
CachedUniquePtrT< const T > CachedUniquePtr
Definition: CachedUniquePtr.h:114
Surface.h
Trk::DistanceSolution
Definition: DistanceSolution.h:25
Trk::Surface::ChargedTrackParametersUniquePtr
std::unique_ptr< ParametersBase< 5, Trk::Charged > > ChargedTrackParametersUniquePtr
Unique ptr types.
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:125
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::DiscSurface::isOnSurface
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const override
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
Definition: DiscSurface.cxx:286
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
BoundSurfaceCnv_p2
Definition: ConeSurface.h:27
Trk::DiscSurface::operator=
DiscSurface & operator=(const DiscSurface &dsf)
Assignement operator.
Definition: DiscSurface.cxx:148
Trk::DiscSurface::clone
virtual DiscSurface * clone() const override
Virtual constructor.
taskman.template
dictionary template
Definition: taskman.py:317
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Trk::DiscSurface::m_referencePoint
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_referencePoint
static member for boundless approach
Definition: DiscSurface.h:287
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
Trk::Surface::NeutralTrackParametersUniquePtr
std::unique_ptr< ParametersBase< 5, Trk::Neutral > > NeutralTrackParametersUniquePtr
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:127
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
Trk::DiscSurface
Definition: DiscSurface.h:54
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::DiscSurface::globalReferencePoint
virtual const Amg::Vector3D & globalReferencePoint() const override final
Returns a global reference point: For the Disc this is Where denote the r(), averagePhi() of the Bo...
Definition: DiscSurface.cxx:208
Trk::DiscSurface::DiscSurface
DiscSurface()
Default Constructor.
Definition: DiscSurface.cxx:26
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
Trk::DiscTrapezoidalBounds
Definition: DiscTrapezoidalBounds.h:42
Trk::DiscSurface::~DiscSurface
virtual ~DiscSurface()=default
Destructor.
Trk::DiscSurface::straightLineIntersection
virtual Intersection straightLineIntersection(const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool forceDir=false, Trk::BoundaryCheck bchk=false) const override final
fast straight line intersection schema - standard: provides closest intersection and (signed) path le...
Definition: DiscSurface.cxx:259
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
BoundSurfaceCnv_p1
Definition: ConeSurface.h:25
GeoPrimitives.h
SurfaceBounds.h
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::DiscSurface::name
virtual std::string name() const override
Return properly formatted class name for screen output.
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::AnnulusBoundsPC
Class that implements the asymmetric shape of the ITk strip endcap modules.
Definition: AnnulusBoundsPC.h:30
Trk::DiscSurface::operator==
bool operator==(const DiscSurface &cf) const
ParametersT.h
Trk::DiscSurface::m_bounds
SharedObject< const SurfaceBounds > m_bounds
reference Point on the Surface
Definition: DiscSurface.h:285
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CxxUtils
Definition: aligned_vector.h:29
Trk::DiscSurface::createUniqueParameters
std::unique_ptr< ParametersT< DIM, T, DiscSurface > > createUniqueParameters(const Amg::Vector3D &position, const Amg::Vector3D &momentum, double charge, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
Use the Surface as a ParametersBase constructor, from global parameters.
Trk::DiscSurface::bounds
const SurfaceBounds & bounds() const override final
This method returns the bounds by reference.
Trk::DiscSurface::DiscSurface
DiscSurface(DiscSurface &&psf) noexcept=default
Copy Constructor.
SharedObject.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::DiscSurface::staticType
static constexpr SurfaceType staticType
Definition: DiscSurface.h:57
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::DiscSurface::createUniqueTrackParameters
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
Definition: DiscSurface.cxx:171
charge
double charge(const T &p)
Definition: AtlasPID.h:756
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
LocalParameters.h
Trk::DiscSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: DiscSurface.cxx:159
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::NoBounds
Definition: NoBounds.h:30
Trk::DiscSurface::createUniqueNeutralParameters
virtual NeutralTrackParametersUniquePtr createUniqueNeutralParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - neutral.
Definition: DiscSurface.cxx:190
Trk::DiscSurface::type
constexpr virtual SurfaceType type() const override final
Return the surface type.
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::DiscSurface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override
Specialized for DiscSurface: GlobalToLocal method without dynamic memory allocation - boolean checks ...
Definition: DiscSurface.cxx:249
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::SurfaceType::Disc
@ Disc
Trk::phi
@ phi
Definition: ParamDefs.h:75
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
Trk::DiscSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override
Specialized for DiscSurface: LocalToGlobal method without dynamic memory allocation.
Definition: DiscSurface.cxx:235
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::DiscSurface::createUniqueParameters
std::unique_ptr< ParametersT< DIM, T, DiscSurface > > createUniqueParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(DIM)> cov=std::nullopt) const
Use the Surface as a ParametersBase constructor, from local parameters.
NoBounds.h
Trk::DiscBounds
Definition: DiscBounds.h:44
Trk::DiscSurface::s_boundless
static const NoBounds s_boundless
Definition: DiscSurface.h:289
Trk::DiscSurface::straightLineDistanceEstimate
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override
fast straight line distance evaluation to Surface
Definition: DiscSurface.cxx:303