ATLAS Offline Software
Loading...
Searching...
No Matches
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
23namespace 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
56
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
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
virtual MsgStream & dump(MsgStream &out) const override=0
Interface method for output, to be overloaded by child classes*.
void setupGlobalFromLocalCovariance()
set up the global covariance matrix by rotating the local one
virtual const Surface & associatedSurface() const override final
Interface method to get the associated Surface.
std::pair< IdentifierHash, IdentifierHash > m_elemIdList
std::pair< const PrepRawData *, const PrepRawData * > m_clusList
Abstract Base Class for tracking surfaces.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
#define ATH_FLATTEN
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output