ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkExtrapolation
TrkExUtils
src
TrackSurfaceIntersection.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
// TrackSurfaceIntersection.cxx, (c) ATLAS Detector software
8
9
// Trk
10
#include "
TrkExUtils/TrackSurfaceIntersection.h
"
11
// Gaudi
12
#include "GaudiKernel/MsgStream.h"
13
// STD
14
#include <iomanip>
15
#include <iostream>
16
#include <sstream>
17
18
// constructor
19
Trk::TrackSurfaceIntersection::TrackSurfaceIntersection(
20
const
Amg::Vector3D
& pos,
21
const
Amg::Vector3D
& dir,
22
double
path)
23
:
m_position
(pos)
24
,
m_direction
(dir)
25
,
m_pathlength
(path)
26
{
27
}
28
29
Trk::TrackSurfaceIntersection::TrackSurfaceIntersection(
30
const
TrackSurfaceIntersection
& other)
31
:
m_position
(other.
m_position
)
32
,
m_direction
(other.
m_direction
)
33
,
m_pathlength
(other.
m_pathlength
)
34
,
m_cache
(other.
m_cache
? other.
m_cache
->clone() : nullptr)
35
{
36
}
37
38
Trk::TrackSurfaceIntersection::TrackSurfaceIntersection(
39
const
TrackSurfaceIntersection
& other,
40
std::unique_ptr<IIntersectionCache>
cache
)
41
:
m_position
(other.
m_position
)
42
,
m_direction
(other.
m_direction
)
43
,
m_pathlength
(other.
m_pathlength
)
44
,
m_cache
(
std
::move(
cache
))
45
{
46
}
47
48
Trk::TrackSurfaceIntersection
&
49
Trk::TrackSurfaceIntersection::operator=(
const
TrackSurfaceIntersection
& other)
50
{
51
if
(
this
!= &other) {
52
m_position = other.m_position;
53
m_direction = other.m_direction;
54
m_pathlength = other.m_pathlength;
55
m_cache = other.m_cache ? other.m_cache->clone() :
nullptr
;
56
}
57
return
*
this
;
58
}
59
60
// Overload of << operator for both, MsgStream and std::ostream for debug output
61
MsgStream&
62
Trk::operator<<
(MsgStream& sl,
const
Trk::TrackSurfaceIntersection
& tsfi)
63
{
64
std::ostringstream
os
;
65
os
<<tsfi;
66
sl<<
os
.str();
67
return
sl;
68
}
69
70
std::ostream&
71
Trk::operator<<
(std::ostream& sl,
const
Trk::TrackSurfaceIntersection
& tsfi)
72
{
73
const
auto
old_flags = sl.flags();
74
const
auto
old_prec = sl.precision();
75
76
sl.setf(std::ios::fixed, std::ios::floatfield);
77
sl.precision(7);
78
79
sl <<
"Trk::TrackSurfaceIntersection\n"
80
<<
" position [mm] = ("
<< tsfi.position().x() <<
", "
81
<< tsfi.position().y() <<
", "
<< tsfi.position().z() <<
")\n"
82
<<
" direction = ("
<< tsfi.direction().x() <<
", "
83
<< tsfi.direction().y() <<
", "
<< tsfi.direction().z() <<
")\n"
84
<<
" pathlength [mm] = "
<< tsfi.pathlength() <<
'\n'
;
85
86
sl.flags(old_flags);
87
sl.precision(old_prec);
88
return
sl;
89
}
TrackSurfaceIntersection.h
TrackSurfaceIntersection
An intersection with a Surface is given by.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
ReadFromCrestCompare.os
int os
Definition
ReadFromCrestCompare.py:229
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition
AlignModule.cxx:204
Trk::m_direction
Amg::Vector3D m_direction
Definition
TrackSurfaceIntersection.h:75
Trk::TrackSurfaceIntersection
TrackSurfaceIntersection(const Amg::Vector3D &pos, const Amg::Vector3D &dir, double path)
Constructor.
Definition
TrackSurfaceIntersection.cxx:19
Trk::m_position
Amg::Vector3D m_position
Definition
TrackSurfaceIntersection.h:74
Trk::cache
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.
Trk::m_pathlength
double m_pathlength
Definition
TrackSurfaceIntersection.h:76
Trk::m_cache
std::unique_ptr< IIntersectionCache > m_cache
Definition
TrackSurfaceIntersection.h:77
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0