]>
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" | |
25be1e5c | 17 | #include "AliGeomManager.h" |
18 | ||
c18195b9 | 19 | |
03b18860 | 20 | class AliTrackPoint; |
21 | class AliTrackPointArray; | |
22 | ||
c18195b9 | 23 | class AliAlignObj : public TObject { |
24 | ||
25 | public: | |
26 | ||
d9cc42ed | 27 | AliAlignObj(); |
b760c02e | 28 | AliAlignObj(const char* symname, UShort_t voluid); |
25be1e5c | 29 | AliAlignObj(const char* symname, AliGeomManager::ELayerID detId, Int_t modId); |
d9cc42ed | 30 | AliAlignObj(const AliAlignObj& theAlignObj); |
31 | AliAlignObj& operator= (const AliAlignObj& theAlignObj); | |
32 | AliAlignObj& operator*=(const AliAlignObj& theAlignObj); | |
33 | virtual ~AliAlignObj(); | |
c18195b9 | 34 | |
35 | //Setters | |
36 | virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0; | |
37 | virtual void SetTranslation(const TGeoMatrix& m) = 0; | |
32898fe7 | 38 | virtual Bool_t SetLocalTranslation(Double_t x, Double_t y, Double_t z); |
39 | virtual Bool_t SetLocalTranslation(const TGeoMatrix& m); | |
c18195b9 | 40 | virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0; |
41 | virtual Bool_t SetRotation(const TGeoMatrix& m) = 0; | |
32898fe7 | 42 | virtual Bool_t SetLocalRotation(Double_t psi, Double_t theta, Double_t phi); |
43 | virtual Bool_t SetLocalRotation(const TGeoMatrix& m); | |
c18195b9 | 44 | virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi, |
b760c02e | 45 | Double_t theta, Double_t phi); |
1bfe7ffc | 46 | virtual Bool_t SetLocalPars(Double_t x, Double_t y, Double_t z, |
47 | Double_t psi, Double_t theta, Double_t phi); | |
b760c02e | 48 | virtual Bool_t SetMatrix(const TGeoMatrix& m); |
49 | virtual Bool_t SetLocalMatrix(const TGeoMatrix& m); | |
50 | void SetSymName(const TString& symname) {fVolPath=symname;} | |
cab6c0d0 | 51 | void SetVolUID(UShort_t voluid) {fVolUID=voluid;} |
25be1e5c | 52 | void SetVolUID(AliGeomManager::ELayerID layerId, Int_t modId); |
c18195b9 | 53 | |
54 | //Getters | |
b760c02e | 55 | const char *GetSymName() const {return fVolPath.Data();} |
c18195b9 | 56 | UShort_t GetVolUID() const {return fVolUID;} |
25be1e5c | 57 | void GetVolUID(AliGeomManager::ELayerID &layerId, Int_t &modId) const; |
c18195b9 | 58 | virtual void GetTranslation(Double_t* tr) const=0; |
32898fe7 | 59 | virtual Bool_t GetLocalTranslation(Double_t* tr) const; |
c18195b9 | 60 | virtual Bool_t GetAngles(Double_t* angles) const=0; |
32898fe7 | 61 | virtual Bool_t GetLocalAngles(Double_t* angles) const; |
62 | virtual Bool_t GetPars(Double_t transl[], Double_t angles[]) const; | |
63 | virtual Bool_t GetLocalPars(Double_t transl[], Double_t angles[]) const; | |
c18195b9 | 64 | virtual void GetMatrix(TGeoHMatrix& m) const=0; |
32898fe7 | 65 | virtual Bool_t GetLocalMatrix(TGeoHMatrix& m) const; |
c18195b9 | 66 | |
d9cc42ed | 67 | Bool_t IsSortable() const {return kTRUE;} |
4b94e753 | 68 | Int_t GetLevel() const; |
69 | virtual Int_t Compare(const TObject* obj) const; | |
70 | ||
03b18860 | 71 | virtual AliAlignObj& Inverse() const=0; |
72 | ||
73 | void Transform(AliTrackPoint &p) const; | |
74 | void Transform(AliTrackPointArray &array) const; | |
75 | ||
c18195b9 | 76 | void Print(Option_t *) const; |
77 | ||
25be1e5c | 78 | static Int_t LayerSize(Int_t layerId) {return AliGeomManager::LayerSize(layerId);} |
79 | static const char* LayerName(Int_t layerId) {return AliGeomManager::LayerName(layerId);} | |
98937d93 | 80 | |
25be1e5c | 81 | static UShort_t LayerToVolUID(AliGeomManager::ELayerID layerId, Int_t modId) {return AliGeomManager::LayerToVolUID(layerId, modId);} |
82 | static UShort_t LayerToVolUID(Int_t layerId, Int_t modId) {return AliGeomManager::LayerToVolUID(layerId, modId);} | |
83 | static AliGeomManager::ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId) {return AliGeomManager::VolUIDToLayer(voluid, modId);} | |
84 | static AliGeomManager::ELayerID VolUIDToLayer(UShort_t voluid) {return AliGeomManager::VolUIDToLayer(voluid);} | |
85 | static UShort_t LayerToVolUIDSafe(AliGeomManager::ELayerID layerId, Int_t modId) {return AliGeomManager::LayerToVolUIDSafe(layerId, modId);} | |
86 | static UShort_t LayerToVolUIDSafe(Int_t layerId, Int_t modId) {return AliGeomManager::LayerToVolUIDSafe(layerId, modId);} | |
87 | static AliGeomManager::ELayerID VolUIDToLayerSafe(UShort_t voluid, Int_t &modId) {return AliGeomManager::VolUIDToLayerSafe(voluid, modId);} | |
88 | static AliGeomManager::ELayerID VolUIDToLayerSafe(UShort_t voluid) {return AliGeomManager::VolUIDToLayerSafe(voluid);} | |
03b18860 | 89 | |
25be1e5c | 90 | static const char* SymName(UShort_t voluid) {return AliGeomManager::SymName(voluid);} |
91 | static const char* SymName(AliGeomManager::ELayerID layerId, Int_t modId) {return AliGeomManager::SymName(layerId, modId);} | |
03b18860 | 92 | |
995ad051 | 93 | Bool_t ApplyToGeometry(); |
25be1e5c | 94 | static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj) {return AliGeomManager::GetFromGeometry(symname, alobj);} |
995ad051 | 95 | |
25be1e5c | 96 | static AliAlignObj* GetAlignObj(UShort_t voluid) {return AliGeomManager::GetAlignObj(voluid);} |
97 | static AliAlignObj* GetAlignObj(AliGeomManager::ELayerID layerId, Int_t modId) {return AliGeomManager::GetAlignObj(layerId, modId);} | |
c5304981 | 98 | |
25be1e5c | 99 | static Bool_t GetOrigGlobalMatrix(const char *symname, TGeoHMatrix &m) {return AliGeomManager::GetOrigGlobalMatrix(symname, m);} |
276cb1b1 | 100 | |
c18195b9 | 101 | protected: |
102 | ||
103 | void AnglesToMatrix(const Double_t *angles, Double_t *rot) const; | |
104 | Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const; | |
105 | ||
106 | //Volume identifiers | |
b760c02e | 107 | TString fVolPath; // Symbolic volume name; in case could coincide with |
ff2dbca1 | 108 | // the volume path inside TGeo geometry (for non-alignable volumes) |
98937d93 | 109 | UShort_t fVolUID; // Unique volume ID |
110 | ||
03b18860 | 111 | ClassDef(AliAlignObj, 2) |
c18195b9 | 112 | }; |
113 | ||
c18195b9 | 114 | #endif |