Belle II Software  release-08-01-10
ARICHGlobalAlignment.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 <arich/dbobjects/ARICHPositionElement.h>
13 #include <string>
14 #include <TVector3.h>
15 #include <TRotation.h>
16 
17 namespace Belle2 {
30 
31  public:
32 
37  {}
38 
43  {
44  *this = align;
45  m_rotation = 0;
46  m_rotationInverse = 0;
47  m_translation = 0;
48  }
49 
50 
55  {
56  if (this != &align) {
57  ARICHGeoBase::operator=(align);
58  m_alignPars = align.getAlignmentElement();
59  if (m_rotation) delete m_rotation;
60  if (m_rotationInverse) delete m_rotationInverse;
61  if (m_translation) delete m_translation;
62  m_rotation = 0;
63  m_rotationInverse = 0;
64  m_translation = 0;
65  }
66  return *this;
67  }
68 
73  {
74  if (m_rotation) delete m_rotation;
75  if (m_rotationInverse) delete m_rotationInverse;
76  if (m_translation) delete m_translation;
77  }
78 
84  {
85  m_alignPars = align;
86  }
87 
93  {
94  return m_alignPars;
95  }
96 
97 
102  void print(const std::string& title = "ARICH global alignment parameters") const;
103 
104 
109  const TVector3& getTranslation() const {if (!m_translation) setTransformation(); return *m_translation;}
110 
115  const TRotation& getRotation() const
116  {
117  if (!m_rotation) setTransformation();
118  return *m_rotation;
119  }
120 
121  TVector3 pointToGlobal(const TVector3& point) const;
122  TVector3 momentumToGlobal(const TVector3& momentum) const;
123  TVector3 pointToLocal(const TVector3& point) const;
124  TVector3 momentumToLocal(const TVector3& momentum) const;
125 
126  private:
127 
128  void setTransformation() const;
129 
130  ARICHPositionElement m_alignPars;
131 
132  mutable TRotation* m_rotation = 0 ;
133  mutable TRotation* m_rotationInverse = 0;
134  mutable TVector3* m_translation = 0;
135 
138  };
139 
141 } // end namespace Belle2
Base class for geometry parameters.
Definition: ARICHGeoBase.h:24
Geometry parameters of ARICH Master volume (envelope)
void print(const std::string &title="ARICH global alignment parameters") const
Print the content of the class.
const TRotation & getRotation() const
Get rotation matrix of ARICH master volume in global Belle II coordinates.
const ARICHPositionElement & getAlignmentElement() const
Returns alignment parameters (element)
ARICHGlobalAlignment(const ARICHGlobalAlignment &align)
Copy constructor.
const TVector3 & getTranslation() const
Get position of ARICH master volume center point in global Belle II coordinates.
ARICHGlobalAlignment & operator=(const ARICHGlobalAlignment &align)
Assignment operator.
ClassDef(ARICHGlobalAlignment, 1)
ClassDef.
void setAlignmentElement(const ARICHPositionElement &align)
Sets alignment parameters (element)
ARICHGlobalAlignment()
Default constructor.
Position element for ARICH.
Abstract base class for different kinds of events.