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