]>
Commit | Line | Data |
---|---|---|
6ddbe5ad | 1 | #ifndef ALIITSGEOMTGEO_H |
2 | #define ALIITSGEOMTGEO_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | ///////////////////////////////////////////////////////////////////////// | |
7 | // AliITSgeomTGeo is a simple interface class to TGeoManager // | |
8 | // It is used in the simulation and reconstruction in order to // | |
9 | // query the TGeo ITS geometry // | |
10 | // // | |
11 | // author - cvetan.cheshkov@cern.ch // | |
12 | // 15/02/2007 // | |
13 | ///////////////////////////////////////////////////////////////////////// | |
14 | ||
15 | #include <TObject.h> | |
16 | #include <TGeoMatrix.h> | |
17 | ||
18 | class TGeoPNEntry; | |
19 | ||
20 | class AliITSgeomTGeo : public TObject { | |
21 | ||
22 | public: | |
23 | ||
24 | AliITSgeomTGeo() { } // Default constructor | |
25 | virtual ~AliITSgeomTGeo() { } // Destructor | |
26 | ||
27 | // This function returns the number of detectors/ladder for a given layer | |
28 | static Int_t GetNDetectors(Int_t lay) {return fgkNDetectors[lay-1];} | |
29 | // This function returns the number of ladders for a given layer | |
30 | static Int_t GetNLadders(Int_t lay) {return fgkNLadders[lay-1];} | |
31 | // This function returns the number of layers | |
32 | static Int_t GetNLayers() {return kNLayers;} | |
33 | ||
34 | // Two methods to map module index to layer,ladder,detector indeces | |
35 | static Int_t GetModuleIndex(Int_t lay,Int_t lad,Int_t det); | |
36 | static Bool_t GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det); | |
37 | ||
38 | static const char *GetSymName(Int_t index); // Get TGeoPNEntry symbolic name | |
39 | static const char *GetSymName(Int_t lay,Int_t lad,Int_t det) | |
40 | { return GetSymName(GetModuleIndex(lay,lad,det)); } | |
41 | ||
42 | // This function returns a pointer to the TGeoHMatrix (local->global) | |
43 | // of a given module index | |
44 | static TGeoHMatrix* GetMatrix(Int_t index); | |
45 | static TGeoHMatrix* GetMatrix(Int_t lay,Int_t lad,Int_t det) | |
46 | { return GetMatrix(GetModuleIndex(lay,lad,det)); } | |
47 | ||
48 | static Bool_t GetTranslation(Int_t index, Double_t t[3]); | |
49 | static Bool_t GetTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3]) | |
50 | { return GetTranslation(GetModuleIndex(lay,lad,det),t); } | |
51 | ||
52 | static Bool_t GetRotation(Int_t index, Double_t r[9]); | |
53 | static Bool_t GetRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9]) | |
54 | { return GetRotation(GetModuleIndex(lay,lad,det),r); } | |
55 | ||
56 | // This function returns a pointer to the original TGeoHMatrix (local->global) | |
57 | // for a specific module index | |
58 | static Bool_t GetOrigMatrix(Int_t index, TGeoHMatrix &m); | |
59 | static Bool_t GetOrigMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m) | |
60 | { return GetOrigMatrix(GetModuleIndex(lay,lad,det),m); } | |
61 | ||
62 | static Bool_t GetOrigTranslation(Int_t index, Double_t t[3]); | |
63 | static Bool_t GetOrigTranslation(Int_t lay,Int_t lad,Int_t det, Double_t t[3]) | |
64 | { return GetOrigTranslation(GetModuleIndex(lay,lad,det),t); } | |
65 | ||
66 | static Bool_t GetOrigRotation(Int_t index, Double_t r[9]); | |
67 | static Bool_t GetOrigRotation(Int_t lay,Int_t lad,Int_t det, Double_t r[9]) | |
68 | { return GetOrigRotation(GetModuleIndex(lay,lad,det),r); } | |
69 | ||
70 | static const TGeoHMatrix* GetTracking2LocalMatrix(Int_t index); | |
71 | static const TGeoHMatrix* GetTracking2LocalMatrix(Int_t lay,Int_t lad,Int_t det) | |
72 | { return GetTracking2LocalMatrix(GetModuleIndex(lay,lad,det)); } | |
73 | ||
74 | static Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m); | |
75 | static Bool_t GetTrackingMatrix(Int_t lay,Int_t lad,Int_t det, TGeoHMatrix &m) | |
76 | { return GetTrackingMatrix(GetModuleIndex(lay,lad,det),m); } | |
77 | ||
78 | private: | |
79 | ||
80 | enum {kNLayers = 6}; // The number of layers. | |
81 | ||
82 | static Bool_t GetLayer(Int_t index,Int_t &lay,Int_t &index2); | |
83 | static TGeoPNEntry* GetPNEntry(Int_t index); | |
84 | ||
85 | AliITSgeomTGeo(const AliITSgeomTGeo &geom); // Copy constructor | |
86 | AliITSgeomTGeo& operator=(const AliITSgeomTGeo &geom);// Assignment operator | |
87 | ||
88 | static const Int_t fgkNModules; // The total number of modules | |
89 | static const Int_t fgkNLadders[kNLayers]; // Array of the number of ladders/layer(layer) | |
90 | static const Int_t fgkNDetectors[kNLayers];// Array of the number of detector/ladder(layer) | |
91 | ||
92 | ClassDef(AliITSgeomTGeo, 0) // ITS geometry based on TGeo | |
93 | }; | |
94 | ||
95 | #endif |