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 ClassImp(AliFMDSubDetector);
39 //____________________________________________________________________
40 AliFMDSubDetector::AliFMDSubDetector(Int_t n)
48 //____________________________________________________________________
50 AliFMDSubDetector::Draw(Option_t* /* opt */) const
52 // DebugGuard guard("AliFMDSubDetector::Draw");
53 AliDebug(10, "AliFMDSubDetector::Draw");
56 //____________________________________________________________________
58 AliFMDSubDetector::CheckHit(Char_t ring, Int_t module, Double_t x, Double_t y)
60 // Check if a hit (x,y) in module module of ring ring is within the
67 ret = fInner->IsWithin(module, x, y);
72 ret = fOuter->IsWithin(module, x, y);
78 //____________________________________________________________________
80 AliFMDSubDetector::SimpleGeometry(TList* nodes,
85 // Make a simplified geometry for event display
89 // nodes List of nodes to register all create nodes in
90 // mother Mother node to put the ring in.
91 // colour Colour of the nodes
92 // zMother Z position of the node in the mother volume
94 for (int i = 0; i < 2; i++) {
109 // Make the coordinates relative to the mother volume. If we're
110 // on the positive side, then we need to flip the z-coordinate, as
111 // we'll rotate the whole sub-detector afterwards.
113 if (zMother > 0) z *= -1;
115 r->SimpleGeometry(nodes, mother, colour, z, fId);
120 //____________________________________________________________________
122 AliFMDSubDetector::SetupGeometry(Int_t airId, Int_t kaptionId)
124 // Set up the geometry of this particular detector.
126 // In this class, it defines the support honey comp calls and
130 // airId Medium of inactive virtual volumes
131 // kaptionId Medium of honeycomb
133 // DebugGuard guard("AliFMDSubDetector::SetupGeometry");
134 AliDebug(10, "AliFMDSubDetector::SetupGeometry");
138 for (int i = 0; i < 2; i++) {
145 par[0] = fInnerHoneyLowR;
146 par[1] = fInnerHoneyHighR;
151 par[0] = fOuterHoneyLowR;
152 par[1] = fOuterHoneyHighR;
156 // Top of honeycomb, inner ring
157 par[2] = fHoneycombThickness / 2;
160 name = Form("HT%c%d", c, fId);
161 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
163 // Bottom of honeycomb, inner ring
166 name = Form("HB%c%d", c, fId);
167 gMC->Gsvolu(name.Data(), "TUBS", kaptionId, par, 5);
169 // Air in top of honeycomb, inner ring
170 par[0] += fKaptionThickness;
171 par[1] -= fKaptionThickness;
172 par[2] -= fKaptionThickness;
175 name = Form("GT%c%d", c, fId);
176 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
178 // Air in bottom of honeycomb, inner ring
181 name = Form("GB%c%d", c, fId);
182 gMC->Gsvolu(name.Data(), "TUBS", airId, par, 5);
186 //____________________________________________________________________
188 AliFMDSubDetector::Geometry(const char* mother, Int_t pbRotId, Int_t idRotId,
191 // Place the volume inside mother volume.
195 // mother Volume to position this detector in
196 // pbRotId Print board rotation matrix,
197 // idRotId Identity rotation matrix
198 // zMother The Z passed in, is the position of the middle
199 // point of the mother volume.
201 // In this base class, it asks the contained rings to position
202 // themselves in the mother volume, and positions the honey comb
203 // support in the mother volume
205 // DebugGuard guard("AliFMDSubDetector::Geometry");
206 AliDebug(10, "AliFMDSubDetector::Geometry");
214 for (int i = 0; i < 2; i++) {
231 // Make the coordinates relative to the mother volume. If we're
232 // on the positive side, then we need to flip the z-coordinate, as
233 // we'll rotate the whole sub-detector afterwards.
235 if (zMother > 0) z *= -1;
237 r->Geometry(mother, fId, z, pbRotId, idRotId);
238 ringW = r->GetRingDepth();
239 z -= ringW + fHoneycombThickness / 2;
242 name = Form("HT%c%d", c, fId);
243 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
245 // Air in top of honeycomb
247 name = Form("GT%c%d", c, fId);
248 gMC->Gspos(name.Data(), 1, name2.Data(),0,fKaptionThickness,0,idRotId);
250 // Bottom of honeycomb
251 name = Form("HB%c%d", c, fId);
252 gMC->Gspos(name.Data(), 1, mother, 0, 0, z, idRotId);
254 // Air in bottom of honeycomb
256 name = Form("GB%c%d", c, fId);
257 gMC->Gspos(name.Data(),1,name2.Data(),0,-fKaptionThickness,0,idRotId);
261 //____________________________________________________________________
263 AliFMDSubDetector::Gsatt()
265 // Set drawing attributes for the detector
267 // DebugGuard guard("AliFMDSubDetector::Gsatt");
268 AliDebug(10, "AliFMDSubDetector::Gsatt");
269 TString name(Form("FMD%d", fId));
270 gMC->Gsatt(name.Data(), "SEEN", 0);
274 //____________________________________________________________________