GetMedium replaced by CurrentMedium (I.Hrivnacova)
[u/mrichter/AliRoot.git] / PMD / AliPMDv0.cxx
CommitLineData
c4561145 1/***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
dee197d3 15
88cb7938 16/* $Id$ */
c4561145 17
18//
19///////////////////////////////////////////////////////////////////////////////
20// //
21// Photon Multiplicity Detector Version 1 //
22// //
23//Begin_Html
24/*
25<img src="picts/AliPMDv0Class.gif">
26*/
27//End_Html
28// //
29///////////////////////////////////////////////////////////////////////////////
30////
31
88cb7938 32#include "Riostream.h"
88cb7938 33#include <TVirtualMC.h>
c4561145 34#include "AliConst.h"
35#include "AliMagF.h"
88cb7938 36#include "AliPMDv0.h"
37#include "AliRun.h"
5d12ce38 38#include "AliMC.h"
4951e003 39#include "AliLog.h"
86bd0ac4 40
41const Int_t AliPMDv0::fgkNcellHole = 24; // Hole dimension
42const Float_t AliPMDv0::fgkCellRadius = 0.25; // Radius of a hexagonal cell
43const Float_t AliPMDv0::fgkCellWall = 0.02; // Thickness of cell Wall
44const Float_t AliPMDv0::fgkCellDepth = 0.50; // Gas thickness
45const Float_t AliPMDv0::fgkBoundary = 0.7; // Thickness of Boundary wall
46const Float_t AliPMDv0::fgkThBase = 0.3; // Thickness of Base plate
47const Float_t AliPMDv0::fgkThAir = 0.1; // Thickness of Air
48const Float_t AliPMDv0::fgkThPCB = 0.16; // Thickness of PCB
49const Float_t AliPMDv0::fgkThLead = 1.5; // Thickness of Pb
50const Float_t AliPMDv0::fgkThSteel = 0.5; // Thickness of Steel
51const Float_t AliPMDv0::fgkZdist = 361.5; // z-position of the detector
52const Float_t AliPMDv0::fgkSqroot3 = 1.7320508;// Square Root of 3
53const Float_t AliPMDv0::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
54const Float_t AliPMDv0::fgkPi = 3.14159; // pi
c4561145 55
56ClassImp(AliPMDv0)
57
86bd0ac4 58//_____________________________________________________________________________
c4561145 59 AliPMDv0::AliPMDv0()
60{
61 //
62 // Default constructor
63 //
64 fMedSens=0;
65}
66
67//_____________________________________________________________________________
68AliPMDv0::AliPMDv0(const char *name, const char *title)
69 : AliPMD(name,title)
70{
71 //
72 // Standard constructor
73 //
74 fMedSens=0;
75}
76
77//_____________________________________________________________________________
78void AliPMDv0::CreateGeometry()
79{
80 //
81 // Create geometry for Photon Multiplicity Detector Version 3 :
82 // April 2, 2001
83 //
84 //Begin_Html
85 /*
86 <img src="picts/AliPMDv0.gif">
87 */
88 //End_Html
89 //Begin_Html
90 /*
91 <img src="picts/AliPMDv0Tree.gif">
92 */
93 //End_Html
94 GetParameters();
95 CreateSupermodule();
96 CreatePMD();
97}
98
99//_____________________________________________________________________________
100void AliPMDv0::CreateSupermodule()
101{
102 //
103 // Creates the geometry of the cells, places them in supermodule which
104 // is a rhombus object.
105
106 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
107 // *** HEXAGONAL CELLS WITH CELL RADIUS 0.25 cm (see "GetParameters")
108 // -- Author : S. Chattopadhyay, 02/04/1999.
109
110 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is placed inside another
111 // hexagonal cell made of Cu (ECCU) with larger radius, compared to ECAR. The difference
112 // in radius gives the dimension of half width of each cell wall.
113 // These cells are placed as 72 x 72 array in a
114 // rhombus shaped supermodule (EHC1). The rhombus shaped modules are designed
115 // to have closed packed structure.
116 //
117 // Each supermodule (ESMA, ESMB), made of G10 is filled with following components
118 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
119 // EHC1 --> Rhombus shaped parallelopiped containing the hexagonal cells
120 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
121 //
122 // ESMA, ESMB are placed in EMM1 along with EMPB (Pb converter)
123 // and EMFE (iron support)
124
125 // EMM1 made of
126 // ESMB --> Normal supermodule, mirror image of ESMA
127 // EMPB --> Pb converter
128 // EMFE --> Fe backing
129 // ESMA --> Normal supermodule
130 //
131 // ESMX, ESMY are placed in EMM2 along with EMPB (Pb converter)
132 // and EMFE (iron support)
133
134 // EMM2 made of
135 // ESMY --> Special supermodule, mirror image of ESMX,
136 // EMPB --> Pb converter
137 // EMFE --> Fe backing
138 // ESMX --> First of the two Special supermodules near the hole
139
140 // EMM3 made of
141 // ESMQ --> Special supermodule, mirror image of ESMX,
142 // EMPB --> Pb converter
143 // EMFE --> Fe backing
144 // ESMP --> Second of the two Special supermodules near the hole
145
146 // EMM2 and EMM3 are used to create the hexagonal HOLE
147
148 //
149 // EPMD
150 // |
151 // |
152 // ---------------------------------------------------------------------------
153 // | | | | |
154 // EHOL EMM1 EMM2 EMM3 EALM
155 // | | |
156 // -------------------- -------------------- --------------------
157 // | | | | | | | | | | | |
158 // ESMB EMPB EMFE ESMA ESMY EMPB EMFE ESMX ESMQ EMPB EMFE ESMP
159 // | | |
160 // ------------ ------------ -------------
161 // | | | | | | | | |
162 // EAIR EHC1 EAIR EAIR EHC2 EAIR EAIR EHC3 EAIR
163 // | | |
164 // ECCU ECCU ECCU
165 // | | |
166 // ECAR ECAR ECAR
167
168
169 Int_t i, j;
170 Float_t xb, yb, zb;
171 Int_t number;
172 Int_t ihrotm,irotdm;
c4561145 173 Int_t *idtmed = fIdtmed->GetArray()-599;
174
175 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
176 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
177
c4561145 178 //Subhasis, dimensional parameters of rhombus (dpara) as given to gsvolu
179 // rhombus to accomodate 72 x 72 hexagons, and with total 1.2cm extension
180 //(1mm tolerance on both side and 5mm thick G10 wall)
181 //
c4561145 182 // **** CELL SIZE 20 mm^2 EQUIVALENT
c4561145 183 // Inner hexagon filled with gas (Ar+CO2)
184
185 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
186
86bd0ac4 187 hexd2[4]= -fgkCellDepth/2.;
188 hexd2[7]= fgkCellDepth/2.;
189 hexd2[6]= fgkCellRadius - fgkCellWall;
190 hexd2[9]= fgkCellRadius - fgkCellWall;
c4561145 191
86bd0ac4 192 // Gas replaced by vacuum for v0(insensitive) version of PMD.
c4561145 193
194 gMC->Gsvolu("ECAR", "PGON", idtmed[697], hexd2,10);
195 gMC->Gsatt("ECAR", "SEEN", 0);
86bd0ac4 196
c4561145 197 // Outer hexagon made of Copper
86bd0ac4 198
c4561145 199 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
c4561145 200
86bd0ac4 201 hexd1[4]= -fgkCellDepth/2.;
202 hexd1[7]= fgkCellDepth/2.;
203 hexd1[6]= fgkCellRadius;
204 hexd1[9]= fgkCellRadius;
c4561145 205
206 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
207 gMC->Gsatt("ECCU", "SEEN", 1);
208
209 // --- place inner hex inside outer hex
210
ef61784c 211 gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
c4561145 212
86bd0ac4 213 // Rhombus shaped supermodules (defined by PARA)
214
215 // volume for SUPERMODULE
c4561145 216
86bd0ac4 217 Float_t dparasm1[6] = {12.5,12.5,0.8,30.,0.,0.};
218 dparasm1[0] = (fNcellSM+0.25)*hexd1[6] ;
219 dparasm1[1] = dparasm1[0] *fgkSqroot3by2;
220 dparasm1[2] = fSMthick/2.;
221
222 //
223 gMC->Gsvolu("ESMA","PARA", idtmed[607], dparasm1, 6);
c4561145 224 gMC->Gsatt("ESMA", "SEEN", 0);
225 //
86bd0ac4 226 gMC->Gsvolu("ESMB","PARA", idtmed[607], dparasm1, 6);
c4561145 227 gMC->Gsatt("ESMB", "SEEN", 0);
86bd0ac4 228
c4561145 229 // Air residing between the PCB and the base
86bd0ac4 230
231 Float_t dparaair[6] = {12.5,12.5,8.,30.,0.,0.};
232 dparaair[0]= dparasm1[0];
233 dparaair[1]= dparasm1[1];
234 dparaair[2]= fgkThAir/2.;
235
236 gMC->Gsvolu("EAIR","PARA", idtmed[698], dparaair, 6);
c4561145 237 gMC->Gsatt("EAIR", "SEEN", 0);
86bd0ac4 238
c4561145 239 // volume for honeycomb chamber EHC1
86bd0ac4 240
c4561145 241 Float_t dpara1[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 242 dpara1[0] = dparasm1[0];
243 dpara1[1] = dparasm1[1];
244 dpara1[2] = fgkCellDepth/2.;
c4561145 245
246 gMC->Gsvolu("EHC1","PARA", idtmed[698], dpara1, 6);
247 gMC->Gsatt("EHC1", "SEEN", 1);
248
c4561145 249 // Place hexagonal cells ECCU cells inside EHC1 (72 X 72)
250
86bd0ac4 251 Int_t xrow = 1;
c4561145 252
86bd0ac4 253 yb = -dpara1[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 254 zb = 0.;
255
86bd0ac4 256 for (j = 1; j <= fNcellSM; ++j) {
c4561145 257 xb =-(dpara1[0] + dpara1[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg)
258 if(xrow >= 2){
259 xb = xb+(xrow-1)*hexd1[6];
260 }
86bd0ac4 261 for (i = 1; i <= fNcellSM; ++i) {
262 number = i+(j-1)*fNcellSM;
ef61784c 263 gMC->Gspos("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY");
c4561145 264 xb += (hexd1[6]*2.);
265 }
266 xrow = xrow+1;
86bd0ac4 267 yb += (hexd1[6]*fgkSqroot3);
c4561145 268 }
269
270
271 // Place EHC1 and EAIR into ESMA and ESMB
272
86bd0ac4 273 Float_t zAir1,zAir2,zGas;
c4561145 274
275 //ESMA is normal supermodule with base at bottom, with EHC1
86bd0ac4 276 zAir1= -dparasm1[2] + fgkThBase + dparaair[2];
277 gMC->Gspos("EAIR", 1, "ESMA", 0., 0., zAir1, 0, "ONLY");
278 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 279 //Line below Commented for version 0 of PMD routine
86bd0ac4 280 // gMC->Gspos("EHC1", 1, "ESMA", 0., 0., zGas, 0, "ONLY");
281 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
282 gMC->Gspos("EAIR", 2, "ESMA", 0., 0., zAir2, 0, "ONLY");
c4561145 283
284 // ESMB is mirror image of ESMA, with base at top, with EHC1
285
86bd0ac4 286 zAir1= -dparasm1[2] + fgkThPCB + dparaair[2];
287 gMC->Gspos("EAIR", 3, "ESMB", 0., 0., zAir1, 0, "ONLY");
288 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 289 //Line below Commented for version 0 of PMD routine
86bd0ac4 290 // gMC->Gspos("EHC1", 2, "ESMB", 0., 0., zGas, 0, "ONLY");
291 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
292 gMC->Gspos("EAIR", 4, "ESMB", 0., 0., zAir2, 0, "ONLY");
c4561145 293
c4561145 294
86bd0ac4 295 // special supermodule EMM2(GEANT only) containing 6 unit modules
296 // volume for SUPERMODULE
c4561145 297
86bd0ac4 298 Float_t dparasm2[6] = {12.5,12.5,0.8,30.,0.,0.};
299 dparasm2[0]=(fNcellSM+0.25)*hexd1[6] ;
300 dparasm2[1] = (fNcellSM - fgkNcellHole + 0.25) * fgkSqroot3by2 * hexd1[6];
301 dparasm2[2] = fSMthick/2.;
c4561145 302
86bd0ac4 303 gMC->Gsvolu("ESMX","PARA", idtmed[607], dparasm2, 6);
c4561145 304 gMC->Gsatt("ESMX", "SEEN", 0);
305 //
86bd0ac4 306 gMC->Gsvolu("ESMY","PARA", idtmed[607], dparasm2, 6);
c4561145 307 gMC->Gsatt("ESMY", "SEEN", 0);
308
309 Float_t dpara2[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 310 dpara2[0] = dparasm2[0];
311 dpara2[1] = dparasm2[1];
312 dpara2[2] = fgkCellDepth/2.;
c4561145 313
314 gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara2, 6);
315 gMC->Gsatt("EHC2", "SEEN", 1);
316
317
318 // Air residing between the PCB and the base
319
86bd0ac4 320 Float_t dpara2Air[6] = {12.5,12.5,8.,30.,0.,0.};
321 dpara2Air[0]= dparasm2[0];
322 dpara2Air[1]= dparasm2[1];
323 dpara2Air[2]= fgkThAir/2.;
c4561145 324
86bd0ac4 325 gMC->Gsvolu("EAIX","PARA", idtmed[698], dpara2Air, 6);
c4561145 326 gMC->Gsatt("EAIX", "SEEN", 0);
327
328 // Place hexagonal single cells ECCU inside EHC2
329 // skip cells which go into the hole in top left corner.
330
331 xrow=1;
86bd0ac4 332 yb = -dpara2[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 333 zb = 0.;
86bd0ac4 334 for (j = 1; j <= (fNcellSM - fgkNcellHole); ++j) {
c4561145 335 xb =-(dpara2[0] + dpara2[1]*0.577) + 2*hexd1[6];
336 if(xrow >= 2){
337 xb = xb+(xrow-1)*hexd1[6];
338 }
86bd0ac4 339 for (i = 1; i <= fNcellSM; ++i) {
340 number = i+(j-1)*fNcellSM;
ef61784c 341 gMC->Gspos("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY");
c4561145 342 xb += (hexd1[6]*2.);
343 }
344 xrow = xrow+1;
86bd0ac4 345 yb += (hexd1[6]*fgkSqroot3);
c4561145 346 }
347
348
349 // ESMX is normal supermodule with base at bottom, with EHC2
350
86bd0ac4 351 zAir1= -dparasm2[2] + fgkThBase + dpara2Air[2];
352 gMC->Gspos("EAIX", 1, "ESMX", 0., 0., zAir1, 0, "ONLY");
353 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 354 //Line below Commented for version 0 of PMD routine
86bd0ac4 355 // gMC->Gspos("EHC2", 1, "ESMX", 0., 0., zGas, 0, "ONLY");
356 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
357 gMC->Gspos("EAIX", 2, "ESMX", 0., 0., zAir2, 0, "ONLY");
c4561145 358
359 // ESMY is mirror image of ESMX with base at bottom, with EHC2
360
86bd0ac4 361 zAir1= -dparasm2[2] + fgkThPCB + dpara2Air[2];
362 gMC->Gspos("EAIX", 3, "ESMY", 0., 0., zAir1, 0, "ONLY");
363 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 364 //Line below Commented for version 0 of PMD routine
86bd0ac4 365 // gMC->Gspos("EHC2", 2, "ESMY", 0., 0., zGas, 0, "ONLY");
366 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
367 gMC->Gspos("EAIX", 4, "ESMY", 0., 0., zAir2, 0, "ONLY");
c4561145 368
86bd0ac4 369 //
370 // special supermodule EMM3 (GEANT only) containing 2 unit modules
371 // volume for SUPERMODULE
372 //
373 Float_t dparaSM3[6] = {12.5,12.5,0.8,30.,0.,0.};
374 dparaSM3[0]=(fNcellSM - fgkNcellHole +0.25)*hexd1[6] ;
375 dparaSM3[1] = (fgkNcellHole + 0.25) * hexd1[6] * fgkSqroot3by2;
376 dparaSM3[2] = fSMthick/2.;
c4561145 377
86bd0ac4 378 gMC->Gsvolu("ESMP","PARA", idtmed[607], dparaSM3, 6);
c4561145 379 gMC->Gsatt("ESMP", "SEEN", 0);
380 //
86bd0ac4 381 gMC->Gsvolu("ESMQ","PARA", idtmed[607], dparaSM3, 6);
c4561145 382 gMC->Gsatt("ESMQ", "SEEN", 0);
383
384 Float_t dpara3[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 385 dpara3[0] = dparaSM3[0];
386 dpara3[1] = dparaSM3[1];
387 dpara3[2] = fgkCellDepth/2.;
c4561145 388
389 gMC->Gsvolu("EHC3","PARA", idtmed[698], dpara3, 6);
390 gMC->Gsatt("EHC3", "SEEN", 1);
391
c4561145 392 // Air residing between the PCB and the base
393
86bd0ac4 394 Float_t dpara3Air[6] = {12.5,12.5,8.,30.,0.,0.};
395 dpara3Air[0]= dparaSM3[0];
396 dpara3Air[1]= dparaSM3[1];
397 dpara3Air[2]= fgkThAir/2.;
c4561145 398
86bd0ac4 399 gMC->Gsvolu("EAIP","PARA", idtmed[698], dpara3Air, 6);
c4561145 400 gMC->Gsatt("EAIP", "SEEN", 0);
401
402
403 // Place hexagonal single cells ECCU inside EHC3
404 // skip cells which go into the hole in top left corner.
405
406 xrow=1;
86bd0ac4 407 yb = -dpara3[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 408 zb = 0.;
86bd0ac4 409 for (j = 1; j <= fgkNcellHole; ++j) {
c4561145 410 xb =-(dpara3[0] + dpara3[1]*0.577) + 2*hexd1[6];
411 if(xrow >= 2){
412 xb = xb+(xrow-1)*hexd1[6];
413 }
86bd0ac4 414 for (i = 1; i <= (fNcellSM - fgkNcellHole); ++i) {
415 number = i+(j-1)*(fNcellSM - fgkNcellHole);
ef61784c 416 gMC->Gspos("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY");
c4561145 417 xb += (hexd1[6]*2.);
418 }
419 xrow = xrow+1;
86bd0ac4 420 yb += (hexd1[6]*fgkSqroot3);
c4561145 421 }
422
423 // ESMP is normal supermodule with base at bottom, with EHC3
424
86bd0ac4 425 zAir1= -dparaSM3[2] + fgkThBase + dpara3Air[2];
426 gMC->Gspos("EAIP", 1, "ESMP", 0., 0., zAir1, 0, "ONLY");
427 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 428 //Line below Commented for version 0 of PMD routine
86bd0ac4 429 // gMC->Gspos("EHC3", 1, "ESMP", 0., 0., zGas, 0, "ONLY");
430 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
431 gMC->Gspos("EAIP", 2, "ESMP", 0., 0., zAir2, 0, "ONLY");
432
c4561145 433 // ESMQ is mirror image of ESMP with base at bottom, with EHC3
434
86bd0ac4 435 zAir1= -dparaSM3[2] + fgkThPCB + dpara3Air[2];
436 gMC->Gspos("EAIP", 3, "ESMQ", 0., 0., zAir1, 0, "ONLY");
437 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 438 //Line below Commented for version 0 of PMD routine
86bd0ac4 439 // gMC->Gspos("EHC3", 2, "ESMQ", 0., 0., zGas, 0, "ONLY");
440 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
441 gMC->Gspos("EAIP", 4, "ESMQ", 0., 0., zAir2, 0, "ONLY");
442
c4561145 443}
86bd0ac4 444
c4561145 445//_____________________________________________________________________________
446
447void AliPMDv0::CreatePMD()
448{
449 //
450 // Create final detector from supermodules
451 //
452 // -- Author : Y.P. VIYOGI, 07/05/1996.
453 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
454 // -- Modified: For New Geometry YPV, March 2001.
455
c4561145 456 Float_t xp, yp, zp;
86bd0ac4 457 Int_t i,j;
458 Int_t nummod;
c4561145 459 Int_t jhrot12,jhrot13, irotdm;
c4561145 460 Int_t *idtmed = fIdtmed->GetArray()-599;
461
462 // VOLUMES Names : begining with "E" for all PMD volumes,
463 // The names of SIZE variables begin with S and have more meaningful
464 // characters as shown below.
c4561145 465 // VOLUME SIZE MEDIUM : REMARKS
466 // ------ ----- ------ : ---------------------------
c4561145 467 // EPMD GASPMD AIR : INSIDE PMD and its SIZE
c4561145 468 // *** Define the EPMD Volume and fill with air ***
c4561145 469 // Gaspmd, the dimension of HEXAGONAL mother volume of PMD,
470
471
472 Float_t gaspmd[10] = {0.,360.,6,2,-4.,12.,150.,4.,12.,150.};
473
86bd0ac4 474 gaspmd[5] = fgkNcellHole * fgkCellRadius * 2. * fgkSqroot3by2;
c4561145 475 gaspmd[8] = gaspmd[5];
476
477 gMC->Gsvolu("EPMD", "PGON", idtmed[698], gaspmd, 10);
478 gMC->Gsatt("EPMD", "SEEN", 0);
479
480 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
481
482 AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.);
483 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
484
485
86bd0ac4 486 Float_t dmthick = 2. * fSMthick + fgkThLead + fgkThSteel;
c4561145 487
86bd0ac4 488 // dparaemm1 array contains parameters of the imaginary volume EMM1,
c4561145 489 // EMM1 is a master module of type 1, which has 24 copies in the PMD.
490 // EMM1 : normal volume as in old cases
491
492
86bd0ac4 493 Float_t dparaemm1[6] = {12.5,12.5,0.8,30.,0.,0.};
494 dparaemm1[0] = fSMLength/2.;
495 dparaemm1[1] = dparaemm1[0] *fgkSqroot3by2;
496 dparaemm1[2] = dmthick/2.;
c4561145 497
86bd0ac4 498 gMC->Gsvolu("EMM1","PARA", idtmed[698], dparaemm1, 6);
c4561145 499 gMC->Gsatt("EMM1", "SEEN", 1);
500
501 //
502 // --- DEFINE Modules, iron, and lead volumes
c4561145 503 // Pb Convertor for EMM1
c4561145 504
86bd0ac4 505 Float_t dparapb1[6] = {12.5,12.5,8.,30.,0.,0.};
506 dparapb1[0] = fSMLength/2.;
507 dparapb1[1] = dparapb1[0] * fgkSqroot3by2;
508 dparapb1[2] = fgkThLead/2.;
509
510 gMC->Gsvolu("EPB1","PARA", idtmed[600], dparapb1, 6);
c4561145 511 gMC->Gsatt ("EPB1", "SEEN", 0);
512
513 // Fe Support for EMM1
86bd0ac4 514 Float_t dparafe1[6] = {12.5,12.5,8.,30.,0.,0.};
515 dparafe1[0] = dparapb1[0];
516 dparafe1[1] = dparapb1[1];
517 dparafe1[2] = fgkThSteel/2.;
c4561145 518
86bd0ac4 519 gMC->Gsvolu("EFE1","PARA", idtmed[618], dparafe1, 6);
c4561145 520 gMC->Gsatt ("EFE1", "SEEN", 0);
521
c4561145 522 //
523 // position supermodule ESMA, ESMB, EPB1, EFE1 inside EMM1
524
86bd0ac4 525 Float_t zps,zpb,zfe,zcv;
c4561145 526
86bd0ac4 527 zps = -dparaemm1[2] + fSMthick/2.;
528 gMC->Gspos("ESMB", 1, "EMM1", 0., 0., zps, 0, "ONLY");
529 zpb = zps+fSMthick/2.+dparapb1[2];
530 gMC->Gspos("EPB1", 1, "EMM1", 0., 0., zpb, 0, "ONLY");
531 zfe = zpb+dparapb1[2]+dparafe1[2];
532 gMC->Gspos("EFE1", 1, "EMM1", 0., 0., zfe, 0, "ONLY");
533 zcv = zfe+dparafe1[2]+fSMthick/2.;
534 gMC->Gspos("ESMA", 1, "EMM1", 0., 0., zcv, 0, "ONLY");
c4561145 535
536 // EMM2 : special master module having full row of cells but the number
537 // of rows limited by hole.
538
86bd0ac4 539 Float_t dparaemm2[6] = {12.5,12.5,0.8,30.,0.,0.};
540 dparaemm2[0] = fSMLength/2.;
541 dparaemm2[1] = (fNcellSM - fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2;
542 dparaemm2[2] = dmthick/2.;
c4561145 543
86bd0ac4 544 gMC->Gsvolu("EMM2","PARA", idtmed[698], dparaemm2, 6);
c4561145 545 gMC->Gsatt("EMM2", "SEEN", 1);
546
c4561145 547 // Pb Convertor for EMM2
86bd0ac4 548 Float_t dparapb2[6] = {12.5,12.5,8.,30.,0.,0.};
549 dparapb2[0] = dparaemm2[0];
550 dparapb2[1] = dparaemm2[1];
551 dparapb2[2] = fgkThLead/2.;
c4561145 552
86bd0ac4 553 gMC->Gsvolu("EPB2","PARA", idtmed[600], dparapb2, 6);
c4561145 554 gMC->Gsatt ("EPB2", "SEEN", 0);
555
556 // Fe Support for EMM2
86bd0ac4 557 Float_t dparafe2[6] = {12.5,12.5,8.,30.,0.,0.};
558 dparafe2[0] = dparapb2[0];
559 dparafe2[1] = dparapb2[1];
560 dparafe2[2] = fgkThSteel/2.;
c4561145 561
86bd0ac4 562 gMC->Gsvolu("EFE2","PARA", idtmed[618], dparafe2, 6);
c4561145 563 gMC->Gsatt ("EFE2", "SEEN", 0);
564
c4561145 565 // position supermodule ESMX, ESMY inside EMM2
566
86bd0ac4 567 zps = -dparaemm2[2] + fSMthick/2.;
568 gMC->Gspos("ESMY", 1, "EMM2", 0., 0., zps, 0, "ONLY");
569 zpb = zps + fSMthick/2.+dparapb2[2];
570 gMC->Gspos("EPB2", 1, "EMM2", 0., 0., zpb, 0, "ONLY");
571 zfe = zpb + dparapb2[2]+dparafe2[2];
572 gMC->Gspos("EFE2", 1, "EMM2", 0., 0., zfe, 0, "ONLY");
573 zcv = zfe + dparafe2[2]+fSMthick/2.;
574 gMC->Gspos("ESMX", 1, "EMM2", 0., 0., zcv, 0, "ONLY");
c4561145 575 //
c4561145 576 // EMM3 : special master module having truncated rows and columns of cells
577 // limited by hole.
578
86bd0ac4 579 Float_t dparaemm3[6] = {12.5,12.5,0.8,30.,0.,0.};
580 dparaemm3[0] = dparaemm2[1]/fgkSqroot3by2;
581 dparaemm3[1] = (fgkNcellHole + 0.25) * fgkCellRadius *fgkSqroot3by2;
582 dparaemm3[2] = dmthick/2.;
c4561145 583
86bd0ac4 584 gMC->Gsvolu("EMM3","PARA", idtmed[698], dparaemm3, 6);
c4561145 585 gMC->Gsatt("EMM3", "SEEN", 1);
586
c4561145 587 // Pb Convertor for EMM3
86bd0ac4 588 Float_t dparapb3[6] = {12.5,12.5,8.,30.,0.,0.};
589 dparapb3[0] = dparaemm3[0];
590 dparapb3[1] = dparaemm3[1];
591 dparapb3[2] = fgkThLead/2.;
c4561145 592
86bd0ac4 593 gMC->Gsvolu("EPB3","PARA", idtmed[600], dparapb3, 6);
c4561145 594 gMC->Gsatt ("EPB3", "SEEN", 0);
595
596 // Fe Support for EMM3
86bd0ac4 597 Float_t dparafe3[6] = {12.5,12.5,8.,30.,0.,0.};
598 dparafe3[0] = dparapb3[0];
599 dparafe3[1] = dparapb3[1];
600 dparafe3[2] = fgkThSteel/2.;
c4561145 601
86bd0ac4 602 gMC->Gsvolu("EFE3","PARA", idtmed[618], dparafe3, 6);
c4561145 603 gMC->Gsatt ("EFE3", "SEEN", 0);
604
c4561145 605 // position supermodule ESMP, ESMQ inside EMM3
606
86bd0ac4 607 zps = -dparaemm3[2] + fSMthick/2.;
608 gMC->Gspos("ESMQ", 1, "EMM3", 0., 0., zps, 0, "ONLY");
609 zpb = zps + fSMthick/2.+dparapb3[2];
610 gMC->Gspos("EPB3", 1, "EMM3", 0., 0., zpb, 0, "ONLY");
611 zfe = zpb + dparapb3[2]+dparafe3[2];
612 gMC->Gspos("EFE3", 1, "EMM3", 0., 0., zfe, 0, "ONLY");
613 zcv = zfe + dparafe3[2] + fSMthick/2.;
614 gMC->Gspos("ESMP", 1, "EMM3", 0., 0., zcv, 0, "ONLY");
c4561145 615 //
616
617 // EHOL is a tube structure made of air
618 //
619 //Float_t d_hole[3];
620 //d_hole[0] = 0.;
86bd0ac4 621 //d_hole[1] = fgkNcellHole * fgkCellRadius *2. * fgkSqroot3by2 + boundary;
622 //d_hole[2] = dmthick/2.;
c4561145 623 //
624 //gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3);
625 //gMC->Gsatt("EHOL", "SEEN", 1);
626
627 //Al-rod as boundary of the supermodules
628
86bd0ac4 629 Float_t alRod[3] ;
630 alRod[0] = fSMLength * 3/2. - gaspmd[5]/2 - fgkBoundary ;
631 alRod[1] = fgkBoundary;
632 alRod[2] = dmthick/2.;
c4561145 633
86bd0ac4 634 gMC->Gsvolu("EALM","BOX ", idtmed[698], alRod, 3);
c4561145 635 gMC->Gsatt ("EALM", "SEEN", 1);
636 Float_t xalm[3];
86bd0ac4 637 xalm[0]=alRod[0] + gaspmd[5] + 3.0*fgkBoundary;
c4561145 638 xalm[1]=-xalm[0]/2.;
639 xalm[2]=xalm[1];
640
641 Float_t yalm[3];
642 yalm[0]=0.;
86bd0ac4 643 yalm[1]=xalm[0]*fgkSqroot3by2;
c4561145 644 yalm[2]=-yalm[1];
645
646 // delx = full side of the supermodule
86bd0ac4 647 Float_t delx=fSMLength * 3.;
648 Float_t x1= delx*fgkSqroot3by2 /2.;
c4561145 649 Float_t x4=delx/4.;
650
c4561145 651 // placing master modules and Al-rod in PMD
652
86bd0ac4 653 Float_t dx = fSMLength;
654 Float_t dy = dx * fgkSqroot3by2;
c4561145 655 Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2.,
656 -dx, 0., dx,
657 -3.*dx/2., -dx/2., dx/2.};
658
659 Float_t ysup[9] = {dy, dy, dy,
660 0., 0., 0.,
661 -dy, -dy, -dy};
662
663 // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes
664
86bd0ac4 665 Float_t xoff = fgkBoundary * TMath::Tan(fgkPi/6.);
666 Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-fgkBoundary/fgkSqroot3by2};
667 Float_t ymod[3] = {-x1 - fgkBoundary, x1 + fgkBoundary, 0.};
c4561145 668 Float_t xpos[9], ypos[9], x2, y2, x3, y3;
669
86bd0ac4 670 Float_t xemm2 = fSMLength/2. -
671 (fNcellSM + fgkNcellHole + 0.25) * fgkCellRadius * 0.5
c4561145 672 + xoff;
86bd0ac4 673 Float_t yemm2 = -(fNcellSM + fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2
674 - fgkBoundary;
c4561145 675
86bd0ac4 676 Float_t xemm3 = (fNcellSM + 0.5 * fgkNcellHole + 0.25) * fgkCellRadius +
677 xoff;
678 Float_t yemm3 = - (fgkNcellHole - 0.25) * fgkCellRadius * fgkSqroot3by2 -
679 fgkBoundary;
c4561145 680
86bd0ac4 681 Float_t theta[3] = {0., 2.*fgkPi/3., 4.*fgkPi/3.};
c4561145 682 Int_t irotate[3] = {0, jhrot12, jhrot13};
86bd0ac4 683
684 nummod=0;
ef61784c 685 for (j=0; j<3; ++j) {
686 gMC->Gspos("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY");
687 x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
688 y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
c4561145 689
ef61784c 690 gMC->Gspos("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY");
c4561145 691
ef61784c 692 x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
693 y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
c4561145 694
ef61784c 695 gMC->Gspos("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY");
c4561145 696
ef61784c 697 for (i=1; i<9; ++i) {
86bd0ac4 698 xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) -
699 ysup[i]*TMath::Sin(theta[j]);
700 ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) +
701 ysup[i]*TMath::Cos(theta[j]);
4951e003 702
703 AliDebugClass(1,Form("xpos: %f, ypos: %f", xpos[i], ypos[i]));
86bd0ac4 704
705 nummod = nummod+1;
706
4951e003 707 AliDebugClass(1,Form("nummod %d",nummod));
86bd0ac4 708
709 gMC->Gspos("EMM1", nummod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY");
710
711 }
ef61784c 712 }
86bd0ac4 713
714
c4561145 715 // place EHOL in the centre of EPMD
716 // gMC->Gspos("EHOL", 1, "EPMD", 0.,0.,0., 0, "ONLY");
86bd0ac4 717
c4561145 718 // --- Place the EPMD in ALICE
719 xp = 0.;
720 yp = 0.;
86bd0ac4 721 zp = fgkZdist;
c4561145 722
723 gMC->Gspos("EPMD", 1, "ALIC", xp,yp,zp, 0, "ONLY");
724
725}
726
727
728//_____________________________________________________________________________
86bd0ac4 729void AliPMDv0::DrawModule() const
c4561145 730{
731 //
732 // Draw a shaded view of the Photon Multiplicity Detector
733 //
734
735 gMC->Gsatt("*", "seen", -1);
736 gMC->Gsatt("alic", "seen", 0);
737 //
738 // Set the visibility of the components
739 //
740 gMC->Gsatt("ECAR","seen",0);
741 gMC->Gsatt("ECCU","seen",1);
742 gMC->Gsatt("EHC1","seen",1);
743 gMC->Gsatt("EHC1","seen",1);
744 gMC->Gsatt("EHC2","seen",1);
745 gMC->Gsatt("EMM1","seen",1);
746 gMC->Gsatt("EHOL","seen",1);
747 gMC->Gsatt("EPMD","seen",0);
748 //
749 gMC->Gdopt("hide", "on");
750 gMC->Gdopt("shad", "on");
751 gMC->Gsatt("*", "fill", 7);
752 gMC->SetClipBox(".");
753 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
754 gMC->DefaultRange();
755 gMC->Gdraw("alic", 40, 30, 0, 22, 20.5, .02, .02);
756 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
757
758 //gMC->Gdman(17, 5, "MAN");
759 gMC->Gdopt("hide", "off");
760}
761
762//_____________________________________________________________________________
763void AliPMDv0::CreateMaterials()
764{
765 //
766 // Create materials for the PMD
767 //
768 // ORIGIN : Y. P. VIYOGI
769 //
770
f017d70a 771 // cout << " Inside create materials " << endl;
908ce7f5 772
c4561145 773 Int_t *idtmed = fIdtmed->GetArray()-599;
774 Int_t isxfld = gAlice->Field()->Integ();
775 Float_t sxmgmx = gAlice->Field()->Max();
776
777 // --- Define the various materials for GEANT ---
f017d70a 778
c4561145 779 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
f017d70a 780
781 // Argon
782
783 Float_t dAr = 0.001782; // --- Ar density in g/cm3 ---
784 Float_t x0Ar = 19.55 / dAr;
785 AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
786
787 // --- CO2 ---
788
789 Float_t aCO2[2] = { 12.,16. };
790 Float_t zCO2[2] = { 6.,8. };
791 Float_t wCO2[2] = { 1.,2. };
792 Float_t dCO2 = 0.001977;
793 AliMixture(3, "CO2 $", aCO2, zCO2, dCO2, -2, wCO2);
794
c4561145 795 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
f017d70a 796
797 // ArCO2
798
799 Float_t aArCO2[3] = {39.948,12.0107,15.9994};
800 Float_t zArCO2[3] = {18.,6.,8.};
801 Float_t wArCO2[3] = {0.7,0.08,0.22};
802 Float_t dArCO2 = dAr * 0.7 + dCO2 * 0.3;
803 AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
804
c4561145 805 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
f017d70a 806
807 // G10
c4561145 808
f017d70a 809 Float_t aG10[4]={1.,12.011,15.9994,28.086};
810 Float_t zG10[4]={1.,6.,8.,14.};
d49fe99a 811 //PH Float_t wG10[4]={0.148648649,0.104054054,0.483499056,0.241666667};
812 Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
f017d70a 813 AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
c4561145 814
f017d70a 815 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
816
817 // Steel
818 Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
819 Float_t zSteel[4] = { 26.,24.,28.,14. };
820 Float_t wSteel[4] = { .715,.18,.1,.005 };
821 Float_t dSteel = 7.88;
822 AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
823
824 //Air
825
826 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
827 Float_t zAir[4]={6.,7.,8.,18.};
828 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
829 Float_t dAir1 = 1.20479E-10;
830 Float_t dAir = 1.20479E-3;
831 AliMixture(98, "Vacum$", aAir, zAir, dAir1, 4, wAir);
832 AliMixture(99, "Air $", aAir, zAir, dAir , 4, wAir);
833
c4561145 834 // Define tracking media
f017d70a 835 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
836 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
837 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
838 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
839 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
840 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
841 AliMedium(19, "S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
842 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
843 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
844
c4561145 845
846 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
847 gMC->Gstpar(idtmed[600], "LOSS", 3.);
848 gMC->Gstpar(idtmed[600], "DRAY", 1.);
849
850 gMC->Gstpar(idtmed[603], "LOSS", 3.);
851 gMC->Gstpar(idtmed[603], "DRAY", 1.);
852
853 gMC->Gstpar(idtmed[604], "LOSS", 3.);
854 gMC->Gstpar(idtmed[604], "DRAY", 1.);
855
856 gMC->Gstpar(idtmed[605], "LOSS", 3.);
857 gMC->Gstpar(idtmed[605], "DRAY", 1.);
858
859 gMC->Gstpar(idtmed[606], "LOSS", 3.);
860 gMC->Gstpar(idtmed[606], "DRAY", 1.);
861
862 gMC->Gstpar(idtmed[607], "LOSS", 3.);
863 gMC->Gstpar(idtmed[607], "DRAY", 1.);
864
865 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
866 // --- without affecting the hit patterns ---
867 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
868 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
869 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
870 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
871 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
872 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
873 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
874 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
875 gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
876 gMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
877 gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
878 gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
879 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
880 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
881 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
882 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
d49fe99a 883// gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
884// gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
885// gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
886// gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
c4561145 887
888 // --- Prevent particles stopping in the gas due to energy cut-off ---
889 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
890 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
891 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
892 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
893 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
894}
895
896//_____________________________________________________________________________
897void AliPMDv0::Init()
898{
899 //
900 // Initialises PMD detector after it has been built
901 //
902 Int_t i;
86bd0ac4 903 // kdet=1;
c4561145 904 //
4951e003 905 if(AliLog::GetGlobalDebugLevel()>0) {
df622204 906 printf("\n%s: ",ClassName());
907 for(i=0;i<35;i++) printf("*");
908 printf(" PMD_INIT ");
909 for(i=0;i<35;i++) printf("*");
910 printf("\n%s: ",ClassName());
911 printf(" PMD simulation package (v0) initialised\n");
912 printf("%s: parameters of pmd\n", ClassName());
dee197d3 913 printf("%s: %10.2f %10.2f %10.2f \
86bd0ac4 914 %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
df622204 915 printf("%s: ",ClassName());
916 for(i=0;i<80;i++) printf("*");
917 printf("\n");
918 }
c4561145 919 Int_t *idtmed = fIdtmed->GetArray()-599;
920 fMedSens=idtmed[605-1];
921}
922
923//_____________________________________________________________________________
924void AliPMDv0::StepManager()
925{
926 //
927 // Called at each step in the PMD
928 //
929 Int_t copy;
930 Float_t hits[4], destep;
931 Float_t center[3] = {0,0,0};
932 Int_t vol[5];
933 //char *namep;
934
fa914fe6 935 if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
c4561145 936
937 gMC->CurrentVolID(copy);
938
939 //namep=gMC->CurrentVolName();
940 //printf("Current vol is %s \n",namep);
941
942 vol[0]=copy;
943 gMC->CurrentVolOffID(1,copy);
944
945 //namep=gMC->CurrentVolOffName(1);
946 //printf("Current vol 11 is %s \n",namep);
947
948 vol[1]=copy;
949 gMC->CurrentVolOffID(2,copy);
950
951 //namep=gMC->CurrentVolOffName(2);
952 //printf("Current vol 22 is %s \n",namep);
953
954 vol[2]=copy;
955
956 // if(strncmp(namep,"EHC1",4))vol[2]=1;
957
958 gMC->CurrentVolOffID(3,copy);
959
960 //namep=gMC->CurrentVolOffName(3);
961 //printf("Current vol 33 is %s \n",namep);
962
963 vol[3]=copy;
964 gMC->CurrentVolOffID(4,copy);
965
966 //namep=gMC->CurrentVolOffName(4);
967 //printf("Current vol 44 is %s \n",namep);
968
969 vol[4]=copy;
970 //printf("volume number %d,%d,%d,%d,%d,%f \n",vol[0],vol[1],vol[2],vol[3],vol[4],destep*1000000);
971
972 gMC->Gdtom(center,hits,1);
973 hits[3] = destep*1e9; //Number in eV
5d12ce38 974 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
c4561145 975 }
976}
977
978
979//------------------------------------------------------------------------
980// Get parameters
981
982void AliPMDv0::GetParameters()
983{
86bd0ac4 984 // This gives all the parameters of the detector
985 // such as Length of Supermodules
986 // thickness of the Supermodule
987 //
988 Int_t ncellum, numum;
989 ncellum = 24;
990 numum = 3;
991 fNcellSM = ncellum * numum; //no. of cells in a row in one supermodule
992 fSMLength = (fNcellSM + 0.25 )*fgkCellRadius*2.;
993 fSMthick = fgkThBase + fgkThAir + fgkThPCB + fgkCellDepth +
994 fgkThPCB + fgkThAir + fgkThPCB;
c4561145 995}