Updated for changing the way reference position is handled by AliMpSlat
[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 *
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 *
befe2c08 9//************************************************************************
c18195b9 10#include "TObject.h"
11#include "TString.h"
12#include "TGeoMatrix.h"
13
14class AliAlignObj : public TObject {
15
16 public:
17
18 AliAlignObj();
19 AliAlignObj(const AliAlignObj& theAlignObj);
20 AliAlignObj& operator= (const AliAlignObj& theAlignObj);
21 virtual ~AliAlignObj();
98937d93 22 enum ELayerID{kFirstLayer=1,
23 kSPD1=1, kSPD2=2,
befe2c08 24 kSDD1=3, kSDD2=4,
25 kSSD1=5, kSSD2=6,
26 kTPC1=7, kTPC2=8,
27 kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
28 kTOF=15,
29 kPHOS1=16, kPHOS2=17,
30 kRICH=18,
98937d93 31 kMUON=19,
32 kLastLayer=20};
c18195b9 33
34 //Setters
35 virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
36 virtual void SetTranslation(const TGeoMatrix& m) = 0;
37 virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
38 virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
39 virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
40 Double_t theta, Double_t phi) = 0;
41 virtual void SetMatrix(const TGeoMatrix& m) = 0;
42 void SetVolPath(const TString& volpath) {fVolPath=volpath;}
cab6c0d0 43 void SetVolUID(UShort_t voluid) {fVolUID=voluid;}
befe2c08 44 void SetVolUID(ELayerID layerId, Int_t modId);
c18195b9 45
46 //Getters
47 const char *GetVolPath() const {return fVolPath.Data();}
48 UShort_t GetVolUID() const {return fVolUID;}
befe2c08 49 void GetVolUID(ELayerID &layerId, Int_t &modId) const;
c18195b9 50 virtual void GetTranslation(Double_t* tr) const=0;
51 virtual Bool_t GetAngles(Double_t* angles) const=0;
52 virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
53 virtual void GetMatrix(TGeoHMatrix& m) const=0;
54
55 void Print(Option_t *) const;
56
98937d93 57 static Int_t LayerSize(Int_t layer) { return fgLayerSize[layer]; }
58 static const char* LayerName(Int_t layer) { return fgLayerName[layer]; }
59
befe2c08 60 static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
61 static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
62 static ELayerID VolUIDToLayer(UShort_t voluid);
c18195b9 63 protected:
64
65 void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
66 Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
67
68 //Volume identifiers
98937d93 69 TString fVolPath; // Volume path inside TGeo geometry
70 UShort_t fVolUID; // Unique volume ID
71
72 static Int_t fgLayerSize[kLastLayer - kFirstLayer];
73 static const char* fgLayerName[kLastLayer - kFirstLayer];
c18195b9 74
75 ClassDef(AliAlignObj, 1)
76};
77
c18195b9 78#endif