]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDv1.cxx
Constants start with k. Warnings corrected.
[u/mrichter/AliRoot.git] / PMD / AliPMDv1.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 **************************************************************************/
15/*
16$Log$
93bdec82 17Revision 1.16 2001/05/21 17:44:04 hristov
18Backslash to continue strings
19
dee197d3 20Revision 1.15 2001/05/21 10:59:49 morsch
21Lost changes from revision 1.13 recovered.
22
1592ac65 23Revision 1.14 2001/05/21 09:39:28 morsch
24Minor modifications on the geometry. (Tapan Nayak)
25
26Revision 1.13 2001/05/16 14:57:19 alibrary
27New files for folders and Stack
28
9e1a0ddb 29Revision 1.12 2001/05/14 14:01:04 morsch
30AliPMDv0 coarse geometry and AliPMDv1 detailed simulation, completely revised versions by Tapan Nayak.
31
c4561145 32*/
33//
34///////////////////////////////////////////////////////////////////////////////
35// //
36// Photon Multiplicity Detector Version 1 //
37// //
38//Begin_Html
39/*
40<img src="picts/AliPMDv1Class.gif">
41*/
42//End_Html
43// //
44///////////////////////////////////////////////////////////////////////////////
45////
46
47#include "AliPMDv1.h"
48#include "AliRun.h"
49#include "AliMC.h"
50#include "AliConst.h"
51#include "AliMagF.h"
93bdec82 52#include "Riostream.h"
c4561145 53
54static Int_t kdet, ncell_sm, ncell_hole;
55static Float_t zdist, zdist1;
56static Float_t sm_length, sm_thick, cell_radius, cell_wall, cell_depth;
57static Float_t boundary, th_base, th_air, th_pcb;
58static Float_t th_lead, th_steel;
59
60ClassImp(AliPMDv1)
61
62 //_____________________________________________________________________________
63 AliPMDv1::AliPMDv1()
64{
65 //
66 // Default constructor
67 //
68 fMedSens=0;
69}
70
71//_____________________________________________________________________________
72AliPMDv1::AliPMDv1(const char *name, const char *title)
73 : AliPMD(name,title)
74{
75 //
76 // Standard constructor
77 //
78 fMedSens=0;
79}
80
81//_____________________________________________________________________________
82void AliPMDv1::CreateGeometry()
83{
84 //
85 // Create geometry for Photon Multiplicity Detector Version 3 :
86 // April 2, 2001
87 //
88 //Begin_Html
89 /*
90 <img src="picts/AliPMDv1.gif">
91 */
92 //End_Html
93 //Begin_Html
94 /*
95 <img src="picts/AliPMDv1Tree.gif">
96 */
97 //End_Html
98 GetParameters();
99 CreateSupermodule();
100 CreatePMD();
101}
102
103//_____________________________________________________________________________
104void AliPMDv1::CreateSupermodule()
105{
106 //
107 // Creates the geometry of the cells, places them in supermodule which
108 // is a rhombus object.
109
110 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
111 // *** HEXAGONAL CELLS WITH CELL RADIUS 0.25 cm (see "GetParameters")
112 // -- Author : S. Chattopadhyay, 02/04/1999.
113
114 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is placed inside another
115 // hexagonal cell made of Cu (ECCU) with larger radius, compared to ECAR. The difference
116 // in radius gives the dimension of half width of each cell wall.
117 // These cells are placed as 72 x 72 array in a
118 // rhombus shaped supermodule (EHC1). The rhombus shaped modules are designed
119 // to have closed packed structure.
120 //
121 // Each supermodule (ESMA, ESMB), made of G10 is filled with following components
122 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
123 // EHC1 --> Rhombus shaped parallelopiped containing the hexagonal cells
124 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
125 //
126 // ESMA, ESMB are placed in EMM1 along with EMPB (Pb converter)
127 // and EMFE (iron support)
128
129 // EMM1 made of
130 // ESMB --> Normal supermodule, mirror image of ESMA
131 // EMPB --> Pb converter
132 // EMFE --> Fe backing
133 // ESMA --> Normal supermodule
134 //
135 // ESMX, ESMY are placed in EMM2 along with EMPB (Pb converter)
136 // and EMFE (iron support)
137
138 // EMM2 made of
139 // ESMY --> Special supermodule, mirror image of ESMX,
140 // EMPB --> Pb converter
141 // EMFE --> Fe backing
142 // ESMX --> First of the two Special supermodules near the hole
143
144 // EMM3 made of
145 // ESMQ --> Special supermodule, mirror image of ESMX,
146 // EMPB --> Pb converter
147 // EMFE --> Fe backing
148 // ESMP --> Second of the two Special supermodules near the hole
149
150 // EMM2 and EMM3 are used to create the hexagonal HOLE
151
152 //
153 // EPMD
154 // |
155 // |
156 // ---------------------------------------------------------------------------
157 // | | | | |
158 // EHOL EMM1 EMM2 EMM3 EALM
159 // | | |
160 // -------------------- -------------------- --------------------
161 // | | | | | | | | | | | |
162 // ESMB EMPB EMFE ESMA ESMY EMPB EMFE ESMX ESMQ EMPB EMFE ESMP
163 // | | |
164 // ------------ ------------ -------------
165 // | | | | | | | | |
166 // EAIR EHC1 EAIR EAIR EHC2 EAIR EAIR EHC3 EAIR
167 // | | |
168 // ECCU ECCU ECCU
169 // | | |
170 // ECAR ECAR ECAR
171
172
173 Int_t i, j;
174 Float_t xb, yb, zb;
175 Int_t number;
176 Int_t ihrotm,irotdm;
177 const Float_t root3_2 = TMath::Sqrt(3.) /2.;
178 Int_t *idtmed = fIdtmed->GetArray()-599;
179
180 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
181 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
182
183 zdist = TMath::Abs(zdist1);
184
185
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 //
190
191 // **** CELL SIZE 20 mm^2 EQUIVALENT
192
193 // Inner hexagon filled with gas (Ar+CO2)
194
195 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
196
197 hexd2[4]= - cell_depth/2.;
198 hexd2[7]= cell_depth/2.;
199 hexd2[6]= cell_radius - cell_wall;
200 hexd2[9]= cell_radius - cell_wall;
201
202 gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
203 gMC->Gsatt("ECAR", "SEEN", 0);
204
205 // Outer hexagon made of Copper
206
207 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
208 //total wall thickness=0.2*2
209
210 hexd1[4]= - cell_depth/2.;
211 hexd1[7]= cell_depth/2.;
212 hexd1[6]= cell_radius;
213 hexd1[9]= cell_radius;
214
215 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
216 gMC->Gsatt("ECCU", "SEEN", 1);
217
218 // --- place inner hex inside outer hex
219
220 gMC->Gsposp("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY", hexd2, 10);
221
222// Rhombus shaped supermodules (defined by PARA)
223
224// volume for SUPERMODULE
225
226 Float_t dpara_sm1[6] = {12.5,12.5,0.8,30.,0.,0.};
227 dpara_sm1[0]=(ncell_sm+0.25)*hexd1[6] ;
228 dpara_sm1[1] = dpara_sm1[0] *root3_2;
229 dpara_sm1[2] = sm_thick/2.;
230
231//
232 gMC->Gsvolu("ESMA","PARA", idtmed[607], dpara_sm1, 6);
233 gMC->Gsatt("ESMA", "SEEN", 0);
234 //
235 gMC->Gsvolu("ESMB","PARA", idtmed[607], dpara_sm1, 6);
236 gMC->Gsatt("ESMB", "SEEN", 0);
237
238 // Air residing between the PCB and the base
239
240 Float_t dpara_air[6] = {12.5,12.5,8.,30.,0.,0.};
241 dpara_air[0]= dpara_sm1[0];
242 dpara_air[1]= dpara_sm1[1];
243 dpara_air[2]= th_air/2.;
244
245 gMC->Gsvolu("EAIR","PARA", idtmed[698], dpara_air, 6);
246 gMC->Gsatt("EAIR", "SEEN", 0);
247
248 // volume for honeycomb chamber EHC1
249
250 Float_t dpara1[6] = {12.5,12.5,0.4,30.,0.,0.};
251 dpara1[0] = dpara_sm1[0];
252 dpara1[1] = dpara_sm1[1];
253 dpara1[2] = cell_depth/2.;
254
255 gMC->Gsvolu("EHC1","PARA", idtmed[698], dpara1, 6);
256 gMC->Gsatt("EHC1", "SEEN", 1);
257
258
259
260 // Place hexagonal cells ECCU cells inside EHC1 (72 X 72)
261
262 Int_t xrow=1;
263
264 yb = -dpara1[1] + (1./root3_2)*hexd1[6];
265 zb = 0.;
266
267 for (j = 1; j <= ncell_sm; ++j) {
268 xb =-(dpara1[0] + dpara1[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg)
269 if(xrow >= 2){
270 xb = xb+(xrow-1)*hexd1[6];
271 }
272 for (i = 1; i <= ncell_sm; ++i) {
273 number = i+(j-1)*ncell_sm;
274 gMC->Gsposp("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
275 xb += (hexd1[6]*2.);
276 }
277 xrow = xrow+1;
278 yb += (hexd1[6]*TMath::Sqrt(3.));
279 }
280
281
282 // Place EHC1 and EAIR into ESMA and ESMB
283
284 Float_t z_air1,z_air2,z_gas;
285
286 //ESMA is normal supermodule with base at bottom, with EHC1
287 z_air1= -dpara_sm1[2] + th_base + dpara_air[2];
288 gMC->Gspos("EAIR", 1, "ESMA", 0., 0., z_air1, 0, "ONLY");
289 z_gas=z_air1+dpara_air[2]+ th_pcb + dpara1[2];
290 gMC->Gspos("EHC1", 1, "ESMA", 0., 0., z_gas, 0, "ONLY");
291 z_air2=z_gas+dpara1[2]+ th_pcb + dpara_air[2];
292 gMC->Gspos("EAIR", 2, "ESMA", 0., 0., z_air2, 0, "ONLY");
293
294 // ESMB is mirror image of ESMA, with base at top, with EHC1
295
296 z_air1= -dpara_sm1[2] + th_pcb + dpara_air[2];
297 gMC->Gspos("EAIR", 3, "ESMB", 0., 0., z_air1, 0, "ONLY");
298 z_gas=z_air1+dpara_air[2]+ th_pcb + dpara1[2];
299 gMC->Gspos("EHC1", 2, "ESMB", 0., 0., z_gas, 0, "ONLY");
300 z_air2=z_gas+dpara1[2]+ th_pcb + dpara_air[2];
301 gMC->Gspos("EAIR", 4, "ESMB", 0., 0., z_air2, 0, "ONLY");
302
303
304// special supermodule EMM2(GEANT only) containing 6 unit modules
305
306// volume for SUPERMODULE
307
308 Float_t dpara_sm2[6] = {12.5,12.5,0.8,30.,0.,0.};
309 dpara_sm2[0]=(ncell_sm+0.25)*hexd1[6] ;
310 dpara_sm2[1] = (ncell_sm - ncell_hole + 0.25) * root3_2 * hexd1[6];
311 dpara_sm2[2] = sm_thick/2.;
312
313 gMC->Gsvolu("ESMX","PARA", idtmed[607], dpara_sm2, 6);
314 gMC->Gsatt("ESMX", "SEEN", 0);
315 //
316 gMC->Gsvolu("ESMY","PARA", idtmed[607], dpara_sm2, 6);
317 gMC->Gsatt("ESMY", "SEEN", 0);
318
319 Float_t dpara2[6] = {12.5,12.5,0.4,30.,0.,0.};
320 dpara2[0] = dpara_sm2[0];
321 dpara2[1] = dpara_sm2[1];
322 dpara2[2] = cell_depth/2.;
323
324 gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara2, 6);
325 gMC->Gsatt("EHC2", "SEEN", 1);
326
327
328 // Air residing between the PCB and the base
329
330 Float_t dpara2_air[6] = {12.5,12.5,8.,30.,0.,0.};
331 dpara2_air[0]= dpara_sm2[0];
332 dpara2_air[1]= dpara_sm2[1];
333 dpara2_air[2]= th_air/2.;
334
335 gMC->Gsvolu("EAIX","PARA", idtmed[698], dpara2_air, 6);
336 gMC->Gsatt("EAIX", "SEEN", 0);
337
338 // Place hexagonal single cells ECCU inside EHC2
339 // skip cells which go into the hole in top left corner.
340
341 xrow=1;
342 yb = -dpara2[1] + (1./root3_2)*hexd1[6];
343 zb = 0.;
344 for (j = 1; j <= (ncell_sm - ncell_hole); ++j) {
345 xb =-(dpara2[0] + dpara2[1]*0.577) + 2*hexd1[6];
346 if(xrow >= 2){
347 xb = xb+(xrow-1)*hexd1[6];
348 }
349 for (i = 1; i <= ncell_sm; ++i) {
350 number = i+(j-1)*ncell_sm;
351 gMC->Gsposp("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
352 xb += (hexd1[6]*2.);
353 }
354 xrow = xrow+1;
355 yb += (hexd1[6]*TMath::Sqrt(3.));
356 }
357
358
359 // ESMX is normal supermodule with base at bottom, with EHC2
360
361 z_air1= -dpara_sm2[2] + th_base + dpara2_air[2];
362 gMC->Gspos("EAIX", 1, "ESMX", 0., 0., z_air1, 0, "ONLY");
363 z_gas=z_air1+dpara2_air[2]+ th_pcb + dpara2[2];
364 gMC->Gspos("EHC2", 1, "ESMX", 0., 0., z_gas, 0, "ONLY");
365 z_air2=z_gas+dpara2[2]+ th_pcb + dpara2_air[2];
366 gMC->Gspos("EAIX", 2, "ESMX", 0., 0., z_air2, 0, "ONLY");
367
368 // ESMY is mirror image of ESMX with base at bottom, with EHC2
369
370 z_air1= -dpara_sm2[2] + th_pcb + dpara2_air[2];
371 gMC->Gspos("EAIX", 3, "ESMY", 0., 0., z_air1, 0, "ONLY");
372 z_gas=z_air1+dpara2_air[2]+ th_pcb + dpara2[2];
373 gMC->Gspos("EHC2", 2, "ESMY", 0., 0., z_gas, 0, "ONLY");
374 z_air2=z_gas+dpara2[2]+ th_pcb + dpara2_air[2];
375 gMC->Gspos("EAIX", 4, "ESMY", 0., 0., z_air2, 0, "ONLY");
376
377//
378
379
380// special supermodule EMM3 (GEANT only) containing 2 unit modules
381
382// volume for SUPERMODULE
383
384 Float_t dpara_sm3[6] = {12.5,12.5,0.8,30.,0.,0.};
385 dpara_sm3[0]=(ncell_sm - ncell_hole +0.25)*hexd1[6] ;
386 dpara_sm3[1] = (ncell_hole + 0.25) * hexd1[6] * root3_2;
387 dpara_sm3[2] = sm_thick/2.;
388
389 gMC->Gsvolu("ESMP","PARA", idtmed[607], dpara_sm3, 6);
390 gMC->Gsatt("ESMP", "SEEN", 0);
391 //
392 gMC->Gsvolu("ESMQ","PARA", idtmed[607], dpara_sm3, 6);
393 gMC->Gsatt("ESMQ", "SEEN", 0);
394
395 Float_t dpara3[6] = {12.5,12.5,0.4,30.,0.,0.};
396 dpara3[0] = dpara_sm3[0];
397 dpara3[1] = dpara_sm3[1];
398 dpara3[2] = cell_depth/2.;
399
400 gMC->Gsvolu("EHC3","PARA", idtmed[698], dpara3, 6);
401 gMC->Gsatt("EHC3", "SEEN", 1);
402
403
404 // Air residing between the PCB and the base
405
406 Float_t dpara3_air[6] = {12.5,12.5,8.,30.,0.,0.};
407 dpara3_air[0]= dpara_sm3[0];
408 dpara3_air[1]= dpara_sm3[1];
409 dpara3_air[2]= th_air/2.;
410
411 gMC->Gsvolu("EAIP","PARA", idtmed[698], dpara3_air, 6);
412 gMC->Gsatt("EAIP", "SEEN", 0);
413
414
415 // Place hexagonal single cells ECCU inside EHC3
416 // skip cells which go into the hole in top left corner.
417
418 xrow=1;
419 yb = -dpara3[1] + (1./root3_2)*hexd1[6];
420 zb = 0.;
421 for (j = 1; j <= ncell_hole; ++j) {
422 xb =-(dpara3[0] + dpara3[1]*0.577) + 2*hexd1[6];
423 if(xrow >= 2){
424 xb = xb+(xrow-1)*hexd1[6];
425 }
426 for (i = 1; i <= (ncell_sm - ncell_hole); ++i) {
427 number = i+(j-1)*(ncell_sm - ncell_hole);
428 gMC->Gsposp("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
429 xb += (hexd1[6]*2.);
430 }
431 xrow = xrow+1;
432 yb += (hexd1[6]*TMath::Sqrt(3.));
433 }
434
435 // ESMP is normal supermodule with base at bottom, with EHC3
436
437 z_air1= -dpara_sm3[2] + th_base + dpara3_air[2];
438 gMC->Gspos("EAIP", 1, "ESMP", 0., 0., z_air1, 0, "ONLY");
439 z_gas=z_air1+dpara3_air[2]+ th_pcb + dpara3[2];
440 gMC->Gspos("EHC3", 1, "ESMP", 0., 0., z_gas, 0, "ONLY");
441 z_air2=z_gas+dpara3[2]+ th_pcb + dpara3_air[2];
442 gMC->Gspos("EAIP", 2, "ESMP", 0., 0., z_air2, 0, "ONLY");
443
444 // ESMQ is mirror image of ESMP with base at bottom, with EHC3
445
446 z_air1= -dpara_sm3[2] + th_pcb + dpara3_air[2];
447 gMC->Gspos("EAIP", 3, "ESMQ", 0., 0., z_air1, 0, "ONLY");
448 z_gas=z_air1+dpara3_air[2]+ th_pcb + dpara3[2];
449 gMC->Gspos("EHC3", 2, "ESMQ", 0., 0., z_gas, 0, "ONLY");
450 z_air2=z_gas+dpara3[2]+ th_pcb + dpara3_air[2];
451 gMC->Gspos("EAIP", 4, "ESMQ", 0., 0., z_air2, 0, "ONLY");
452
453}
454
455//_____________________________________________________________________________
456
457void AliPMDv1::CreatePMD()
458{
459 //
460 // Create final detector from supermodules
461 //
462 // -- Author : Y.P. VIYOGI, 07/05/1996.
463 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
464 // -- Modified: For New Geometry YPV, March 2001.
465
466
467 const Float_t root3_2 = TMath::Sqrt(3.)/2.;
468 const Float_t pi = 3.14159;
469 Int_t i,j;
470
471 Float_t xp, yp, zp;
472
473 Int_t num_mod;
474 Int_t jhrot12,jhrot13, irotdm;
475
476 Int_t *idtmed = fIdtmed->GetArray()-599;
477
478 // VOLUMES Names : begining with "E" for all PMD volumes,
479 // The names of SIZE variables begin with S and have more meaningful
480 // characters as shown below.
481
482 // VOLUME SIZE MEDIUM : REMARKS
483 // ------ ----- ------ : ---------------------------
484
485 // EPMD GASPMD AIR : INSIDE PMD and its SIZE
486
487 // *** Define the EPMD Volume and fill with air ***
488
489
490 // Gaspmd, the dimension of HEXAGONAL mother volume of PMD,
491
492
493 Float_t gaspmd[10] = {0.,360.,6,2,-4.,12.,150.,4.,12.,150.};
494
495 gaspmd[5] = ncell_hole * cell_radius * 2. * root3_2;
496 gaspmd[8] = gaspmd[5];
497
498 gMC->Gsvolu("EPMD", "PGON", idtmed[698], gaspmd, 10);
499 gMC->Gsatt("EPMD", "SEEN", 0);
500
501 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
502
503 AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.);
504 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
505
506
507 Float_t dm_thick = 2. * sm_thick + th_lead + th_steel;
508
509 // dpara_emm1 array contains parameters of the imaginary volume EMM1,
510 // EMM1 is a master module of type 1, which has 24 copies in the PMD.
511 // EMM1 : normal volume as in old cases
512
513
514 Float_t dpara_emm1[6] = {12.5,12.5,0.8,30.,0.,0.};
515 dpara_emm1[0] = sm_length/2.;
516 dpara_emm1[1] = dpara_emm1[0] *root3_2;
517 dpara_emm1[2] = dm_thick/2.;
518
519 gMC->Gsvolu("EMM1","PARA", idtmed[698], dpara_emm1, 6);
520 gMC->Gsatt("EMM1", "SEEN", 1);
521
522 //
523 // --- DEFINE Modules, iron, and lead volumes
524
525 // Pb Convertor for EMM1
526 Float_t dpara_pb1[6] = {12.5,12.5,8.,30.,0.,0.};
527 dpara_pb1[0] = sm_length/2.;
528 dpara_pb1[1] = dpara_pb1[0] * root3_2;
529 dpara_pb1[2] = th_lead/2.;
530
531 gMC->Gsvolu("EPB1","PARA", idtmed[600], dpara_pb1, 6);
532 gMC->Gsatt ("EPB1", "SEEN", 0);
533
534 // Fe Support for EMM1
535 Float_t dpara_fe1[6] = {12.5,12.5,8.,30.,0.,0.};
536 dpara_fe1[0] = dpara_pb1[0];
537 dpara_fe1[1] = dpara_pb1[1];
538 dpara_fe1[2] = th_steel/2.;
539
540 gMC->Gsvolu("EFE1","PARA", idtmed[618], dpara_fe1, 6);
541 gMC->Gsatt ("EFE1", "SEEN", 0);
542
543
544
545 //
546 // position supermodule ESMA, ESMB, EPB1, EFE1 inside EMM1
547
548 Float_t z_ps,z_pb,z_fe,z_cv;
549
550 z_ps = - dpara_emm1[2] + sm_thick/2.;
551 gMC->Gspos("ESMB", 1, "EMM1", 0., 0., z_ps, 0, "ONLY");
552 z_pb=z_ps+sm_thick/2.+dpara_pb1[2];
553 gMC->Gspos("EPB1", 1, "EMM1", 0., 0., z_pb, 0, "ONLY");
554 z_fe=z_pb+dpara_pb1[2]+dpara_fe1[2];
555 gMC->Gspos("EFE1", 1, "EMM1", 0., 0., z_fe, 0, "ONLY");
556 z_cv=z_fe+dpara_fe1[2]+sm_thick/2.;
557 gMC->Gspos("ESMA", 1, "EMM1", 0., 0., z_cv, 0, "ONLY");
558
559
560
561 // EMM2 : special master module having full row of cells but the number
562 // of rows limited by hole.
563
564 Float_t dpara_emm2[6] = {12.5,12.5,0.8,30.,0.,0.};
565 dpara_emm2[0] = sm_length/2.;
566 dpara_emm2[1] = (ncell_sm - ncell_hole + 0.25) * cell_radius * root3_2;
567 dpara_emm2[2] = dm_thick/2.;
568
569 gMC->Gsvolu("EMM2","PARA", idtmed[698], dpara_emm2, 6);
570 gMC->Gsatt("EMM2", "SEEN", 1);
571
572
573 // Pb Convertor for EMM2
574 Float_t dpara_pb2[6] = {12.5,12.5,8.,30.,0.,0.};
575 dpara_pb2[0] = dpara_emm2[0];
576 dpara_pb2[1] = dpara_emm2[1];
577 dpara_pb2[2] = th_lead/2.;
578
579 gMC->Gsvolu("EPB2","PARA", idtmed[600], dpara_pb2, 6);
580 gMC->Gsatt ("EPB2", "SEEN", 0);
581
582 // Fe Support for EMM2
583 Float_t dpara_fe2[6] = {12.5,12.5,8.,30.,0.,0.};
584 dpara_fe2[0] = dpara_pb2[0];
585 dpara_fe2[1] = dpara_pb2[1];
586 dpara_fe2[2] = th_steel/2.;
587
588 gMC->Gsvolu("EFE2","PARA", idtmed[618], dpara_fe2, 6);
589 gMC->Gsatt ("EFE2", "SEEN", 0);
590
591
592
593 // position supermodule ESMX, ESMY inside EMM2
594
595 z_ps = - dpara_emm2[2] + sm_thick/2.;
596 gMC->Gspos("ESMY", 1, "EMM2", 0., 0., z_ps, 0, "ONLY");
597 z_pb = z_ps + sm_thick/2.+dpara_pb2[2];
598 gMC->Gspos("EPB2", 1, "EMM2", 0., 0., z_pb, 0, "ONLY");
599 z_fe = z_pb + dpara_pb2[2]+dpara_fe2[2];
600 gMC->Gspos("EFE2", 1, "EMM2", 0., 0., z_fe, 0, "ONLY");
601 z_cv = z_fe + dpara_fe2[2]+sm_thick/2.;
602 gMC->Gspos("ESMX", 1, "EMM2", 0., 0., z_cv, 0, "ONLY");
603 //
604
605
606 // EMM3 : special master module having truncated rows and columns of cells
607 // limited by hole.
608
609 Float_t dpara_emm3[6] = {12.5,12.5,0.8,30.,0.,0.};
610 dpara_emm3[0] = dpara_emm2[1]/root3_2;
611 dpara_emm3[1] = (ncell_hole + 0.25) * cell_radius *root3_2;
612 dpara_emm3[2] = dm_thick/2.;
613
614 gMC->Gsvolu("EMM3","PARA", idtmed[698], dpara_emm3, 6);
615 gMC->Gsatt("EMM3", "SEEN", 1);
616
617
618 // Pb Convertor for EMM3
619 Float_t dpara_pb3[6] = {12.5,12.5,8.,30.,0.,0.};
620 dpara_pb3[0] = dpara_emm3[0];
621 dpara_pb3[1] = dpara_emm3[1];
622 dpara_pb3[2] = th_lead/2.;
623
624 gMC->Gsvolu("EPB3","PARA", idtmed[600], dpara_pb3, 6);
625 gMC->Gsatt ("EPB3", "SEEN", 0);
626
627 // Fe Support for EMM3
628 Float_t dpara_fe3[6] = {12.5,12.5,8.,30.,0.,0.};
629 dpara_fe3[0] = dpara_pb3[0];
630 dpara_fe3[1] = dpara_pb3[1];
631 dpara_fe3[2] = th_steel/2.;
632
633 gMC->Gsvolu("EFE3","PARA", idtmed[618], dpara_fe3, 6);
634 gMC->Gsatt ("EFE3", "SEEN", 0);
635
636
637
638 // position supermodule ESMP, ESMQ inside EMM3
639
640 z_ps = - dpara_emm3[2] + sm_thick/2.;
641 gMC->Gspos("ESMQ", 1, "EMM3", 0., 0., z_ps, 0, "ONLY");
642 z_pb = z_ps + sm_thick/2.+dpara_pb3[2];
643 gMC->Gspos("EPB3", 1, "EMM3", 0., 0., z_pb, 0, "ONLY");
644 z_fe = z_pb + dpara_pb3[2]+dpara_fe3[2];
645 gMC->Gspos("EFE3", 1, "EMM3", 0., 0., z_fe, 0, "ONLY");
646 z_cv = z_fe + dpara_fe3[2] + sm_thick/2.;
647 gMC->Gspos("ESMP", 1, "EMM3", 0., 0., z_cv, 0, "ONLY");
648 //
649
650 // EHOL is a tube structure made of air
651 //
652 //Float_t d_hole[3];
653 //d_hole[0] = 0.;
654 //d_hole[1] = ncell_hole * cell_radius *2. * root3_2 + boundary;
655 //d_hole[2] = dm_thick/2.;
656 //
657 //gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3);
658 //gMC->Gsatt("EHOL", "SEEN", 1);
659
660 //Al-rod as boundary of the supermodules
661
662 Float_t Al_rod[3] ;
663 Al_rod[0] = sm_length * 3/2. - gaspmd[5]/2 - boundary ;
76ad67b5 664 Al_rod[1] = boundary - 0.5*cell_radius*root3_2;
c4561145 665 Al_rod[2] = dm_thick/2.;
666
667 gMC->Gsvolu("EALM","BOX ", idtmed[698], Al_rod, 3);
668 gMC->Gsatt ("EALM", "SEEN", 1);
669 Float_t xalm[3];
670 xalm[0]=Al_rod[0] + gaspmd[5] + 3.0*boundary;
671 xalm[1]=-xalm[0]/2.;
672 xalm[2]=xalm[1];
673
674 Float_t yalm[3];
675 yalm[0]=0.;
676 yalm[1]=xalm[0]*root3_2;
677 yalm[2]=-yalm[1];
678
679 // delx = full side of the supermodule
680 Float_t delx=sm_length * 3.;
681 Float_t x1= delx*root3_2 /2.;
682 Float_t x4=delx/4.;
683
684
685 // placing master modules and Al-rod in PMD
686
687 Float_t dx = sm_length;
688 Float_t dy = dx * root3_2;
689
690 Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2.,
691 -dx, 0., dx,
692 -3.*dx/2., -dx/2., dx/2.};
693
694 Float_t ysup[9] = {dy, dy, dy,
695 0., 0., 0.,
696 -dy, -dy, -dy};
697
698 // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes
699
700 Float_t xoff = boundary * TMath::Tan(pi/6.);
701 Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-boundary/root3_2};
702 Float_t ymod[3] = {-x1 - boundary, x1 + boundary, 0.};
703 Float_t xpos[9], ypos[9], x2, y2, x3, y3;
704
705 Float_t xemm2 = sm_length/2. -
706 (ncell_sm + ncell_hole + 0.25) * cell_radius * 0.5
707 + xoff;
708 Float_t yemm2 = -(ncell_sm + ncell_hole + 0.25) * cell_radius * root3_2
709 - boundary;
710
711 Float_t xemm3 = (ncell_sm + 0.5 * ncell_hole + 0.25) * cell_radius + xoff;
712 Float_t yemm3 = - (ncell_hole - 0.25) * cell_radius * root3_2 - boundary;
713
714 Float_t theta[3] = {0., 2.*pi/3., 4.*pi/3.};
715 Int_t irotate[3] = {0, jhrot12, jhrot13};
716
717 num_mod=0;
718 for (j=0; j<3; ++j)
719 {
720 gMC->Gsposp("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY", Al_rod, 3);
721 x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
722 y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
723
724 gMC->Gsposp("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY", dpara_emm2, 6);
725
726 x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
727 y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
728
729 gMC->Gsposp("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY", dpara_emm3, 6);
730
731 for (i=1; i<9; ++i)
732 {
733 xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) - ysup[i]*TMath::Sin(theta[j]);
734 ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) + ysup[i]*TMath::Cos(theta[j]);
735
1592ac65 736 if(fDebug)
737 printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]);
c4561145 738
739 num_mod = num_mod+1;
740
1592ac65 741 if(fDebug)
742 printf("\n%s: Num_mod %d\n",ClassName(),num_mod);
c4561145 743
744 gMC->Gsposp("EMM1", num_mod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY", dpara_emm1, 6);
745
746 }
747 }
748
749
750 // place EHOL in the centre of EPMD
751 // gMC->Gspos("EHOL", 1, "EPMD", 0.,0.,0., 0, "ONLY");
752
753 // --- Place the EPMD in ALICE
754 xp = 0.;
755 yp = 0.;
756 zp = zdist1;
757
758 gMC->Gspos("EPMD", 1, "ALIC", xp,yp,zp, 0, "ONLY");
759
760}
761
762
763//_____________________________________________________________________________
764void AliPMDv1::DrawModule()
765{
766 //
767 // Draw a shaded view of the Photon Multiplicity Detector
768 //
769
770 gMC->Gsatt("*", "seen", -1);
771 gMC->Gsatt("alic", "seen", 0);
772 //
773 // Set the visibility of the components
774 //
775 gMC->Gsatt("ECAR","seen",0);
776 gMC->Gsatt("ECCU","seen",1);
777 gMC->Gsatt("EHC1","seen",1);
778 gMC->Gsatt("EHC1","seen",1);
779 gMC->Gsatt("EHC2","seen",1);
780 gMC->Gsatt("EMM1","seen",1);
781 gMC->Gsatt("EHOL","seen",1);
782 gMC->Gsatt("EPMD","seen",0);
783 //
784 gMC->Gdopt("hide", "on");
785 gMC->Gdopt("shad", "on");
786 gMC->Gsatt("*", "fill", 7);
787 gMC->SetClipBox(".");
788 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
789 gMC->DefaultRange();
790 gMC->Gdraw("alic", 40, 30, 0, 22, 20.5, .02, .02);
791 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
792
793 //gMC->Gdman(17, 5, "MAN");
794 gMC->Gdopt("hide", "off");
795}
796
797//_____________________________________________________________________________
798void AliPMDv1::CreateMaterials()
799{
800 //
801 // Create materials for the PMD
802 //
803 // ORIGIN : Y. P. VIYOGI
804 //
805
806 // --- The Argon- CO2 mixture ---
807 Float_t ag[2] = { 39.95 };
808 Float_t zg[2] = { 18. };
809 Float_t wg[2] = { .8,.2 };
810 Float_t dar = .001782; // --- Ar density in g/cm3 ---
811 // --- CO2 ---
812 Float_t ac[2] = { 12.,16. };
813 Float_t zc[2] = { 6.,8. };
814 Float_t wc[2] = { 1.,2. };
815 Float_t dc = .001977;
816 Float_t dco = .002; // --- CO2 density in g/cm3 ---
817
818 Float_t absl, radl, a, d, z;
819 Float_t dg;
820 Float_t x0ar;
821 //Float_t x0xe=2.4;
822 //Float_t dxe=0.005858;
823 Float_t buf[1];
824 Int_t nbuf;
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
829 Int_t *idtmed = fIdtmed->GetArray()-599;
830 Int_t isxfld = gAlice->Field()->Integ();
831 Float_t sxmgmx = gAlice->Field()->Max();
832
833 // --- Define the various materials for GEANT ---
834 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
835 x0ar = 19.55 / dar;
836 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
837 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
838 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
839 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
840 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
841 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999.);
842 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
843 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
844 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
845 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
846 AliMaterial(17, "POLYCARBONATE $", 20., 10., 1.2, 34.6, 999.);
847 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
848 // AliMaterial(31, "Xenon$", 131.3, 54., dxe, x0xe, 6.5e4);
849
850 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
851 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
852 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
853 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
854
855 // define gas-mixtures
856
857 char namate[21];
858 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
859 ag[1] = a;
860 zg[1] = z;
861 dg = (dar * 4 + dco) / 5;
862 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
863
864 // Define tracking media
865 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
866 AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
867 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
868 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
869 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
870 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
871 AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
872 AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
873 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
874 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
875 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
876 AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
877 AliMedium(17, "PLOYCARB$", 17, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
878 AliMedium(19, " S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
879 // AliMedium(31, "Xenon $", 31, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
880
881 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
882 gMC->Gstpar(idtmed[600], "LOSS", 3.);
883 gMC->Gstpar(idtmed[600], "DRAY", 1.);
884
885 gMC->Gstpar(idtmed[603], "LOSS", 3.);
886 gMC->Gstpar(idtmed[603], "DRAY", 1.);
887
888 gMC->Gstpar(idtmed[604], "LOSS", 3.);
889 gMC->Gstpar(idtmed[604], "DRAY", 1.);
890
891 gMC->Gstpar(idtmed[605], "LOSS", 3.);
892 gMC->Gstpar(idtmed[605], "DRAY", 1.);
893
894 gMC->Gstpar(idtmed[606], "LOSS", 3.);
895 gMC->Gstpar(idtmed[606], "DRAY", 1.);
896
897 gMC->Gstpar(idtmed[607], "LOSS", 3.);
898 gMC->Gstpar(idtmed[607], "DRAY", 1.);
899
900 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
901 // --- without affecting the hit patterns ---
902 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
903 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
904 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
905 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
906 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
907 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
908 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
909 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
910 gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
911 gMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
912 gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
913 gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
914 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
915 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
916 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
917 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
918 gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
919 gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
920 gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
921 gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
922
923 // --- Prevent particles stopping in the gas due to energy cut-off ---
924 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
925 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
926 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
927 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
928 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
929}
930
931//_____________________________________________________________________________
932void AliPMDv1::Init()
933{
934 //
935 // Initialises PMD detector after it has been built
936 //
937 Int_t i;
938 kdet=1;
939 //
1592ac65 940 if(fDebug) {
941 printf("\n%s: ",ClassName());
942 for(i=0;i<35;i++) printf("*");
943 printf(" PMD_INIT ");
944 for(i=0;i<35;i++) printf("*");
945 printf("\n%s: ",ClassName());
946 printf(" PMD simulation package (v1) initialised\n");
947 printf("%s: parameters of pmd\n",ClassName());
dee197d3 948 printf("%s: %10.2f %10.2f %10.2f \
1592ac65 949 %10.2f\n",ClassName(),cell_radius,cell_wall,cell_depth,zdist1 );
950 printf("%s: ",ClassName());
951 for(i=0;i<80;i++) printf("*");
952 printf("\n");
953 }
c4561145 954
955 Int_t *idtmed = fIdtmed->GetArray()-599;
956 fMedSens=idtmed[605-1];
957}
958
959//_____________________________________________________________________________
960void AliPMDv1::StepManager()
961{
962 //
963 // Called at each step in the PMD
964 //
965 Int_t copy;
966 Float_t hits[4], destep;
967 Float_t center[3] = {0,0,0};
968 Int_t vol[5];
969 //char *namep;
970
971 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
972
973 gMC->CurrentVolID(copy);
974
975 //namep=gMC->CurrentVolName();
976 //printf("Current vol is %s \n",namep);
977
978 vol[0]=copy;
979 gMC->CurrentVolOffID(1,copy);
980
981 //namep=gMC->CurrentVolOffName(1);
982 //printf("Current vol 11 is %s \n",namep);
983
984 vol[1]=copy;
985 gMC->CurrentVolOffID(2,copy);
986
987 //namep=gMC->CurrentVolOffName(2);
988 //printf("Current vol 22 is %s \n",namep);
989
990 vol[2]=copy;
991
992 // if(strncmp(namep,"EHC1",4))vol[2]=1;
993
994 gMC->CurrentVolOffID(3,copy);
995
996 //namep=gMC->CurrentVolOffName(3);
997 //printf("Current vol 33 is %s \n",namep);
998
999 vol[3]=copy;
1000 gMC->CurrentVolOffID(4,copy);
1001
1002 //namep=gMC->CurrentVolOffName(4);
1003 //printf("Current vol 44 is %s \n",namep);
1004
1005 vol[4]=copy;
1006 //printf("volume number %d,%d,%d,%d,%d,%f \n",vol[0],vol[1],vol[2],vol[3],vol[4],destep*1000000);
1007
1008 gMC->Gdtom(center,hits,1);
1009 hits[3] = destep*1e9; //Number in eV
1010 AddHit(gAlice->CurrentTrack(), vol, hits);
1011 }
1012}
1013
1014
1015//------------------------------------------------------------------------
1016// Get parameters
1017
1018void AliPMDv1::GetParameters()
1019{
1020 Int_t ncell_um, num_um;
1021 ncell_um=24;
1022 num_um=3;
1023 ncell_hole=24;
1024 cell_radius=0.25;
1025 cell_wall=0.02;
1026 cell_depth=0.25 * 2.;
1027 //
1028 boundary=0.7;
1029 ncell_sm=ncell_um * num_um; //no. of cells in a row in one supermodule
1030 sm_length= ((ncell_sm + 0.25 ) * cell_radius) * 2.;
1031 //
1032 th_base=0.3;
1033 th_air=0.1;
1034 th_pcb=0.16;
1035 //
1036 sm_thick = th_base + th_air + th_pcb + cell_depth + th_pcb + th_air + th_pcb;
1037 //
1038 th_lead=1.5;
1039 th_steel=0.5;
1040 //
1041 zdist1 = -365.;
1042}
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055