Belle II Software  release-05-01-25
ARICHGlobalAlignment.h
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 #pragma once
12 
13 #include <arich/dbobjects/ARICHGeoBase.h>
14 #include <arich/dbobjects/ARICHPositionElement.h>
15 #include <string>
16 #include <TVector3.h>
17 #include <TRotation.h>
18 
19 namespace Belle2 {
31  class ARICHGlobalAlignment: public ARICHGeoBase {
32 
33  public:
34 
39  {}
40 
45  {
46  *this = align;
47  m_rotation = 0;
48  m_rotationInverse = 0;
49  m_translation = 0;
50  }
51 
52 
57  {
58  if (this != &align) {
59  ARICHGeoBase::operator=(align);
60  m_alignPars = align.getAlignmentElement();
61  if (m_rotation) delete m_rotation;
62  if (m_rotationInverse) delete m_rotationInverse;
63  if (m_translation) delete m_translation;
64  m_rotation = 0;
65  m_rotationInverse = 0;
66  m_translation = 0;
67  }
68  return *this;
69  }
70 
75  {
76  if (m_rotation) delete m_rotation;
77  if (m_rotationInverse) delete m_rotationInverse;
78  if (m_translation) delete m_translation;
79  }
80 
85  void setAlignmentElement(const ARICHPositionElement& align)
86  {
87  m_alignPars = align;
88  }
89 
94  const ARICHPositionElement& getAlignmentElement() const
95  {
96  return m_alignPars;
97  }
98 
99 
104  void print(const std::string& title = "ARICH global alignment parameters") const;
105 
106 
111  const TVector3& getTranslation() const {if (!m_translation) setTransformation(); return *m_translation;}
112 
117  const TRotation& getRotation() const
118  {
119  if (!m_rotation) setTransformation();
120  return *m_rotation;
121  }
122 
123  TVector3 pointToGlobal(const TVector3& point) const;
124  TVector3 momentumToGlobal(const TVector3& momentum) const;
125  TVector3 pointToLocal(const TVector3& point) const;
126  TVector3 momentumToLocal(const TVector3& momentum) const;
127 
128  private:
129 
130  void setTransformation() const;
131 
132  ARICHPositionElement m_alignPars;
133 
134  mutable TRotation* m_rotation = 0 ;
135  mutable TRotation* m_rotationInverse = 0;
136  mutable TVector3* m_translation = 0;
137 
140  };
141 
143 } // end namespace Belle2
Belle2::ARICHPositionElement
Position element for ARICH.
Definition: ARICHPositionElement.h:36
Belle2::ARICHGlobalAlignment::setAlignmentElement
void setAlignmentElement(const ARICHPositionElement &align)
Sets alignment parameters (element)
Definition: ARICHGlobalAlignment.h:93
Belle2::ARICHGlobalAlignment::print
void print(const std::string &title="ARICH global alignment parameters") const
Print the content of the class.
Definition: ARICHGlobalAlignment.cc:51
Belle2::ARICHGlobalAlignment::ARICHGlobalAlignment
ARICHGlobalAlignment()
Default constructor.
Definition: ARICHGlobalAlignment.h:46
Belle2::ARICHGlobalAlignment
Geometry parameters of ARICH Master volume (envelope)
Definition: ARICHGlobalAlignment.h:39
Belle2::ARICHGlobalAlignment::getTranslation
const TVector3 & getTranslation() const
Get position of ARICH master volume center point in global Belle II coordinates.
Definition: ARICHGlobalAlignment.h:119
Belle2::ARICHGlobalAlignment::operator=
ARICHGlobalAlignment & operator=(const ARICHGlobalAlignment &align)
Assignment operator.
Definition: ARICHGlobalAlignment.h:64
Belle2::ARICHGeoBase
Base class for geometry parameters.
Definition: ARICHGeoBase.h:34
Belle2::ARICHGlobalAlignment::getRotation
const TRotation & getRotation() const
Get rotation matrix of ARICH master volume in global Belle II coordinates.
Definition: ARICHGlobalAlignment.h:125
Belle2::ARICHGlobalAlignment::ClassDef
ClassDef(ARICHGlobalAlignment, 1)
ClassDef.
Belle2::ARICHGlobalAlignment::getAlignmentElement
const ARICHPositionElement & getAlignmentElement() const
Returns alignment parameters (element)
Definition: ARICHGlobalAlignment.h:102
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ARICHGlobalAlignment::~ARICHGlobalAlignment
~ARICHGlobalAlignment()
Destructor.
Definition: ARICHGlobalAlignment.h:82