Belle II Software  release-05-01-25
ARICHGeoMasterVolume.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <arich/dbobjects/ARICHGeoMasterVolume.h>
12 #include <iostream>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 
18 
19 TVector3 ARICHGeoMasterVolume::pointToGlobal(const TVector3& point) const
20 {
21  return (*m_rotation) * point + (*m_translation);
22 }
23 
24 TVector3 ARICHGeoMasterVolume::momentumToGlobal(const TVector3& momentum) const
25 {
26  return (*m_rotation) * momentum;
27 }
28 
29 TVector3 ARICHGeoMasterVolume::pointToLocal(const TVector3& point) const
30 {
31  return (*m_rotationInverse) * (point - (*m_translation));
32 }
33 
34 TVector3 ARICHGeoMasterVolume::momentumToLocal(const TVector3& momentum) const
35 {
36  return (*m_rotationInverse) * momentum;
37 }
38 
39 void ARICHGeoMasterVolume::setPlacement(double x, double y, double z, double rx, double ry, double rz)
40 {
41 
42  m_x = x; m_y = y; m_z = z; m_rx = rx; m_ry = ry; m_rz = rz;
43 
44  TVector3 translation(x, y, z);
45 
46  m_rotation = new TRotation();
47  m_rotation->RotateX(rx);
48  m_rotation->RotateY(ry);
49  m_rotation->RotateZ(rz);
50 
51  m_rotationInverse = new TRotation(m_rotation->Inverse());
52  m_translation = new TVector3(x, y, z);
53 
54 }
55 
56 
57 
58 bool ARICHGeoMasterVolume::isConsistent() const
59 {
60  if (m_innerR > m_outerR) return false;
61  if (m_length <= 0 || m_innerR < 0) return false;
62  if (m_material.empty()) return false;
63  return true;
64 }
65 
66 
67 void ARICHGeoMasterVolume::print(const std::string& title) const
68 {
69  ARICHGeoBase::print(title);
70 
71  cout << " Tube inner radius: " << getInnerRadius() << " " << s_unitName << endl;
72  cout << " Tube outer radius: " << getOuterRadius() << " " << s_unitName << endl;
73  cout << " Tube length: " << getLength() << " " << s_unitName << endl;
74 
75  cout << "Positioning parameters (in Belle II global frame)" << endl;
76  ARICHGeoBase::printPlacement(m_x, m_y, m_z, m_rx, m_ry, m_rz);
77 
78 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19