1 #ifndef ALIFMDGEOMETRY_H
2 #define ALIFMDGEOMETRY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
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
15 //____________________________________________________________________
17 // Forward Multiplicity Detector based on Silicon wafers.
19 // This class is a singleton that handles the geometry parameters of
23 # include <AliGeometry.h>
28 #ifndef ROOT_TMatrixFfwd
29 # include <TMatrixFfwd.h>
39 class AliFMDGeometryBuilder;
42 //__________________________________________________________________
43 /** @brief Singleton object of FMD geometry descriptions and parameters.
44 This class is a singleton that handles the geometry parameters of
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
54 +----------------+<>--+ |
56 +----------------+<>--+ V 1..2
57 3 | +----------------+
62 +-------------+-------------+
64 +---------+ +---------+ +---------+
65 | AliFMD1 | | AliFMD2 | | AliFMD3 |
66 +---------+ +---------+ +---------+
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.
82 class AliFMDGeometry : public AliGeometry
85 /** @return Singleton */
86 static AliFMDGeometry* Instance();
89 /** Initialize transforms */
90 virtual void InitTransformations();
91 /** @return Get inner description */
92 AliFMDRing* GetInner() const { return fInner; }
93 /** @return Get outer description */
94 AliFMDRing* GetOuter() const { return fOuter; }
95 /** @return Get FMD1 description */
96 AliFMD1* GetFMD1() const { return (fUseFMD1 ? fFMD1 : 0); }
97 /** @return Get FMD2 description */
98 AliFMD2* GetFMD2() const { return (fUseFMD2 ? fFMD2 : 0); }
99 /** @return Get FMD3 description */
100 AliFMD3* GetFMD3() const { return (fUseFMD3 ? fFMD3 : 0); }
101 /** Get description of a sub-detector
102 @param i Sub-detector #
103 @return Description of sub-detector, or 0 */
104 AliFMDDetector* GetDetector(Int_t i) const;
105 /** Get description of a ring
107 @return Description of ring, or 0 */
108 AliFMDRing* GetRing(Char_t i) const;
109 /** @param i IF true, disable sub-detector @a i */
110 void Disable(Int_t i);
111 /** @param i IF true, enable sub-detector @a i */
112 void Enable(Int_t i);
113 /** @return Density @f$ \rho@f$ of silicon */
114 Double_t GetSiDensity() const { return 2.33; }
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
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 */
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;
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,
136 geom->XYZ2Detector(x,y,z-ipz,d,r,s,t);
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
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;
150 /** Make the geometry. This delegates to AliFMDGeometryBuilder */
152 /** @return Get detector offset in paths */
153 Int_t GetDetectorOff() const { return fDetectorOff; }
154 /** @return Get sensor offset in paths */
155 Int_t GetModuleOff() const { return fModuleOff; }
156 /** @return Get ring offset in paths */
157 Int_t GetRingOff() const { return fRingOff; }
158 /** @return Get ring sector in paths */
159 Int_t GetSectorOff() const { return fSectorOff; }
160 /** @param off Detector off-set set in geometry path */
161 void SetDetectorOff(Int_t off) { fDetectorOff = off; }
162 /** @param off Module off-set set in geometry path */
163 void SetModuleOff(Int_t off) { fModuleOff = off; }
164 /** @param off Ring off-set set in geometry path */
165 void SetRingOff(Int_t off) { fRingOff = off; }
166 /** @param off Sectord off-set set in geometry path */
167 void SetSectorOff(Int_t off) { fSectorOff = off; }
168 /** Check if volume @a vol is marked as active
170 @return @c true if @a vol is declared active */
171 Bool_t IsActive(Int_t vol) const;
172 /** Set active volumes
173 @param active Active volume id array
174 @param n elements of @a active */
175 void SetActive(Int_t* active, Int_t n);
176 /** @param id Register volume @a id to be active */
177 void AddActive(Int_t id);
178 /** Set an external geometry builder
179 @param b Geometry builder */
180 void SetBuilder(AliFMDGeometryBuilder* b) { fBuilder = b; }
181 /** Extract informaton from TGeoManager */
182 void ExtractGeomInfo();
183 /** Whether we are to use a detailed geometry or not
184 @param det if @c true, make a detailed geometry. */
185 void SetDetailed(Bool_t det) { fDetailed = det; }
186 /** @return @c true if geometry is detailed */
187 Bool_t IsDetailed() const { return fDetailed; }
188 /** @param ass Whether to use assemblies or not */
189 void UseAssembly(Bool_t ass) { fUseAssembly = ass; }
191 // AliGeometry member functions
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 */
196 virtual void GetGlobal(const AliRecPoint* p, TVector3& pos,
197 TMatrixF& mat) const;
198 /** Get global coordinates cooresponding to a rec point.
199 @param p Reconstructed point.
200 @param pos On return, the position */
201 virtual void GetGlobal(const AliRecPoint* p, TVector3& pos) const;
202 /** Check if particle will hit an active detector element. Note
204 @param particle Track
205 @return @c true if @a particle will hit this detector */
206 virtual Bool_t Impact(const TParticle* particle) const;
208 Bool_t fIsInitialized; // Whether singleton is initalized
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
217 static AliFMDGeometry* fgInstance; // Singleton instance
221 @param other To copy from */
222 AliFMDGeometry(const AliFMDGeometry& other);
223 /** Assignment operator
224 @param other To assig from
225 @return reference to this. */
226 AliFMDGeometry& operator=(const AliFMDGeometry& other);
227 virtual ~AliFMDGeometry() {}
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
238 ClassDef(AliFMDGeometry,1); // Geometry parameters and manager
243 //____________________________________________________________________