Project
Loading...
Searching...
No Matches
AlignParam.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef ALICEO2_BASE_ALIGNPARAM_H_
18#define ALICEO2_BASE_ALIGNPARAM_H_
19
20class TGeoMatrix;
21class TGeoHMatrix;
22
23#include <string>
24
25namespace o2
26{
27namespace detectors
28{
31
33{
34 public:
35 AlignParam() = default;
36 ~AlignParam() = default;
37 AlignParam(const char* symname, int algID, // volume symbolic name and its alignable ID
38 double x, double y, double z, // delta translation
39 double psi, double theta, double phi, // delta rotation
40 bool global = true); // global (preferable) or local delta definition
41
42 AlignParam(const char* symname, int algID, TGeoMatrix& m, bool global = true);
43
45 const std::string& getSymName() const { return mSymName; }
47 double getPhi() const { return mPhi; }
48 double getPsi() const { return mPsi; }
49 double getTheta() const { return mTheta; }
50 double getX() const { return mX; }
51 double getY() const { return mY; }
52 double getZ() const { return mZ; }
53
55 bool applyToGeometry() const;
56
58 TGeoHMatrix createMatrix() const;
59
61 bool createLocalMatrix(TGeoHMatrix& m) const;
62
64 void setSymName(const char* m) { mSymName = m; }
65
67 int getAlignableID() const { return mAlignableID; }
68
70 void setAlignableID(int id) { mAlignableID = id; }
72
74 void setGlobalParams(double x, double y, double z, double psi, double theta, double phi);
75
77 void setRotation(double psi, double theta, double phi);
78
80 void setTranslation(double x, double y, double z);
81
83 void setGlobalParams(const TGeoMatrix& m);
84
86 void setTranslation(const TGeoMatrix& m);
87
88 // set rotation from the matrix of global delta
89 bool setRotation(const TGeoMatrix& m);
90
92
94 bool setLocalParams(double x, double y, double z, double psi, double theta, double phi);
95
97 bool setLocalTranslation(double x, double y, double z);
98
100 bool setLocalRotation(double psi, double theta, double phi);
101
103 bool setLocalParams(const TGeoMatrix& m);
104
106 bool setLocalTranslation(const TGeoMatrix& m);
107
109 bool setLocalRotation(const TGeoMatrix& m);
110
111 int getLevel() const;
112
113 void print() const;
114
115 int rectify(double zero = 1e-13);
116
117 protected:
118 bool matrixToAngles(const double* rot, double& psi, double& theta, double& phi) const;
119 void anglesToMatrix(double psi, double theta, double phi, double* rot) const;
120 void setMatrixRotation(double psi, double theta, double phi, TGeoHMatrix& dest) const;
121 void setMatrixTranslation(double x, double y, double z, TGeoHMatrix& dest) const;
122
123 private:
124 std::string mSymName{};
125
126 int mAlignableID = -1;
127
128 double mX = 0.;
129 double mY = 0.;
130 double mZ = 0.;
131
132 double mPsi = 0.;
133 double mTheta = 0.;
134 double mPhi = 0.;
135
136 ClassDefNV(AlignParam, 1);
137};
138
139} // namespace detectors
140} // namespace o2
141
142#endif
bool createLocalMatrix(TGeoHMatrix &m) const
extract local delta matrix
int getAlignableID() const
return alignable entry ID
Definition AlignParam.h:67
void setGlobalParams(double x, double y, double z, double psi, double theta, double phi)
================ methods for direct setting of delta params
int rectify(double zero=1e-13)
bool setLocalRotation(double psi, double theta, double phi)
set global delta rotation from the local delta rotation
void anglesToMatrix(double psi, double theta, double phi, double *rot) const
TGeoHMatrix createMatrix() const
extract global delta matrix
void setMatrixRotation(double psi, double theta, double phi, TGeoHMatrix &dest) const
void setRotation(double psi, double theta, double phi)
set global delta rotations angles in radian
double getTheta() const
Definition AlignParam.h:49
void setSymName(const char *m)
set symbolic name of the volume
Definition AlignParam.h:64
bool setLocalTranslation(double x, double y, double z)
set global delta translation from the local delta translation
const std::string & getSymName() const
return symbolic name of the volume
Definition AlignParam.h:45
double getPhi() const
iparamater's getters
Definition AlignParam.h:47
void setMatrixTranslation(double x, double y, double z, TGeoHMatrix &dest) const
bool setLocalParams(double x, double y, double z, double psi, double theta, double phi)
================ methods for setting global delta params from local delta
void setTranslation(double x, double y, double z)
set global delta displacements in cm
double getPsi() const
Definition AlignParam.h:48
bool applyToGeometry() const
apply object to geoemetry
void setAlignableID(int id)
set alignable entry ID
Definition AlignParam.h:70
bool matrixToAngles(const double *rot, double &psi, double &theta, double &phi) const
GLint GLenum GLint x
Definition glcorearb.h:403
const GLfloat * m
Definition glcorearb.h:4066
GLuint id
Definition glcorearb.h:650
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...