]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliGeomManager.h
First implementation of the raw data error logger
[u/mrichter/AliRoot.git] / STEER / AliGeomManager.h
CommitLineData
67dd5535 1#ifndef ALI_GEOM_MANAGER_H
2#define ALI_GEOM_MANAGER_H
3
4//
5// Class for interfacing to the geometry; it also builds and manages two
6// look-up tables for fast access to volumes :
7// 1) the look-up table mapping unique volume ids to symbolic volume names
8// 2) the look-up table mapping unique volume ids to TGeoPNEntries
9// this allows to access directly the functionality of the physical node
10// associated to a given alignable volume by means of its index
11//
12
13#include <TObject.h>
36b010bf 14
15class TGeoManager;
16class TGeoPNEntry;
17class TGeoHMatrix;
67dd5535 18
19class TObjArray;
20
21class AliAlignObj;
22class AliCDBId;
23class AliCDBParam;
24
25class AliGeomManager: public TObject {
26
27public:
28 enum ELayerID{kInvalidLayer=0,
29 kFirstLayer=1,
30 kSPD1=1, kSPD2=2,
31 kSDD1=3, kSDD2=4,
32 kSSD1=5, kSSD2=6,
33 kTPC1=7, kTPC2=8,
34 kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
35 kTOF=15,
36 kPHOS1=16, kPHOS2=17,
37 kHMPID=18,
38 kMUON=19,
39 kLastLayer=20};
40
41
42 static Int_t LayerSize(Int_t layerId);
43 static const char* LayerName(Int_t layerId);
44 static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
45 static UShort_t LayerToVolUID(Int_t layerId, Int_t modId);
46 static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
47 static ELayerID VolUIDToLayer(UShort_t voluid);
48 static UShort_t LayerToVolUIDSafe(ELayerID layerId, Int_t modId);
49 static UShort_t LayerToVolUIDSafe(Int_t layerId, Int_t modId);
50 static ELayerID VolUIDToLayerSafe(UShort_t voluid, Int_t &modId);
51 static ELayerID VolUIDToLayerSafe(UShort_t voluid);
52
53 static const char* SymName(UShort_t voluid);
54 static const char* SymName(ELayerID layerId, Int_t modId);
55
67dd5535 56 static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj);
57 static AliAlignObj* GetAlignObj(UShort_t voluid);
58 static AliAlignObj* GetAlignObj(ELayerID layerId, Int_t modId);
59
25fad4e5 60 //to be used making a copy of the returned pointer to TGeoHMatrix!!
67dd5535 61 static TGeoHMatrix* GetMatrix(Int_t index);
62 static TGeoHMatrix* GetMatrix(const char *symname);
63 static Bool_t GetTranslation(Int_t index, Double_t t[3]);
64 static Bool_t GetRotation(Int_t index, Double_t r[9]);
65
36b010bf 66 static TGeoHMatrix* GetOrigGlobalMatrix(Int_t index);
67dd5535 67 static Bool_t GetOrigGlobalMatrix(const char *symname, TGeoHMatrix &m);
68 static Bool_t GetOrigTranslation(Int_t index, Double_t t[3]);
69 static Bool_t GetOrigRotation(Int_t index, Double_t r[9]);
70
71 static const TGeoHMatrix* GetTracking2LocalMatrix(Int_t index);
72 static Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m);
73
36b010bf 74 static void LoadGeometry(const char *geomFileName = NULL);
75
76 static Bool_t ApplyAlignObjsToGeom(TObjArray& alObjArray);
67dd5535 77
36b010bf 78 static Bool_t ApplyAlignObjsToGeom(const char* fileName,
67dd5535 79 const char* clArrayName);
36b010bf 80 static Bool_t ApplyAlignObjsToGeom(AliCDBParam* param,
67dd5535 81 AliCDBId& Id);
36b010bf 82 static Bool_t ApplyAlignObjsToGeom(const char* uri, const char* path,
67dd5535 83 Int_t runnum, Int_t version,
84 Int_t sversion);
36b010bf 85 static Bool_t ApplyAlignObjsToGeom(const char* detName, Int_t runnum, Int_t version,
67dd5535 86 Int_t sversion);
87
36b010bf 88 static Bool_t ApplyAlignObjsFromCDB(const char* AlDetsList);
89 static Bool_t LoadAlignObjsFromCDBSingleDet(const char* detName, TObjArray& alignObjArray);
67dd5535 90
91 ~AliGeomManager();
67dd5535 92
36b010bf 93 private:
94 AliGeomManager();
95 AliGeomManager(const AliGeomManager&);
96 AliGeomManager& operator=(const AliGeomManager&);
97
98 static TGeoHMatrix* GetMatrix(TGeoPNEntry* pne);
99 static TGeoHMatrix* GetOrigGlobalMatrix(TGeoPNEntry* pne);
100 static Bool_t GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m);
67dd5535 101
36b010bf 102 static TGeoPNEntry* GetPNEntry(Int_t index);
103 static TGeoPNEntry* GetPNEntry(ELayerID layerId, Int_t modId);
67dd5535 104
105 static void InitAlignObjFromGeometry();
106 static void InitSymNamesLUT();
107 static void InitPNEntriesLUT();
36b010bf 108 static void InitOrigMatricesLUT();
109
110 static TGeoManager* fgGeometry;
67dd5535 111
112 static Int_t fgLayerSize[kLastLayer - kFirstLayer]; // Size of layers
113 static const char* fgLayerName[kLastLayer - kFirstLayer]; // Name of layers
114 static TString* fgSymName[kLastLayer - kFirstLayer]; // Symbolic volume names
115 static TGeoPNEntry** fgPNEntry[kLastLayer - kFirstLayer]; // TGeoPNEntries
36b010bf 116 static TGeoHMatrix** fgOrigMatrix[kLastLayer - kFirstLayer]; // Original matrices before misalignment
67dd5535 117 static AliAlignObj** fgAlignObjs[kLastLayer - kFirstLayer]; // Alignment objects
118
67dd5535 119 ClassDef(AliGeomManager, 0);
120};
121
122#endif