1 /**************************************************************************
2 * Copyright(c) 2004, 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 // Utility class to help implement the FMD geometry. This provides
21 // the interface for the concrete geometry implementations of the FMD
24 // The AliFMD object owns the AliFMDSubDetector objects
26 // Latest changes by Christian Holm Christensen
28 //////////////////////////////////////////////////////////////////////////////
30 #include "AliFMDSubDetector.h" // ALIFMDSUBDETECTOR_H
31 #include "AliFMDRing.h" // ALIFMDRING_H
32 #include <AliLog.h> // ALILOG_H
33 #include <TVirtualMC.h> // ROOT_TVirtualMC
34 #include <TList.h> // ROOT_TList
35 #include <TString.h> // ROOT_TString
37 //____________________________________________________________________
38 ClassImp(AliFMDSubDetector);
40 //____________________________________________________________________
41 const Char_t* AliFMDSubDetector::fgkHoneyTopFormat = "F%d%cH";
42 const Char_t* AliFMDSubDetector::fgkHoneyBottomFormat = "F%d%cI";
43 const Char_t* AliFMDSubDetector::fgkHoneyTopInnerFormat = "F%d%cJ";
44 const Char_t* AliFMDSubDetector::fgkHoneyBottomInnerFormat = "F%d%cK";
46 //____________________________________________________________________
47 AliFMDSubDetector::AliFMDSubDetector(Int_t n)
55 SetHoneycombThickness();
59 //____________________________________________________________________
61 AliFMDSubDetector::Draw(Option_t* /* opt */) const
63 // DebugGuard guard("AliFMDSubDetector::Draw");
64 AliDebug(10, "AliFMDSubDetector::Draw");
67 //____________________________________________________________________
69 AliFMDSubDetector::CheckHit(Char_t ring, Int_t module, Double_t x, Double_t y)
71 // Check if a hit (x,y) in module module of ring ring is within the
78 ret = fInner->IsWithin(module, x, y);
83 ret = fOuter->IsWithin(module, x, y);
89 //____________________________________________________________________
91 AliFMDSubDetector::SimpleGeometry(TList* nodes,
96 // Make a simplified geometry for event display
100 // nodes List of nodes to register all create nodes in
101 // mother Mother node to put the ring in.
102 // colour Colour of the nodes
103 // zMother Z position of the node in the mother volume
105 for (int i = 0; i < 2; i++) {
120 // Make the coordinates relative to the mother volume. If we're
121 // on the positive side, then we need to flip the z-coordinate, as
122 // we'll rotate the whole sub-detector afterwards.
124 if (zMother > 0) z *= -1;
126 r->SimpleGeometry(nodes, mother, colour, z, fId);
131 //____________________________________________________________________
133 AliFMDSubDetector::SetupGeometry(Int_t airId, Int_t alId, Int_t /* cId
136 // Set up the geometry of this particular detector.
138 // In this class, it defines the support honey comp calls and
142 // airId Medium of inactive virtual volumes
143 // alId Medium of honeycomb
145 // DebugGuard guard("AliFMDSubDetector::SetupGeometry");
146 AliDebug(10, "AliFMDSubDetector::SetupGeometry");
150 for (int i = 0; i < 2; i++) {
156 par[0] = fInnerHoneyLowR;
157 par[1] = fInnerHoneyHighR;
161 par[0] = fOuterHoneyLowR;
162 par[1] = fOuterHoneyHighR;
168 // Top of honeycomb, inner ring
169 par[2] = fHoneycombThickness / 2;
172 name = Form(fgkHoneyTopFormat, fId, c);
173 gMC->Gsvolu(name.Data(), "TUBS", alId, par, 5);
175 // Bottom of honeycomb, inner ring
178 name = Form(fgkHoneyBottomFormat, fId, c);
179 gMC->Gsvolu(name.Data(), "TUBS", alId, par, 5);
181 // Air in top of honeycomb, inner ring
182 par[0] += fAlThickness;
183 par[1] -= fAlThickness;
184 par[2] -= fAlThickness;
187 name = Form(fgkHoneyTopInnerFormat, fId, c);
188 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
190 // Air in bottom of honeycomb, inner ring
193 name = Form(fgkHoneyBottomInnerFormat, fId, c);
194 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
198 //____________________________________________________________________
200 AliFMDSubDetector::Geometry(const char* mother, Int_t pbRotId, Int_t idRotId,
203 // Place the volume inside mother volume.
207 // mother Volume to position this detector in
208 // pbRotId Print board rotation matrix,
209 // idRotId Identity rotation matrix
210 // zMother The Z passed in, is the position of the middle
211 // point of the mother volume.
213 // In this base class, it asks the contained rings to position
214 // themselves in the mother volume, and positions the honey comb
215 // support in the mother volume
217 // DebugGuard guard("AliFMDSubDetector::Geometry");
218 AliDebug(10, "AliFMDSubDetector::Geometry");
226 for (int i = 0; i < 2; i++) {
242 // Make the coordinates relative to the mother volume. If we're
243 // on the positive side, then we need to flip the z-coordinate, as
244 // we'll rotate the whole sub-detector afterwards.
247 if (zMother > 0) z2 *= -1;
248 AliDebug(10, Form("Putting ring %c in %s at z=%lf-%lf=%lf",
249 c, mother, z, zMother, z2));
250 r->Geometry(mother, fId, z2, pbRotId, idRotId);
251 ringW = r->GetRingDepth();
252 z2 -= ringW + fHoneycombThickness / 2;
255 name = Form(fgkHoneyTopFormat, fId, c);
256 gMC->Gspos(name.Data(), 1, mother, 0, 0, z2, idRotId);
258 // Air in top of honeycomb
260 name = Form(fgkHoneyTopInnerFormat, fId, c);
261 gMC->Gspos(name.Data(), 1, name2.Data(),0,fAlThickness,0,idRotId);
263 // Bottom of honeycomb
264 name = Form(fgkHoneyBottomFormat, fId, c);
265 gMC->Gspos(name.Data(), 1, mother, 0, 0, z2, idRotId);
267 // Air in bottom of honeycomb
269 name = Form(fgkHoneyBottomInnerFormat, fId, c);
270 gMC->Gspos(name.Data(),1,name2.Data(),0,-fAlThickness,0,idRotId);
274 //____________________________________________________________________
276 AliFMDSubDetector::Gsatt()
278 // Set drawing attributes for the detector
280 // DebugGuard guard("AliFMDSubDetector::Gsatt");
281 AliDebug(10, "AliFMDSubDetector::Gsatt");
284 name = Form("FMD%d", fId);
285 gMC->Gsatt(name.Data(), "SEEN", 0);
287 for (int i = 0; i < 2; i++) {
291 case 0: r = fInner; break;
292 case 1: r = fOuter; break;
297 name = Form(fgkHoneyTopFormat, fId, c);
298 gMC->Gsatt(name.Data(), "SEEN", 1);
300 name = Form(fgkHoneyBottomFormat, fId, c);
301 gMC->Gsatt(name.Data(), "SEEN", 1);
303 name = Form(fgkHoneyTopInnerFormat, fId, c);
304 gMC->Gsatt(name.Data(), "SEEN", 0);
306 name = Form(fgkHoneyBottomInnerFormat, fId, c);
307 gMC->Gsatt(name.Data(), "SEEN", 0);
312 //____________________________________________________________________