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"
36 #ifndef ROOT_TVirtualMC
37 # include <TVirtualMC.h>
49 ClassImp(AliFMDSubDetector);
51 //____________________________________________________________________
52 AliFMDSubDetector::AliFMDSubDetector(Int_t n)
60 //____________________________________________________________________
62 AliFMDSubDetector::Draw(Option_t* /* opt */) const
64 // DebugGuard guard("AliFMDSubDetector::Draw");
65 AliDebug(10, "AliFMDSubDetector::Draw");
68 //____________________________________________________________________
70 AliFMDSubDetector::CheckHit(Char_t ring, Int_t module, Double_t x, Double_t y)
72 // Check if a hit (x,y) in module module of ring ring is within the
79 ret = fInner->IsWithin(module, x, y);
84 ret = fOuter->IsWithin(module, x, y);
90 //____________________________________________________________________
92 AliFMDSubDetector::SimpleGeometry(TList* nodes,
97 // Make a simplified geometry for event display
101 // nodes List of nodes to register all create nodes in
102 // mother Mother node to put the ring in.
103 // colour Colour of the nodes
104 // zMother Z position of the node in the mother volume
106 for (int i = 0; i < 2; i++) {
121 // Make the coordinates relative to the mother volume. If we're
122 // on the positive side, then we need to flip the z-coordinate, as
123 // we'll rotate the whole sub-detector afterwards.
125 if (zMother > 0) z *= -1;
127 r->SimpleGeometry(nodes, mother, colour, z, fId);
132 //____________________________________________________________________
134 AliFMDSubDetector::SetupGeometry(Int_t airId, Int_t kaptionId)
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 // kaptionId Medium of honeycomb
145 // DebugGuard guard("AliFMDSubDetector::SetupGeometry");
146 AliDebug(10, "AliFMDSubDetector::SetupGeometry");
150 for (int i = 0; i < 2; i++) {
157 par[0] = fInnerHoneyLowR;
158 par[1] = fInnerHoneyHighR;
163 par[0] = fOuterHoneyLowR;
164 par[1] = fOuterHoneyHighR;
168 // Top of honeycomb, inner ring
169 par[2] = fHoneycombThickness / 2;
172 name = Form("HT%c%d", c, fId);
173 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
175 // Bottom of honeycomb, inner ring
178 name = Form("HB%c%d", c, fId);
179 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
181 // Air in top of honeycomb, inner ring
182 par[0] += fKaptionThickness;
183 par[1] -= fKaptionThickness;
184 par[2] -= fKaptionThickness;
187 name = Form("GT%c%d", c, fId);
188 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
190 // Air in bottom of honeycomb, inner ring
193 name = Form("GB%c%d", c, fId);
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++) {
243 // Make the coordinates relative to the mother volume. If we're
244 // on the positive side, then we need to flip the z-coordinate, as
245 // we'll rotate the whole sub-detector afterwards.
247 if (zMother > 0) z *= -1;
249 r->Geometry(mother, fId, z, pbRotId, idRotId);
250 ringW = r->GetRingDepth();
251 z -= ringW + fHoneycombThickness / 2;
254 name = Form("HT%c%d", c, fId);
255 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
257 // Air in top of honeycomb
259 name = Form("GT%c%d", c, fId);
260 gMC->Gspos(name.Data(), 1, name2.Data(),0,fKaptionThickness,0,idRotId);
262 // Bottom of honeycomb
263 name = Form("HB%c%d", c, fId);
264 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
266 // Air in bottom of honeycomb
268 name = Form("GB%c%d", c, fId);
269 gMC->Gspos(name.Data(),1,name2.Data(),0,-fKaptionThickness,0,idRotId);
273 //____________________________________________________________________
275 AliFMDSubDetector::Gsatt()
277 // Set drawing attributes for the detector
279 // DebugGuard guard("AliFMDSubDetector::Gsatt");
280 AliDebug(10, "AliFMDSubDetector::Gsatt");
281 TString name(Form("FMD%d", fId));
282 gMC->Gsatt(name.Data(), "SEEN", 0);
286 //____________________________________________________________________