Adding presentation style (T.Kuhr)
[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 **************************************************************************/
b1952773 15/*
16$Log$
5d12ce38 17Revision 1.29 2003/10/13 05:28:59 bnandi
18gaspmd[2] value changed 0.25->7.0 because of overlap
19
fe9578d7 20Revision 1.28 2003/10/08 12:59:08 bnandi
21zpos is positive
22
c7113aab 23Revision 1.27 2003/10/08 12:56:58 bnandi
24gaspmd[2] value changed from 7.0 to 0.25
25
fbd5cd1d 26Revision 1.26 2003/10/03 06:04:10 bnandi
27z_psa and z_psb bugs fixed
28
96c4b1d1 29Revision 1.25 2003/10/01 11:08:04 bnandi
30changes for NewIO
31
788c3ee6 32Revision 1.24 2003/10/01 08:32:51 hristov
33CurrentTrack replaced by GetCurrentTrackNumber
34
d1f5ecc3 35Revision 1.23 2003/10/01 05:07:51 bnandi
36New geometry in new Alice Coordinate system
37
b1952773 38New rectangular geometry for ALICE PMD - Bedanga Mohanty and Y. P. Viyogi
39June 2003
40*/
c4561145 41//
42///////////////////////////////////////////////////////////////////////////////
43// //
44// Photon Multiplicity Detector Version 1 //
45// //
46//Begin_Html
47/*
48<img src="picts/AliPMDv1Class.gif">
49*/
50//End_Html
51// //
52///////////////////////////////////////////////////////////////////////////////
53////
54
88cb7938 55#include "AliPMDv1.h"
56#include "AliRun.h"
b1952773 57#include "AliConst.h"
58#include "AliMagF.h"
788c3ee6 59#include "Riostream.h"
60#include <TVirtualMC.h>
5d12ce38 61#include "AliMC.h"
c4561145 62
b1952773 63static Int_t ncol_um1,ncol_um2, nrow_um1, nrow_um2;
64static Int_t kdet;
65static Float_t sm_length_ax,sm_length_ay;
66static Float_t sm_length_bx,sm_length_by;
67static Float_t zdist, zdist1;
68static Float_t sm_thick, cell_radius, cell_wall, cell_depth;
69static Float_t boundary, th_base, th_air, th_pcb;
70static Float_t th_lead, th_steel;
c4561145 71
72ClassImp(AliPMDv1)
73
74 //_____________________________________________________________________________
75 AliPMDv1::AliPMDv1()
76{
77 //
78 // Default constructor
79 //
80 fMedSens=0;
81}
82
83//_____________________________________________________________________________
84AliPMDv1::AliPMDv1(const char *name, const char *title)
85 : AliPMD(name,title)
86{
87 //
88 // Standard constructor
89 //
90 fMedSens=0;
91}
92
93//_____________________________________________________________________________
94void AliPMDv1::CreateGeometry()
95{
b1952773 96 // Create geometry for Photon Multiplicity Detector
97
c4561145 98 GetParameters();
99 CreateSupermodule();
100 CreatePMD();
101}
102
103//_____________________________________________________________________________
104void AliPMDv1::CreateSupermodule()
105{
b1952773 106 //
107 // Creates the geometry of the cells of PMD, places them in supermodule
108 // which is a rectangular object.
109 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is
110 // placed inside another hexagonal cell made of Cu (ECCU) with larger
111 // radius, compared to ECAR. The difference in radius gives the dimension
112 // of half width of each cell wall.
113 // These cells are placed in a rectangular strip which are of 2 types
114 // EST1 and EST2
115 // 2 types of unit modules are made EUM1 and EUM2 which contains these strips
116 // placed repeatedly
117 // Each supermodule (ESMA, ESMB), made of G10 is filled with following
118 //components. They have 9 unit moudles inside them
119 // ESMA, ESMB are placed in EPMD along with EMPB (Pb converter)
c4561145 120 // and EMFE (iron support)
121
c4561145 122
b1952773 123 Int_t i,j;
c4561145 124 Float_t xb, yb, zb;
125 Int_t number;
126 Int_t ihrotm,irotdm;
127 const Float_t root3_2 = TMath::Sqrt(3.) /2.;
b1952773 128 const Float_t root3 = TMath::Sqrt(3.);
c4561145 129 Int_t *idtmed = fIdtmed->GetArray()-599;
130
131 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
132 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
133
134 zdist = TMath::Abs(zdist1);
135
b1952773 136 // First create the sensitive medium of a hexagon cell (ECAR)
c4561145 137 // Inner hexagon filled with gas (Ar+CO2)
b1952773 138
c4561145 139 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
b1952773 140 hexd2[4] = -cell_depth/2.;
141 hexd2[7] = cell_depth/2.;
142 hexd2[6] = cell_radius - cell_wall;
143 hexd2[9] = cell_radius - cell_wall;
c4561145 144
145 gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
146 gMC->Gsatt("ECAR", "SEEN", 0);
b1952773 147
148 // Place the sensitive medium inside a hexagon copper cell (ECCU)
c4561145 149 // Outer hexagon made of Copper
b1952773 150
c4561145 151 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
b1952773 152 hexd1[4] = -cell_depth/2.;
153 hexd1[7] = cell_depth/2.;
154 hexd1[6] = cell_radius;
155 hexd1[9] = cell_radius;
c4561145 156
157 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
b1952773 158 gMC->Gsatt("ECCU", "SEEN", 0);
c4561145 159
b1952773 160 // Place inner hex (sensitive volume) inside outer hex (copper)
161
162 gMC->Gsposp("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY", hexd2, 10);
163
164 // Now create Rectangular TWO strips (EST1, EST2)
165 // of 1 column and 48 or 96 cells length
c4561145 166
b1952773 167 // volume for first strip EST1 made of AIR
c4561145 168
b1952773 169 Float_t dbox1[3];
170 dbox1[0] = ncol_um1*cell_radius;
171 dbox1[1] = cell_radius/root3_2;
172 dbox1[2] = cell_depth/2.;
173
174 gMC->Gsvolu("EST1","BOX", idtmed[698], dbox1, 3);
175 gMC->Gsatt("EST1", "SEEN", 0);
c4561145 176
b1952773 177 // volume for second strip EST2
c4561145 178
b1952773 179 Float_t dbox2[3];
180 dbox2[0] = ncol_um2*cell_radius;
181 dbox2[1] = dbox1[1];
182 dbox2[2] = dbox1[2];
c4561145 183
b1952773 184 gMC->Gsvolu("EST2","BOX", idtmed[698], dbox2, 3);
185 gMC->Gsatt("EST2", "SEEN", 0);
c4561145 186
b1952773 187 // Place hexagonal cells ECCU placed inside EST1
188 yb = 0.;
189 zb = 0.;
190 xb = -(dbox1[0]) + cell_radius;
191 for (i = 1; i <= ncol_um1; ++i)
192 {
193 number = i;
194 gMC->Gsposp("ECCU", number, "EST1", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
195 xb += (cell_radius*2.);
196 }
197 // Place hexagonal cells ECCU placed inside EST2
198 yb = 0.;
199 zb = 0.;
200 xb = -(dbox2[0]) + cell_radius;
201 for (i = 1; i <= ncol_um2; ++i)
202 {
203 number = i;
204 gMC->Gsposp("ECCU", number, "EST2", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
205 xb += (cell_radius*2.);
206 }
c4561145 207
c4561145 208
209
b1952773 210 // 2 types of rectangular shaped unit modules EUM1 and EUM2 (defined by BOX)
c4561145 211
b1952773 212 // Create EUM1
c4561145 213
b1952773 214 Float_t dbox3[3];
215 dbox3[0] = dbox1[0]+cell_radius/2.;
216 dbox3[1] = (dbox1[1]*nrow_um1)-(cell_radius*root3*(nrow_um1-1)/6.);
217 dbox3[2] = cell_depth/2.;
218
219 gMC->Gsvolu("EUM1","BOX", idtmed[698], dbox3, 3);
220 gMC->Gsatt("EUM1", "SEEN", 1);
221
222 // Place rectangular strips EST1 inside EUM1 unit module
c4561145 223
b1952773 224 yb = -dbox3[1]+dbox1[1];
225 for (j = 1; j <= nrow_um1; ++j)
226 {
227 if(j%2 == 0)
228 {
229 xb =cell_radius/2.0;
230 }
231 else
232 {
233 xb = -cell_radius/2.0;
234 }
235 number = j;
236 gMC->Gsposp("EST1",number, "EUM1", xb, yb , 0. , 0, "MANY",dbox1,3);
237 yb = (-dbox3[1]+dbox1[1])+j*1.0*cell_radius*root3;
c4561145 238 }
c4561145 239
b1952773 240 // Create EUM2
c4561145 241
b1952773 242 Float_t dbox4[3];
243 dbox4[0] = dbox2[0]+cell_radius/2.;
244 dbox4[1] =(dbox2[1]*nrow_um2)-(cell_radius*root3*(nrow_um2-1)/6.);
245 dbox4[2] = dbox3[2];
c4561145 246
b1952773 247 gMC->Gsvolu("EUM2","BOX", idtmed[698], dbox4, 3);
248 gMC->Gsatt("EUM2", "SEEN", 1);
c4561145 249
b1952773 250 // Place rectangular strips EST2 inside EUM2 unit module
c4561145 251
b1952773 252 yb = -dbox4[1]+dbox2[1];
253 for (j = 1; j <= nrow_um2; ++j)
254 {
255 if(j%2 == 0)
256 {
257 xb =cell_radius/2.0;
258 }
259 else
260 {
261 xb = -cell_radius/2.0;
262 }
263 number = j;
264 gMC->Gsposp("EST2",number, "EUM2", xb, yb , 0. , 0, "MANY",dbox2,3);
265 yb = (-dbox4[1]+dbox2[1])+j*1.0*cell_radius*root3;
266 }
c4561145 267
b1952773 268 // 2 types of Rectangular shaped supermodules (BOX)
269 //each with 6 unit modules
270
271 // volume for SUPERMODULE ESMA
272 //Space added to provide a gapping for HV between UM's
273
274 Float_t dbox_sm1[3];
275 dbox_sm1[0] = 3.0*dbox3[0]+(2.0*0.025);
276 dbox_sm1[1] = 2.0*dbox3[1]+0.025;
277 dbox_sm1[2] = cell_depth/2.;
278
279 gMC->Gsvolu("ESMA","BOX", idtmed[698], dbox_sm1, 3);
280 gMC->Gsatt("ESMA", "SEEN", 1);
281
282 //Position the 6 unit modules in EMSA
283 Float_t x_a1,x_a2,x_a3,y_a1,y_a2;
284 x_a1 = -dbox_sm1[0] + dbox3[0];
285 x_a2 = 0.;
286 x_a3 = dbox_sm1[0] - dbox3[0];
287 y_a1 = dbox_sm1[1] - dbox3[1];
288 y_a2 = -dbox_sm1[1] + dbox3[1];
289
290 gMC->Gsposp("EUM1", 1, "ESMA", x_a1, y_a1, 0., 0, "ONLY",dbox3,3);
291 gMC->Gsposp("EUM1", 2, "ESMA", x_a2, y_a1, 0., 0, "ONLY",dbox3,3);
292 gMC->Gsposp("EUM1", 3, "ESMA", x_a3, y_a1, 0., 0, "ONLY",dbox3,3);
293 gMC->Gsposp("EUM1", 4, "ESMA", x_a1, y_a2, 0., 0, "ONLY",dbox3,3);
294 gMC->Gsposp("EUM1", 5, "ESMA", x_a2, y_a2, 0., 0, "ONLY",dbox3,3);
295 gMC->Gsposp("EUM1", 6, "ESMA", x_a3, y_a2, 0., 0, "ONLY",dbox3,3);
296
297
298 // volume for SUPERMODULE ESMB
299 //Space is added to provide a gapping for HV between UM's
300 Float_t dbox_sm2[3];
301 dbox_sm2[0] = 2.0*dbox4[0]+0.025;
302 dbox_sm2[1] = 3.0*dbox4[1]+(2.0*0.025);
303 dbox_sm2[2] = cell_depth/2.;
304
305 gMC->Gsvolu("ESMB","BOX", idtmed[698], dbox_sm2, 3);
306 gMC->Gsatt("ESMB", "SEEN", 1);
307
308 //Position the 6 unit modules in EMSB
309 Float_t x_b1,x_b2,y_b1,y_b2,y_b3;
310 x_b1 = -dbox_sm2[0] +dbox4[0];
311 x_b2 = dbox_sm2[0]-dbox4[0];
312 y_b1 =dbox_sm2[1]-dbox4[1];
313 y_b2 = 0.;
314 y_b3 = -dbox_sm2[1]+dbox4[1];
315
316 gMC->Gsposp("EUM2", 1, "ESMB", x_b1, y_b1, 0., 0, "ONLY",dbox4,3);
317 gMC->Gsposp("EUM2", 2, "ESMB", x_b2, y_b1, 0., 0, "ONLY",dbox4,3);
318 gMC->Gsposp("EUM2", 3, "ESMB", x_b1, y_b2, 0., 0, "ONLY",dbox4,3);
319 gMC->Gsposp("EUM2", 4, "ESMB", x_b2, y_b2, 0., 0, "ONLY",dbox4,3);
320 gMC->Gsposp("EUM2", 5, "ESMB", x_b1, y_b3, 0., 0, "ONLY",dbox4,3);
321 gMC->Gsposp("EUM2", 6, "ESMB", x_b2, y_b3, 0., 0, "ONLY",dbox4,3);
322
323
324 // Make a 3mm thick G10 Base plate for ESMA
325 Float_t dbox_g1a[3];
326 dbox_g1a[0] = dbox_sm1[0];
327 dbox_g1a[1] = dbox_sm1[1];
328 dbox_g1a[2] = th_base/2.;
329
330 gMC->Gsvolu("EBPA","BOX", idtmed[607], dbox_g1a, 3);
331 gMC->Gsatt("EBPA", "SEEN", 1);
332
333 // Make a 1.6mm thick G10 PCB for ESMA
334 Float_t dbox_g2a[3];
335 dbox_g2a[0] = dbox_sm1[0];
336 dbox_g2a[1] = dbox_sm1[1];
337 dbox_g2a[2] = th_pcb/2.;
338
339 gMC->Gsvolu("EPCA","BOX", idtmed[607], dbox_g2a, 3);
340 gMC->Gsatt("EPCA", "SEEN", 1);
341
342
343 // Make a Full module EFPA of AIR to place EBPA,
344 // 1mm AIR, EPCA, ESMA,EPCA for PMD
345
346 Float_t dbox_alla[3];
347 dbox_alla[0] = dbox_sm1[0];
348 dbox_alla[1] = dbox_sm1[1];
349 dbox_alla[2] = (th_base+0.1+th_pcb+dbox_sm1[2]+th_pcb)/2.;
350
351 gMC->Gsvolu("EFPA","BOX", idtmed[698], dbox_alla, 3);
352 gMC->Gsatt("EFPA", "SEEN", 1);
353
354
355 // Make a Full module EFCA of AIR to place EBPA,
356 // 1mm AIR, EPCA, ESMA,EPC for CPV
357 Float_t dbox_alla2[3];
358 dbox_alla2[0] = dbox_sm1[0];
359 dbox_alla2[1] = dbox_sm1[1];
360 dbox_alla2[2] = (th_base+0.1+th_pcb+dbox_sm1[2]+th_pcb)/2.;
361
362 gMC->Gsvolu("EFCA","BOX", idtmed[698], dbox_alla2, 3);
363 gMC->Gsatt("EFCA", "SEEN", 1);
364
365 // Now place everything in EFPA for PMD
366
367 Float_t z_bpa,z_pcba1,z_pcba2,z_sma;
368 z_pcba1 = - dbox_alla[2]+th_pcb/2.0;
369 gMC->Gsposp("EPCA", 1, "EFPA", 0., 0., z_pcba1, 0, "ONLY",dbox_g2a,3);
370 z_sma = z_pcba1+dbox_sm1[2];
371 gMC->Gsposp("ESMA", 1, "EFPA", 0., 0., z_sma, 0, "ONLY",dbox_sm1,3);
372 z_pcba2 = z_sma+th_pcb/2.0;
373 gMC->Gsposp("EPCA", 2, "EFPA", 0., 0., z_pcba2, 0, "ONLY",dbox_g2a,3);
374 z_bpa = z_pcba2+0.1+th_base/2.0; // 0.1 for 0.1 mm Air gap
375 gMC->Gsposp("EBPA", 1, "EFPA", 0., 0., z_bpa, 0, "ONLY",dbox_g1a,3);
376
377 // Now place everything in EFCA for CPV
378
379 Float_t z_bpa2,z_pcba12,z_pcba22,z_sma2;
380 z_bpa2 = - dbox_alla2[2]+th_base/2.0;
381 gMC->Gsposp("EBPA", 1, "EFCA", 0., 0., z_bpa2, 0, "ONLY",dbox_g1a,3);
382 z_pcba12 = z_bpa2+0.1+th_pcb/2.0;
383 gMC->Gsposp("EPCA", 1, "EFCA", 0., 0., z_pcba12, 0, "ONLY",dbox_g2a,3);
384 z_sma2 = z_pcba12+dbox_sm1[2];
385 gMC->Gsposp("ESMA", 1, "EFCA", 0., 0., z_sma2, 0, "ONLY",dbox_sm1,3);
386 z_pcba22 = z_sma2+th_pcb/2.0;
387 gMC->Gsposp("EPCA", 2, "EFCA", 0., 0., z_pcba22, 0, "ONLY",dbox_g2a,3);
c4561145 388
389
c4561145 390
b1952773 391 // Make a 3mm thick G10 Base plate for ESMB
392 Float_t dbox_g1b[3];
393 dbox_g1b[0] = dbox_sm2[0];
394 dbox_g1b[1] = dbox_sm2[1];
395 dbox_g1b[2] = th_base/2.;
396
397 gMC->Gsvolu("EBPB","BOX", idtmed[607], dbox_g1b, 3);
398 gMC->Gsatt("EBPB", "SEEN", 1);
399
400 // Make a 1.6mm thick G10 PCB for ESMB
401 Float_t dbox_g2b[3];
402 dbox_g2b[0] = dbox_sm2[0];
403 dbox_g2b[1] = dbox_sm2[1];
404 dbox_g2b[2] = th_pcb/2.;
c4561145 405
b1952773 406 gMC->Gsvolu("EPCB","BOX", idtmed[607], dbox_g2b, 3);
407 gMC->Gsatt("EPCB", "SEEN", 1);
c4561145 408
c4561145 409
b1952773 410 // Make a Full module EFPB of AIR to place EBPB,
411 //1mm AIR, EPCB, ESMB,EPCB for PMD
412 Float_t dbox_allb[3];
413 dbox_allb[0] = dbox_sm2[0];
414 dbox_allb[1] = dbox_sm2[1];
415 dbox_allb[2] = (th_base+0.1+th_pcb+dbox_sm2[2]+th_pcb)/2.;
c4561145 416
b1952773 417 gMC->Gsvolu("EFPB","BOX", idtmed[698], dbox_allb, 3);
418 gMC->Gsatt("EFPB", "SEEN", 1);
c4561145 419
b1952773 420 // Make a Full module EFCB of AIR to place EBPB,
421 //1mm AIR, EPCB, ESMB,EPCB for CPV
422 Float_t dbox_allb2[3];
423 dbox_allb2[0] = dbox_sm2[0];
424 dbox_allb2[1] = dbox_sm2[1];
425 dbox_allb2[2] = (th_base+0.1+th_pcb+dbox_sm2[2]+th_pcb)/2.;
c4561145 426
b1952773 427 gMC->Gsvolu("EFCB","BOX", idtmed[698], dbox_allb2, 3);
428 gMC->Gsatt("EFCB", "SEEN", 1);
c4561145 429
c4561145 430
b1952773 431 // Now place everything in EFPB for PMD
c4561145 432
b1952773 433 Float_t z_bpb,z_pcbb1,z_pcbb2,z_smb;
434 z_pcbb1 = - dbox_allb[2]+th_pcb/2.0;
435 gMC->Gsposp("EPCB", 1, "EFPB", 0., 0., z_pcbb1, 0, "ONLY",dbox_g2b,3);
436 z_smb = z_pcbb1+dbox_sm2[2];
437 gMC->Gsposp("ESMB", 1, "EFPB", 0., 0., z_smb, 0, "ONLY",dbox_sm2,3);
438 z_pcbb2 = z_smb+th_pcb/2.0;
439 gMC->Gsposp("EPCB", 2, "EFPB", 0., 0., z_pcbb2, 0, "ONLY",dbox_g2b,3);
440 z_bpb = z_pcbb2+0.1+th_base/2.0; // 0.1 for 0.1 mm Air gap
441 gMC->Gsposp("EBPB", 1, "EFPB", 0., 0., z_bpb, 0, "ONLY",dbox_g1b,3);
c4561145 442
c4561145 443
b1952773 444 // Now place everything in EFCB for CPV
445
446 Float_t z_bpb2,z_pcbb12,z_pcbb22,z_smb2;
447 z_bpb2 = - dbox_allb2[2]+th_base/2.0;
448 gMC->Gsposp("EBPB", 1, "EFCB", 0., 0., z_bpb2, 0, "ONLY",dbox_g1b,3);
449 z_pcbb12 = z_bpb2+0.1+th_pcb/2.0;
450 gMC->Gsposp("EPCB", 1, "EFCB", 0., 0., z_pcbb12, 0, "ONLY",dbox_g2b,3);
451 z_smb2 = z_pcbb12+dbox_sm2[2];
452 gMC->Gsposp("ESMB", 1, "EFCB", 0., 0., z_smb2, 0, "ONLY",dbox_sm2,3);
453 z_pcbb22 = z_smb2+th_pcb/2.0;
454 gMC->Gsposp("EPCB", 2, "EFCB", 0., 0., z_pcbb22, 0, "ONLY",dbox_g2b,3);
c4561145 455
c4561145 456
b1952773 457 // Master MODULE EMPA of aluminum for PMD
458 //Float_t dbox_mm1[3];
459 dbox_mm1[0] = dbox_sm1[0]+boundary;
460 dbox_mm1[1] = dbox_sm1[1]+boundary;
461 dbox_mm1[2] = dbox_alla[2];
c4561145 462
b1952773 463 gMC->Gsvolu("EMPA","BOX", idtmed[603], dbox_mm1, 3);
464 gMC->Gsatt("EMPA", "SEEN", 1);
c4561145 465
b1952773 466 // Master MODULE EMCA of aluminum for CPV
467 //Float_t dbox_mm12[3];
468 dbox_mm12[0] = dbox_sm1[0]+boundary;
469 dbox_mm12[1] = dbox_sm1[1]+boundary;
470 dbox_mm12[2] = dbox_alla[2];
c4561145 471
b1952773 472 gMC->Gsvolu("EMCA","BOX", idtmed[603], dbox_mm12, 3);
473 gMC->Gsatt("EMCA", "SEEN", 1);
c4561145 474
475
b1952773 476 //Position EFMA inside EMMA for PMD and CPV
477 gMC->Gsposp("EFPA", 1, "EMPA", 0., 0., 0., 0, "ONLY",dbox_alla,3);
478 gMC->Gsposp("EFCA", 1, "EMCA", 0., 0., 0., 0, "ONLY",dbox_alla2,3);
c4561145 479
c4561145 480
b1952773 481 // Master MODULE EMPB of aluminum for PMD
482 //Float_t dbox_mm2[3];
483 dbox_mm2[0] = dbox_sm2[0]+boundary;
484 dbox_mm2[1] = dbox_sm2[1]+boundary;
485 dbox_mm2[2] = dbox_allb[2];
c4561145 486
b1952773 487 gMC->Gsvolu("EMPB","BOX", idtmed[603], dbox_mm2, 3);
488 gMC->Gsatt("EMPB", "SEEN", 1);
c4561145 489
b1952773 490 // Master MODULE EMCB of aluminum for CPV
491 //Float_t dbox_mm22[3];
492 dbox_mm22[0] = dbox_sm2[0]+boundary;
493 dbox_mm22[1] = dbox_sm2[1]+boundary;
494 dbox_mm22[2] = dbox_allb[2];
c4561145 495
b1952773 496 gMC->Gsvolu("EMCB","BOX", idtmed[603], dbox_mm22, 3);
497 gMC->Gsatt("EMCB", "SEEN", 1);
c4561145 498
b1952773 499
500 //Position EFMB inside EMMB
501 gMC->Gsposp("EFPB", 1, "EMPB", 0., 0., 0., 0, "ONLY",dbox_allb,3);
502 gMC->Gsposp("EFCB", 1, "EMCB", 0., 0., 0., 0, "ONLY",dbox_allb2,3);
c4561145 503
504}
505
506//_____________________________________________________________________________
507
508void AliPMDv1::CreatePMD()
509{
b1952773 510
c4561145 511 //
512 // Create final detector from supermodules
b1952773 513 // -- Author : Bedanga and Viyogi June 2003
c4561145 514
515 Float_t xp, yp, zp;
c4561145 516 Int_t jhrot12,jhrot13, irotdm;
c4561145 517 Int_t *idtmed = fIdtmed->GetArray()-599;
518
b1952773 519 //VOLUMES Names : begining with "E" for all PMD volumes,
520
521 // --- DEFINE Iron, and lead volumes for SM A
522
523 Float_t dbox_pba[3];
524 dbox_pba[0] = sm_length_ax;
525 dbox_pba[1] = sm_length_ay;
526 dbox_pba[2] = th_lead/2.;
c4561145 527
b1952773 528 gMC->Gsvolu("EPBA","BOX", idtmed[600], dbox_pba, 3);
529 gMC->Gsatt ("EPBA", "SEEN", 0);
c4561145 530
b1952773 531 // Fe Support
532 Float_t dbox_fea[3];
533 dbox_fea[0] = sm_length_ax;
534 dbox_fea[1] = sm_length_ay;
535 dbox_fea[2] = th_steel/2.;
c4561145 536
b1952773 537 gMC->Gsvolu("EFEA","BOX", idtmed[618], dbox_fea, 3);
538 gMC->Gsatt ("EFEA", "SEEN", 0);
c4561145 539
b1952773 540 // --- DEFINE Iron, and lead volumes for SM B
541
542 Float_t dbox_pbb[3];
543 dbox_pbb[0] = sm_length_bx;
544 dbox_pbb[1] = sm_length_by;
545 dbox_pbb[2] = th_lead/2.;
546
547 gMC->Gsvolu("EPBB","BOX", idtmed[600], dbox_pbb, 3);
548 gMC->Gsatt ("EPBB", "SEEN", 0);
549
550 // Fe Support
551 Float_t dbox_feb[3];
552 dbox_feb[0] = sm_length_bx;
553 dbox_feb[1] = sm_length_by;
554 dbox_feb[2] = th_steel/2.;
555
556 gMC->Gsvolu("EFEB","BOX", idtmed[618], dbox_feb, 3);
557 gMC->Gsatt ("EFEB", "SEEN", 0);
c4561145 558
c4561145 559
b1952773 560 // Gaspmd, the dimension of RECTANGULAR mother volume of PMD,
c4561145 561
fe9578d7 562 Float_t gaspmd[3] = {81.5,94.5,7.};
b1952773 563 gaspmd[0] = sm_length_ax+sm_length_bx;
564 gaspmd[1] = sm_length_ay+sm_length_by;
c4561145 565
c4561145 566
b1952773 567 gMC->Gsvolu("EPMD", "BOX", idtmed[698], gaspmd, 3);
568 gMC->Gsatt("EPMD", "SEEN", 1);
c4561145 569
570 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
571
b1952773 572 AliMatrix(jhrot12, 90., 180., 90., 270., 0., 0.);
c4561145 573 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
574
b1952773 575 Float_t x_sma,y_sma;
576 Float_t x_smb,y_smb;
577 x_sma = -(sm_length_bx)/1.0;
578 y_sma = sm_length_by;
579 x_smb = -sm_length_ax;
580 y_smb = -sm_length_ay;
581
582 //Complete detector for Type A
583 //Position Super modules type A for both CPV and PMD in EPMD
584 Float_t z_psa,z_pba,z_fea,z_cva;
96c4b1d1 585
586 z_psa = - gaspmd[2] + sm_thick/2.;
b1952773 587
588 gMC->Gsposp("EMPA", 1, "EPMD", x_sma, y_sma, z_psa, 0, "ONLY",dbox_mm1,3);
589 gMC->Gsposp("EMPA", 2, "EPMD", -x_sma, -y_sma, z_psa, jhrot12, "ONLY",dbox_mm1,3);
590 z_pba=z_psa+sm_thick/2.+dbox_pba[2];
591 gMC->Gsposp("EPBA", 1, "EPMD", x_sma, y_sma, z_pba, 0, "ONLY",dbox_pba,3);
592 gMC->Gsposp("EPBA", 2, "EPMD", -x_sma, -y_sma, z_pba, 0, "ONLY",dbox_pba,3);
593 z_fea=z_pba+dbox_pba[2]+dbox_fea[2];
594 gMC->Gsposp("EFEA", 1, "EPMD", x_sma, y_sma, z_fea, 0, "ONLY",dbox_fea,3);
595 gMC->Gsposp("EFEA", 2, "EPMD", -x_sma, -y_sma, z_fea, 0, "ONLY",dbox_fea,3);
596 z_cva=z_fea+dbox_fea[2]+sm_thick/2.;
597 gMC->Gsposp("EMCA", 1, "EPMD", x_sma, y_sma, z_cva, 0, "ONLY",dbox_mm12,3);
598 gMC->Gsposp("EMCA", 2, "EPMD", -x_sma,-y_sma, z_cva, jhrot12, "ONLY",dbox_mm12,3);
599
600 //Complete detector for Type B
601 //Position Super modules type B for both CPV and PMD in EPMD
602 Float_t z_psb,z_pbb,z_feb,z_cvb;
96c4b1d1 603 z_psb = - gaspmd[2] + sm_thick/2.;
b1952773 604
605 gMC->Gsposp("EMPB", 3, "EPMD", x_smb, y_smb, z_psb, 0, "ONLY",dbox_mm2,3);
606 gMC->Gsposp("EMPB", 4, "EPMD", -x_smb, -y_smb, z_psb, jhrot12, "ONLY",dbox_mm2,3);
607 z_pbb=z_psb+sm_thick/2.+dbox_pbb[2];
608 gMC->Gsposp("EPBB", 3, "EPMD", x_smb, y_smb, z_pbb, 0, "ONLY",dbox_pbb,3);
609 gMC->Gsposp("EPBB", 4, "EPMD", -x_smb, -y_smb, z_pbb, 0, "ONLY",dbox_pbb,3);
610 z_feb=z_pbb+dbox_pbb[2]+dbox_feb[2];
611 gMC->Gsposp("EFEB", 3, "EPMD", x_smb, y_smb, z_feb, 0, "ONLY",dbox_feb,3);
612 gMC->Gsposp("EFEB", 4, "EPMD", -x_smb, -y_smb, z_feb, 0, "ONLY",dbox_feb,3);
613 z_cvb=z_feb+dbox_feb[2]+sm_thick/2.;
614 gMC->Gsposp("EMCB", 3, "EPMD", x_smb, y_smb, z_cvb, 0, "ONLY",dbox_mm22,3);
615 gMC->Gsposp("EMCB", 4, "EPMD", -x_smb,-y_smb, z_cvb, jhrot12, "ONLY",dbox_mm22,3);
c4561145 616
c4561145 617 // --- Place the EPMD in ALICE
618 xp = 0.;
619 yp = 0.;
620 zp = zdist1;
b1952773 621
622 //Position Full PMD in ALICE
623 gMC->Gsposp("EPMD", 1, "ALIC", xp,yp,zp, 0, "ONLY",gaspmd,3);
624
c4561145 625}
626
627
628//_____________________________________________________________________________
629void AliPMDv1::DrawModule()
630{
b1952773 631 cout << " Inside Draw Modules " << endl;
c4561145 632 //
633 // Draw a shaded view of the Photon Multiplicity Detector
634 //
635
636 gMC->Gsatt("*", "seen", -1);
637 gMC->Gsatt("alic", "seen", 0);
638 //
639 // Set the visibility of the components
640 //
641 gMC->Gsatt("ECAR","seen",0);
642 gMC->Gsatt("ECCU","seen",1);
b1952773 643 gMC->Gsatt("EST1","seen",1);
644 gMC->Gsatt("EST2","seen",1);
645 gMC->Gsatt("EUM1","seen",1);
646 gMC->Gsatt("EUM2","seen",1);
647 gMC->Gsatt("ESMA","seen",1);
648 gMC->Gsatt("EPMD","seen",1);
c4561145 649 //
650 gMC->Gdopt("hide", "on");
651 gMC->Gdopt("shad", "on");
652 gMC->Gsatt("*", "fill", 7);
653 gMC->SetClipBox(".");
654 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
655 gMC->DefaultRange();
656 gMC->Gdraw("alic", 40, 30, 0, 22, 20.5, .02, .02);
657 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
658
659 //gMC->Gdman(17, 5, "MAN");
660 gMC->Gdopt("hide", "off");
b1952773 661
662 cout << " Outside Draw Modules " << endl;
c4561145 663}
664
665//_____________________________________________________________________________
666void AliPMDv1::CreateMaterials()
667{
b1952773 668 cout << " Inside create materials " << endl;
c4561145 669 //
670 // Create materials for the PMD
671 //
672 // ORIGIN : Y. P. VIYOGI
673 //
674
675 // --- The Argon- CO2 mixture ---
676 Float_t ag[2] = { 39.95 };
677 Float_t zg[2] = { 18. };
b1952773 678 Float_t wg[2] = { .7,.3 };
c4561145 679 Float_t dar = .001782; // --- Ar density in g/cm3 ---
680 // --- CO2 ---
681 Float_t ac[2] = { 12.,16. };
682 Float_t zc[2] = { 6.,8. };
683 Float_t wc[2] = { 1.,2. };
684 Float_t dc = .001977;
685 Float_t dco = .002; // --- CO2 density in g/cm3 ---
686
687 Float_t absl, radl, a, d, z;
688 Float_t dg;
689 Float_t x0ar;
c4561145 690 Float_t buf[1];
691 Int_t nbuf;
692 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
693 Float_t zsteel[4] = { 26.,24.,28.,14. };
694 Float_t wsteel[4] = { .715,.18,.1,.005 };
695
696 Int_t *idtmed = fIdtmed->GetArray()-599;
697 Int_t isxfld = gAlice->Field()->Integ();
698 Float_t sxmgmx = gAlice->Field()->Max();
699
700 // --- Define the various materials for GEANT ---
701 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
702 x0ar = 19.55 / dar;
703 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
704 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
705 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
706 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
707 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
708 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999.);
709 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
710 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
711 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
712 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
713 AliMaterial(17, "POLYCARBONATE $", 20., 10., 1.2, 34.6, 999.);
714 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
715 // AliMaterial(31, "Xenon$", 131.3, 54., dxe, x0xe, 6.5e4);
716
717 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
718 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
719 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
720 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
721
722 // define gas-mixtures
723
b1952773 724 char namate[21];
c4561145 725 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
726 ag[1] = a;
727 zg[1] = z;
728 dg = (dar * 4 + dco) / 5;
729 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
730
731 // Define tracking media
732 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
733 AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
734 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
735 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
736 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
737 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
738 AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
739 AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
740 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
741 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
742 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
743 AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
744 AliMedium(17, "PLOYCARB$", 17, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
745 AliMedium(19, " S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
746 // AliMedium(31, "Xenon $", 31, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
747
748 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
749 gMC->Gstpar(idtmed[600], "LOSS", 3.);
750 gMC->Gstpar(idtmed[600], "DRAY", 1.);
751
752 gMC->Gstpar(idtmed[603], "LOSS", 3.);
753 gMC->Gstpar(idtmed[603], "DRAY", 1.);
754
755 gMC->Gstpar(idtmed[604], "LOSS", 3.);
756 gMC->Gstpar(idtmed[604], "DRAY", 1.);
757
758 gMC->Gstpar(idtmed[605], "LOSS", 3.);
759 gMC->Gstpar(idtmed[605], "DRAY", 1.);
760
761 gMC->Gstpar(idtmed[606], "LOSS", 3.);
762 gMC->Gstpar(idtmed[606], "DRAY", 1.);
763
764 gMC->Gstpar(idtmed[607], "LOSS", 3.);
765 gMC->Gstpar(idtmed[607], "DRAY", 1.);
766
767 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
768 // --- without affecting the hit patterns ---
769 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
770 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
771 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
772 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
773 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
774 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
775 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
776 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
777 gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
778 gMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
779 gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
780 gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
781 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
782 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
783 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
784 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
785 gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
786 gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
787 gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
788 gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
789
790 // --- Prevent particles stopping in the gas due to energy cut-off ---
791 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
792 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
793 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
794 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
795 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
b1952773 796
797 cout << " Outside create materials " << endl;
798
c4561145 799}
800
801//_____________________________________________________________________________
802void AliPMDv1::Init()
803{
804 //
805 // Initialises PMD detector after it has been built
806 //
b1952773 807
c4561145 808 Int_t i;
809 kdet=1;
810 //
b1952773 811 cout << " Inside Init " << endl;
1592ac65 812 if(fDebug) {
813 printf("\n%s: ",ClassName());
814 for(i=0;i<35;i++) printf("*");
815 printf(" PMD_INIT ");
816 for(i=0;i<35;i++) printf("*");
817 printf("\n%s: ",ClassName());
818 printf(" PMD simulation package (v1) initialised\n");
819 printf("%s: parameters of pmd\n",ClassName());
dee197d3 820 printf("%s: %10.2f %10.2f %10.2f \
1592ac65 821 %10.2f\n",ClassName(),cell_radius,cell_wall,cell_depth,zdist1 );
822 printf("%s: ",ClassName());
823 for(i=0;i<80;i++) printf("*");
824 printf("\n");
825 }
c4561145 826
827 Int_t *idtmed = fIdtmed->GetArray()-599;
828 fMedSens=idtmed[605-1];
b1952773 829
c4561145 830}
831
832//_____________________________________________________________________________
833void AliPMDv1::StepManager()
834{
835 //
836 // Called at each step in the PMD
837 //
b1952773 838
c4561145 839 Int_t copy;
840 Float_t hits[4], destep;
841 Float_t center[3] = {0,0,0};
b1952773 842 Int_t vol[8]; //5
843 //const char *namep;
c4561145 844
845 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
846
847 gMC->CurrentVolID(copy);
c4561145 848 //namep=gMC->CurrentVolName();
b1952773 849 //printf("Current vol is %s \n",namep);
c4561145 850 vol[0]=copy;
c4561145 851
b1952773 852 gMC->CurrentVolOffID(1,copy);
c4561145 853 //namep=gMC->CurrentVolOffName(1);
854 //printf("Current vol 11 is %s \n",namep);
c4561145 855 vol[1]=copy;
c4561145 856
b1952773 857 gMC->CurrentVolOffID(2,copy);
c4561145 858 //namep=gMC->CurrentVolOffName(2);
859 //printf("Current vol 22 is %s \n",namep);
c4561145 860 vol[2]=copy;
861
862 // if(strncmp(namep,"EHC1",4))vol[2]=1;
863
864 gMC->CurrentVolOffID(3,copy);
c4561145 865 //namep=gMC->CurrentVolOffName(3);
866 //printf("Current vol 33 is %s \n",namep);
c4561145 867 vol[3]=copy;
c4561145 868
b1952773 869 gMC->CurrentVolOffID(4,copy);
c4561145 870 //namep=gMC->CurrentVolOffName(4);
871 //printf("Current vol 44 is %s \n",namep);
c4561145 872 vol[4]=copy;
c4561145 873
b1952773 874 gMC->CurrentVolOffID(5,copy);
875 //namep=gMC->CurrentVolOffName(5);
876 //printf("Current vol 55 is %s \n",namep);
877 vol[5]=copy;
878
879 gMC->CurrentVolOffID(6,copy);
880 //namep=gMC->CurrentVolOffName(6);
881 //printf("Current vol 66 is %s \n",namep);
882 vol[6]=copy;
883
884 gMC->CurrentVolOffID(7,copy);
885 //namep=gMC->CurrentVolOffName(7);
886 //printf("Current vol 77 is %s \n",namep);
887 vol[7]=copy;
888
889
890 //printf("volume number %4d %4d %4d %4d %4d %4d %4d %4d %10.3f \n",vol[0],vol[1],vol[2],vol[3],vol[4],vol[5],vol[6],vol[7],destep*1000000);
891
c4561145 892 gMC->Gdtom(center,hits,1);
893 hits[3] = destep*1e9; //Number in eV
5d12ce38 894 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
b1952773 895
c4561145 896 }
897}
898
899
900//------------------------------------------------------------------------
901// Get parameters
902
903void AliPMDv1::GetParameters()
904{
b1952773 905 const Float_t root3 = TMath::Sqrt(3.);
906 const Float_t root3_2 = TMath::Sqrt(3.) /2.;
907 //
c4561145 908 cell_radius=0.25;
909 cell_wall=0.02;
910 cell_depth=0.25 * 2.;
911 //
b1952773 912 ncol_um1 = 48;
913 ncol_um2 = 96;
914 nrow_um1 = 96;//each strip has 1 row
915 nrow_um2 = 48;//each strip has 1 row
916 //
917 sm_length_ax = (3.0*(ncol_um1*cell_radius+cell_radius/2.)+(2.0*0.025)) + 0.7;
918 sm_length_bx = 2.0*(ncol_um2*cell_radius+cell_radius/2.)+0.025+0.7;
919
920 sm_length_ay = 2.0*(((cell_radius/root3_2)*nrow_um1)-(cell_radius*root3*(nrow_um1-1)/6.))+0.025+0.7;
921 sm_length_by = 3.0*(((cell_radius/root3_2)*nrow_um2)-(cell_radius*root3*(nrow_um2-1)/6.))+(2.0*0.025)+0.7;
922 //
923 boundary=0.7;
924 //
925 th_base=0.3;
926 th_air=0.1;
927 th_pcb=0.16;
928 //
929 sm_thick = th_base + th_air + th_pcb + cell_depth + th_pcb + th_air + th_pcb;
930 //
931 th_lead=1.5;
932 th_steel=0.5;
933
c7113aab 934 zdist1 = 361.5;
ef61784c 935
b1952773 936}