ATLAS Offline Software
DetElementSurface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKEVENTCNVTOOLS_DETELEMENTSURFACE_H
6 #define TRKEVENTCNVTOOLS_DETELEMENTSURFACE_H
7 #include "TrkSurfaces/Surface.h"
13 #include <cstdlib>//for "abort"
14 #include <memory>
15 
16 namespace Trk
17 {
18 
21 // template <class SURFACE>
22 // class DetElementSurface : public SURFACE
23 // {
24 // public:
25 // DetElementSurface( const DetElementSurface& rhs) : SURFACE(rhs) {}
26 // };
27 
28 
29 template<int DIM, class T, class S> class ParametersT;
30 
31 class DetElementSurface : public Surface
32 {
33  public:
37 // Normally the Surface copy ctor sets the Identifier to be invalid. Store it, to get around this.
38  bool operator==(const Trk::Surface&) const { return false;}
39  Surface * clone () const { return nullptr; }
40  std::unique_ptr<Surface> uniqueClone() const {return nullptr; }
41  bool insideBounds(const Amg::Vector2D &, double, double) const {return false;}
42  bool insideBoundsCheck(const Amg::Vector2D& /*locpos*/, const BoundaryCheck& /*bchk*/) const { return false;}
43  const Amg::Vector3D * localToGlobal (const Amg::Vector2D &) const { return nullptr; }
44  const Amg::Vector3D * localToGlobal (const LocalParameters &) const { return nullptr; }
45  const Amg::Vector2D * globalToLocal (const Amg::Vector3D &, const double) const { return nullptr; }
47  const SurfaceBounds & bounds () const { std::abort();/*should never be called*/ }
48  MsgStream & dump (MsgStream &sl) const { return sl;}
49  std::ostream & dump (std::ostream &sl) const { return sl;};
51  bool isFree() {return true;}// To avoid memory leaks
53  void localToGlobal(const Amg::Vector2D&, const Amg::Vector3D&, Amg::Vector3D&) const {}
54  bool globalToLocal(const Amg::Vector3D&, const Amg::Vector3D&, Amg::Vector2D&) const {return false;}
55  std::string name() const { return "Trk::DetElementSurface";}
56  // A dummy method required for consistency of the package and
57  virtual std::unique_ptr<ParametersBase<5, Trk::Charged>>
59  double,
60  double,
61  double,
62  double,
63  std::optional<AmgSymMatrix(5)> = std::nullopt) const
64  {
65  return nullptr;
66  }
67  virtual std::unique_ptr<ParametersBase<5, Trk::Charged>>
69  const Amg::Vector3D&,
70  double,
71  std::optional<AmgSymMatrix(5)> = std::nullopt) const
72  {
73  return nullptr;
74  }
75 
76  virtual std::unique_ptr<ParametersBase<5, Trk::Neutral>>
78  double,
79  double,
80  double,
81  double,
82  std::optional<AmgSymMatrix(5)> = std::nullopt) const
83  {
84  return nullptr;
85  }
86  virtual std::unique_ptr<ParametersBase<5, Trk::Neutral>>
88  const Amg::Vector3D&,
89  double,
90  std::optional<AmgSymMatrix(5)> = std::nullopt) const
91  {
92  return nullptr;
93  }
94 
96  const Amg::Vector3D&,
97  bool, Trk::BoundaryCheck) const { return Trk::Intersection(Amg::Vector3D(0.,0.,0.),0.,false); }
98 
99 
100 // persistency libraries..
102  const Amg::Vector3D&, bool) const {return 0;}
103 
104  virtual bool isOnSurface(const Amg::Vector3D&, const Trk::BoundaryCheck&, double, double) const {return false;}
105 
106 private:
108 };
109 
110 
111 }
112 
113 #endif
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::DetElementSurface::straightLineDistanceEstimate
virtual Trk::DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &, const Amg::Vector3D &, bool) const
fast straight line distance evaluation to Surface - with bound option
Definition: DetElementSurface.h:101
Trk::DetElementSurface::bounds
const SurfaceBounds & bounds() const
Surface Bounds method.
Definition: DetElementSurface.h:47
Trk::DetElementSurface::localToGlobal
const Amg::Vector3D * localToGlobal(const LocalParameters &) const
Definition: DetElementSurface.h:44
Trk::Intersection
Definition: Intersection.h:24
RectangleBounds.h
Trk::DetElementSurface::clone
Surface * clone() const
Implicit constructor - uses the copy constructor.
Definition: DetElementSurface.h:39
Surface.h
DistanceSolution.h
Trk::DistanceSolution
Definition: DistanceSolution.h:25
Trk::DetElementSurface::associatedDetectorElementIdentifier
const Identifier associatedDetectorElementIdentifier() const
Definition: DetElementSurface.h:50
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::DetElementSurface::name
std::string name() const
Return properly formatted class name.
Definition: DetElementSurface.h:55
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
Trk::DetElementSurface::straightLineIntersection
virtual Intersection straightLineIntersection(const Amg::Vector3D &, const Amg::Vector3D &, bool, Trk::BoundaryCheck) const
fast straight line intersection schema - standard: provides closest intersection and (signed) path le...
Definition: DetElementSurface.h:95
Trk::DetElementSurface::DetElementSurface
DetElementSurface(const Surface &rhs)
Definition: DetElementSurface.h:36
Trk::DetElementSurface::dump
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition: DetElementSurface.h:48
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
Trk::SurfaceType::Other
@ Other
Trk::DetElementSurface::insideBounds
bool insideBounds(const Amg::Vector2D &, double, double) const
virtual methods to be overwritten by the inherited surfaces
Definition: DetElementSurface.h:41
Trk::DetElementSurface::operator==
bool operator==(const Trk::Surface &) const
Equality operator.
Definition: DetElementSurface.h:38
Trk::DetElementSurface::DetElementSurface
DetElementSurface(Identifier id)
Definition: DetElementSurface.h:35
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
GeoPrimitives.h
Trk::DetElementSurface::localToGlobal
const Amg::Vector3D * localToGlobal(const Amg::Vector2D &) const
Definition: DetElementSurface.h:43
ParametersBase.h
Trk::DetElementSurface::createUniqueTrackParameters
virtual std::unique_ptr< ParametersBase< 5, Trk::Charged > > createUniqueTrackParameters(double, double, double, double, double, std::optional< AmgSymMatrix(5)>=std::nullopt) const
Use the Surface as a ParametersBase constructor, from local parameters - charged.
Definition: DetElementSurface.h:58
Trk::DetElementSurface::createUniqueTrackParameters
virtual std::unique_ptr< ParametersBase< 5, Trk::Charged > > createUniqueTrackParameters(const Amg::Vector3D &, const Amg::Vector3D &, double, std::optional< AmgSymMatrix(5)>=std::nullopt) const
Use the Surface as a ParametersBase constructor, from global parameters - charged.
Definition: DetElementSurface.h:68
Trk::DetElementSurface::createUniqueNeutralParameters
virtual std::unique_ptr< ParametersBase< 5, Trk::Neutral > > createUniqueNeutralParameters(const Amg::Vector3D &, const Amg::Vector3D &, double, std::optional< AmgSymMatrix(5)>=std::nullopt) const
Use the Surface as a ParametersBase constructor, from global parameters - neutral.
Definition: DetElementSurface.h:87
Trk::DetElementSurface
Definition: DetElementSurface.h:32
Trk::DetElementSurface::dump
std::ostream & dump(std::ostream &sl) const
Output Method for std::ostream, to be overloaded by child classes.
Definition: DetElementSurface.h:49
Trk::DetElementSurface::localToGlobal
void localToGlobal(const Amg::Vector2D &, const Amg::Vector3D &, Amg::Vector3D &) const
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
Definition: DetElementSurface.h:53
Trk::DetElementSurface::isOnSurface
virtual bool isOnSurface(const Amg::Vector3D &, const Trk::BoundaryCheck &, double, double) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
Definition: DetElementSurface.h:104
Trk::DetElementSurface::globalToLocal
bool globalToLocal(const Amg::Vector3D &, const Amg::Vector3D &, Amg::Vector2D &) const
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
Definition: DetElementSurface.h:54
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::DetElementSurface::insideBoundsCheck
bool insideBoundsCheck(const Amg::Vector2D &, const BoundaryCheck &) const
Definition: DetElementSurface.h:42
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
Trk::DetElementSurface::m_id
Identifier m_id
Definition: DetElementSurface.h:107
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::DetElementSurface::createUniqueNeutralParameters
virtual std::unique_ptr< ParametersBase< 5, Trk::Neutral > > createUniqueNeutralParameters(double, double, double, double, double, std::optional< AmgSymMatrix(5)>=std::nullopt) const
Use the Surface as a ParametersBase constructor, from local parameters - neutral.
Definition: DetElementSurface.h:77
Trk::DetElementSurface::type
SurfaceType type() const
Returns the Surface type to avoid dynamic casts.
Definition: DetElementSurface.h:52
Trk::DetElementSurface::globalToLocal
const Amg::Vector2D * globalToLocal(const Amg::Vector3D &, const double) const
Definition: DetElementSurface.h:45
Trk::DetElementSurface::DetElementSurface
DetElementSurface()
Definition: DetElementSurface.h:34
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::DetElementSurface::isFree
bool isFree()
Definition: DetElementSurface.h:51
Trk::DetElementSurface::straightLineDistanceEstimate
virtual DistanceSolution straightLineDistanceEstimate(const Amg::Vector3D &, const Amg::Vector3D &) const
fast straight line distance evaluation to Surface
Definition: DetElementSurface.h:46
Trk::DetElementSurface::uniqueClone
std::unique_ptr< Surface > uniqueClone() const
Definition: DetElementSurface.h:40
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Intersection.h
Identifier
Definition: IdentifierFieldParser.cxx:14