ATLAS Offline Software
SiSpacePointsSeed.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 // Implementation file for class SiSpacePointsSeed
8 // (c) ATLAS Detector software
11 // Version 1.0 18/11/2004 I.Gavrilenko
13 
14 #include <iostream>
15 #include <iomanip>
16 #include "GaudiKernel/MsgStream.h"
18 
19 namespace InDet {
20 
22  // Constructors
24 
26  {
27  m_zvertex = 0.;
28  }
29 
31  (const Trk::SpacePoint*& p1,const Trk::SpacePoint*& p2,
32  const double& z)
33  {
34  m_spacepoints.push_back(p1);
35  m_spacepoints.push_back(p2);
36  m_zvertex = z;
37  }
38 
40  (const Trk::SpacePoint*& p1,const Trk::SpacePoint*& p2,const Trk::SpacePoint*& p3,
41  const double& z)
42  {
43  m_spacepoints.push_back(p1);
44  m_spacepoints.push_back(p2);
45  m_spacepoints.push_back(p3);
46  m_zvertex = z;
47  }
48 
50  // Copy constructor
52 
54  : m_spacepoints (Se.m_spacepoints),
55  m_zvertex (Se.m_zvertex)
56  {
57  }
58 
60  // Operator =
62 
63  // Not all variables copied --- presume deliberately.
64  // cppcheck-suppress operatorEqVarError
66  {
67  if(&Se!=this) {
69  m_zvertex = Se.m_zvertex ;
70  }
71  return *this;
72  }
73 
75  // Dumps relevant information into the MsgStream
77 
78  MsgStream& SiSpacePointsSeed::dump( MsgStream& out ) const
79  {
80 
81  out<<"InDet::SpacePointsSeed contains: "
82  <<std::setw(3)<<m_spacepoints.size()
83  <<" space points"
84  <<std::endl;
85  std::vector<const Trk::SpacePoint*>::const_iterator is,ise = m_spacepoints.end();
86  for(is=m_spacepoints.begin(); is!=ise; ++is) {
87 
88  if((*is)->clusterList().second == 0) {
89  out<<"pix: r,f,z = "
90  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().perp()
91  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().phi ()
92  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().z ()
93  <<std::endl;
94  }
95  else {
96  out<<"sct: r,f,z = "
97  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().perp()
98  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().phi ()
99  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().z ()
100  <<std::endl;
101  }
102  }
103  return out;
104  }
105 
107  // Dumps relevant information into the ostream
109 
110  std::ostream& SiSpacePointsSeed::dump( std::ostream& out ) const
111  {
112 
113  out<<"InDet::SpacePointsSeed contains: "
114  <<std::setw(3)<<m_spacepoints.size()
115  <<" space points"
116  <<std::endl;
117  std::vector<const Trk::SpacePoint*>::const_iterator is,ise = m_spacepoints.end();
118  for(is=m_spacepoints.begin(); is!=ise; ++is) {
119 
120  if((*is)->clusterList().second == 0) {
121  out<<"pix: r,f,z = "
122  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().perp()
123  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().phi ()
124  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().z ()
125  <<std::endl;
126  }
127  else {
128  out<<"sct: r,f,z = "
129  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().perp()
130  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().phi ()
131  <<std::setw(12)<<std::setprecision(5)<<(*is)->globalPosition().z ()
132  <<std::endl;
133  }
134  }
135  return out;
136  }
137 
139  // Overload of << operator MsgStream
141 
142  MsgStream& operator << (MsgStream& sl,const SiSpacePointsSeed& se)
143  {
144  return se.dump(sl);
145  }
147  // Overload of << operator std::ostream
149 
150  std::ostream& operator << (std::ostream& sl,const SiSpacePointsSeed& se)
151  {
152  return se.dump(sl);
153  }
154 
155 } // end of name space
156 
157 
158 
159 
160 
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
InDet::operator<<
MsgStream & operator<<(MsgStream &, const GNNTrackReaderTool &)
InDet::SiSpacePointsSeed::operator=
SiSpacePointsSeed & operator=(const SiSpacePointsSeed &)
Definition: SiSpacePointsSeed.cxx:65
SiSpacePointsSeed.h
InDet::SiSpacePointsSeed::SiSpacePointsSeed
SiSpacePointsSeed()
Definition: SiSpacePointsSeed.cxx:25
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::SiSpacePointsSeed::dump
virtual MsgStream & dump(MsgStream &out) const
Definition: SiSpacePointsSeed.cxx:78
InDet::SiSpacePointsSeed::m_spacepoints
std::vector< const Trk::SpacePoint * > m_spacepoints
Definition: SiSpacePointsSeed.h:97
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
InDet::SiSpacePointsSeed
Definition: SiSpacePointsSeed.h:30
z
#define z
InDet::SiSpacePointsSeed::m_zvertex
double m_zvertex
Definition: SiSpacePointsSeed.h:99
TRTCalib_cfilter.p3
p3
Definition: TRTCalib_cfilter.py:132