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