1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //____________________________________________________________________
20 // Forward Multiplicity Detector based on Silicon wafers.
22 // This class is a singleton that handles the geometry parameters of
25 // The actual code is done by various separate classes. Below is
26 // diagram showing the relationship between the various FMD classes
27 // that handles the geometry
32 // +----------------+<>--+ |
33 // | AliFMDGeometry | ^
34 // +----------------+<>--+ V 1..2
35 // 3 | +----------------+
36 // +-| AliFMDDetector |
40 // +-------------+-------------+
42 // +---------+ +---------+ +---------+
43 // | AliFMD1 | | AliFMD2 | | AliFMD3 |
44 // +---------+ +---------+ +---------+
48 // This class contains all stuff needed to do with a ring. It's
49 // used by the AliFMDDetector objects to instantise inner and
50 // outer rings. The AliFMDRing objects are shared by the
51 // AliFMDDetector objects, and owned by the AliFMDv1 object.
53 // * AliFMD1, AliFMD2, and AliFMD3
54 // These are specialisation of AliFMDDetector, that contains the
55 // particularities of each of the sub-detector system. It is
56 // envisioned that the classes should also define the support
57 // volumes and material for each of the detectors.
60 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
61 #include "AliFMDRing.h" // ALIFMDRING_H
62 #include "AliFMD1.h" // ALIFMD1_H
63 #include "AliFMD2.h" // ALIFMD2_H
64 #include "AliFMD3.h" // ALIFMD2_H
65 #include "AliRecPoint.h" // ALIRECPOINT_H
66 #include "AliLog.h" // ALIRECPOINT_H
67 #include <TVector3.h> // ROOT_TVector3
68 #include <TMatrix.h> // ROOT_TMatrix
69 #include <TParticle.h> // ROOT_TParticle
70 #include <Riostream.h>
72 //====================================================================
73 ClassImp(AliFMDGeometry)
75 ; // This is here to keep Emacs for indenting the next line
78 //____________________________________________________________________
79 AliFMDGeometry* AliFMDGeometry::fgInstance = 0;
81 //____________________________________________________________________
83 AliFMDGeometry::Instance()
85 if (!fgInstance) fgInstance = new AliFMDGeometry;
89 //____________________________________________________________________
90 AliFMDGeometry::AliFMDGeometry()
91 : AliGeometry("FMD", "Forward multiplicity")
96 fInner = new AliFMDRing('I');
97 fOuter = new AliFMDRing('O');
98 fFMD1 = new AliFMD1(fInner);
99 fFMD2 = new AliFMD2(fInner, fOuter);
100 fFMD3 = new AliFMD3(fInner, fOuter);
101 fIsInitialized = kFALSE;
104 //____________________________________________________________________
106 AliFMDGeometry::Init()
108 if (fIsInitialized) return;
116 //____________________________________________________________________
118 AliFMDGeometry::GetDetector(Int_t i) const
121 case 1: return fUseFMD1 ? static_cast<AliFMDDetector*>(fFMD1) : 0;
122 case 2: return fUseFMD2 ? static_cast<AliFMDDetector*>(fFMD2) : 0;
123 case 3: return fUseFMD3 ? static_cast<AliFMDDetector*>(fFMD3) : 0;
128 //____________________________________________________________________
130 AliFMDGeometry::GetRing(Char_t i) const
134 case 'i': return fInner;
136 case 'o': return fOuter;
141 //____________________________________________________________________
143 AliFMDGeometry::Enable(Int_t i)
146 case 1: fUseFMD1 = kTRUE; break;
147 case 2: fUseFMD2 = kTRUE; break;
148 case 3: fUseFMD3 = kTRUE; break;
152 //____________________________________________________________________
154 AliFMDGeometry::Disable(Int_t i)
157 case 1: fUseFMD1 = kFALSE; break;
158 case 2: fUseFMD2 = kFALSE; break;
159 case 3: fUseFMD3 = kFALSE; break;
163 //____________________________________________________________________
165 AliFMDGeometry::Detector2XYZ(UShort_t detector,
173 AliFMDDetector* det = GetDetector(detector);
175 det->Detector2XYZ(ring, sector, strip, x, y, z);
179 //____________________________________________________________________
181 AliFMDGeometry::GetGlobal(const AliRecPoint* p,
183 TMatrix& /* mat */) const
188 //____________________________________________________________________
190 AliFMDGeometry::GetGlobal(const AliRecPoint* p, TVector3& pos) const
194 p->GetLocalPosition(local);
195 UShort_t detector = UShort_t(local.X());
196 UShort_t sector = UShort_t(local.Y());
197 UShort_t strip = UShort_t(local.Z());
198 Detector2XYZ(detector, 'I', sector, strip, x, y, z);
202 //____________________________________________________________________
204 AliFMDGeometry::Impact(const TParticle* /* particle */) const
209 //____________________________________________________________________