]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDGeometry.h
Using the recommended way of forward declarations for TVector and TMatrix (see v5...
[u/mrichter/AliRoot.git] / FMD / AliFMDGeometry.h
1 #ifndef ALIFMDGEOMETRY_H
2 #define ALIFMDGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice                               
9  */
10 //____________________________________________________________________ 
11 //  
12 // Forward Multiplicity Detector based on Silicon wafers. 
13 //
14 // This class is a singleton that handles the geometry parameters of
15 // the FMD detectors.  
16 //                                                       
17 #ifndef ALIGEOMETRY_H
18 # include <AliGeometry.h>
19 #endif
20 class TParticle;
21 class AliRecPoint;
22 class AliFMDRing;
23 class AliFMDDetector;
24 class AliFMD1;
25 class AliFMD2;
26 class AliFMD3;
27 #ifndef USE_PRE_MOVE
28 #ifndef ROOT_TArrayI
29 # include <TArrayI.h>
30 #endif
31 class AliFMDGeometryBuilder;
32 class TArrayI;
33 #endif
34
35
36 //__________________________________________________________________
37 /** Singleton object of FMD geometry descriptions and parameters.
38  */
39 class AliFMDGeometry : public AliGeometry
40 {
41 public:
42   static AliFMDGeometry* Instance();
43   virtual void Init();
44   AliFMDRing*     GetInner() const { return fInner; }
45   AliFMDRing*     GetOuter() const { return fOuter; }
46   AliFMD1*        GetFMD1()  const { return (fUseFMD1 ? fFMD1 : 0); }
47   AliFMD2*        GetFMD2()  const { return (fUseFMD2 ? fFMD2 : 0); }
48   AliFMD3*        GetFMD3()  const { return (fUseFMD3 ? fFMD3 : 0); }
49   AliFMDDetector* GetDetector(Int_t i) const;
50   AliFMDRing*     GetRing(Char_t i) const;
51   void            Disable(Int_t i);
52   void            Enable(Int_t i);
53   Double_t        GetSiDensity() const { return 2.33; }
54   void            Detector2XYZ(UShort_t detector, Char_t ring, 
55                                UShort_t sector, UShort_t strip, 
56                                Double_t& x, Double_t& y, Double_t& z) const;
57   Bool_t          XYZ2Detector(Double_t x, Double_t y, Double_t z, 
58                                UShort_t& detector, Char_t& ring, 
59                                UShort_t& sector, UShort_t& strip) const;
60 #ifndef USE_PRE_MOVE
61   void   Build();
62   Int_t  GetDetectorOff() const    { return fDetectorOff; }
63   Int_t  GetModuleOff() const      { return fModuleOff;   }
64   Int_t  GetRingOff() const        { return fRingOff;     }
65   Int_t  GetSectorOff() const      { return fSectorOff;   }
66   void   SetDetectorOff(Int_t off) { fDetectorOff = off; }
67   void   SetModuleOff(Int_t off)   { fModuleOff   = off; }
68   void   SetRingOff(Int_t off)     { fRingOff     = off; }
69   void   SetSectorOff(Int_t off)   { fSectorOff   = off; }
70   Bool_t IsActive(Int_t vol) const;
71   void   SetActive(Int_t* active, Int_t n);
72   void   AddActive(Int_t id);
73   void   SetBuilder(AliFMDGeometryBuilder* b) { fBuilder = b; }
74   void   ExtractGeomInfo();
75   void   SetDetailed(Bool_t det) { fDetailed = det; }
76   Bool_t IsDetailed() const { return fDetailed; }
77   void   UseAssembly(Bool_t ass)  { fUseAssembly = ass; }
78 #endif  
79
80   // AliGeometry member functions 
81   virtual void GetGlobal(const AliRecPoint* p, TVector3& pos, 
82                          TMatrixF& mat) const;
83   virtual void GetGlobal(const AliRecPoint* p, TVector3& pos) const;
84   virtual Bool_t Impact(const TParticle* particle) const;
85 protected:
86   Bool_t        fIsInitialized; // Whether singleton is initalized
87   AliFMDRing*   fInner;         // Inner ring geometry information
88   AliFMDRing*   fOuter;         // Outer ring geometry information
89   AliFMD1*      fFMD1;          // FMD1 geometry information
90   AliFMD2*      fFMD2;          // FMD2 geometry information
91   AliFMD3*      fFMD3;          // FMD3 geometry information
92   Bool_t        fUseFMD1;       // Wheter to Use FMD1 or not
93   Bool_t        fUseFMD2;       // Wheter to Use FMD2 or not
94   Bool_t        fUseFMD3;       // Wheter to Use FMD3 or not
95   static AliFMDGeometry* fgInstance; // Singleton instance 
96   AliFMDGeometry();
97   AliFMDGeometry(const AliFMDGeometry& other);
98   AliFMDGeometry& operator=(const AliFMDGeometry& other);
99   virtual ~AliFMDGeometry() {}
100   
101 #ifndef USE_PRE_MOVE
102   AliFMDGeometryBuilder* fBuilder;
103   Int_t fDetectorOff;
104   Int_t fModuleOff;  
105   Int_t fRingOff;    
106   Int_t fSectorOff;  
107   TArrayI fActive;
108   Bool_t fDetailed;
109   Bool_t fUseAssembly;
110 #endif
111
112   ClassDef(AliFMDGeometry,1); //
113 };
114
115
116 #endif
117 //____________________________________________________________________
118 //
119 // Local Variables:
120 //   mode: C++
121 // End:
122 //
123 // EOF
124 //