ATLAS Offline Software
StraightLineSurface.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 // StraightLineSurface.h, (c) ATLAS Detector software
8 
9 #ifndef TRKSURFACES_STRAIGHTLINESURFACE_H
10 #define TRKSURFACES_STRAIGHTLINESURFACE_H
11 // Amg
14 
15 // Trk
16 #include "CxxUtils/CachedValue.h"
20 #include "TrkSurfaces/NoBounds.h"
21 #include "TrkSurfaces/Surface.h"
22 
23 class Identifier;
24 class MsgStream;
25 template<class SURFACE, class BOUNDS_CNV>
26 class BoundSurfaceCnv_p1;
27 template<class SURFACE, class BOUNDS_CNV>
28 class BoundSurfaceCnv_p2;
29 
30 namespace Trk {
31 
32 class TrkDetElementBase;
33 class LocalParameters;
34 template<int DIM, class T, class S>
35 class ParametersT;
36 
51 {
52 
53 public:
57 
60 
63 
65  StraightLineSurface(StraightLineSurface&& slsf) noexcept = default;
66 
68  StraightLineSurface& operator=(StraightLineSurface&& slsf) noexcept = default;
69 
71  virtual ~StraightLineSurface() = default;
72 
75 
77  StraightLineSurface(const Amg::Transform3D& htrans, double radius, double halez);
78 
81  const TrkDetElementBase& detelement,
82  const Identifier& id);
83 
86  const StraightLineSurface& slsf,
87  const Amg::Transform3D& transf);
88 
90  virtual bool operator==(const Surface& sf) const override;
91  bool operator==(const StraightLineSurface& cf) const;
92 
94  virtual StraightLineSurface* clone() const override final;
95 
99  double l1,
100  double l2,
101  double phi,
102  double theta,
103  double qop,
104  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
105 
109  const Amg::Vector3D& position,
111  double charge,
112  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
113 
117  double l1,
118  double l2,
119  double phi,
120  double theta,
121  double qop,
122  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
123 
127  const Amg::Vector3D& position,
129  double charge,
130  std::optional<AmgSymMatrix(5)> cov = std::nullopt) const override final;
131 
133  template<int DIM, class T>
134  std::unique_ptr<ParametersT<DIM, T, StraightLineSurface>>
136  double l1,
137  double l2,
138  double phi,
139  double theta,
140  double qop,
141  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
142 
144  template<int DIM, class T>
145  std::unique_ptr<ParametersT<DIM, T, StraightLineSurface>>
147  const Amg::Vector3D& position,
149  double charge,
150  std::optional<AmgSymMatrix(DIM)> cov = std::nullopt) const;
151 
157  const Amg::Vector3D& glopos,
158  const Amg::Vector3D& glomom) const override final;
159 
161  constexpr virtual SurfaceType type() const override final;
162 
165  virtual void localToGlobal(
166  const Amg::Vector2D& locp,
167  const Amg::Vector3D& mom,
168  Amg::Vector3D& glob) const override final;
169 
189  virtual bool globalToLocal(
190  const Amg::Vector3D& glob,
191  const Amg::Vector3D& mom,
192  Amg::Vector2D& loc) const override final;
193 
197  const Trk::LocalParameters& locpars,
198  const Amg::Vector3D& glomom,
199  double locZ) const;
200 
204 
236  const Amg::Vector3D& pos,
237  const Amg::Vector3D& dir,
238  bool forceDir,
239  Trk::BoundaryCheck bchk) const override final;
240 
243  const Amg::Vector3D& pos,
244  const Amg::Vector3D& dir) const override final;
245 
248  const Amg::Vector3D& pos,
249  const Amg::Vector3D& dir,
250  bool Bound) const override final;
251 
254  const override final;
255 
260  virtual bool isOnSurface(
261  const Amg::Vector3D& glopo,
262  const BoundaryCheck& bchk = true,
263  double tol1 = 0.,
264  double tol2 = 0.) const override final;
265 
267  virtual const SurfaceBounds& bounds() const override final;
268 
270  virtual bool insideBounds(
271  const Amg::Vector2D& locpos,
272  double tol1 = 0.,
273  double tol2 = 0.) const override final;
274  virtual bool insideBoundsCheck(
275  const Amg::Vector2D& locpos,
276  const BoundaryCheck& bchk) const override final;
277 
279  virtual std::string name() const override final;
280 
281 protected:
282  template<class SURFACE, class BOUNDS_CNV>
283  friend class ::BoundSurfaceCnv_p1;
284  template<class SURFACE, class BOUNDS_CNV>
285  friend class ::BoundSurfaceCnv_p2;
292 };
293 } // end of namespace
294 
295 #include "TrkSurfaces/StraightLineSurface.icc"
296 #endif // TRKSURFACES_STRAIGHTLINESURFACE_H
Trk::StraightLineSurface::~StraightLineSurface
virtual ~StraightLineSurface()=default
Destructor.
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::StraightLineSurface::bounds
virtual const SurfaceBounds & bounds() const override final
This method returns the bounds of the Surface by reference.
Trk::Intersection
Definition: Intersection.h:24
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::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
BoundSurfaceCnv_p2
Definition: ConeSurface.h:27
taskman.template
dictionary template
Definition: taskman.py:317
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Trk::StraightLineSurface::type
constexpr virtual SurfaceType type() const override final
Return the surface type.
Trk::StraightLineSurface::isOnSurface
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const override final
This method checks if the provided GlobalPosition is inside the assigned straw radius,...
Definition: StraightLineSurface.cxx:188
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
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::StraightLineSurface::clone
virtual StraightLineSurface * clone() const override final
Implicit constructor.
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
Trk::StraightLineSurface::operator=
StraightLineSurface & operator=(StraightLineSurface &&slsf) noexcept=default
Move Assignment operator.
Trk::StraightLineSurface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for StraightLineSurface: GlobalToLocal method without dynamic memory allocation This method...
Definition: StraightLineSurface.cxx:164
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
BoundSurfaceCnv_p1
Definition: ConeSurface.h:25
GeoPrimitives.h
Trk::StraightLineSurface::operator==
virtual bool operator==(const Surface &sf) const override
Equality operator.
Definition: StraightLineSurface.cxx:87
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
Trk::StraightLineSurface::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: StraightLineSurface.cxx:225
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:42
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::StraightLineSurface::staticType
static constexpr SurfaceType staticType
Definition: StraightLineSurface.h:54
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::StraightLineSurface::straightLineDistanceEstimate
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const override final
fast straight line distance evaluation to Surface
Definition: StraightLineSurface.cxx:205
Trk::CylinderBounds
Definition: CylinderBounds.h:46
ParametersT.h
Trk::StraightLineSurface::StraightLineSurface
StraightLineSurface()
Default Constructor - needed for persistency.
Definition: StraightLineSurface.cxx:25
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CxxUtils
Definition: aligned_vector.h:29
Trk::StraightLineSurface::s_boundless
static const NoBounds s_boundless
Definition: StraightLineSurface.h:291
Trk::StraightLineSurface::m_bounds
SharedObject< const CylinderBounds > m_bounds
NoBounds as return object when no bounds are declared.
Definition: StraightLineSurface.h:289
SharedObject.h
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::StraightLineSurface::m_lineDirection
CxxUtils::CachedValue< Amg::Vector3D > m_lineDirection
bounds (shared)
Definition: StraightLineSurface.h:287
EventPrimitives.h
Trk::StraightLineSurface::insideBounds
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const override final
This surface calls the iside method of the bouns.
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
CachedValue.h
Cached value with atomic update.
Trk::StraightLineSurface::insideBoundsCheck
virtual bool insideBoundsCheck(const Amg::Vector2D &locpos, const BoundaryCheck &bchk) const override final
charge
double charge(const T &p)
Definition: AtlasPID.h:538
Trk::StraightLineSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for StraightLineSurface: LocalToGlobal method without dynamic memory allocation.
Definition: StraightLineSurface.cxx:139
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
Trk::StraightLineSurface::name
virtual std::string name() const override final
Return properly formatted class name for screen output.
Trk::StraightLineSurface::straightLineIntersection
virtual Intersection straightLineIntersection(const Amg::Vector3D &pos, const Amg::Vector3D &dir, bool forceDir, Trk::BoundaryCheck bchk) const override final
fast straight line intersection schema - standard: provides closest intersection and (signed) path le...
Definition: StraightLineSurface.cxx:295
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::NoBounds
Definition: NoBounds.h:30
CylinderBounds.h
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::StraightLineSurface::createUniqueParameters
std::unique_ptr< ParametersT< DIM, T, StraightLineSurface > > 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.
Trk::StraightLineSurface::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: StraightLineSurface.cxx:99
Trk::StraightLineSurface::lineDirection
const Amg::Vector3D & lineDirection() const
Special method for StraightLineSurface - provides the Line direction from cache: speedup.
Trk::StraightLineSurface::StraightLineSurface
StraightLineSurface(StraightLineSurface &&slsf) noexcept=default
Move constructor.
Trk::phi
@ phi
Definition: ParamDefs.h:75
Trk::StraightLineSurface::pathCorrection
virtual double pathCorrection(const Amg::Vector3D &, const Amg::Vector3D &) const override final
the pathCorrection for derived classes with thickness
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
Trk::SurfaceType::Line
@ Line
Trk::StraightLineSurface::operator==
bool operator==(const StraightLineSurface &cf) const
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::StraightLineSurface::operator=
StraightLineSurface & operator=(const StraightLineSurface &slsf)
Assignment operator.
Definition: StraightLineSurface.cxx:76
NoBounds.h
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
Trk::StraightLineSurface::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: StraightLineSurface.cxx:118
Identifier
Definition: IdentifierFieldParser.cxx:14