]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAlignObj.h
Call the MC QA only in case of debug
[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 displacement (a shift    *
7 //   a rotation) plus the identity of the volume itself in form of a     *
8 //   symbolic volume name (eventually a TGeo path) and as a unique       *
9 //   integer identifier                                                  *
10 //************************************************************************
11 #include "TObject.h"
12 #include "TString.h"
13 #include "TGeoMatrix.h"
14
15 class AliTrackPoint;
16 class AliTrackPointArray;
17
18 class AliAlignObj : public TObject {
19
20  public:
21
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   AliAlignObj();
35   AliAlignObj(const char* symname, UShort_t voluid);
36   AliAlignObj(const char* symname, ELayerID detId, Int_t modId);
37   AliAlignObj(const AliAlignObj& theAlignObj);
38   AliAlignObj& operator= (const AliAlignObj& theAlignObj);
39   AliAlignObj& operator*=(const AliAlignObj& theAlignObj);
40   virtual ~AliAlignObj();
41
42   //Setters
43   virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
44   virtual void SetTranslation(const TGeoMatrix& m) = 0;
45   virtual void SetRotation(Double_t psi, Double_t theta, Double_t phi) = 0;
46   virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
47   virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
48                Double_t theta, Double_t phi);
49   virtual Bool_t SetLocalPars(Double_t x, Double_t y, Double_t z,
50                               Double_t psi, Double_t theta, Double_t phi);
51   virtual Bool_t SetMatrix(const TGeoMatrix& m);
52   virtual Bool_t SetLocalMatrix(const TGeoMatrix& m);
53   void  SetSymName(const TString& symname) {fVolPath=symname;}
54   void  SetVolUID(UShort_t voluid) {fVolUID=voluid;}
55   void  SetVolUID(ELayerID layerId, Int_t modId);
56
57   //Getters
58   const char  *GetSymName()    const {return fVolPath.Data();}
59   UShort_t     GetVolUID()     const {return fVolUID;}
60   void         GetVolUID(ELayerID &layerId, Int_t &modId) const;
61   virtual void GetTranslation(Double_t* tr)  const=0;
62   virtual Bool_t GetAngles(Double_t* angles) const=0;
63   virtual Bool_t GetPars(Double_t transl[], Double_t rot[]) const;
64   virtual void GetMatrix(TGeoHMatrix& m) const=0;
65
66   Bool_t   IsSortable() const {return kTRUE;}
67   Int_t         GetLevel() const;
68   virtual Int_t Compare(const TObject* obj) const;
69
70   virtual AliAlignObj& Inverse() const=0;
71
72   void  Transform(AliTrackPoint &p) const;
73   void  Transform(AliTrackPointArray &array) const;
74
75   void  Print(Option_t *) const;
76
77   static Int_t       LayerSize(Int_t layerId);
78   static const char* LayerName(Int_t layerId);
79
80   static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
81   static UShort_t LayerToVolUID(Int_t    layerId, Int_t modId);
82   static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
83   static ELayerID VolUIDToLayer(UShort_t voluid);
84
85   static const char* SymName(UShort_t voluid);
86   static const char* SymName(ELayerID layerId, Int_t modId);
87
88   Bool_t ApplyToGeometry();
89   static Bool_t   GetFromGeometry(const char *symname, AliAlignObj &alobj);
90
91   static AliAlignObj* GetAlignObj(UShort_t voluid);
92   static AliAlignObj* GetAlignObj(ELayerID layerId, Int_t modId);
93
94  protected:
95
96   void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
97   Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
98
99   static void InitSymNames();
100   static void InitAlignObjFromGeometry();
101
102   //Volume identifiers
103   TString  fVolPath; // Symbolic volume name; in case could coincide with
104                      // the volume path inside TGeo geometry
105   UShort_t fVolUID;  // Unique volume ID
106
107   static Int_t       fgLayerSize[kLastLayer - kFirstLayer]; // Size of layers
108   static const char* fgLayerName[kLastLayer - kFirstLayer]; // Name of layers
109
110   static TString*    fgVolPath[kLastLayer - kFirstLayer]; // Symbolic volume names
111   static AliAlignObj** fgAlignObjs[kLastLayer - kFirstLayer]; // Alignment objects
112
113   ClassDef(AliAlignObj, 2)
114 };
115
116 #endif