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 bool convertLocalToGlobal = true); // if local is provided, convert it to global
42
43 AlignParam(const char* symname, int algID, TGeoMatrix& m,
44 bool global = true, // global (preferable) or local delta definition
45 bool convertLocalToGlobal = true); // if local is provided, convert it to global
46
48 const std::string& getSymName() const { return mSymName; }
50 double getPhi() const { return mPhi; }
51 double getPsi() const { return mPsi; }
52 double getTheta() const { return mTheta; }
53 double getX() const { return mX; }
54 double getY() const { return mY; }
55 double getZ() const { return mZ; }
56
58 bool applyToGeometry() const;
59
61 TGeoHMatrix createMatrix() const;
62
64 bool createLocalMatrix(TGeoHMatrix& m) const;
65
67 void setSymName(const char* m) { mSymName = m; }
68
70 int getAlignableID() const { return mAlignableID; }
71
73 void setAlignableID(int id) { mAlignableID = id; }
75
77 void setParams(double x, double y, double z, double psi, double theta, double phi);
78
80 void setGlobalParams(double x, double y, double z, double psi, double theta, double phi);
81
83 void setRotation(double psi, double theta, double phi);
84
86 void setTranslation(double x, double y, double z);
87
89 void setGlobalParams(const TGeoMatrix& m);
90
92 void setTranslation(const TGeoMatrix& m);
93
94 // set rotation from the matrix of global delta
95 bool setRotation(const TGeoMatrix& m);
96
98
100 bool setLocalParams(double x, double y, double z, double psi, double theta, double phi);
101
103 bool setLocalTranslation(double x, double y, double z);
104
106 bool setLocalRotation(double psi, double theta, double phi);
107
109 bool setLocalParams(const TGeoMatrix& m);
110
112 bool setLocalTranslation(const TGeoMatrix& m);
113
115 bool setLocalRotation(const TGeoMatrix& m);
116
117 int getLevel() const;
118
119 void print() const;
120
121 int rectify(double zero = 1e-13);
122
123 bool isGlobal() const { return mIsGlobal; }
124 void setIsGlobal(bool v) { mIsGlobal = v; }
125
126 protected:
127 bool matrixToAngles(const double* rot, double& psi, double& theta, double& phi) const;
128 void anglesToMatrix(double psi, double theta, double phi, double* rot) const;
129 void setMatrixRotation(double psi, double theta, double phi, TGeoHMatrix& dest) const;
130 void setMatrixTranslation(double x, double y, double z, TGeoHMatrix& dest) const;
131
132 private:
133 std::string mSymName{};
134
135 bool mIsGlobal = true;
136 int mAlignableID = -1;
137 double mX = 0.;
138 double mY = 0.;
139 double mZ = 0.;
140
141 double mPsi = 0.;
142 double mTheta = 0.;
143 double mPhi = 0.;
144
145 ClassDefNV(AlignParam, 2);
146};
147
148} // namespace detectors
149} // namespace o2
150
151#endif
void setParams(double x, double y, double z, double psi, double theta, double phi)
================ methods for direct setting of delta params
bool createLocalMatrix(TGeoHMatrix &m) const
extract local delta matrix
int getAlignableID() const
return alignable entry ID
Definition AlignParam.h:70
void setGlobalParams(double x, double y, double z, double psi, double theta, double phi)
set parameters of global delta
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:52
void setSymName(const char *m)
set symbolic name of the volume
Definition AlignParam.h:67
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:48
double getPhi() const
iparamater's getters
Definition AlignParam.h:50
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:51
bool applyToGeometry() const
apply object to geoemetry
void setAlignableID(int id)
set alignable entry ID
Definition AlignParam.h:73
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
const GLdouble * v
Definition glcorearb.h:832
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 ...