Belle II Software  release-08-01-10
ARICHGlobalAlignment.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/ARICHGlobalAlignment.h>
10 #include <iostream>
11 
12 using namespace std;
13 using namespace Belle2;
14 
15 
16 
17 TVector3 ARICHGlobalAlignment::pointToGlobal(const TVector3& point) const
18 {
19  if (!m_rotation) setTransformation();
20  return (*m_rotation) * point + (*m_translation);
21 }
22 
23 TVector3 ARICHGlobalAlignment::momentumToGlobal(const TVector3& momentum) const
24 {
25  if (!m_rotation) setTransformation();
26  return (*m_rotation) * momentum;
27 }
28 
29 TVector3 ARICHGlobalAlignment::pointToLocal(const TVector3& point) const
30 {
31  if (!m_translation) setTransformation();
32  return (*m_rotationInverse) * (point - (*m_translation));
33 }
34 
35 TVector3 ARICHGlobalAlignment::momentumToLocal(const TVector3& momentum) const
36 {
37  if (!m_rotationInverse) setTransformation();
38  return (*m_rotationInverse) * momentum;
39 }
40 
41 void ARICHGlobalAlignment::setTransformation() const
42 {
43  TRotation Rot = m_alignPars.getRotation();
44  m_rotation = new TRotation(Rot);
45  m_rotationInverse = new TRotation(Rot.Inverse());
46  m_translation = new TVector3(m_alignPars.getTranslation());
47 }
48 
49 void ARICHGlobalAlignment::print(const std::string& title) const
50 {
51  ARICHGeoBase::print(title);
52  m_alignPars.print();
53 }
Abstract base class for different kinds of events.