ATLAS Offline Software
Tracking/TrkEvent/TrkSpacePoint/src/SpacePoint.cxx
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.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 
58  const Amg::MatrixX& lc = this->localCovariance();
59 
60  Eigen::Matrix3d cov;
61 
62  cov << lc(0, 0), lc(0, 1), 0.,
63  lc(1, 0), lc(1, 1), 0.,
64  // cppcheck-suppress constStatement
65  0., 0., 0.;
66 
67  const Amg::RotationMatrix3D& R = associatedSurface().transform().rotation();
68  m_globalCovariance = R * cov * R.transpose();
69  }
70 
72  assert(m_clusList.first->detectorElement());
73  return m_clusList.first->detectorElement()->surface();
74  }
75 
76 } // namespace Trk
77 
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:201
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:579
PrepRawData.h
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
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:75
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.