ATLAS Offline Software
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
11 // Gaudi
12 #include "GaudiKernel/MsgStream.h"
13 // STD
14 #include <iomanip>
15 #include <iostream>
16 #include <sstream>
17 
18 // constructor
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 
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 
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 
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 }
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
Trk::TrackSurfaceIntersection
Definition: TrackSurfaceIntersection.h:32
Trk::TrackSurfaceIntersection::pathlength
double pathlength() const
Method to retrieve the pathlength propagated till the Intersection.
Definition: TrackSurfaceIntersection.h:96
python.Utilities.clone
clone
Definition: Utilities.py:134
Trk::TrackSurfaceIntersection::position
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
Definition: TrackSurfaceIntersection.h:80
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:226
beamspotman.dir
string dir
Definition: beamspotman.py:619
Trk::TrackSurfaceIntersection::TrackSurfaceIntersection
TrackSurfaceIntersection()=default
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrackSurfaceIntersection::direction
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
Definition: TrackSurfaceIntersection.h:88
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
TrackSurfaceIntersection.h
Trk::TrackSurfaceIntersection::operator=
TrackSurfaceIntersection & operator=(const TrackSurfaceIntersection &other)
Definition: TrackSurfaceIntersection.cxx:49