]>
Commit | Line | Data |
---|---|---|
1a1fdef7 | 1 | #ifndef ALIFMDGEOMETRY_H |
2 | #define ALIFMDGEOMETRY_H | |
088f8e79 | 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 | */ | |
c2fc1258 | 10 | /** @file AliFMDGeometry.h |
11 | @author Christian Holm Christensen <cholm@nbi.dk> | |
12 | @date Mon Mar 27 12:40:37 2006 | |
13 | @brief Geometry mananger for the FMD | |
14 | */ | |
02a27b50 | 15 | //____________________________________________________________________ |
16 | // | |
69b696b9 | 17 | // Forward Multiplicity Detector based on Silicon wafers. |
18 | // | |
19 | // This class is a singleton that handles the geometry parameters of | |
20 | // the FMD detectors. | |
21 | // | |
1a1fdef7 | 22 | #ifndef ALIGEOMETRY_H |
23 | # include <AliGeometry.h> | |
24 | #endif | |
57c3c593 | 25 | #ifndef ROOT_TArrayI |
26 | # include <TArrayI.h> | |
27 | #endif | |
28 | #ifndef ROOT_TMatrixFfwd | |
29 | # include <TMatrixFfwd.h> | |
30 | #endif | |
31 | class TVector3; | |
1a1fdef7 | 32 | class TParticle; |
33 | class AliRecPoint; | |
34 | class AliFMDRing; | |
35 | class AliFMDDetector; | |
36 | class AliFMD1; | |
37 | class AliFMD2; | |
38 | class AliFMD3; | |
54e415a8 | 39 | class AliFMDGeometryBuilder; |
1a1fdef7 | 40 | |
41 | ||
42 | //__________________________________________________________________ | |
c2fc1258 | 43 | /** @brief Singleton object of FMD geometry descriptions and parameters. |
9f662337 | 44 | This class is a singleton that handles the geometry parameters of |
45 | the FMD detectors. | |
46 | ||
47 | The actual code is done by various separate classes. Below is | |
48 | diagram showing the relationship between the various FMD classes | |
49 | that handles the geometry | |
50 | @verbatim | |
51 | +------------+ | |
52 | +- | AliFMDRing | | |
53 | 2 | +------------+ | |
54 | +----------------+<>--+ | | |
55 | | AliFMDGeometry | ^ | |
56 | +----------------+<>--+ V 1..2 | |
57 | 3 | +----------------+ | |
58 | +-| AliFMDDetector | | |
59 | +----------------+ | |
60 | ^ | |
61 | | | |
62 | +-------------+-------------+ | |
63 | | | | | |
64 | +---------+ +---------+ +---------+ | |
65 | | AliFMD1 | | AliFMD2 | | AliFMD3 | | |
66 | +---------+ +---------+ +---------+ | |
67 | ||
68 | @endverbatim | |
69 | - AliFMDRing | |
70 | This class contains all stuff needed to do with a ring. It's | |
71 | used by the AliFMDDetector objects to instantise inner and | |
72 | outer rings. The AliFMDRing objects are shared by the | |
73 | AliFMDDetector objects, and owned by the AliFMDv1 object. | |
74 | - AliFMD1, AliFMD2, and AliFMD3 | |
75 | These are specialisation of AliFMDDetector, that contains the | |
76 | particularities of each of the sub-detector system. It is | |
77 | envisioned that the classes should also define the support | |
78 | volumes and material for each of the detectors. | |
79 | ||
80 | @ingroup FMD_base | |
1a1fdef7 | 81 | */ |
82 | class AliFMDGeometry : public AliGeometry | |
83 | { | |
84 | public: | |
9f662337 | 85 | /** @return Singleton */ |
1a1fdef7 | 86 | static AliFMDGeometry* Instance(); |
9f662337 | 87 | /** Initialize */ |
1a1fdef7 | 88 | virtual void Init(); |
9f662337 | 89 | /** Initialize transforms */ |
bf000c32 | 90 | virtual void InitTransformations(); |
9f662337 | 91 | /** @return Get inner description */ |
1a1fdef7 | 92 | AliFMDRing* GetInner() const { return fInner; } |
9f662337 | 93 | /** @return Get outer description */ |
1a1fdef7 | 94 | AliFMDRing* GetOuter() const { return fOuter; } |
9f662337 | 95 | /** @return Get FMD1 description */ |
1a1fdef7 | 96 | AliFMD1* GetFMD1() const { return (fUseFMD1 ? fFMD1 : 0); } |
9f662337 | 97 | /** @return Get FMD2 description */ |
1a1fdef7 | 98 | AliFMD2* GetFMD2() const { return (fUseFMD2 ? fFMD2 : 0); } |
9f662337 | 99 | /** @return Get FMD3 description */ |
1a1fdef7 | 100 | AliFMD3* GetFMD3() const { return (fUseFMD3 ? fFMD3 : 0); } |
9f662337 | 101 | /** Get description of a sub-detector |
102 | @param i Sub-detector # | |
103 | @return Description of sub-detector, or 0 */ | |
1a1fdef7 | 104 | AliFMDDetector* GetDetector(Int_t i) const; |
9f662337 | 105 | /** Get description of a ring |
106 | @param i Ring id | |
107 | @return Description of ring, or 0 */ | |
1a1fdef7 | 108 | AliFMDRing* GetRing(Char_t i) const; |
9f662337 | 109 | /** @param i IF true, disable sub-detector @a i */ |
1a1fdef7 | 110 | void Disable(Int_t i); |
9f662337 | 111 | /** @param i IF true, enable sub-detector @a i */ |
1a1fdef7 | 112 | void Enable(Int_t i); |
9f662337 | 113 | /** @return Density @f$ \rho@f$ of silicon */ |
1a1fdef7 | 114 | Double_t GetSiDensity() const { return 2.33; } |
9f662337 | 115 | /** Translate detector coordinates (detector, ring, sector, strip) |
116 | to spatial coordinates (x, y, z) in the master reference frame | |
117 | of ALICE. The member function uses the transformations | |
118 | previously obtained from the TGeoManager. | |
119 | @param detector Detector number | |
120 | @param ring Ring id | |
121 | @param sector Sector number | |
122 | @param strip Strip number | |
123 | @param x On return, X coordinate | |
124 | @param y On return, Y coordinate | |
125 | @param z On return, Z coordinate */ | |
54e415a8 | 126 | void Detector2XYZ(UShort_t detector, Char_t ring, |
127 | UShort_t sector, UShort_t strip, | |
128 | Double_t& x, Double_t& y, Double_t& z) const; | |
9f662337 | 129 | /** Translate spatial coordinates (x,y,z) in the master reference |
130 | frame of ALICE to the detector coordinates (detector, ring, | |
131 | sector, strip). Note, that if this method is to be used in | |
132 | reconstruction or the like, then the input z-coordinate should | |
133 | be corrected for the events interactions points z-coordinate, | |
134 | like | |
135 | @code | |
136 | geom->XYZ2Detector(x,y,z-ipz,d,r,s,t); | |
f8616692 | 137 | @endcode |
9f662337 | 138 | @param x X coordinate |
139 | @param y Y coordinate | |
140 | @param z Z coordinate | |
141 | @param detector On return, Detector number | |
142 | @param ring On return, Ring id | |
143 | @param sector On return, Sector number | |
144 | @param strip On return, Strip number | |
145 | @return @c false of (@a x, @a y, @a z) is not within this | |
146 | detector. */ | |
54e415a8 | 147 | Bool_t XYZ2Detector(Double_t x, Double_t y, Double_t z, |
148 | UShort_t& detector, Char_t& ring, | |
149 | UShort_t& sector, UShort_t& strip) const; | |
9f662337 | 150 | /** Make the geometry. This delegates to AliFMDGeometryBuilder */ |
54e415a8 | 151 | void Build(); |
9f662337 | 152 | /** @return Get detector offset in paths */ |
54e415a8 | 153 | Int_t GetDetectorOff() const { return fDetectorOff; } |
9f662337 | 154 | /** @return Get sensor offset in paths */ |
54e415a8 | 155 | Int_t GetModuleOff() const { return fModuleOff; } |
9f662337 | 156 | /** @return Get ring offset in paths */ |
54e415a8 | 157 | Int_t GetRingOff() const { return fRingOff; } |
9f662337 | 158 | /** @return Get ring sector in paths */ |
54e415a8 | 159 | Int_t GetSectorOff() const { return fSectorOff; } |
9f662337 | 160 | /** @param off Detector off-set set in geometry path */ |
54e415a8 | 161 | void SetDetectorOff(Int_t off) { fDetectorOff = off; } |
9f662337 | 162 | /** @param off Module off-set set in geometry path */ |
54e415a8 | 163 | void SetModuleOff(Int_t off) { fModuleOff = off; } |
9f662337 | 164 | /** @param off Ring off-set set in geometry path */ |
54e415a8 | 165 | void SetRingOff(Int_t off) { fRingOff = off; } |
9f662337 | 166 | /** @param off Sectord off-set set in geometry path */ |
54e415a8 | 167 | void SetSectorOff(Int_t off) { fSectorOff = off; } |
9f662337 | 168 | /** Check if volume @a vol is marked as active |
169 | @param vol Volume ID | |
170 | @return @c true if @a vol is declared active */ | |
54e415a8 | 171 | Bool_t IsActive(Int_t vol) const; |
9f662337 | 172 | /** Set active volumes |
173 | @param active Active volume id array | |
174 | @param n elements of @a active */ | |
54e415a8 | 175 | void SetActive(Int_t* active, Int_t n); |
9f662337 | 176 | /** @param id Register volume @a id to be active */ |
54e415a8 | 177 | void AddActive(Int_t id); |
9f662337 | 178 | /** Set an external geometry builder |
179 | @param b Geometry builder */ | |
54e415a8 | 180 | void SetBuilder(AliFMDGeometryBuilder* b) { fBuilder = b; } |
9f662337 | 181 | /** Extract informaton from TGeoManager */ |
54e415a8 | 182 | void ExtractGeomInfo(); |
9f662337 | 183 | /** Whether we are to use a detailed geometry or not |
184 | @param det if @c true, make a detailed geometry. */ | |
54e415a8 | 185 | void SetDetailed(Bool_t det) { fDetailed = det; } |
9f662337 | 186 | /** @return @c true if geometry is detailed */ |
54e415a8 | 187 | Bool_t IsDetailed() const { return fDetailed; } |
9f662337 | 188 | /** @param ass Whether to use assemblies or not */ |
54e415a8 | 189 | void UseAssembly(Bool_t ass) { fUseAssembly = ass; } |
1a1fdef7 | 190 | |
191 | // AliGeometry member functions | |
9f662337 | 192 | /** Get global coordinates cooresponding to a rec point. |
193 | @param p Reconstructed point. | |
194 | @param pos On return, the position | |
195 | @param mat On return, the material at @a post */ | |
1a1fdef7 | 196 | virtual void GetGlobal(const AliRecPoint* p, TVector3& pos, |
e8d02863 | 197 | TMatrixF& mat) const; |
9f662337 | 198 | /** Get global coordinates cooresponding to a rec point. |
199 | @param p Reconstructed point. | |
200 | @param pos On return, the position */ | |
1a1fdef7 | 201 | virtual void GetGlobal(const AliRecPoint* p, TVector3& pos) const; |
9f662337 | 202 | /** Check if particle will hit an active detector element. Note |
203 | done yet. | |
204 | @param particle Track | |
205 | @return @c true if @a particle will hit this detector */ | |
1a1fdef7 | 206 | virtual Bool_t Impact(const TParticle* particle) const; |
207 | protected: | |
69b696b9 | 208 | Bool_t fIsInitialized; // Whether singleton is initalized |
1a1fdef7 | 209 | AliFMDRing* fInner; // Inner ring geometry information |
210 | AliFMDRing* fOuter; // Outer ring geometry information | |
211 | AliFMD1* fFMD1; // FMD1 geometry information | |
212 | AliFMD2* fFMD2; // FMD2 geometry information | |
213 | AliFMD3* fFMD3; // FMD3 geometry information | |
214 | Bool_t fUseFMD1; // Wheter to Use FMD1 or not | |
215 | Bool_t fUseFMD2; // Wheter to Use FMD2 or not | |
216 | Bool_t fUseFMD3; // Wheter to Use FMD3 or not | |
69b696b9 | 217 | static AliFMDGeometry* fgInstance; // Singleton instance |
9f662337 | 218 | /** CTOR */ |
1a1fdef7 | 219 | AliFMDGeometry(); |
9f662337 | 220 | /** Copy CTOR |
221 | @param other To copy from */ | |
69b696b9 | 222 | AliFMDGeometry(const AliFMDGeometry& other); |
9f662337 | 223 | /** Assignment operator |
224 | @param other To assig from | |
225 | @return reference to this. */ | |
69b696b9 | 226 | AliFMDGeometry& operator=(const AliFMDGeometry& other); |
1a1fdef7 | 227 | virtual ~AliFMDGeometry() {} |
69b696b9 | 228 | |
02a27b50 | 229 | AliFMDGeometryBuilder* fBuilder; // Geometry builder |
230 | Int_t fDetectorOff; // Detector off-set | |
231 | Int_t fModuleOff; // Module off-set | |
232 | Int_t fRingOff; // ring offset | |
233 | Int_t fSectorOff; // Sector offset | |
234 | TArrayI fActive; // Active volumes | |
235 | Bool_t fDetailed; // Whether to make detailed geom | |
236 | Bool_t fUseAssembly; // Whther to use assemblies | |
54e415a8 | 237 | |
02a27b50 | 238 | ClassDef(AliFMDGeometry,1); // Geometry parameters and manager |
1a1fdef7 | 239 | }; |
240 | ||
241 | ||
242 | #endif | |
243 | //____________________________________________________________________ | |
244 | // | |
245 | // Local Variables: | |
246 | // mode: C++ | |
247 | // End: | |
248 | // | |
249 | // EOF | |
250 | // |