ATLAS Offline Software
RotPhi.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DCMATH_ROTPHI_H
6 #define DCMATH_ROTPHI_H
7 
8 #include <cmath>
9 
11 
12 namespace TrkDriftCircleMath {
13 
14  class RotPhi {
15  public:
17 
18  RotPhi(const RotPhi&) = default;
19  RotPhi(RotPhi&&) = default;
20 
21  RotPhi& operator=(RotPhi&&) = default;
22  RotPhi& operator=(const RotPhi&) = default;
23 
24  double phi() const { return m_phi; }
25  double cosphi() const { return m_cosphi; }
26  double sinphi() const { return m_sinphi; }
27 
28  double xval(const LocVec2D& lv) const { return cosphi() * lv.x() + sinphi() * lv.y(); }
29  double yval(const LocVec2D& lv) const { return -sinphi() * lv.x() + cosphi() * lv.y(); }
30  LocVec2D operator*(const LocVec2D& lv) const {return LocVec2D{xval(lv), yval(lv)}; }
31 
32  RotPhi inverse() const { return RotPhi(-phi()); }
33 
34  void set(double phi) {
35  m_phi = phi;
38  }
39 
40  private:
41  double m_phi{0};
42  double m_cosphi{0};
43  double m_sinphi{0};
44  };
45 
46 } // namespace TrkDriftCircleMath
47 #endif
TrkDriftCircleMath::RotPhi::cosphi
double cosphi() const
Definition: RotPhi.h:25
TrkDriftCircleMath::RotPhi::RotPhi
RotPhi(double phi)
Definition: RotPhi.h:16
TrkDriftCircleMath::RotPhi::operator=
RotPhi & operator=(const RotPhi &)=default
TrkDriftCircleMath::RotPhi
Definition: RotPhi.h:14
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
TrkDriftCircleMath::LocVec2D::x
double x() const
Returns the x coordinate of the vector.
Definition: LocVec2D.h:27
TrkDriftCircleMath::RotPhi::inverse
RotPhi inverse() const
Definition: RotPhi.h:32
TrkDriftCircleMath::RotPhi::xval
double xval(const LocVec2D &lv) const
Definition: RotPhi.h:28
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TrkDriftCircleMath::RotPhi::sinphi
double sinphi() const
Definition: RotPhi.h:26
TrkDriftCircleMath::LocVec2D
Implementation of 2 dimensional vector class.
Definition: LocVec2D.h:16
TrkDriftCircleMath::RotPhi::operator*
LocVec2D operator*(const LocVec2D &lv) const
Definition: RotPhi.h:30
TrkDriftCircleMath::LocVec2D::y
double y() const
Returns the y coordinate of the vector.
Definition: LocVec2D.h:29
TrkDriftCircleMath::RotPhi::RotPhi
RotPhi(const RotPhi &)=default
TrkDriftCircleMath::RotPhi::m_phi
double m_phi
Definition: RotPhi.h:41
TrkDriftCircleMath::RotPhi::set
void set(double phi)
Definition: RotPhi.h:34
TrkDriftCircleMath::RotPhi::yval
double yval(const LocVec2D &lv) const
Definition: RotPhi.h:29
TrkDriftCircleMath::RotPhi::RotPhi
RotPhi(RotPhi &&)=default
TrkDriftCircleMath::RotPhi::phi
double phi() const
Definition: RotPhi.h:24
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TrkDriftCircleMath::RotPhi::operator=
RotPhi & operator=(RotPhi &&)=default
LocVec2D.h
TrkDriftCircleMath::RotPhi::m_sinphi
double m_sinphi
Definition: RotPhi.h:43
TrkDriftCircleMath::RotPhi::m_cosphi
double m_cosphi
Definition: RotPhi.h:42