ATLAS Offline Software
SiWidth.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiWidth.h, (c) ATLAS Detector software
8 
9 #ifndef INDETPREPRAWDATA_SIWIDTH_H
10 #define INDETPREPRAWDATA_SIWIDTH_H
11 
14 #include <iosfwd>
15 
16 class MsgStream;
17 
19 namespace InDet {
20 
25  class SiWidth final{
26 
28  // Public methods:
30  public:
31 
32  // Implicit constructor:
33  SiWidth();
34 
35  // Copy constructor:
36  SiWidth(const SiWidth& position);
37  //move ctor
38  SiWidth(SiWidth&& position) = default;
39 
40  // Constructor with parameters: <col, row> in units of RDOs (so should be int),
41  // <phiR width in mm, Z width in mm>
42  SiWidth(const Amg::Vector2D& colrow, const Amg::Vector2D& phiRZ);
43 
44  // online constructor: only the col, row in units of RDOs
45  SiWidth(const Amg::Vector2D& colrow);
46 
47  // Destructor:
48  ~SiWidth() = default;
49 
50  // Assignment operator:
51  SiWidth &operator=(const SiWidth& width);
52  // move assignment
53  SiWidth &operator=(SiWidth&& width) = default;
54 
56  // Const methods:
58 
59  // return col row:
60  const Amg::Vector2D& colRow() const;
61 
62  // return phiRZ in mm:
63  const Amg::Vector2D& widthPhiRZ() const;
64 
65  // return PhiR
66  double phiR() const;
67 
68  // return z
69  double z() const;
70 
71  // comparison
72  bool operator <(const SiWidth& width) const;
73  bool operator >(const SiWidth& width) const;
74 
76  // Non-const methods:
78 
79  void setColumn(const double col);
80 
81  void setRow(const double row);
82 
83  void setColRow(const Amg::Vector2D& colRow);
84 
85  void setPhirWidth(const double phirWidth);
86 
87  void setZWidth(const double zWidth);
88 
89  void setPhirzWidth(const Amg::Vector2D& phirzWidth);
90 
92  MsgStream& dump(MsgStream& stream) const;
93 
95  std::ostream& dump(std::ostream& stream) const;
96 
97  // scaling
98 
100  // Private data:
102  private:
103  // Need to force proper alignment; otherwise cling gets it wrong.
104  alignas(16) Amg::Vector2D m_colrow;//<col, row>
106  };
107 
108  MsgStream& operator << (MsgStream& stream, const SiWidth& prd);
109  std::ostream& operator << (std::ostream& stream, const SiWidth& prd);
110 
111 
113  // Inline methods:
115  inline const Amg::Vector2D& SiWidth::colRow() const
116  {
117  return (m_colrow);
118  }
119 
120 
121  inline const Amg::Vector2D& SiWidth::widthPhiRZ() const
122  {
123  return m_phirzWidth;
124  }
125 
126  inline double SiWidth::phiR() const
127  {
128  return m_phirzWidth[Trk::locPhiR];
129  }
130 
131  inline double SiWidth::z() const
132  {
133  return m_phirzWidth[Trk::locZ];
134  }
135 
136  // comparison
137  // return true if smaller in either direction
139  {
140  // size phi
141  if ( m_colrow[0] < width.colRow()[0] ) { return true; }
142  // size z
143  if ( m_colrow[1] < width.colRow()[1] ) { return true; }
144  return false;
145  }
146 
147  // flip logic of <
149  {
150  // size phi
151  if ( m_colrow[0] < width.colRow()[0] ) { return false; }
152  // size z
153  if ( m_colrow[1] < width.colRow()[1] ) { return false; }
154  return true;
155  }
156 
157 
158  inline void SiWidth::setColumn(const double col)
159  {
160  m_colrow[0] = col;
161  }
162 
163  inline void SiWidth::setRow(const double row)
164  {
165  m_colrow[1] = row;
166  }
167 
168  inline void SiWidth::setColRow(const Amg::Vector2D& colRow)
169  {
171  }
172 
173  inline void SiWidth::setPhirWidth(const double phir)
174  {
175  m_phirzWidth[Trk::locPhiR] = phir;
176  }
177  inline void SiWidth::setZWidth(const double zwidth)
178  {
179  m_phirzWidth[Trk::locZ] = zwidth;
180  }
181  inline void SiWidth::setPhirzWidth(const Amg::Vector2D& phirzwidth)
182  {
183  m_phirzWidth = phirzwidth;
184  }
185 
186 
187 } // end of namespace
188 
189 #endif // INDETPREPRAWDATA_SIWIDTH_H
query_example.row
row
Definition: query_example.py:24
InDet::operator<<
MsgStream & operator<<(MsgStream &, const GNNTrackReaderTool &)
InDet::SiWidth::setPhirWidth
void setPhirWidth(const double phirWidth)
Definition: SiWidth.h:173
InDet::SiWidth::operator>
bool operator>(const SiWidth &width) const
Definition: SiWidth.h:148
InDet::SiWidth::m_colrow
Amg::Vector2D m_colrow
Definition: SiWidth.h:104
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDet::SiWidth::operator=
SiWidth & operator=(SiWidth &&width)=default
InDet::SiWidth::widthPhiRZ
const Amg::Vector2D & widthPhiRZ() const
Definition: SiWidth.h:121
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SiWidth::setColumn
void setColumn(const double col)
Definition: SiWidth.h:158
InDet::SiWidth::~SiWidth
~SiWidth()=default
InDet::SiWidth::setRow
void setRow(const double row)
Definition: SiWidth.h:163
InDet::SiWidth::operator<
bool operator<(const SiWidth &width) const
Definition: SiWidth.h:138
ParamDefs.h
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
InDet::SiWidth::SiWidth
SiWidth(const SiWidth &position)
GeoPrimitives.h
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
InDet::SiWidth::m_phirzWidth
Amg::Vector2D m_phirzWidth
Definition: SiWidth.h:105
InDet::SiWidth::setZWidth
void setZWidth(const double zWidth)
Definition: SiWidth.h:177
InDet::SiWidth::operator=
SiWidth & operator=(const SiWidth &width)
Definition: SiWidth.cxx:41
query_example.col
col
Definition: query_example.py:7
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
Trk::locPhiR
@ locPhiR
Definition: ParamDefs.h:47
InDet::SiWidth
Definition: SiWidth.h:25
InDet::SiWidth::colRow
const Amg::Vector2D & colRow() const
Definition: SiWidth.h:115
InDet::SiWidth::setPhirzWidth
void setPhirzWidth(const Amg::Vector2D &phirzWidth)
Definition: SiWidth.h:181
InDet::SiWidth::dump
MsgStream & dump(MsgStream &stream) const
dump information about the PRD object.
Definition: SiWidth.cxx:56
InDet::SiWidth::SiWidth
SiWidth(SiWidth &&position)=default
InDet::SiWidth::phiR
double phiR() const
Definition: SiWidth.h:126
InDet::SiWidth::SiWidth
SiWidth()
Definition: SiWidth.cxx:16
InDet::SiWidth::setColRow
void setColRow(const Amg::Vector2D &colRow)
Definition: SiWidth.h:168
InDet::SiWidth::z
double z() const
Definition: SiWidth.h:131