ATLAS Offline Software
CylinderSurface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // CylinderSurface.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_CYLINDERSURFACE_H
10 #define TRKSURFACES_CYLINDERSURFACE_H
11 
12 // Trk
17 #include "TrkSurfaces/Surface.h"
18 // Amg
21 
22 #include <memory>
23 class MsgStream;
24 template<class SURFACE, class BOUNDS_CNV>
25 class BoundSurfaceCnv_p1;
26 template<class SURFACE, class BOUNDS_CNV>
27 class BoundSurfaceCnv_p2;
28 
29 namespace Trk {
30 
31 template<int DIM, class T, class S>
32 class ParametersT;
33 
54 class CylinderSurface : public Surface
55 {
56 
57 public:
60 
63 
65  CylinderSurface(const CylinderSurface& csf);
66 
69 
71  CylinderSurface(CylinderSurface&& csf) noexcept = default;
72 
74  CylinderSurface& operator=(CylinderSurface&& csf) noexcept = default;
75 
77  virtual ~CylinderSurface() = default;
78 
80  CylinderSurface(const Amg::Transform3D& htrans,
81  double radius,
82  double hlength);
83 
85  CylinderSurface(const Amg::Transform3D& htrans,
86  double radius,
87  double hphi,
88  double hlength);
89 
91  CylinderSurface(const Amg::Transform3D& htrans, std::shared_ptr<const CylinderBounds> cbounds);
92 
95  CylinderSurface(const Amg::Transform3D& htrans);
96 
99  CylinderSurface(double radius, double hlength);
100 
103  CylinderSurface(double radius, double hphi, double hlength);
104 
108  CylinderSurface(std::shared_ptr<const CylinderBounds> cbounds);
109 
111  CylinderSurface(const CylinderSurface& csf, const Amg::Transform3D& transf);
112 
114  virtual bool operator==(const Surface& sf) const override;
115  bool operator==(const CylinderSurface& cf) const;
116 
118  virtual CylinderSurface* clone() const override;
119 
123  double l1,
124  double l2,
125  double phi,
126  double theta,
127  double qop,
128  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
129 
133  const Amg::Vector3D& position,
134  const Amg::Vector3D& momentum,
135  double charge,
136  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
137 
141  double l1,
142  double l2,
143  double phi,
144  double theta,
145  double qop,
146  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
147 
151  const Amg::Vector3D& position,
152  const Amg::Vector3D& momentum,
153  double charge,
154  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
155 
157  template<int DIM, class T>
158  std::unique_ptr<ParametersT<DIM, T, CylinderSurface>> createUniqueParameters(
159  double l1,
160  double l2,
161  double phi,
162  double theta,
163  double qop,
164  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
165 
167  template<int DIM, class T>
168  std::unique_ptr<ParametersT<DIM, T, CylinderSurface>> createUniqueParameters(
169  const Amg::Vector3D& position,
170  const Amg::Vector3D& momentum,
171  double charge,
172  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
173 
179  const Amg::Vector3D& glopos,
180  const Amg::Vector3D& glomom) const override final;
181 
183  constexpr virtual SurfaceType type() const override final;
184 
189  virtual const Amg::Vector3D& globalReferencePoint() const override final;
190 
191  // using from the base class
192  using Trk::Surface::normal;
195  virtual Amg::Vector3D normal(const Amg::Vector2D& locpo) const override final;
196 
199  virtual const Amg::Vector3D& rotSymmetryAxis() const;
200 
203  virtual const CylinderBounds& bounds() const override final;
204 
205  bool hasBounds() const;
206 
208  virtual bool insideBounds(const Amg::Vector2D& locpos,
209  double tol1 = 0.,
210  double tol2 = 0.) const override;
211 
212  virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
213  const BoundaryCheck& bchk) const override final;
214 
217  const LocalParameters& locpars) const override final;
218 
221  virtual void localToGlobal(const Amg::Vector2D& locp,
222  const Amg::Vector3D& mom,
223  Amg::Vector3D& glob) const override;
224 
227  virtual bool globalToLocal(const Amg::Vector3D& glob,
228  const Amg::Vector3D& mom,
229  Amg::Vector2D& loc) const override;
230 
234  virtual bool isOnSurface(const Amg::Vector3D& glopo,
235  const BoundaryCheck& bchk = true,
236  double tol1 = 0.,
237  double tol2 = 0.) const override;
238 
259  const Amg::Vector3D& pos,
260  const Amg::Vector3D& dir,
261  bool forceDir = false,
262  Trk::BoundaryCheck bchk = false) const override final;
263 
266  const Amg::Vector3D& pos,
267  const Amg::Vector3D& dir) const override;
268 
271  const Amg::Vector3D& pos,
272  const Amg::Vector3D& dir,
273  bool bound) const override;
274 
276  virtual double pathCorrection(const Amg::Vector3D& pos,
277  const Amg::Vector3D& mom) const override;
278 
280  virtual std::string name() const override;
281 
282 protected:
283  template<class SURFACE, class BOUNDS_CNV>
284  friend class ::BoundSurfaceCnv_p1;
285  template<class SURFACE, class BOUNDS_CNV>
286  friend class ::BoundSurfaceCnv_p2;
287 
289  std::shared_ptr<const CylinderBounds> m_bounds;
294 };
295 
296 } // end of namespace
297 #include "TrkSurfaces/CylinderSurface.icc"
298 
299 #endif // TRKSURFACES_CYLINDERSURFACE_H
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::CylinderSurface::rotSymmetryAxis
virtual const Amg::Vector3D & rotSymmetryAxis() const
Return method for the rotational symmetry axis - the z-Axis of the HepTransform.
Definition: CylinderSurface.cxx:208
Trk::CylinderSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: CylinderSurface.cxx:176
Trk::Intersection
Definition: Intersection.h:24
Trk::CylinderSurface::hasBounds
bool hasBounds() const
Trk::CylinderSurface::CylinderSurface
CylinderSurface(CylinderSurface &&csf) noexcept=default
Move constructor.
CxxUtils::CachedUniquePtr
CachedUniquePtrT< const T > CachedUniquePtr
Definition: CachedUniquePtr.h:114
Surface.h
Trk::CylinderSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override
Specialized for CylinderSurface : LocalToGlobal method without dynamic memory allocation.
Definition: CylinderSurface.cxx:220
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:129
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
BoundSurfaceCnv_p2
Definition: ConeSurface.h:27
Trk::CylinderSurface::createUniqueParameters
std::unique_ptr< ParametersT< DIM, T, CylinderSurface > > 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.
taskman.template
dictionary template
Definition: taskman.py:314
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
Trk::CylinderSurface::staticType
static constexpr SurfaceType staticType
The surface type static constexpr.
Definition: CylinderSurface.h:59
Trk::CylinderSurface::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 - provides closest intersection and (signed) path length
Definition: CylinderSurface.cxx:274
Trk::CylinderSurface::bounds
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
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:131
Trk::CylinderSurface::name
virtual std::string name() const override
Return properly formatted class name for screen output.
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ParamDefs.h
Trk::CylinderSurface::operator=
CylinderSurface & operator=(CylinderSurface &&csf) noexcept=default
Move Assignment operator.
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
BoundSurfaceCnv_p1
Definition: ConeSurface.h:25
Trk::CylinderSurface::operator==
bool operator==(const CylinderSurface &cf) const
Trk::CylinderSurface::localParametersToPosition
virtual Amg::Vector2D localParametersToPosition(const LocalParameters &locpars) const override final
Specialized for CylinderSurface : LocalParameters to Vector2D.
GeoPrimitives.h
Trk::CylinderSurface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override
Specialized for CylinderSurface : GlobalToLocal method without dynamic memory allocation - boolean ch...
Definition: CylinderSurface.cxx:235
Trk::CylinderSurface::straightLineDistanceEstimate
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override
fast distance to Surface
Definition: CylinderSurface.cxx:374
Trk::CylinderSurface::insideBoundsCheck
virtual bool insideBoundsCheck(const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const override final
skel.l2
l2
Definition: skel.GENtoEVGEN.py:410
Trk::CylinderSurface::~CylinderSurface
virtual ~CylinderSurface()=default
Destructor.
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::CylinderSurface::type
constexpr virtual SurfaceType type() const override final
Return the surface type.
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::CylinderSurface::CylinderSurface
CylinderSurface()
Default Constructor.
Definition: CylinderSurface.cxx:21
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::CylinderBounds
Definition: CylinderBounds.h:46
ParametersT.h
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CxxUtils
Definition: aligned_vector.h:29
Trk::Surface::normal
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
Trk::CylinderSurface::measurementFrame
virtual Amg::RotationMatrix3D measurementFrame(const Amg::Vector3D &glopos, const Amg::Vector3D &glomom) const override final
Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perig...
Definition: CylinderSurface.cxx:187
Trk::CylinderSurface::m_bounds
std::shared_ptr< const CylinderBounds > m_bounds
The global reference point (== a point on the surface)
Definition: CylinderSurface.h:289
Trk::CylinderSurface::m_referencePoint
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_referencePoint
The rotational symmetry axis.
Definition: CylinderSurface.h:291
Trk::CylinderSurface::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: CylinderSurface.cxx:146
beamspotman.dir
string dir
Definition: beamspotman.py:619
Trk::CylinderSurface::clone
virtual CylinderSurface * clone() const override
Implicit Constructor.
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
protected
#define protected
Definition: GenEventCnv_p1.h:26
Trk::CylinderSurface::operator=
CylinderSurface & operator=(const CylinderSurface &csf)
Assignment operator.
Definition: CylinderSurface.cxx:112
charge
double charge(const T &p)
Definition: AtlasPID.h:991
Trk::CylinderSurface::pathCorrection
virtual double pathCorrection(const Amg::Vector3D &pos, const Amg::Vector3D &mom) const override
the pathCorrection for derived classes with thickness
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
LocalParameters.h
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
Trk::CylinderSurface::m_rotSymmetryAxis
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_rotSymmetryAxis
Definition: CylinderSurface.h:293
CylinderBounds.h
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::CylinderSurface::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: CylinderSurface.cxx:260
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::SurfaceType::Cylinder
@ Cylinder
Trk::CylinderSurface::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: CylinderSurface.cxx:126
Trk::phi
@ phi
Definition: ParamDefs.h:75
Trk::CylinderSurface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const override
This method calls the inside method of CylinderBounds.
skel.l1
l1
Definition: skel.GENtoEVGEN.py:409
Trk::CylinderSurface::globalReferencePoint
virtual const Amg::Vector3D & globalReferencePoint() const override final
Returns a global reference point: For the Cylinder this is Where denotes the averagePhi() of the cy...
Definition: CylinderSurface.cxx:164
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
Trk::CylinderSurface::createUniqueParameters
std::unique_ptr< ParametersT< DIM, T, CylinderSurface > > 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.