AliRoot Core  edcc906 (edcc906)
AliGeomManager.h
Go to the documentation of this file.
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 the
6 // look-up tables for fast access to geometry and alignment information
7 // for sensitive alignable volumes:
8 // 1) the look-up table mapping unique volume ids to TGeoPNEntries
9 // this allows to access directly by means of the unique index
10 // the associated symbolic name and original global matrix
11 // in addition to the functionality of the physical node
12 // associated to a given alignable volume
13 // 2) the look-up table of the alignment objects associated to the
14 // indexed alignable volumes
15 //
16 
17 #include <TObject.h>
18 
19 class TGeoManager;
20 class TGeoPNEntry;
21 class TGeoHMatrix;
22 class TObjArray;
23 
24 class AliAlignObj;
25 class AliCDBId;
26 class AliCDBParam;
27 
28 class AliGeomManager: public TObject {
29 
30 public:
33  kSPD1=1, kSPD2=2,
34  kSDD1=3, kSDD2=4,
35  kSSD1=5, kSSD2=6,
36  kTPC1=7, kTPC2=8,
37  kTRD1=9, kTRD2=10, kTRD3=11, kTRD4=12, kTRD5=13, kTRD6=14,
38  kTOF=15,
39  kPHOS1=16, kPHOS2=17,
40  kHMPID=18,
41  kMUON=19,
42  kEMCAL=20,
44 
45  static TGeoManager* GetGeometry() { return fgGeometry; }
46  static void Destroy();
47 
48  static Int_t LayerSize(Int_t layerId);
49  static const char* LayerName(Int_t layerId);
50  static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
51  static UShort_t LayerToVolUID(Int_t layerId, Int_t modId);
52  static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
53  static ELayerID VolUIDToLayer(UShort_t voluid);
54  static UShort_t LayerToVolUIDSafe(ELayerID layerId, Int_t modId);
55  static UShort_t LayerToVolUIDSafe(Int_t layerId, Int_t modId);
56  static ELayerID VolUIDToLayerSafe(UShort_t voluid, Int_t &modId);
57  static ELayerID VolUIDToLayerSafe(UShort_t voluid);
58 
59  static const char* SymName(UShort_t voluid);
60  static const char* SymName(ELayerID layerId, Int_t modId);
61 
62  static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj);
63  static AliAlignObj* GetAlignObj(UShort_t voluid);
64  static AliAlignObj* GetAlignObj(ELayerID layerId, Int_t modId);
65 
66  //to be used making a copy of the returned pointer to TGeoHMatrix!!
67  static TGeoHMatrix* GetMatrix(Int_t index);
68  static TGeoHMatrix* GetMatrix(const char *symname);
69  static Bool_t GetTranslation(Int_t index, Double_t t[3]);
70  static Bool_t GetRotation(Int_t index, Double_t r[9]);
71 
72  static Bool_t GetDeltaForBranch(AliAlignObj& aao, TGeoHMatrix &inclusiveD);
73  static Bool_t GetDeltaForBranch(Int_t index, TGeoHMatrix &inclusiveD);
74  static TGeoHMatrix* GetOrigGlobalMatrix(Int_t index);
75  static Bool_t GetOrigGlobalMatrix(const char *symname, TGeoHMatrix &m);
76  static Bool_t GetOrigTranslation(Int_t index, Double_t t[3]);
77  static Bool_t GetOrigRotation(Int_t index, Double_t r[9]);
78 
79  static const TGeoHMatrix* GetTracking2LocalMatrix(Int_t index);
80  static Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m);
81 
82  static void LoadGeometry(const char *geomFileName = NULL);
83  static void SetGeometry(TGeoManager * const geom);
84  static void CheckOverlapsOverPNs(Double_t threshold);
85 
86  static Bool_t ApplyAlignObjsToGeom(TObjArray& alObjArray, Bool_t ovlpcheck=kFALSE);
87 
88  static Bool_t ApplyAlignObjsToGeom(const char* fileName,
89  const char* clArrayName);
90  static Bool_t ApplyAlignObjsToGeom(const char* uri, const char* path,
91  Int_t runnum, Int_t version,
92  Int_t sversion);
93  static Bool_t ApplyAlignObjsToGeom(const char* detName, Int_t runnum, Int_t version,
94  Int_t sversion);
95  static Bool_t ApplyAlignObjsFromCDB(const char* AlDetsList);
96  static Bool_t LoadAlignObjsFromCDBSingleDet(const char* detName, TObjArray& alignObjArray);
97  static Bool_t CheckSymNamesLUT(const char* detsToBeChecked);
98  static Int_t GetNalignable(const char* module);
99 
100  ~AliGeomManager();
101 
102  private:
103  AliGeomManager();
106 
107  static TGeoHMatrix* GetMatrix(TGeoPNEntry *pne);
108  static TGeoHMatrix* GetOrigGlobalMatrix(TGeoPNEntry * const pne);
109  static Bool_t GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m);
110 
111  static TGeoPNEntry* GetPNEntry(Int_t index);
112  static TGeoPNEntry* GetPNEntry(ELayerID layerId, Int_t modId);
113 
114  static void ResetPNEntriesLUT();
115  static void InitAlignObjFromGeometry();
116  static void InitPNEntriesLUT();
117  static void InitNalignable();
118 
119  static TGeoManager* fgGeometry;
120 
121  static Int_t fgLayerSize[kLastLayer - kFirstLayer]; // Size of layers
122  static const char* fgLayerName[kLastLayer - kFirstLayer]; // Name of layers
123  static TGeoPNEntry** fgPNEntry[kLastLayer - kFirstLayer]; // TGeoPNEntries
124  static AliAlignObj** fgAlignObjs[kLastLayer - kFirstLayer]; // Alignment objects
125  static const Int_t fgkNDetectors = 18; // number of detectors + AD
126  static const char * fgkDetectorName[fgkNDetectors] ; // name of detectors
128 
129  ClassDef(AliGeomManager, 0); // Manager of geometry information for alignment
130 };
131 
132 #endif
static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj)
static void InitAlignObjFromGeometry()
static Bool_t GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m)
static void CheckOverlapsOverPNs(Double_t threshold)
static const char * SymName(UShort_t voluid)
static Int_t fgLayerSize[kLastLayer-kFirstLayer]
static AliAlignObj * GetAlignObj(UShort_t voluid)
static void Destroy()
static const char * LayerName(Int_t layerId)
static AliAlignObj ** fgAlignObjs[kLastLayer-kFirstLayer]
#define TObjArray
static Int_t GetNalignable(const char *module)
const char * path
static Bool_t ApplyAlignObjsFromCDB(const char *AlDetsList)
static Bool_t GetOrigRotation(Int_t index, Double_t r[9])
static TGeoManager * fgGeometry
static Int_t fgNalignable[fgkNDetectors]
static TGeoHMatrix * GetOrigGlobalMatrix(Int_t index)
static TGeoHMatrix * GetMatrix(Int_t index)
static Int_t LayerSize(Int_t layerId)
static void InitNalignable()
static ELayerID VolUIDToLayerSafe(UShort_t voluid, Int_t &modId)
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
static const Int_t fgkNDetectors
static Bool_t LoadAlignObjsFromCDBSingleDet(const char *detName, TObjArray &alignObjArray)
static void InitPNEntriesLUT()
static const TGeoHMatrix * GetTracking2LocalMatrix(Int_t index)
static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId)
AliGeomManager & operator=(const AliGeomManager &)
static const char * fgkDetectorName[fgkNDetectors]
static void SetGeometry(TGeoManager *const geom)
static Bool_t GetDeltaForBranch(AliAlignObj &aao, TGeoHMatrix &inclusiveD)
static Bool_t GetRotation(Int_t index, Double_t r[9])
static TGeoPNEntry * GetPNEntry(Int_t index)
static Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m)
static void ResetPNEntriesLUT()
static Bool_t CheckSymNamesLUT(const char *detsToBeChecked)
static Bool_t ApplyAlignObjsToGeom(TObjArray &alObjArray, Bool_t ovlpcheck=kFALSE)
static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId)
static const char * fgLayerName[kLastLayer-kFirstLayer]
static TGeoPNEntry ** fgPNEntry[kLastLayer-kFirstLayer]
TEveGeoShape * geom
Definition: tpc_tracks.C:10
static TGeoManager * GetGeometry()
static Bool_t GetTranslation(Int_t index, Double_t t[3])
static void LoadGeometry(const char *geomFileName=NULL)
static UShort_t LayerToVolUIDSafe(ELayerID layerId, Int_t modId)
static Bool_t GetOrigTranslation(Int_t index, Double_t t[3])