]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliAlignObj.h
Memory leak (Sacha)
[u/mrichter/AliRoot.git] / STEER / AliAlignObj.h
CommitLineData
c18195b9 1#ifndef ALIALIGNOBJ_H
2#define ALIALIGNOBJ_H
3
fdf65bb5 4//************************************************************************
5// AliAlignObj: alignment base class for the storage of alignment *
6// information for a single volume, that is a translation, a rotation *
7// and a the identity of the volume itself in form of a TGeo path and *
8// as a unique integer identifier *
9// ***********************************************************************
c18195b9 10#include "TObject.h"
11#include "TString.h"
12#include "TGeoMatrix.h"
13
14class AliAlignObj : public TObject {
15
16 public:
17
18 AliAlignObj();
19 AliAlignObj(const AliAlignObj& theAlignObj);
20 AliAlignObj& operator= (const AliAlignObj& theAlignObj);
21 virtual ~AliAlignObj();
22
23 //Setters
24 virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
25 virtual void SetTranslation(const TGeoMatrix& m) = 0;
26 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
27 virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
28 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
29 Double_t theta, Double_t phi) = 0;
30 virtual void SetMatrix(const TGeoMatrix& m) = 0;
31 void SetVolPath(const TString& volpath) {fVolPath=volpath;}
32 void SetVolUID(const UShort_t voluid) {fVolUID=voluid;}
33
34 //Getters
35 const char *GetVolPath() const {return fVolPath.Data();}
36 UShort_t GetVolUID() const {return fVolUID;}
37 virtual void GetTranslation(Double_t* tr) const=0;
38 virtual Bool_t GetAngles(Double_t* angles) const=0;
39 virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
40 virtual void GetMatrix(TGeoHMatrix& m) const=0;
41
42 void Print(Option_t *) const;
43
44 protected:
45
46 void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
47 Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
48
49 //Volume identifiers
50 TString fVolPath; // Volume path inside TGeo geometry
51 UShort_t fVolUID; // Unique volume ID
52
53 ClassDef(AliAlignObj, 1)
54};
55
fdf65bb5 56//****************************************************************************
57// AliAlignObjAngles: derived alignment class storing alignment information *
58// for a single volume in form of three doubles for the translation *
59// and three doubles for the rotation expressed with the euler angles *
60// in the xyz-convention (http://mathworld.wolfram.com/EulerAngles.html), *
61// also known as roll, pitch, yaw. PLEASE NOTE THE ANGLES SIGNS ARE *
62// INVERSE WITH RESPECT TO THIS REFERENCE!!! In this way the representation*
63// is fully consistent with the TGeo Rotation methods. *
64//****************************************************************************
c18195b9 65class AliAlignObjAngles : public AliAlignObj{
66 public:
67 AliAlignObjAngles();
68 AliAlignObjAngles(const AliAlignObjAngles& theAlignObj);
69 AliAlignObjAngles& operator= (const AliAlignObjAngles& theAlignObj);
70 virtual ~AliAlignObjAngles();
71
72 //Setters
73 virtual void SetTranslation(Double_t x, Double_t y, Double_t z){
74 fTranslation[0]=x; fTranslation[1]=y; fTranslation[2]=z;}
75 virtual void SetTranslation(const TGeoMatrix& m);
76 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi){
77 fRotation[0]=psi; fRotation[1]=theta; fRotation[2]=phi;}
78 virtual Bool_t SetRotation(const TGeoMatrix& m);
79 virtual void SetMatrix(const TGeoMatrix& m);
80 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
81 Double_t theta, Double_t phi){
82 fTranslation[0]=x; fTranslation[1]=y; fTranslation[2]=z;
83 fRotation[0]=psi; fRotation[1]=theta; fRotation[2]=phi;}
84
85 //Getters
86 virtual void GetTranslation(Double_t *tr) const {
87 tr[0] = fTranslation[0]; tr[1] = fTranslation[1]; tr[2] = fTranslation[2];}
88 virtual Bool_t GetAngles(Double_t* angles) const {
89 angles[0] = fRotation[0]; angles[1] = fRotation[1];
90 angles[2] = fRotation[2]; return kTRUE;}
91 virtual void GetPars(Double_t tr[], Double_t angles[]) const;
92 virtual void GetMatrix(TGeoHMatrix& m) const;
93
94 protected:
95 Double_t fTranslation[3]; // Translation vector
96 Double_t fRotation[3]; // Roll-pitch-yaw angles
97
98 ClassDef(AliAlignObjAngles, 1)
99};
100
101/**************************************************************************
102 * AliAlignObjMatrix: derived alignment class storing alignment *
103 * information for a single volume in form of TGeoHMatrix, which *
104 * includes the information for a translation, a rotation and a scale *
105 *************************************************************************/
106class AliAlignObjMatrix : public AliAlignObj {
107 public:
108 AliAlignObjMatrix();
109 AliAlignObjMatrix(const AliAlignObjMatrix& theAlignObj);
110 AliAlignObjMatrix& operator= (const AliAlignObjMatrix& theAlignObj);
111 virtual ~AliAlignObjMatrix();
112
113 //Setters
114 virtual void SetTranslation(Double_t x, Double_t y, Double_t z);
115 virtual void SetTranslation(const TGeoMatrix& m);
116 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi);
117 virtual Bool_t SetRotation(const TGeoMatrix& m);
118 virtual void SetMatrix(const TGeoMatrix& m);
119 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
120 Double_t theta, Double_t phi);
121 //Getters
122 virtual void GetTranslation(Double_t* tr) const;
123 virtual Bool_t GetAngles(Double_t* angles) const;
124 virtual void GetPars(Double_t tr[], Double_t rot[]) const;
125 virtual void GetMatrix(TGeoHMatrix& m) const;
126
127 protected:
128 TGeoHMatrix fMatrix; // Transformation matrix
129
130 ClassDef(AliAlignObjMatrix, 1)
131};
132
133#endif