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