ATLAS Offline Software
PseudoMeasurementOnTrack.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 // PseudoMeasurementOnTrack.cxx, (c) ATLAS Detector software
8 
10 //#include "TrkEventPrimitives/LocalParameters.h"
11 //#include "TrkEventPrimitives/ErrorMatrix.h"
12 #include "GaudiKernel/MsgStream.h"
13 #include "TrkSurfaces/Surface.h"
14 #include <string>
15 #include <typeinfo>
16 
17 namespace {
18 // helper to move pointer and set source to nullptr
19 template<class T>
20 T
21 move_ptr(T& src)
22 {
23  T tmp = src;
24  src = nullptr;
25  return tmp;
26 }
27 
28 const double NaN(std::numeric_limits<double>::quiet_NaN());
29 const Amg::Vector3D INVALID_VECTOR3D(NaN, NaN, NaN);
30 }
31 
33  LocalParameters&& locpars,
34  Amg::MatrixX&& locerr,
35  const Surface& assocSurf)
36  : Trk::MeasurementBase(std::move(locpars), std::move(locerr))
37  , SurfacePtrHolder(assocSurf)
38  , m_globalPosition(m_associatedSurface->center())
39 {
40 }
41 
43  LocalParameters&& locpars,
44  Amg::MatrixX&& locerr,
46  : Trk::MeasurementBase(std::move(locpars), std::move(locerr))
47  , SurfacePtrHolder(assocSurf.release())
48  , m_globalPosition(m_associatedSurface->center())
49 {
50 }
51 
52 // default constructor:
54  : Trk::MeasurementBase()
55  , SurfacePtrHolder(nullptr)
56  , m_globalPosition(INVALID_VECTOR3D)
57 {}
58 
59 MsgStream&
61 {
62  std::string name(typeid(*this).name());
63  sl << "Concrete dump method not implemented - using base class" << std::endl;
64  sl << name << "\t local position = " << this->localParameters() << std::endl;
65  sl << name << "\t global position ( " << this->globalPosition().x() << " , "
66  << this->globalPosition().y() << " , " << this->globalPosition().z()
67  << " ) " << std::endl;
68  sl << name << "\t has error matrix: " << std::endl;
69  sl << this->localCovariance() << std::endl;
70  sl << name << "\t has associated surface:" << std::endl;
71  sl << this->associatedSurface() << std::endl;
72  return sl;
73 }
74 
75 std::ostream&
76 Trk::PseudoMeasurementOnTrack::dump(std::ostream& sl) const
77 {
78  std::string name(typeid(*this).name());
79  sl << "Concrete dump method not implemented - using base class" << std::endl;
80  sl << name << "\t local position = " << this->localParameters() << std::endl;
81  sl << name << "\t global position ( " << this->globalPosition().x() << " , "
82  << this->globalPosition().y() << " , " << this->globalPosition().z()
83  << " ) " << std::endl;
84  sl << name << "\t has error matrix: " << std::endl;
85  sl << this->localCovariance() << std::endl;
86  sl << name << "\t has associated surface:" << std::endl;
87  sl << this->associatedSurface() << std::endl;
88  return sl;
89 }
90 
Trk::LocalParameters
Definition: LocalParameters.h:98
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Surface.h
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
Trk::SurfacePtrHolderImpl
Definition: SurfaceHolderImpl.h:79
PseudoMeasurementOnTrack.h
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::PseudoMeasurementOnTrack::PseudoMeasurementOnTrack
PseudoMeasurementOnTrack()
Default Constructor for POOL.
Definition: PseudoMeasurementOnTrack.cxx:53
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::PseudoMeasurementOnTrack::dump
virtual MsgStream & dump(MsgStream &out) const override final
produces logfile output about its content in MsgStream form.
Definition: PseudoMeasurementOnTrack.cxx:60
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::ConstSurfaceUniquePtr
SurfaceUniquePtrT< const Trk::Surface > ConstSurfaceUniquePtr
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:468
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35