Belle II Software development
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 <Math/Vector3D.h>
14#include <Math/Rotation3D.h>
15#include <Math/RotationX.h>
16#include <Math/RotationY.h>
17#include <Math/RotationZ.h>
18
19namespace Belle2 {
32
33 public:
34
39 {}
40
45 {
46 /*if(m_rotation) delete m_rotation;
47 if(m_rotationInverse) delete m_rotationInverse;
48 if(m_translation) delete m_translation;
49 */
50 }
51
56 bool isConsistent() const override;
57
62 void print(const std::string& title = "ARICH Master Volume geometry parameters") const override;
63
73 void setPlacement(double x, double y, double z, double rx, double ry, double rz);
74
82 void setVolume(double innerR, double outerR, double length, const std::string& material) {m_innerR = innerR; m_outerR = outerR; m_length = length; m_material = material;};
83
88 ROOT::Math::XYZVector getPosition() const {return ROOT::Math::XYZVector(m_x / s_unit, m_y / s_unit, m_z / s_unit);}
89
94 ROOT::Math::Rotation3D getRotation() const
95 {
96 ROOT::Math::Rotation3D rot;
97 ROOT::Math::RotationX rotX(m_rx);
98 ROOT::Math::RotationY rotY(m_ry);
99 ROOT::Math::RotationZ rotZ(m_rz);
100 rot *= rotZ * rotY * rotX;
101 return rot;
102 }
103
108 double getRotationX() const {return m_rx;}
109
114 double getRotationY() const {return m_ry;}
115
120 double getRotationZ() const {return m_rz;}
121
126 double getInnerRadius() const {return m_innerR / s_unit;};
127
132 double getOuterRadius() const {return m_outerR / s_unit;};
133
138 double getLength() const {return m_length / s_unit;};
139
144 const std::string& getMaterial() const {return m_material;}
145
151 ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector& point) const;
152
158 ROOT::Math::XYZVector momentumToGlobal(const ROOT::Math::XYZVector& momentum) const;
159
165 ROOT::Math::XYZVector pointToLocal(const ROOT::Math::XYZVector& point) const;
166
172 ROOT::Math::XYZVector momentumToLocal(const ROOT::Math::XYZVector& momentum) const;
173
174
175 private:
176 // position in global BelleII frame
177 double m_x = 0;
178 double m_y = 0;
179 double m_z = 0;
181 // rotations in global BelleII frame
182 double m_rx = 0;
183 double m_ry = 0;
184 double m_rz = 0;
186 double m_innerR = 0;
187 double m_outerR = 0;
188 double m_length = 0;
190 std::string m_material;
192 mutable ROOT::Math::Rotation3D* m_rotation = nullptr ;
193 mutable ROOT::Math::Rotation3D* m_rotationInverse = nullptr;
194 mutable ROOT::Math::XYZVector* m_translation = nullptr;
198 };
199
201} // 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
std::string m_material
material of ARICH master volume
ClassDefOverride(ARICHGeoMasterVolume, 2)
ClassDef.
double m_ry
rotation around y-axis
ROOT::Math::Rotation3D getRotation() const
Get rotation matrix of ARICH master volume in global Belle II coordinates.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &point) const
Transform local point into global Belle II coordinate system via rotation and translation.
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.
ROOT::Math::XYZVector momentumToLocal(const ROOT::Math::XYZVector &momentum) const
Rotate global point into ARICH reference system via inverse rotation.
ROOT::Math::Rotation3D * m_rotationInverse
inverse rotation matrix of ARICH master volume
void setVolume(double innerR, double outerR, double length, const std::string &material)
Sets parameters of ARICH master volume.
ROOT::Math::XYZVector pointToLocal(const ROOT::Math::XYZVector &point) const
Transform global point into ARICH reference system via inverse rotation and translation.
const std::string & getMaterial() const
Get material of ARICH master volume.
void print(const std::string &title="ARICH Master Volume geometry parameters") const override
Print the content of the class.
double m_outerR
tube outer radius
ROOT::Math::XYZVector momentumToGlobal(const ROOT::Math::XYZVector &momentum) const
Rotate local momentum into global Belle II coordinate system.
ROOT::Math::XYZVector getPosition() const
Get position of ARICH master volume center point in global Belle II coordinates.
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
ROOT::Math::XYZVector * m_translation
position of ARICH master volume center point
ROOT::Math::Rotation3D * m_rotation
rotation matrix of ARICH master volume
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.