ATLAS Offline Software
Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SpacePoint.h
7 // Header file for ABC SpacePoint
9 // (c) ATLAS Detector software
11 // Class to handle SPs for InDet and Muons
13 // Version 1.0 14/10/2003 Veronique Boisvert
14 // Version 2.0 12/12/2005 Martin Siebel
16 #ifndef TRKSPACEPOINT_SPACEPOINT_H
17 #define TRKSPACEPOINT_SPACEPOINT_H
18 
19 #include <cassert>
20 #include <cmath>
21 #include <iosfwd>
22 #include <utility> //for std::pair
23 
26 
27 class MsgStream;
28 
29 namespace Trk {
30 
31 class LocalParameters;
32 class Surface;
33 class PrepRawData;
34 
35 class SpacePoint : public MeasurementBase {
36 
38  // Public methods:
40  public:
41  // public because of DataPool
42  SpacePoint();
43  // Destructor:
44  virtual ~SpacePoint() = default;
45 
47  // Const methods:
49 
51  const std::pair<IdentifierHash, IdentifierHash>& elementIdList() const;
52 
54  const std::pair<const PrepRawData*, const PrepRawData*>& clusterList() const;
55 
59  const AmgSymMatrix(3)& globCovariance() const;
60 
62  double eta(double z0 = 0) const;
63 
66  double r() const;
67 
70  double phi() const;
71 
73  virtual const Surface& associatedSurface() const override final;
74 
76  virtual const Amg::Vector3D& globalPosition() const override final;
77 
79  virtual SpacePoint* clone() const override = 0;
80 
82  std::unique_ptr<SpacePoint> uniqueClone() const {
83  return std::unique_ptr<SpacePoint>(clone());
84  }
85 
87  virtual bool type(MeasurementBaseType::Type type) const override final {
89  }
90 
92  virtual MsgStream& dump(MsgStream& out) const override = 0;
94  virtual std::ostream& dump(std::ostream& out) const override = 0;
95 
96  protected:
97  std::pair<const PrepRawData*, const PrepRawData*> m_clusList;
98  std::pair<IdentifierHash, IdentifierHash> m_elemIdList;
100  AmgSymMatrix(3) m_globalCovariance;
101 
102  //For use by the final derived ones
106  SpacePoint& operator=(SpacePoint&&) noexcept = default;
107 
109 };
110 
112 MsgStream& operator<<(MsgStream& sl, const SpacePoint& spacePoint);
113 
115 std::ostream& operator<<(std::ostream& sl, const SpacePoint& spacePoint);
116 
118 // Inline methods:
120 
121 inline const std::pair<IdentifierHash, IdentifierHash>&
123  return m_elemIdList;
124 }
125 
126 inline const std::pair<const PrepRawData*, const PrepRawData*>&
128  return m_clusList;
129 }
130 
131 inline double SpacePoint::eta(double z0) const {
132  // double zr = (m_z-z0)/m_r;
133  double zr = (m_position.z() - z0) / m_position.perp();
134  return std::log(zr + std::sqrt(1. + zr * zr));
135 }
136 
137 inline double SpacePoint::r() const {
138  return m_position.perp();
139 }
140 
141 inline double SpacePoint::phi() const {
142  return m_position.phi();
143 }
144 
145 // The methods required by MeasurementBase
147  return m_position;
148 }
149 inline const AmgSymMatrix(3)& SpacePoint::globCovariance() const {
150  return m_globalCovariance;
151 }
152 
153 } // namespace Trk
154 
155 #endif // TRKSPACEPOINT_SPACEPOINT_H
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
MeasurementBase.h
Trk::SpacePoint::dump
virtual MsgStream & dump(MsgStream &out) const override=0
Interface method for output, to be overloaded by child classes*.
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
Trk::SpacePoint::AmgSymMatrix
const AmgSymMatrix(3) &globCovariance() const
return the error matrix by reference The Matrix is calculated from the local Covariance Matrix when d...
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::z0
@ z0
Definition: ParamDefs.h:64
Trk::SpacePoint::phi
double phi() const
returns the phi value of the SpacePoint's position (in cylindrical coordinates).
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:141
Trk::SpacePoint::m_clusList
std::pair< const PrepRawData *, const PrepRawData * > m_clusList
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:97
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::SpacePoint::r
double r() const
returns the r value of the SpacePoint's position (in cylindrical coordinates).
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:137
Trk::SpacePoint::type
virtual bool type(MeasurementBaseType::Type type) const override final
Extended method checking the type.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:87
Trk::SpacePoint::setupGlobalFromLocalCovariance
void setupGlobalFromLocalCovariance()
set up the global covariance matrix by rotating the local one
Definition: Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx:57
Trk::SpacePoint::SpacePoint
SpacePoint()
Definition: Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx:30
Trk::SpacePoint::associatedSurface
virtual const Surface & associatedSurface() const override final
Interface method to get the associated Surface.
Definition: Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx:71
Trk::MeasurementBase
Definition: MeasurementBase.h:58
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::SpacePoint::m_position
Amg::Vector3D m_position
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:99
Trk::SpacePoint::elementIdList
const std::pair< IdentifierHash, IdentifierHash > & elementIdList() const
return the pair of Ids of the element by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:122
IdentifierHash.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::SpacePoint::clone
virtual SpacePoint * clone() const override=0
Clone.
Trk::SpacePoint::uniqueClone
std::unique_ptr< SpacePoint > uniqueClone() const
Clone.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:82
Trk::SpacePoint::eta
double eta(double z0=0) const
calculate eta (not cached), needs z0 info
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:131
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::SpacePoint::~SpacePoint
virtual ~SpacePoint()=default
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
Trk::SpacePoint::AmgSymMatrix
AmgSymMatrix(3) m_globalCovariance
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Trk::MeasurementBaseType::Type
Type
Definition: MeasurementBase.h:46
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::SpacePoint::m_elemIdList
std::pair< IdentifierHash, IdentifierHash > m_elemIdList
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:98
Trk::SpacePoint::dump
virtual std::ostream & dump(std::ostream &out) const override=0
Interface method for output, to be overloaded by child classes*.
Trk::MeasurementBaseType::SpacePoint
@ SpacePoint
Definition: MeasurementBase.h:48