Belle II Software development
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 <Math/Transform3D.h>
12#include <vector>
13
14namespace Belle2 {
27 class TOPCalModuleAlignment: public TObject {
28 public:
29
33 enum EStatus {
36 c_Unusable = 2
37 };
38
44
51 void setAlpha(int moduleID, double alpha, double errAlpha);
52
59 void setBeta(int moduleID, double beta, double errBeta);
60
67 void setGamma(int moduleID, double gamma, double errGamma);
68
75 void setX(int moduleID, double x, double errX);
76
83 void setY(int moduleID, double y, double errY);
84
91 void setZ(int moduleID, double z, double errZ);
92
97 void setCalibrated(int moduleID);
98
103 void setUnusable(int moduleID);
104
110 double getAlpha(int moduleID) const;
111
117 double getBeta(int moduleID) const;
118
124 double getGamma(int moduleID) const;
125
131 double getX(int moduleID) const;
132
138 double getY(int moduleID) const;
139
145 double getZ(int moduleID) const;
146
152 double getAlphaErr(int moduleID) const;
153
159 double getBetaErr(int moduleID) const;
160
166 double getGammaErr(int moduleID) const;
167
173 double getXErr(int moduleID) const;
174
180 double getYErr(int moduleID) const;
181
187 double getZErr(int moduleID) const;
188
194 bool isCalibrated(int moduleID) const;
195
201 bool isDefault(int moduleID) const;
202
208 bool isUnusable(int moduleID) const;
209
216 const ROOT::Math::Transform3D& getTransformation(int moduleID) const;
217
221 bool areAllCalibrated() const;
222
228 bool areAllPrecise(double spatialPrecision, double angularPrecision) const;
229
230 private:
231
235 void setTransformations() const;
236
240 enum {c_numModules = 16,
241 };
242
243 float m_alpha[c_numModules] = {0};
244 float m_beta[c_numModules] = {0};
245 float m_gamma[c_numModules] = {0};
246 float m_x[c_numModules] = {0};
247 float m_y[c_numModules] = {0};
248 float m_z[c_numModules] = {0};
251 float m_errBeta[c_numModules] = {0};
253 float m_errX[c_numModules] = {0};
254 float m_errY[c_numModules] = {0};
255 float m_errZ[c_numModules] = {0};
260 mutable std::vector<ROOT::Math::Transform3D> m_transforms;
261
264 };
265
267} // end namespace Belle2
268
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
std::vector< ROOT::Math::Transform3D > m_transforms
cache for transformations (from local to nominal)
float m_y[c_numModules]
displacement along the y axis
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
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.
const ROOT::Math::Transform3D & getTransformation(int moduleID) const
Returns transformation from local to nominal frame.
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.
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.
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.