Belle II Software  release-08-01-10
ARICHGeoMasterVolume.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 <arich/dbobjects/ARICHGeoBase.h>
12 #include <string>
13 #include <TVector3.h>
14 #include <TRotation.h>
15 
16 namespace Belle2 {
29 
30  public:
31 
36  {}
37 
42  {
43  /*if(m_rotation) delete m_rotation;
44  if(m_rotationInverse) delete m_rotationInverse;
45  if(m_translation) delete m_translation;
46  */
47  }
48 
53  bool isConsistent() const override;
54 
59  void print(const std::string& title = "ARICH Master Volume geometry parameters") const override;
60 
70  void setPlacement(double x, double y, double z, double rx, double ry, double rz);
71 
79  void setVolume(double innerR, double outerR, double length, const std::string& material) {m_innerR = innerR; m_outerR = outerR; m_length = length; m_material = material;};
80 
85  TVector3 getPosition() const {return TVector3(m_x / s_unit, m_y / s_unit, m_z / s_unit);}
86 
91  TRotation getRotation() const
92  {
93  TRotation rot;
94  rot.RotateX(m_rx).RotateY(m_ry).RotateZ(m_rz);
95  return rot;
96  }
97 
102  double getRotationX() const {return m_rx;}
103 
108  double getRotationY() const {return m_ry;}
109 
114  double getRotationZ() const {return m_rz;}
115 
120  double getInnerRadius() const {return m_innerR / s_unit;};
121 
126  double getOuterRadius() const {return m_outerR / s_unit;};
127 
132  double getLength() const {return m_length / s_unit;};
133 
138  const std::string& getMaterial() const {return m_material;}
139 
140  TVector3 pointToGlobal(const TVector3& point) const;
141  TVector3 momentumToGlobal(const TVector3& momentum) const;
142  TVector3 pointToLocal(const TVector3& point) const;
143  TVector3 momentumToLocal(const TVector3& momentum) const;
144 
145 
146  private:
147  // position in global BelleII frame
148  double m_x = 0;
149  double m_y = 0;
150  double m_z = 0;
152  // rotations in global BelleII frame
153  double m_rx = 0;
154  double m_ry = 0;
155  double m_rz = 0;
157  double m_innerR = 0;
158  double m_outerR = 0;
159  double m_length = 0;
161  std::string m_material;
162 
163  mutable TRotation* m_rotation = 0 ;
164  mutable TRotation* m_rotationInverse = 0;
165  mutable TVector3* m_translation = 0;
166 
169  };
170 
172 } // end namespace Belle2
Base class for geometry parameters.
Definition: ARICHGeoBase.h:24
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:83
Geometry parameters of ARICH Master volume (envelope)
bool isConsistent() const override
Check of geometry parameters consistency.
ARICHGeoMasterVolume()
Default constructor.
double m_innerR
tube inner radius
double m_ry
rotation around y-axis
TRotation getRotation() const
Get rotation matrix of ARICH master volume in global Belle II coordinates.
double getRotationY() const
Get angle of rotation around Y axis.
double getRotationZ() const
Get angle of rotation around Z axis.
double getOuterRadius() const
Get ARICH master volume outer radius.
double getInnerRadius() const
Get ARICH master volume inner radius.
void setVolume(double innerR, double outerR, double length, const std::string &material)
Sets parameters of ARICH master volume.
ClassDefOverride(ARICHGeoMasterVolume, 1)
ClassDef.
TVector3 getPosition() const
Get position of ARICH master volume center point in global Belle II coordinates.
void print(const std::string &title="ARICH Master Volume geometry parameters") const override
Print the content of the class.
const std::string & getMaterial() const
Get material of ARICH master volume.
double m_outerR
tube outer radius
void setPlacement(double x, double y, double z, double rx, double ry, double rz)
Sets positioning of ARICH master volume in global Belle II coordinate system.
double m_rz
rotation around z-axis
double m_rx
rotation around x-axis
double getLength() const
Get ARICH master volume length.
double getRotationX() const
Get angle of rotation around X axis.
Abstract base class for different kinds of events.