ATLAS Offline Software
Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SpacePoint.cxx Implementation file for class SpacePoint
8 // (c) ATLAS Detector software
10 // Version 1.0 14/10/2003 Veronique Boisvert
11 // Version 2.0 /12/2005 Martin Siebel
13 
15 #include "GaudiKernel/MsgStream.h"
19 #include "TrkSurfaces/Surface.h"
20 #include <ostream>
21 #include <new>
22 
23 namespace Trk
24 {
25 
26 
27  // ------------------------------------------------------------------
28 
29  // Default constructor
31  :
32  m_clusList(nullptr, nullptr),
33  m_elemIdList(0,0),
34  m_position(),
35  m_globalCovariance()
36  {
37  }
38 
39  // ------------------------------------------------------------------
40 
41 
43  MsgStream& operator << ( MsgStream& sl, const Trk::SpacePoint& spacePoint)
44  {
45  return spacePoint.dump(sl);
46  }
47 
48  // ------------------------------------------------------------------
49 
50  std::ostream& operator << ( std::ostream& sl, const Trk::SpacePoint& spacePoint)
51  {
52  return spacePoint.dump(sl);
53  }
54 
57  // We compile this function with optimization, even in debug builds; otherwise,
58  // the heavy use of Eigen makes it too slow. However, from here we may call
59  // to out-of-line Eigen code that is linked from other DSOs; in that case,
60  // it would not be optimized. Avoid this by forcing all Eigen code
61  // to be inlined here if possible.
64  const Amg::MatrixX& lc = this->localCovariance();
65 
66  Eigen::Matrix3d cov;
67 
68  cov << lc(0, 0), lc(0, 1), 0.,
69  lc(1, 0), lc(1, 1), 0.,
70  // cppcheck-suppress constStatement
71  0., 0., 0.;
72 
73  const Amg::RotationMatrix3D& R = associatedSurface().transform().rotation();
74  m_globalCovariance = R * cov * R.transpose();
75  }
76 
78  assert(m_clusList.first->detectorElement());
79  return m_clusList.first->detectorElement()->surface();
80  }
81 
82 } // namespace Trk
83 
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
TrkDetElementBase.h
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::SpacePoint::dump
virtual MsgStream & dump(MsgStream &out) const override=0
Interface method for output, to be overloaded by child classes*.
Surface.h
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
Trk::SpacePoint::m_clusList
std::pair< const PrepRawData *, const PrepRawData * > m_clusList
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:97
python.LumiCalcHtml.lc
lc
Definition: LumiCalcHtml.py:578
Trk::SpacePoint::setupGlobalFromLocalCovariance
void setupGlobalFromLocalCovariance()
set up the global covariance matrix by rotating the local one
Definition: Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx:63
PrepRawData.h
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:77
ATH_FLATTEN
#define ATH_FLATTEN
Definition: inline_hints.h:52
SpacePoint.h
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
LocalParameters.h
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.