Belle II Software  release-06-00-14
TOPCalModuleAlignment.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 #include <TObject.h>
11 #include <TVector3.h>
12 #include <TRotation.h>
13 #include <vector>
14 
15 namespace Belle2 {
28  class TOPCalModuleAlignment: public TObject {
29  public:
30 
34  enum EStatus {
35  c_Default = 0,
37  c_Unusable = 2
38  };
39 
45 
52  void setAlpha(int moduleID, double alpha, double errAlpha);
53 
60  void setBeta(int moduleID, double beta, double errBeta);
61 
68  void setGamma(int moduleID, double gamma, double errGamma);
69 
76  void setX(int moduleID, double x, double errX);
77 
84  void setY(int moduleID, double y, double errY);
85 
92  void setZ(int moduleID, double z, double errZ);
93 
98  void setCalibrated(int moduleID);
99 
104  void setUnusable(int moduleID);
105 
111  double getAlpha(int moduleID) const;
112 
118  double getBeta(int moduleID) const;
119 
125  double getGamma(int moduleID) const;
126 
132  double getX(int moduleID) const;
133 
139  double getY(int moduleID) const;
140 
146  double getZ(int moduleID) const;
147 
153  double getAlphaErr(int moduleID) const;
154 
160  double getBetaErr(int moduleID) const;
161 
167  double getGammaErr(int moduleID) const;
168 
174  double getXErr(int moduleID) const;
175 
181  double getYErr(int moduleID) const;
182 
188  double getZErr(int moduleID) const;
189 
195  bool isCalibrated(int moduleID) const;
196 
202  bool isDefault(int moduleID) const;
203 
209  bool isUnusable(int moduleID) const;
210 
216  const TRotation& getRotation(int moduleID) const;
217 
223  const TVector3& getTranslation(int moduleID) const;
224 
228  bool areAllCalibrated() const;
229 
235  bool areAllPrecise(double spatialPrecision, double angularPrecision) const;
236 
237  private:
238 
242  void setTransformations() const;
243 
247  enum {c_numModules = 16,
248  };
249 
250  float m_alpha[c_numModules] = {0};
251  float m_beta[c_numModules] = {0};
252  float m_gamma[c_numModules] = {0};
253  float m_x[c_numModules] = {0};
254  float m_y[c_numModules] = {0};
255  float m_z[c_numModules] = {0};
257  float m_errAlpha[c_numModules] = {0};
258  float m_errBeta[c_numModules] = {0};
259  float m_errGamma[c_numModules] = {0};
260  float m_errX[c_numModules] = {0};
261  float m_errY[c_numModules] = {0};
262  float m_errZ[c_numModules] = {0};
267  mutable std::vector<TRotation> m_rotations;
269  mutable std::vector<TVector3> m_translations;
270 
273  };
274 
276 } // end namespace Belle2
277 
Alignment constants for all 16 modules.
EStatus m_status[c_numModules]
calibration status
float m_errGamma[c_numModules]
error on gamma
float m_gamma[c_numModules]
rotation angle around the z axis
float m_y[c_numModules]
displacement along the y axis
std::vector< TRotation > m_rotations
cache for rotations (from local to nominal)
ClassDef(TOPCalModuleAlignment, 3)
do not write out
TOPCalModuleAlignment()
Default constructor All the calibrations constants and the related errors are set to zero.
float m_errX[c_numModules]
error on the x displacement
EStatus
Calibration status of a constant.
@ c_Calibrated
good calibrated value
@ c_Default
uncalibrated default value
float m_x[c_numModules]
displacement along the x axis
float m_errBeta[c_numModules]
error on beta
std::vector< TVector3 > m_translations
do not write out
float m_alpha[c_numModules]
rotation angle around the x axis
float m_z[c_numModules]
displacement along the z axis
float m_beta[c_numModules]
rotation angle around the y axis
float m_errY[c_numModules]
error on the y displacement
float m_errZ[c_numModules]
error on the z displacement
float m_errAlpha[c_numModules]
error on alpha
double getGammaErr(int moduleID) const
Returns the error on gamma on a single module.
bool areAllCalibrated() const
Returns true if all modules are calibrated.
void setGamma(int moduleID, double gamma, double errGamma)
Sets the angle gamma on a single module.
double getX(int moduleID) const
Returns the shift x on a single module.
double getBetaErr(int moduleID) const
Returns the error on beta on a single module.
bool isCalibrated(int moduleID) const
Returns calibration status.
void setX(int moduleID, double x, double errX)
Sets the displacement x on a single module.
void setTransformations() const
Sets the transformation cache.
double getAlpha(int moduleID) const
Gets the angle alpha on a single module.
double getZ(int moduleID) const
Returns the shift z on a single module.
double getAlphaErr(int moduleID) const
Returns the error on alpha on a single module.
const TVector3 & getTranslation(int moduleID) const
Returns the translation from local to nominal frame Transformation is: rotation first then translatio...
void setBeta(int moduleID, double beta, double errBeta)
Sets the angle beta on a single module.
double getBeta(int moduleID) const
Gets the angle beta on a single module.
double getXErr(int moduleID) const
Returns the error on x on a single module.
bool areAllPrecise(double spatialPrecision, double angularPrecision) const
Returns true if calibration precision for all modules is within specified values.
void setUnusable(int moduleID)
Switches calibration status to unusable to flag badly calibrated constant.
bool isDefault(int moduleID) const
Returns calibration status.
bool isUnusable(int moduleID) const
Returns calibration status.
void setCalibrated(int moduleID)
Switches calibration status to calibrated.
void setAlpha(int moduleID, double alpha, double errAlpha)
Sets the angle alpha on a single module.
double getGamma(int moduleID) const
Gets the angle gamma on a single module.
double getZErr(int moduleID) const
Returns the error on z on a single module.
const TRotation & getRotation(int moduleID) const
Returns the rotation from local to nominal frame Transformation is: rotation first then translation.
void setZ(int moduleID, double z, double errZ)
Sets the displacement z on a single module.
double getYErr(int moduleID) const
Returns the error on y on a single module.
void setY(int moduleID, double y, double errY)
Sets the displacement y on a single module.
double getY(int moduleID) const
Returns the shift y on a single module.
Abstract base class for different kinds of events.