Belle II Software development
ARICHGeoMasterVolume.cc
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#include <arich/dbobjects/ARICHGeoMasterVolume.h>
10#include <iostream>
11
12using namespace std;
13using namespace Belle2;
14
15
16
17ROOT::Math::XYZVector ARICHGeoMasterVolume::pointToGlobal(const ROOT::Math::XYZVector& point) const
18{
19 return (*m_rotation) * point + (*m_translation);
20}
21
22ROOT::Math::XYZVector ARICHGeoMasterVolume::momentumToGlobal(const ROOT::Math::XYZVector& momentum) const
23{
24 return (*m_rotation) * momentum;
25}
26
27ROOT::Math::XYZVector ARICHGeoMasterVolume::pointToLocal(const ROOT::Math::XYZVector& point) const
28{
29 return (*m_rotationInverse) * (point - (*m_translation));
30}
31
32ROOT::Math::XYZVector ARICHGeoMasterVolume::momentumToLocal(const ROOT::Math::XYZVector& momentum) const
33{
34 return (*m_rotationInverse) * momentum;
35}
36
37void ARICHGeoMasterVolume::setPlacement(double x, double y, double z, double rx, double ry, double rz)
38{
39
40 m_x = x; m_y = y; m_z = z; m_rx = rx; m_ry = ry; m_rz = rz;
41
42 ROOT::Math::XYZVector translation(x, y, z);
43
44 m_rotation = new ROOT::Math::Rotation3D();
45 ROOT::Math::RotationX rotX(m_rx);
46 ROOT::Math::RotationY rotY(m_ry);
47 ROOT::Math::RotationZ rotZ(m_rz);
48 (*m_rotation) *= rotZ * rotY * rotX;
49
50 m_rotationInverse = new ROOT::Math::Rotation3D(m_rotation->Inverse());
51 m_translation = new ROOT::Math::XYZVector(x, y, z);
52
53}
54
55
56
58{
59 if (m_innerR > m_outerR) return false;
60 if (m_length <= 0 || m_innerR < 0) return false;
61 if (m_material.empty()) return false;
62 return true;
63}
64
65
66void ARICHGeoMasterVolume::print(const std::string& title) const
67{
69
70 cout << " Tube inner radius: " << getInnerRadius() << " " << s_unitName << endl;
71 cout << " Tube outer radius: " << getOuterRadius() << " " << s_unitName << endl;
72 cout << " Tube length: " << getLength() << " " << s_unitName << endl;
73
74 cout << "Positioning parameters (in Belle II global frame)" << endl;
76
77}
virtual void printPlacement(double x, double y, double z, double rx, double ry, double rz) const
Print volume positioning parameters.
Definition: ARICHGeoBase.cc:25
virtual void print(const std::string &title) const
Print the content of the class.
Definition: ARICHGeoBase.cc:20
static std::string s_unitName
conversion unit name
Definition: ARICHGeoBase.h:84
bool isConsistent() const override
Check of geometry parameters consistency.
double m_innerR
tube inner radius
std::string m_material
material of ARICH master volume
double m_ry
rotation around y-axis
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &point) const
Transform local point into global Belle II coordinate system via rotation and translation.
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
ROOT::Math::XYZVector pointToLocal(const ROOT::Math::XYZVector &point) const
Transform global point into ARICH reference system via inverse rotation and translation.
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.
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.
Abstract base class for different kinds of events.
STL namespace.