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 #ifndef ALIFMDSUBDETECTOR_H
31 # include "AliFMDSubDetector.h"
34 # include <AliFMDRing.h>
39 #ifndef ROOT_TVirtualMC
40 # include <TVirtualMC.h>
52 ClassImp(AliFMDSubDetector);
54 //____________________________________________________________________
55 AliFMDSubDetector::AliFMDSubDetector(Int_t n)
63 //____________________________________________________________________
65 AliFMDSubDetector::Draw(Option_t* /* opt */) const
67 // DebugGuard guard("AliFMDSubDetector::Draw");
68 AliDebug(10, "AliFMDSubDetector::Draw");
71 //____________________________________________________________________
73 AliFMDSubDetector::CheckHit(Char_t ring, Int_t module, Double_t x, Double_t y)
75 // Check if a hit (x,y) in module module of ring ring is within the
82 ret = fInner->IsWithin(module, x, y);
87 ret = fOuter->IsWithin(module, x, y);
93 //____________________________________________________________________
95 AliFMDSubDetector::SimpleGeometry(TList* nodes,
100 // Make a simplified geometry for event display
104 // nodes List of nodes to register all create nodes in
105 // mother Mother node to put the ring in.
106 // colour Colour of the nodes
107 // zMother Z position of the node in the mother volume
109 for (int i = 0; i < 2; i++) {
124 // Make the coordinates relative to the mother volume. If we're
125 // on the positive side, then we need to flip the z-coordinate, as
126 // we'll rotate the whole sub-detector afterwards.
128 if (zMother > 0) z *= -1;
130 r->SimpleGeometry(nodes, mother, colour, z, fId);
135 //____________________________________________________________________
137 AliFMDSubDetector::SetupGeometry(Int_t airId, Int_t kaptionId)
139 // Set up the geometry of this particular detector.
141 // In this class, it defines the support honey comp calls and
145 // airId Medium of inactive virtual volumes
146 // kaptionId Medium of honeycomb
148 // DebugGuard guard("AliFMDSubDetector::SetupGeometry");
149 AliDebug(10, "AliFMDSubDetector::SetupGeometry");
153 for (int i = 0; i < 2; i++) {
160 par[0] = fInnerHoneyLowR;
161 par[1] = fInnerHoneyHighR;
166 par[0] = fOuterHoneyLowR;
167 par[1] = fOuterHoneyHighR;
171 // Top of honeycomb, inner ring
172 par[2] = fHoneycombThickness / 2;
175 name = Form("HT%c%d", c, fId);
176 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
178 // Bottom of honeycomb, inner ring
181 name = Form("HB%c%d", c, fId);
182 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
184 // Air in top of honeycomb, inner ring
185 par[0] += fKaptionThickness;
186 par[1] -= fKaptionThickness;
187 par[2] -= fKaptionThickness;
190 name = Form("GT%c%d", c, fId);
191 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
193 // Air in bottom of honeycomb, inner ring
196 name = Form("GB%c%d", c, fId);
197 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
201 //____________________________________________________________________
203 AliFMDSubDetector::Geometry(const char* mother, Int_t pbRotId, Int_t idRotId,
206 // Place the volume inside mother volume.
210 // mother Volume to position this detector in
211 // pbRotId Print board rotation matrix,
212 // idRotId Identity rotation matrix
213 // zMother The Z passed in, is the position of the middle
214 // point of the mother volume.
216 // In this base class, it asks the contained rings to position
217 // themselves in the mother volume, and positions the honey comb
218 // support in the mother volume
220 // DebugGuard guard("AliFMDSubDetector::Geometry");
221 AliDebug(10, "AliFMDSubDetector::Geometry");
229 for (int i = 0; i < 2; i++) {
246 // Make the coordinates relative to the mother volume. If we're
247 // on the positive side, then we need to flip the z-coordinate, as
248 // we'll rotate the whole sub-detector afterwards.
250 if (zMother > 0) z *= -1;
252 r->Geometry(mother, fId, z, pbRotId, idRotId);
253 ringW = r->GetRingDepth();
254 z -= ringW + fHoneycombThickness / 2;
257 name = Form("HT%c%d", c, fId);
258 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
260 // Air in top of honeycomb
262 name = Form("GT%c%d", c, fId);
263 gMC->Gspos(name.Data(), 1, name2.Data(),0,fKaptionThickness,0,idRotId);
265 // Bottom of honeycomb
266 name = Form("HB%c%d", c, fId);
267 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
269 // Air in bottom of honeycomb
271 name = Form("GB%c%d", c, fId);
272 gMC->Gspos(name.Data(),1,name2.Data(),0,-fKaptionThickness,0,idRotId);
276 //____________________________________________________________________
278 AliFMDSubDetector::Gsatt()
280 // Set drawing attributes for the detector
282 // DebugGuard guard("AliFMDSubDetector::Gsatt");
283 AliDebug(10, "AliFMDSubDetector::Gsatt");
284 TString name(Form("FMD%d", fId));
285 gMC->Gsatt(name.Data(), "SEEN", 0);
289 //____________________________________________________________________