]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliAlignObj.h
Bugfixes and clean-up of alignment object classes. Introduction of so called symbolic...
[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 *
b760c02e 6// information for a single volume, that is a displacement (a shift *
7// a rotation) plus the identity of the volume itself in form of a *
8// symbolic volume name (eventually a TGeo path) and as a unique *
9// integer identifier *
befe2c08 10//************************************************************************
c18195b9 11#include "TObject.h"
12#include "TString.h"
13#include "TGeoMatrix.h"
14
03b18860 15class AliTrackPoint;
16class AliTrackPointArray;
17
c18195b9 18class AliAlignObj : public TObject {
19
20 public:
21
877c3816 22 enum ELayerID{kInvalidLayer=0,
23 kFirstLayer=1,
98937d93 24 kSPD1=1, kSPD2=2,
befe2c08 25 kSDD1=3, kSDD2=4,
26 kSSD1=5, kSSD2=6,
27 kTPC1=7, kTPC2=8,
28 kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
29 kTOF=15,
30 kPHOS1=16, kPHOS2=17,
31 kRICH=18,
98937d93 32 kMUON=19,
33 kLastLayer=20};
d9cc42ed 34 AliAlignObj();
b760c02e 35 AliAlignObj(const char* symname, UShort_t voluid);
36 AliAlignObj(const char* symname, ELayerID detId, Int_t modId);
d9cc42ed 37 AliAlignObj(const AliAlignObj& theAlignObj);
38 AliAlignObj& operator= (const AliAlignObj& theAlignObj);
39 AliAlignObj& operator*=(const AliAlignObj& theAlignObj);
40 virtual ~AliAlignObj();
c18195b9 41
42 //Setters
43 virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
44 virtual void SetTranslation(const TGeoMatrix& m) = 0;
45 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
46 virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
47 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
b760c02e 48 Double_t theta, Double_t phi);
1bfe7ffc 49 virtual Bool_t SetLocalPars(Double_t x, Double_t y, Double_t z,
50 Double_t psi, Double_t theta, Double_t phi);
b760c02e 51 virtual Bool_t SetMatrix(const TGeoMatrix& m);
52 virtual Bool_t SetLocalMatrix(const TGeoMatrix& m);
53 void SetSymName(const TString& symname) {fVolPath=symname;}
cab6c0d0 54 void SetVolUID(UShort_t voluid) {fVolUID=voluid;}
befe2c08 55 void SetVolUID(ELayerID layerId, Int_t modId);
c18195b9 56
57 //Getters
b760c02e 58 const char *GetSymName() const {return fVolPath.Data();}
c18195b9 59 UShort_t GetVolUID() const {return fVolUID;}
befe2c08 60 void GetVolUID(ELayerID &layerId, Int_t &modId) const;
c18195b9 61 virtual void GetTranslation(Double_t* tr) const=0;
62 virtual Bool_t GetAngles(Double_t* angles) const=0;
b760c02e 63 virtual Bool_t GetPars(Double_t transl[], Double_t rot[]) const;
c18195b9 64 virtual void GetMatrix(TGeoHMatrix& m) const=0;
65
d9cc42ed 66 Bool_t IsSortable() const {return kTRUE;}
4b94e753 67 Int_t GetLevel() const;
68 virtual Int_t Compare(const TObject* obj) const;
69
03b18860 70 virtual AliAlignObj& Inverse() const=0;
71
72 void Transform(AliTrackPoint &p) const;
73 void Transform(AliTrackPointArray &array) const;
74
c18195b9 75 void Print(Option_t *) const;
76
c041444f 77 static Int_t LayerSize(Int_t layerId);
78 static const char* LayerName(Int_t layerId);
98937d93 79
befe2c08 80 static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
46ae650f 81 static UShort_t LayerToVolUID(Int_t layerId, Int_t modId);
befe2c08 82 static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
83 static ELayerID VolUIDToLayer(UShort_t voluid);
03b18860 84
b760c02e 85 static const char* SymName(UShort_t voluid);
86 static const char* SymName(ELayerID layerId, Int_t modId);
03b18860 87
995ad051 88 Bool_t ApplyToGeometry();
b760c02e 89 static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj);
995ad051 90
e1e6896f 91 static AliAlignObj* GetAlignObj(UShort_t voluid);
c5304981 92 static AliAlignObj* GetAlignObj(ELayerID layerId, Int_t modId);
93
c18195b9 94 protected:
95
96 void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
97 Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
98
b760c02e 99 static void InitSymNames();
100 static void InitAlignObjFromGeometry();
03b18860 101
c18195b9 102 //Volume identifiers
b760c02e 103 TString fVolPath; // Symbolic volume name; in case could coincide with
104 // the volume path inside TGeo geometry
98937d93 105 UShort_t fVolUID; // Unique volume ID
106
e1e6896f 107 static Int_t fgLayerSize[kLastLayer - kFirstLayer]; // Size of layers
108 static const char* fgLayerName[kLastLayer - kFirstLayer]; // Name of layers
03b18860 109
b760c02e 110 static TString* fgVolPath[kLastLayer - kFirstLayer]; // Symbolic volume names
e1e6896f 111 static AliAlignObj** fgAlignObjs[kLastLayer - kFirstLayer]; // Alignment objects
c5304981 112
03b18860 113 ClassDef(AliAlignObj, 2)
c18195b9 114};
115
c18195b9 116#endif