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