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 //************************************************************************
12 #include "TGeoMatrix.h"
15 class AliTrackPointArray;
17 class AliAlignObj : public TObject {
22 AliAlignObj(const AliAlignObj& theAlignObj);
23 AliAlignObj& operator= (const AliAlignObj& theAlignObj);
24 virtual ~AliAlignObj();
25 enum ELayerID{kInvalidLayer=0,
31 kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
39 virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
40 virtual void SetTranslation(const TGeoMatrix& m) = 0;
41 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
42 virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
43 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
44 Double_t theta, Double_t phi) = 0;
45 virtual void SetMatrix(const TGeoMatrix& m) = 0;
46 void SetVolPath(const TString& volpath) {fVolPath=volpath;}
47 void SetVolUID(UShort_t voluid) {fVolUID=voluid;}
48 void SetVolUID(ELayerID layerId, Int_t modId);
51 const char *GetVolPath() const {return fVolPath.Data();}
52 UShort_t GetVolUID() const {return fVolUID;}
53 void GetVolUID(ELayerID &layerId, Int_t &modId) const;
54 virtual void GetTranslation(Double_t* tr) const=0;
55 virtual Bool_t GetAngles(Double_t* angles) const=0;
56 virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
57 virtual void GetMatrix(TGeoHMatrix& m) const=0;
59 virtual AliAlignObj& Inverse() const=0;
61 void Transform(AliTrackPoint &p) const;
62 void Transform(AliTrackPointArray &array) const;
64 void Print(Option_t *) const;
66 static Int_t LayerSize(Int_t layer) { return fgLayerSize[layer]; }
67 static const char* LayerName(Int_t layer) { return fgLayerName[layer]; }
69 static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
70 static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
71 static ELayerID VolUIDToLayer(UShort_t voluid);
73 static const char* GetVolPath(UShort_t voluid) {
75 ELayerID layerId = VolUIDToLayer(voluid,modId);
76 return GetVolPath(layerId,modId);
78 static const char* GetVolPath(ELayerID layerId, Int_t modId) { return fgVolPath[layerId-kFirstLayer][modId].Data(); }
82 void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
83 Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
88 TString fVolPath; // Volume path inside TGeo geometry
89 UShort_t fVolUID; // Unique volume ID
91 static Int_t fgLayerSize[kLastLayer - kFirstLayer];
92 static const char* fgLayerName[kLastLayer - kFirstLayer];
94 static TString* fgVolPath[kLastLayer - kFirstLayer];
96 ClassDef(AliAlignObj, 2)