]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDv0.cxx
Better sorting algorithm
[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"
86bd0ac4 39
40const Int_t AliPMDv0::fgkNcellHole = 24; // Hole dimension
41const Float_t AliPMDv0::fgkCellRadius = 0.25; // Radius of a hexagonal cell
42const Float_t AliPMDv0::fgkCellWall = 0.02; // Thickness of cell Wall
43const Float_t AliPMDv0::fgkCellDepth = 0.50; // Gas thickness
44const Float_t AliPMDv0::fgkBoundary = 0.7; // Thickness of Boundary wall
45const Float_t AliPMDv0::fgkThBase = 0.3; // Thickness of Base plate
46const Float_t AliPMDv0::fgkThAir = 0.1; // Thickness of Air
47const Float_t AliPMDv0::fgkThPCB = 0.16; // Thickness of PCB
48const Float_t AliPMDv0::fgkThLead = 1.5; // Thickness of Pb
49const Float_t AliPMDv0::fgkThSteel = 0.5; // Thickness of Steel
50const Float_t AliPMDv0::fgkZdist = 361.5; // z-position of the detector
51const Float_t AliPMDv0::fgkSqroot3 = 1.7320508;// Square Root of 3
52const Float_t AliPMDv0::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
53const Float_t AliPMDv0::fgkPi = 3.14159; // pi
c4561145 54
55ClassImp(AliPMDv0)
56
86bd0ac4 57//_____________________________________________________________________________
c4561145 58 AliPMDv0::AliPMDv0()
59{
60 //
61 // Default constructor
62 //
63 fMedSens=0;
64}
65
66//_____________________________________________________________________________
67AliPMDv0::AliPMDv0(const char *name, const char *title)
68 : AliPMD(name,title)
69{
70 //
71 // Standard constructor
72 //
73 fMedSens=0;
74}
75
76//_____________________________________________________________________________
77void AliPMDv0::CreateGeometry()
78{
79 //
80 // Create geometry for Photon Multiplicity Detector Version 3 :
81 // April 2, 2001
82 //
83 //Begin_Html
84 /*
85 <img src="picts/AliPMDv0.gif">
86 */
87 //End_Html
88 //Begin_Html
89 /*
90 <img src="picts/AliPMDv0Tree.gif">
91 */
92 //End_Html
93 GetParameters();
94 CreateSupermodule();
95 CreatePMD();
96}
97
98//_____________________________________________________________________________
99void AliPMDv0::CreateSupermodule()
100{
101 //
102 // Creates the geometry of the cells, places them in supermodule which
103 // is a rhombus object.
104
105 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
106 // *** HEXAGONAL CELLS WITH CELL RADIUS 0.25 cm (see "GetParameters")
107 // -- Author : S. Chattopadhyay, 02/04/1999.
108
109 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is placed inside another
110 // hexagonal cell made of Cu (ECCU) with larger radius, compared to ECAR. The difference
111 // in radius gives the dimension of half width of each cell wall.
112 // These cells are placed as 72 x 72 array in a
113 // rhombus shaped supermodule (EHC1). The rhombus shaped modules are designed
114 // to have closed packed structure.
115 //
116 // Each supermodule (ESMA, ESMB), made of G10 is filled with following components
117 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
118 // EHC1 --> Rhombus shaped parallelopiped containing the hexagonal cells
119 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
120 //
121 // ESMA, ESMB are placed in EMM1 along with EMPB (Pb converter)
122 // and EMFE (iron support)
123
124 // EMM1 made of
125 // ESMB --> Normal supermodule, mirror image of ESMA
126 // EMPB --> Pb converter
127 // EMFE --> Fe backing
128 // ESMA --> Normal supermodule
129 //
130 // ESMX, ESMY are placed in EMM2 along with EMPB (Pb converter)
131 // and EMFE (iron support)
132
133 // EMM2 made of
134 // ESMY --> Special supermodule, mirror image of ESMX,
135 // EMPB --> Pb converter
136 // EMFE --> Fe backing
137 // ESMX --> First of the two Special supermodules near the hole
138
139 // EMM3 made of
140 // ESMQ --> Special supermodule, mirror image of ESMX,
141 // EMPB --> Pb converter
142 // EMFE --> Fe backing
143 // ESMP --> Second of the two Special supermodules near the hole
144
145 // EMM2 and EMM3 are used to create the hexagonal HOLE
146
147 //
148 // EPMD
149 // |
150 // |
151 // ---------------------------------------------------------------------------
152 // | | | | |
153 // EHOL EMM1 EMM2 EMM3 EALM
154 // | | |
155 // -------------------- -------------------- --------------------
156 // | | | | | | | | | | | |
157 // ESMB EMPB EMFE ESMA ESMY EMPB EMFE ESMX ESMQ EMPB EMFE ESMP
158 // | | |
159 // ------------ ------------ -------------
160 // | | | | | | | | |
161 // EAIR EHC1 EAIR EAIR EHC2 EAIR EAIR EHC3 EAIR
162 // | | |
163 // ECCU ECCU ECCU
164 // | | |
165 // ECAR ECAR ECAR
166
167
168 Int_t i, j;
169 Float_t xb, yb, zb;
170 Int_t number;
171 Int_t ihrotm,irotdm;
c4561145 172 Int_t *idtmed = fIdtmed->GetArray()-599;
173
174 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
175 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
176
c4561145 177 //Subhasis, dimensional parameters of rhombus (dpara) as given to gsvolu
178 // rhombus to accomodate 72 x 72 hexagons, and with total 1.2cm extension
179 //(1mm tolerance on both side and 5mm thick G10 wall)
180 //
c4561145 181 // **** CELL SIZE 20 mm^2 EQUIVALENT
c4561145 182 // Inner hexagon filled with gas (Ar+CO2)
183
184 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
185
86bd0ac4 186 hexd2[4]= -fgkCellDepth/2.;
187 hexd2[7]= fgkCellDepth/2.;
188 hexd2[6]= fgkCellRadius - fgkCellWall;
189 hexd2[9]= fgkCellRadius - fgkCellWall;
c4561145 190
86bd0ac4 191 // Gas replaced by vacuum for v0(insensitive) version of PMD.
c4561145 192
193 gMC->Gsvolu("ECAR", "PGON", idtmed[697], hexd2,10);
194 gMC->Gsatt("ECAR", "SEEN", 0);
86bd0ac4 195
c4561145 196 // Outer hexagon made of Copper
86bd0ac4 197
c4561145 198 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
c4561145 199
86bd0ac4 200 hexd1[4]= -fgkCellDepth/2.;
201 hexd1[7]= fgkCellDepth/2.;
202 hexd1[6]= fgkCellRadius;
203 hexd1[9]= fgkCellRadius;
c4561145 204
205 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
206 gMC->Gsatt("ECCU", "SEEN", 1);
207
208 // --- place inner hex inside outer hex
209
ef61784c 210 gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
c4561145 211
86bd0ac4 212 // Rhombus shaped supermodules (defined by PARA)
213
214 // volume for SUPERMODULE
c4561145 215
86bd0ac4 216 Float_t dparasm1[6] = {12.5,12.5,0.8,30.,0.,0.};
217 dparasm1[0] = (fNcellSM+0.25)*hexd1[6] ;
218 dparasm1[1] = dparasm1[0] *fgkSqroot3by2;
219 dparasm1[2] = fSMthick/2.;
220
221 //
222 gMC->Gsvolu("ESMA","PARA", idtmed[607], dparasm1, 6);
c4561145 223 gMC->Gsatt("ESMA", "SEEN", 0);
224 //
86bd0ac4 225 gMC->Gsvolu("ESMB","PARA", idtmed[607], dparasm1, 6);
c4561145 226 gMC->Gsatt("ESMB", "SEEN", 0);
86bd0ac4 227
c4561145 228 // Air residing between the PCB and the base
86bd0ac4 229
230 Float_t dparaair[6] = {12.5,12.5,8.,30.,0.,0.};
231 dparaair[0]= dparasm1[0];
232 dparaair[1]= dparasm1[1];
233 dparaair[2]= fgkThAir/2.;
234
235 gMC->Gsvolu("EAIR","PARA", idtmed[698], dparaair, 6);
c4561145 236 gMC->Gsatt("EAIR", "SEEN", 0);
86bd0ac4 237
c4561145 238 // volume for honeycomb chamber EHC1
86bd0ac4 239
c4561145 240 Float_t dpara1[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 241 dpara1[0] = dparasm1[0];
242 dpara1[1] = dparasm1[1];
243 dpara1[2] = fgkCellDepth/2.;
c4561145 244
245 gMC->Gsvolu("EHC1","PARA", idtmed[698], dpara1, 6);
246 gMC->Gsatt("EHC1", "SEEN", 1);
247
c4561145 248 // Place hexagonal cells ECCU cells inside EHC1 (72 X 72)
249
86bd0ac4 250 Int_t xrow = 1;
c4561145 251
86bd0ac4 252 yb = -dpara1[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 253 zb = 0.;
254
86bd0ac4 255 for (j = 1; j <= fNcellSM; ++j) {
c4561145 256 xb =-(dpara1[0] + dpara1[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg)
257 if(xrow >= 2){
258 xb = xb+(xrow-1)*hexd1[6];
259 }
86bd0ac4 260 for (i = 1; i <= fNcellSM; ++i) {
261 number = i+(j-1)*fNcellSM;
ef61784c 262 gMC->Gspos("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY");
c4561145 263 xb += (hexd1[6]*2.);
264 }
265 xrow = xrow+1;
86bd0ac4 266 yb += (hexd1[6]*fgkSqroot3);
c4561145 267 }
268
269
270 // Place EHC1 and EAIR into ESMA and ESMB
271
86bd0ac4 272 Float_t zAir1,zAir2,zGas;
c4561145 273
274 //ESMA is normal supermodule with base at bottom, with EHC1
86bd0ac4 275 zAir1= -dparasm1[2] + fgkThBase + dparaair[2];
276 gMC->Gspos("EAIR", 1, "ESMA", 0., 0., zAir1, 0, "ONLY");
277 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 278 //Line below Commented for version 0 of PMD routine
86bd0ac4 279 // gMC->Gspos("EHC1", 1, "ESMA", 0., 0., zGas, 0, "ONLY");
280 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
281 gMC->Gspos("EAIR", 2, "ESMA", 0., 0., zAir2, 0, "ONLY");
c4561145 282
283 // ESMB is mirror image of ESMA, with base at top, with EHC1
284
86bd0ac4 285 zAir1= -dparasm1[2] + fgkThPCB + dparaair[2];
286 gMC->Gspos("EAIR", 3, "ESMB", 0., 0., zAir1, 0, "ONLY");
287 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 288 //Line below Commented for version 0 of PMD routine
86bd0ac4 289 // gMC->Gspos("EHC1", 2, "ESMB", 0., 0., zGas, 0, "ONLY");
290 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
291 gMC->Gspos("EAIR", 4, "ESMB", 0., 0., zAir2, 0, "ONLY");
c4561145 292
c4561145 293
86bd0ac4 294 // special supermodule EMM2(GEANT only) containing 6 unit modules
295 // volume for SUPERMODULE
c4561145 296
86bd0ac4 297 Float_t dparasm2[6] = {12.5,12.5,0.8,30.,0.,0.};
298 dparasm2[0]=(fNcellSM+0.25)*hexd1[6] ;
299 dparasm2[1] = (fNcellSM - fgkNcellHole + 0.25) * fgkSqroot3by2 * hexd1[6];
300 dparasm2[2] = fSMthick/2.;
c4561145 301
86bd0ac4 302 gMC->Gsvolu("ESMX","PARA", idtmed[607], dparasm2, 6);
c4561145 303 gMC->Gsatt("ESMX", "SEEN", 0);
304 //
86bd0ac4 305 gMC->Gsvolu("ESMY","PARA", idtmed[607], dparasm2, 6);
c4561145 306 gMC->Gsatt("ESMY", "SEEN", 0);
307
308 Float_t dpara2[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 309 dpara2[0] = dparasm2[0];
310 dpara2[1] = dparasm2[1];
311 dpara2[2] = fgkCellDepth/2.;
c4561145 312
313 gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara2, 6);
314 gMC->Gsatt("EHC2", "SEEN", 1);
315
316
317 // Air residing between the PCB and the base
318
86bd0ac4 319 Float_t dpara2Air[6] = {12.5,12.5,8.,30.,0.,0.};
320 dpara2Air[0]= dparasm2[0];
321 dpara2Air[1]= dparasm2[1];
322 dpara2Air[2]= fgkThAir/2.;
c4561145 323
86bd0ac4 324 gMC->Gsvolu("EAIX","PARA", idtmed[698], dpara2Air, 6);
c4561145 325 gMC->Gsatt("EAIX", "SEEN", 0);
326
327 // Place hexagonal single cells ECCU inside EHC2
328 // skip cells which go into the hole in top left corner.
329
330 xrow=1;
86bd0ac4 331 yb = -dpara2[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 332 zb = 0.;
86bd0ac4 333 for (j = 1; j <= (fNcellSM - fgkNcellHole); ++j) {
c4561145 334 xb =-(dpara2[0] + dpara2[1]*0.577) + 2*hexd1[6];
335 if(xrow >= 2){
336 xb = xb+(xrow-1)*hexd1[6];
337 }
86bd0ac4 338 for (i = 1; i <= fNcellSM; ++i) {
339 number = i+(j-1)*fNcellSM;
ef61784c 340 gMC->Gspos("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY");
c4561145 341 xb += (hexd1[6]*2.);
342 }
343 xrow = xrow+1;
86bd0ac4 344 yb += (hexd1[6]*fgkSqroot3);
c4561145 345 }
346
347
348 // ESMX is normal supermodule with base at bottom, with EHC2
349
86bd0ac4 350 zAir1= -dparasm2[2] + fgkThBase + dpara2Air[2];
351 gMC->Gspos("EAIX", 1, "ESMX", 0., 0., zAir1, 0, "ONLY");
352 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 353 //Line below Commented for version 0 of PMD routine
86bd0ac4 354 // gMC->Gspos("EHC2", 1, "ESMX", 0., 0., zGas, 0, "ONLY");
355 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
356 gMC->Gspos("EAIX", 2, "ESMX", 0., 0., zAir2, 0, "ONLY");
c4561145 357
358 // ESMY is mirror image of ESMX with base at bottom, with EHC2
359
86bd0ac4 360 zAir1= -dparasm2[2] + fgkThPCB + dpara2Air[2];
361 gMC->Gspos("EAIX", 3, "ESMY", 0., 0., zAir1, 0, "ONLY");
362 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 363 //Line below Commented for version 0 of PMD routine
86bd0ac4 364 // gMC->Gspos("EHC2", 2, "ESMY", 0., 0., zGas, 0, "ONLY");
365 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
366 gMC->Gspos("EAIX", 4, "ESMY", 0., 0., zAir2, 0, "ONLY");
c4561145 367
86bd0ac4 368 //
369 // special supermodule EMM3 (GEANT only) containing 2 unit modules
370 // volume for SUPERMODULE
371 //
372 Float_t dparaSM3[6] = {12.5,12.5,0.8,30.,0.,0.};
373 dparaSM3[0]=(fNcellSM - fgkNcellHole +0.25)*hexd1[6] ;
374 dparaSM3[1] = (fgkNcellHole + 0.25) * hexd1[6] * fgkSqroot3by2;
375 dparaSM3[2] = fSMthick/2.;
c4561145 376
86bd0ac4 377 gMC->Gsvolu("ESMP","PARA", idtmed[607], dparaSM3, 6);
c4561145 378 gMC->Gsatt("ESMP", "SEEN", 0);
379 //
86bd0ac4 380 gMC->Gsvolu("ESMQ","PARA", idtmed[607], dparaSM3, 6);
c4561145 381 gMC->Gsatt("ESMQ", "SEEN", 0);
382
383 Float_t dpara3[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 384 dpara3[0] = dparaSM3[0];
385 dpara3[1] = dparaSM3[1];
386 dpara3[2] = fgkCellDepth/2.;
c4561145 387
388 gMC->Gsvolu("EHC3","PARA", idtmed[698], dpara3, 6);
389 gMC->Gsatt("EHC3", "SEEN", 1);
390
c4561145 391 // Air residing between the PCB and the base
392
86bd0ac4 393 Float_t dpara3Air[6] = {12.5,12.5,8.,30.,0.,0.};
394 dpara3Air[0]= dparaSM3[0];
395 dpara3Air[1]= dparaSM3[1];
396 dpara3Air[2]= fgkThAir/2.;
c4561145 397
86bd0ac4 398 gMC->Gsvolu("EAIP","PARA", idtmed[698], dpara3Air, 6);
c4561145 399 gMC->Gsatt("EAIP", "SEEN", 0);
400
401
402 // Place hexagonal single cells ECCU inside EHC3
403 // skip cells which go into the hole in top left corner.
404
405 xrow=1;
86bd0ac4 406 yb = -dpara3[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 407 zb = 0.;
86bd0ac4 408 for (j = 1; j <= fgkNcellHole; ++j) {
c4561145 409 xb =-(dpara3[0] + dpara3[1]*0.577) + 2*hexd1[6];
410 if(xrow >= 2){
411 xb = xb+(xrow-1)*hexd1[6];
412 }
86bd0ac4 413 for (i = 1; i <= (fNcellSM - fgkNcellHole); ++i) {
414 number = i+(j-1)*(fNcellSM - fgkNcellHole);
ef61784c 415 gMC->Gspos("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY");
c4561145 416 xb += (hexd1[6]*2.);
417 }
418 xrow = xrow+1;
86bd0ac4 419 yb += (hexd1[6]*fgkSqroot3);
c4561145 420 }
421
422 // ESMP is normal supermodule with base at bottom, with EHC3
423
86bd0ac4 424 zAir1= -dparaSM3[2] + fgkThBase + dpara3Air[2];
425 gMC->Gspos("EAIP", 1, "ESMP", 0., 0., zAir1, 0, "ONLY");
426 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 427 //Line below Commented for version 0 of PMD routine
86bd0ac4 428 // gMC->Gspos("EHC3", 1, "ESMP", 0., 0., zGas, 0, "ONLY");
429 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
430 gMC->Gspos("EAIP", 2, "ESMP", 0., 0., zAir2, 0, "ONLY");
431
c4561145 432 // ESMQ is mirror image of ESMP with base at bottom, with EHC3
433
86bd0ac4 434 zAir1= -dparaSM3[2] + fgkThPCB + dpara3Air[2];
435 gMC->Gspos("EAIP", 3, "ESMQ", 0., 0., zAir1, 0, "ONLY");
436 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 437 //Line below Commented for version 0 of PMD routine
86bd0ac4 438 // gMC->Gspos("EHC3", 2, "ESMQ", 0., 0., zGas, 0, "ONLY");
439 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
440 gMC->Gspos("EAIP", 4, "ESMQ", 0., 0., zAir2, 0, "ONLY");
441
c4561145 442}
86bd0ac4 443
c4561145 444//_____________________________________________________________________________
445
446void AliPMDv0::CreatePMD()
447{
448 //
449 // Create final detector from supermodules
450 //
451 // -- Author : Y.P. VIYOGI, 07/05/1996.
452 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
453 // -- Modified: For New Geometry YPV, March 2001.
454
c4561145 455 Float_t xp, yp, zp;
86bd0ac4 456 Int_t i,j;
457 Int_t nummod;
c4561145 458 Int_t jhrot12,jhrot13, irotdm;
c4561145 459 Int_t *idtmed = fIdtmed->GetArray()-599;
460
461 // VOLUMES Names : begining with "E" for all PMD volumes,
462 // The names of SIZE variables begin with S and have more meaningful
463 // characters as shown below.
c4561145 464 // VOLUME SIZE MEDIUM : REMARKS
465 // ------ ----- ------ : ---------------------------
c4561145 466 // EPMD GASPMD AIR : INSIDE PMD and its SIZE
c4561145 467 // *** Define the EPMD Volume and fill with air ***
c4561145 468 // Gaspmd, the dimension of HEXAGONAL mother volume of PMD,
469
470
471 Float_t gaspmd[10] = {0.,360.,6,2,-4.,12.,150.,4.,12.,150.};
472
86bd0ac4 473 gaspmd[5] = fgkNcellHole * fgkCellRadius * 2. * fgkSqroot3by2;
c4561145 474 gaspmd[8] = gaspmd[5];
475
476 gMC->Gsvolu("EPMD", "PGON", idtmed[698], gaspmd, 10);
477 gMC->Gsatt("EPMD", "SEEN", 0);
478
479 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
480
481 AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.);
482 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
483
484
86bd0ac4 485 Float_t dmthick = 2. * fSMthick + fgkThLead + fgkThSteel;
c4561145 486
86bd0ac4 487 // dparaemm1 array contains parameters of the imaginary volume EMM1,
c4561145 488 // EMM1 is a master module of type 1, which has 24 copies in the PMD.
489 // EMM1 : normal volume as in old cases
490
491
86bd0ac4 492 Float_t dparaemm1[6] = {12.5,12.5,0.8,30.,0.,0.};
493 dparaemm1[0] = fSMLength/2.;
494 dparaemm1[1] = dparaemm1[0] *fgkSqroot3by2;
495 dparaemm1[2] = dmthick/2.;
c4561145 496
86bd0ac4 497 gMC->Gsvolu("EMM1","PARA", idtmed[698], dparaemm1, 6);
c4561145 498 gMC->Gsatt("EMM1", "SEEN", 1);
499
500 //
501 // --- DEFINE Modules, iron, and lead volumes
c4561145 502 // Pb Convertor for EMM1
c4561145 503
86bd0ac4 504 Float_t dparapb1[6] = {12.5,12.5,8.,30.,0.,0.};
505 dparapb1[0] = fSMLength/2.;
506 dparapb1[1] = dparapb1[0] * fgkSqroot3by2;
507 dparapb1[2] = fgkThLead/2.;
508
509 gMC->Gsvolu("EPB1","PARA", idtmed[600], dparapb1, 6);
c4561145 510 gMC->Gsatt ("EPB1", "SEEN", 0);
511
512 // Fe Support for EMM1
86bd0ac4 513 Float_t dparafe1[6] = {12.5,12.5,8.,30.,0.,0.};
514 dparafe1[0] = dparapb1[0];
515 dparafe1[1] = dparapb1[1];
516 dparafe1[2] = fgkThSteel/2.;
c4561145 517
86bd0ac4 518 gMC->Gsvolu("EFE1","PARA", idtmed[618], dparafe1, 6);
c4561145 519 gMC->Gsatt ("EFE1", "SEEN", 0);
520
c4561145 521 //
522 // position supermodule ESMA, ESMB, EPB1, EFE1 inside EMM1
523
86bd0ac4 524 Float_t zps,zpb,zfe,zcv;
c4561145 525
86bd0ac4 526 zps = -dparaemm1[2] + fSMthick/2.;
527 gMC->Gspos("ESMB", 1, "EMM1", 0., 0., zps, 0, "ONLY");
528 zpb = zps+fSMthick/2.+dparapb1[2];
529 gMC->Gspos("EPB1", 1, "EMM1", 0., 0., zpb, 0, "ONLY");
530 zfe = zpb+dparapb1[2]+dparafe1[2];
531 gMC->Gspos("EFE1", 1, "EMM1", 0., 0., zfe, 0, "ONLY");
532 zcv = zfe+dparafe1[2]+fSMthick/2.;
533 gMC->Gspos("ESMA", 1, "EMM1", 0., 0., zcv, 0, "ONLY");
c4561145 534
535 // EMM2 : special master module having full row of cells but the number
536 // of rows limited by hole.
537
86bd0ac4 538 Float_t dparaemm2[6] = {12.5,12.5,0.8,30.,0.,0.};
539 dparaemm2[0] = fSMLength/2.;
540 dparaemm2[1] = (fNcellSM - fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2;
541 dparaemm2[2] = dmthick/2.;
c4561145 542
86bd0ac4 543 gMC->Gsvolu("EMM2","PARA", idtmed[698], dparaemm2, 6);
c4561145 544 gMC->Gsatt("EMM2", "SEEN", 1);
545
c4561145 546 // Pb Convertor for EMM2
86bd0ac4 547 Float_t dparapb2[6] = {12.5,12.5,8.,30.,0.,0.};
548 dparapb2[0] = dparaemm2[0];
549 dparapb2[1] = dparaemm2[1];
550 dparapb2[2] = fgkThLead/2.;
c4561145 551
86bd0ac4 552 gMC->Gsvolu("EPB2","PARA", idtmed[600], dparapb2, 6);
c4561145 553 gMC->Gsatt ("EPB2", "SEEN", 0);
554
555 // Fe Support for EMM2
86bd0ac4 556 Float_t dparafe2[6] = {12.5,12.5,8.,30.,0.,0.};
557 dparafe2[0] = dparapb2[0];
558 dparafe2[1] = dparapb2[1];
559 dparafe2[2] = fgkThSteel/2.;
c4561145 560
86bd0ac4 561 gMC->Gsvolu("EFE2","PARA", idtmed[618], dparafe2, 6);
c4561145 562 gMC->Gsatt ("EFE2", "SEEN", 0);
563
c4561145 564 // position supermodule ESMX, ESMY inside EMM2
565
86bd0ac4 566 zps = -dparaemm2[2] + fSMthick/2.;
567 gMC->Gspos("ESMY", 1, "EMM2", 0., 0., zps, 0, "ONLY");
568 zpb = zps + fSMthick/2.+dparapb2[2];
569 gMC->Gspos("EPB2", 1, "EMM2", 0., 0., zpb, 0, "ONLY");
570 zfe = zpb + dparapb2[2]+dparafe2[2];
571 gMC->Gspos("EFE2", 1, "EMM2", 0., 0., zfe, 0, "ONLY");
572 zcv = zfe + dparafe2[2]+fSMthick/2.;
573 gMC->Gspos("ESMX", 1, "EMM2", 0., 0., zcv, 0, "ONLY");
c4561145 574 //
c4561145 575 // EMM3 : special master module having truncated rows and columns of cells
576 // limited by hole.
577
86bd0ac4 578 Float_t dparaemm3[6] = {12.5,12.5,0.8,30.,0.,0.};
579 dparaemm3[0] = dparaemm2[1]/fgkSqroot3by2;
580 dparaemm3[1] = (fgkNcellHole + 0.25) * fgkCellRadius *fgkSqroot3by2;
581 dparaemm3[2] = dmthick/2.;
c4561145 582
86bd0ac4 583 gMC->Gsvolu("EMM3","PARA", idtmed[698], dparaemm3, 6);
c4561145 584 gMC->Gsatt("EMM3", "SEEN", 1);
585
c4561145 586 // Pb Convertor for EMM3
86bd0ac4 587 Float_t dparapb3[6] = {12.5,12.5,8.,30.,0.,0.};
588 dparapb3[0] = dparaemm3[0];
589 dparapb3[1] = dparaemm3[1];
590 dparapb3[2] = fgkThLead/2.;
c4561145 591
86bd0ac4 592 gMC->Gsvolu("EPB3","PARA", idtmed[600], dparapb3, 6);
c4561145 593 gMC->Gsatt ("EPB3", "SEEN", 0);
594
595 // Fe Support for EMM3
86bd0ac4 596 Float_t dparafe3[6] = {12.5,12.5,8.,30.,0.,0.};
597 dparafe3[0] = dparapb3[0];
598 dparafe3[1] = dparapb3[1];
599 dparafe3[2] = fgkThSteel/2.;
c4561145 600
86bd0ac4 601 gMC->Gsvolu("EFE3","PARA", idtmed[618], dparafe3, 6);
c4561145 602 gMC->Gsatt ("EFE3", "SEEN", 0);
603
c4561145 604 // position supermodule ESMP, ESMQ inside EMM3
605
86bd0ac4 606 zps = -dparaemm3[2] + fSMthick/2.;
607 gMC->Gspos("ESMQ", 1, "EMM3", 0., 0., zps, 0, "ONLY");
608 zpb = zps + fSMthick/2.+dparapb3[2];
609 gMC->Gspos("EPB3", 1, "EMM3", 0., 0., zpb, 0, "ONLY");
610 zfe = zpb + dparapb3[2]+dparafe3[2];
611 gMC->Gspos("EFE3", 1, "EMM3", 0., 0., zfe, 0, "ONLY");
612 zcv = zfe + dparafe3[2] + fSMthick/2.;
613 gMC->Gspos("ESMP", 1, "EMM3", 0., 0., zcv, 0, "ONLY");
c4561145 614 //
615
616 // EHOL is a tube structure made of air
617 //
618 //Float_t d_hole[3];
619 //d_hole[0] = 0.;
86bd0ac4 620 //d_hole[1] = fgkNcellHole * fgkCellRadius *2. * fgkSqroot3by2 + boundary;
621 //d_hole[2] = dmthick/2.;
c4561145 622 //
623 //gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3);
624 //gMC->Gsatt("EHOL", "SEEN", 1);
625
626 //Al-rod as boundary of the supermodules
627
86bd0ac4 628 Float_t alRod[3] ;
629 alRod[0] = fSMLength * 3/2. - gaspmd[5]/2 - fgkBoundary ;
630 alRod[1] = fgkBoundary;
631 alRod[2] = dmthick/2.;
c4561145 632
86bd0ac4 633 gMC->Gsvolu("EALM","BOX ", idtmed[698], alRod, 3);
c4561145 634 gMC->Gsatt ("EALM", "SEEN", 1);
635 Float_t xalm[3];
86bd0ac4 636 xalm[0]=alRod[0] + gaspmd[5] + 3.0*fgkBoundary;
c4561145 637 xalm[1]=-xalm[0]/2.;
638 xalm[2]=xalm[1];
639
640 Float_t yalm[3];
641 yalm[0]=0.;
86bd0ac4 642 yalm[1]=xalm[0]*fgkSqroot3by2;
c4561145 643 yalm[2]=-yalm[1];
644
645 // delx = full side of the supermodule
86bd0ac4 646 Float_t delx=fSMLength * 3.;
647 Float_t x1= delx*fgkSqroot3by2 /2.;
c4561145 648 Float_t x4=delx/4.;
649
c4561145 650 // placing master modules and Al-rod in PMD
651
86bd0ac4 652 Float_t dx = fSMLength;
653 Float_t dy = dx * fgkSqroot3by2;
c4561145 654 Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2.,
655 -dx, 0., dx,
656 -3.*dx/2., -dx/2., dx/2.};
657
658 Float_t ysup[9] = {dy, dy, dy,
659 0., 0., 0.,
660 -dy, -dy, -dy};
661
662 // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes
663
86bd0ac4 664 Float_t xoff = fgkBoundary * TMath::Tan(fgkPi/6.);
665 Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-fgkBoundary/fgkSqroot3by2};
666 Float_t ymod[3] = {-x1 - fgkBoundary, x1 + fgkBoundary, 0.};
c4561145 667 Float_t xpos[9], ypos[9], x2, y2, x3, y3;
668
86bd0ac4 669 Float_t xemm2 = fSMLength/2. -
670 (fNcellSM + fgkNcellHole + 0.25) * fgkCellRadius * 0.5
c4561145 671 + xoff;
86bd0ac4 672 Float_t yemm2 = -(fNcellSM + fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2
673 - fgkBoundary;
c4561145 674
86bd0ac4 675 Float_t xemm3 = (fNcellSM + 0.5 * fgkNcellHole + 0.25) * fgkCellRadius +
676 xoff;
677 Float_t yemm3 = - (fgkNcellHole - 0.25) * fgkCellRadius * fgkSqroot3by2 -
678 fgkBoundary;
c4561145 679
86bd0ac4 680 Float_t theta[3] = {0., 2.*fgkPi/3., 4.*fgkPi/3.};
c4561145 681 Int_t irotate[3] = {0, jhrot12, jhrot13};
86bd0ac4 682
683 nummod=0;
ef61784c 684 for (j=0; j<3; ++j) {
685 gMC->Gspos("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY");
686 x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
687 y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
c4561145 688
ef61784c 689 gMC->Gspos("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY");
c4561145 690
ef61784c 691 x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
692 y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
c4561145 693
ef61784c 694 gMC->Gspos("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY");
c4561145 695
ef61784c 696 for (i=1; i<9; ++i) {
86bd0ac4 697 xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) -
698 ysup[i]*TMath::Sin(theta[j]);
699 ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) +
700 ysup[i]*TMath::Cos(theta[j]);
701 if(fDebug)
702 printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]);
703
704 nummod = nummod+1;
705
706 if(fDebug)
707 printf("\n%s: nummod %d\n",ClassName(),nummod);
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
771 // --- The Argon- CO2 mixture ---
772 Float_t ag[2] = { 39.95 };
773 Float_t zg[2] = { 18. };
774 Float_t wg[2] = { .8,.2 };
775 Float_t dar = .001782; // --- Ar density in g/cm3 ---
776 // --- CO2 ---
777 Float_t ac[2] = { 12.,16. };
778 Float_t zc[2] = { 6.,8. };
779 Float_t wc[2] = { 1.,2. };
780 Float_t dc = .001977;
781 Float_t dco = .002; // --- CO2 density in g/cm3 ---
782
783 Float_t absl, radl, a, d, z;
784 Float_t dg;
785 Float_t x0ar;
786 //Float_t x0xe=2.4;
787 //Float_t dxe=0.005858;
788 Float_t buf[1];
789 Int_t nbuf;
790 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
791 Float_t zsteel[4] = { 26.,24.,28.,14. };
792 Float_t wsteel[4] = { .715,.18,.1,.005 };
793
794 Int_t *idtmed = fIdtmed->GetArray()-599;
795 Int_t isxfld = gAlice->Field()->Integ();
796 Float_t sxmgmx = gAlice->Field()->Max();
797
798 // --- Define the various materials for GEANT ---
799 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
800 x0ar = 19.55 / dar;
801 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
802 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
803 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
804 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
805 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
806 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999.);
807 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
808 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
809 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
810 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
811 AliMaterial(17, "POLYCARBONATE $", 20., 10., 1.2, 34.6, 999.);
812 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
813 // AliMaterial(31, "Xenon$", 131.3, 54., dxe, x0xe, 6.5e4);
814
815 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
816 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
817 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
818 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
819
820 // define gas-mixtures
821
00d6d986 822 char namate[21]="";
c4561145 823 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
824 ag[1] = a;
825 zg[1] = z;
826 dg = (dar * 4 + dco) / 5;
827 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
828
829 // Define tracking media
830 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
831 AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
832 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
833 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
834 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
835 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
836 AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
837 AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
838 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
839 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
840 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
841 AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
842 AliMedium(17, "PLOYCARB$", 17, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
843 AliMedium(19, " S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
844 // AliMedium(31, "Xenon $", 31, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
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);
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);
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 //
df622204 905 if(fDebug) {
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
935 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
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}