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"
14 class AliAlignObj : public TObject {
19 AliAlignObj(const AliAlignObj& theAlignObj);
20 AliAlignObj& operator= (const AliAlignObj& theAlignObj);
21 virtual ~AliAlignObj();
22 enum ELayerID{kSPD1=1, kSPD2=2,
26 kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
33 virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
34 virtual void SetTranslation(const TGeoMatrix& m) = 0;
35 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
36 virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
37 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
38 Double_t theta, Double_t phi) = 0;
39 virtual void SetMatrix(const TGeoMatrix& m) = 0;
40 void SetVolPath(const TString& volpath) {fVolPath=volpath;}
41 void SetVolUID(UShort_t voluid) {fVolUID=voluid;}
42 void SetVolUID(ELayerID layerId, Int_t modId);
45 const char *GetVolPath() const {return fVolPath.Data();}
46 UShort_t GetVolUID() const {return fVolUID;}
47 void GetVolUID(ELayerID &layerId, Int_t &modId) const;
48 virtual void GetTranslation(Double_t* tr) const=0;
49 virtual Bool_t GetAngles(Double_t* angles) const=0;
50 virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
51 virtual void GetMatrix(TGeoHMatrix& m) const=0;
53 void Print(Option_t *) const;
55 static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
56 static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
57 static ELayerID VolUIDToLayer(UShort_t voluid);
60 void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
61 Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
64 TString fVolPath; // Volume path inside TGeo geometry
65 UShort_t fVolUID; // Unique volume ID
67 ClassDef(AliAlignObj, 1)