ATLAS Offline Software
CylinderSurface.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 // CylinderSurface.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_CYLINDERSURFACE_H
10 #define TRKSURFACES_CYLINDERSURFACE_H
11 
12 // Trk
18 #include "TrkSurfaces/Surface.h"
19 // Amg
22 
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 
92  CylinderSurface(const Amg::Transform3D& htrans, CylinderBounds* cbounds);
93 
96  CylinderSurface(const Amg::Transform3D& htrans);
97 
100  CylinderSurface(double radius, double hlength);
101 
104  CylinderSurface(double radius, double hphi, double hlength);
105 
110 
112  CylinderSurface(const CylinderSurface& csf, const Amg::Transform3D& transf);
113 
115  virtual bool operator==(const Surface& sf) const override;
116  bool operator==(const CylinderSurface& cf) const;
117 
119  virtual CylinderSurface* clone() const override;
120 
124  double l1,
125  double l2,
126  double phi,
127  double theta,
128  double qop,
129  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
130 
134  const Amg::Vector3D& position,
135  const Amg::Vector3D& momentum,
136  double charge,
137  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
138 
142  double l1,
143  double l2,
144  double phi,
145  double theta,
146  double qop,
147  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
148 
152  const Amg::Vector3D& position,
153  const Amg::Vector3D& momentum,
154  double charge,
155  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
156 
158  template<int DIM, class T>
159  std::unique_ptr<ParametersT<DIM, T, CylinderSurface>> createUniqueParameters(
160  double l1,
161  double l2,
162  double phi,
163  double theta,
164  double qop,
165  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
166 
168  template<int DIM, class T>
169  std::unique_ptr<ParametersT<DIM, T, CylinderSurface>> createUniqueParameters(
170  const Amg::Vector3D& position,
171  const Amg::Vector3D& momentum,
172  double charge,
173  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
174 
180  const Amg::Vector3D& glopos,
181  const Amg::Vector3D& glomom) const override final;
182 
184  constexpr virtual SurfaceType type() const override final;
185 
190  virtual const Amg::Vector3D& globalReferencePoint() const override final;
191 
192  // using from the base class
193  using Trk::Surface::normal;
196  virtual Amg::Vector3D normal(const Amg::Vector2D& locpo) const override final;
197 
200  virtual const Amg::Vector3D& rotSymmetryAxis() const;
201 
204  virtual const CylinderBounds& bounds() const override final;
205 
206  bool hasBounds() const;
207 
209  virtual bool insideBounds(const Amg::Vector2D& locpos,
210  double tol1 = 0.,
211  double tol2 = 0.) const override;
212 
213  virtual bool insideBoundsCheck(const Amg::Vector2D& locpos,
214  const BoundaryCheck& bchk) const override final;
215 
218  const LocalParameters& locpars) const override final;
219 
222  virtual void localToGlobal(const Amg::Vector2D& locp,
223  const Amg::Vector3D& mom,
224  Amg::Vector3D& glob) const override;
225 
228  virtual bool globalToLocal(const Amg::Vector3D& glob,
229  const Amg::Vector3D& mom,
230  Amg::Vector2D& loc) const override;
231 
235  virtual bool isOnSurface(const Amg::Vector3D& glopo,
236  const BoundaryCheck& bchk = true,
237  double tol1 = 0.,
238  double tol2 = 0.) const override;
239 
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 double pathCorrection(const Amg::Vector3D& pos,
278  const Amg::Vector3D& mom) const override;
279 
281  virtual std::string name() const override;
282 
283 protected:
284  template<class SURFACE, class BOUNDS_CNV>
285  friend class ::BoundSurfaceCnv_p1;
286  template<class SURFACE, class BOUNDS_CNV>
287  friend class ::BoundSurfaceCnv_p2;
288 
295 };
296 
297 } // end of namespace
298 #include "TrkSurfaces/CylinderSurface.icc"
299 
300 #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:211
Trk::CylinderSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: CylinderSurface.cxx:179
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:223
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
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:317
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
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:277
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:127
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
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
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:238
Trk::CylinderSurface::straightLineDistanceEstimate
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override
fast distance to Surface
Definition: CylinderSurface.cxx:377
Trk::CylinderSurface::insideBoundsCheck
virtual bool insideBoundsCheck(const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const override final
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
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::m_bounds
SharedObject< const CylinderBounds > m_bounds
The global reference point (== a point on the surface)
Definition: CylinderSurface.h:290
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:22
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:190
Trk::CylinderSurface::m_referencePoint
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_referencePoint
The rotational symmetry axis.
Definition: CylinderSurface.h:292
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:149
SharedObject.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
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
Trk::CylinderSurface::operator=
CylinderSurface & operator=(const CylinderSurface &csf)
Assignment operator.
Definition: CylinderSurface.cxx:115
charge
double charge(const T &p)
Definition: AtlasPID.h:538
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:18
Trk::CylinderSurface::m_rotSymmetryAxis
CxxUtils::CachedUniquePtr< Amg::Vector3D > m_rotSymmetryAxis
Definition: CylinderSurface.h:294
CylinderBounds.h
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
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:263
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:129
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:398
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:167
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
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.