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