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