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