Belle II Software  release-06-00-14
TOPGeoModuleDisplacement.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <top/dbobjects/TOPGeoBase.h>
12 #include <TVector3.h>
13 #include <TRotation.h>
14 
15 namespace Belle2 {
27  public:
28 
33  {}
34 
45  TOPGeoModuleDisplacement(double x, double y, double z,
46  double alpha, double beta, double gamma,
47  const std::string& name = "TOPModuleDisplacement"):
48  TOPGeoBase(name),
49  m_x(x), m_y(y), m_z(z),
50  m_alpha(alpha), m_beta(beta), m_gamma(gamma)
51  {}
52 
57  double getX() const {return m_x / s_unit;}
58 
63  double getY() const {return m_y / s_unit;}
64 
69  double getZ() const {return m_z / s_unit;}
70 
75  double getAlpha() const {return m_alpha;}
76 
81  double getBeta() const {return m_beta;}
82 
87  double getGamma() const {return m_gamma;}
88 
93  TRotation getRotation() const
94  {
95  TRotation rot;
96  rot.RotateX(m_alpha).RotateY(m_beta).RotateZ(m_gamma);
97  return rot;
98  }
99 
104  TVector3 getTranslation() const {return TVector3(m_x, m_y, m_z);}
105 
110  bool isConsistent() const override {return true;}
111 
116  void print(const std::string& title = "Module displacement parameters") const override;
117 
118  private:
119 
120  float m_x = 0;
121  float m_y = 0;
122  float m_z = 0;
123  float m_alpha = 0;
124  float m_beta = 0;
125  float m_gamma = 0;
129  };
130 
132 } // end namespace Belle2
Base class for geometry parameters.
Definition: TOPGeoBase.h:25
Displacement parameters of a TOP module.
float m_beta
rotation angle around y
bool isConsistent() const override
Check for consistency of data members.
double getGamma() const
Returns rotation angle around z.
double getX() const
Returns translation in x.
TRotation getRotation() const
Returns rotation matrix.
double getAlpha() const
Returns rotation angle around x.
TVector3 getTranslation() const
Returns translation vector (always in basf2 units!)
TOPGeoModuleDisplacement(double x, double y, double z, double alpha, double beta, double gamma, const std::string &name="TOPModuleDisplacement")
Full constructor.
double getZ() const
Returns translation in z.
double getY() const
Returns translation in y.
float m_alpha
rotation angle around x
TOPGeoModuleDisplacement()
Default constructor.
float m_gamma
rotation angle around z
ClassDefOverride(TOPGeoModuleDisplacement, 1)
ClassDef.
double getBeta() const
Returns rotation angle around y.
static double s_unit
conversion unit for length
Definition: TOPGeoBase.h:86
void print(const std::string &title="Module displacement parameters") const override
Print the content of the class.
Abstract base class for different kinds of events.