removed Gfmate by AliMixture
[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$
f017d70a 17Revision 1.36 2004/06/26 08:01:14 bnandi
18syntax correction for Mylar
19
908ce7f5 20Revision 1.35 2004/01/07 10:49:49 hristov
21Initialization to avoid runtime problems (valgrind)
22
3901cc75 23Revision 1.34 2003/12/18 04:25:03 bnandi
24overlap with beam pipe fixed and Gsposp changed to Gspos
25
a978c9e3 26Revision 1.33 2003/11/03 14:33:26 hristov
27Correct initialization of static data members
28
5c3a1290 29Revision 1.32 2003/11/03 11:53:05 bnandi
30global variables are removed
31
3cdb4e97 32Revision 1.31 2003/10/31 12:25:36 bnandi
33variable names are changed according to ALICE convention
34
36031625 35Revision 1.30 2003/10/23 16:32:19 hristov
36MC-dependent part of AliRun extracted in AliMC (F.Carminati)
37
5d12ce38 38Revision 1.29 2003/10/13 05:28:59 bnandi
39gaspmd[2] value changed 0.25->7.0 because of overlap
40
fe9578d7 41Revision 1.28 2003/10/08 12:59:08 bnandi
42zpos is positive
43
c7113aab 44Revision 1.27 2003/10/08 12:56:58 bnandi
45gaspmd[2] value changed from 7.0 to 0.25
46
fbd5cd1d 47Revision 1.26 2003/10/03 06:04:10 bnandi
48z_psa and z_psb bugs fixed
49
96c4b1d1 50Revision 1.25 2003/10/01 11:08:04 bnandi
51changes for NewIO
52
788c3ee6 53Revision 1.24 2003/10/01 08:32:51 hristov
54CurrentTrack replaced by GetCurrentTrackNumber
55
d1f5ecc3 56Revision 1.23 2003/10/01 05:07:51 bnandi
57New geometry in new Alice Coordinate system
58
b1952773 59New rectangular geometry for ALICE PMD - Bedanga Mohanty and Y. P. Viyogi
60June 2003
61*/
c4561145 62//
63///////////////////////////////////////////////////////////////////////////////
64// //
65// Photon Multiplicity Detector Version 1 //
66// //
67//Begin_Html
68/*
69<img src="picts/AliPMDv1Class.gif">
70*/
71//End_Html
72// //
73///////////////////////////////////////////////////////////////////////////////
74////
75
88cb7938 76#include "AliPMDv1.h"
77#include "AliRun.h"
b1952773 78#include "AliConst.h"
79#include "AliMagF.h"
788c3ee6 80#include "Riostream.h"
81#include <TVirtualMC.h>
5d12ce38 82#include "AliMC.h"
c4561145 83
5c3a1290 84const Int_t AliPMDv1::fgkNcolUM1 = 48; // Number of cols in UM, type 1
85const Int_t AliPMDv1::fgkNcolUM2 = 96; // Number of cols in UM, type 2
86const Int_t AliPMDv1::fgkNrowUM1 = 96; // Number of rows in UM, type 1
87const Int_t AliPMDv1::fgkNrowUM2 = 48; // Number of rows in UM, type 2
88const Float_t AliPMDv1::fgkCellRadius = 0.25; // Radius of a hexagonal cell
89const Float_t AliPMDv1::fgkCellWall = 0.02; // Thickness of cell Wall
90const Float_t AliPMDv1::fgkCellDepth = 0.50; // Gas thickness
91const Float_t AliPMDv1::fgkBoundary = 0.7; // Thickness of Boundary wall
92const Float_t AliPMDv1::fgkThBase = 0.3; // Thickness of Base plate
93const Float_t AliPMDv1::fgkThAir = 0.1; // Thickness of Air
94const Float_t AliPMDv1::fgkThPCB = 0.16; // Thickness of PCB
95const Float_t AliPMDv1::fgkThLead = 1.5; // Thickness of Pb
96const Float_t AliPMDv1::fgkThSteel = 0.5; // Thickness of Steel
97const Float_t AliPMDv1::fgkGap = 0.025; // Air Gap
98const Float_t AliPMDv1::fgkZdist = 361.5; // z-position of the detector
99const Float_t AliPMDv1::fgkSqroot3 = 1.7320508;// Square Root of 3
100const Float_t AliPMDv1::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
101
c4561145 102ClassImp(AliPMDv1)
103
104 //_____________________________________________________________________________
105 AliPMDv1::AliPMDv1()
106{
107 //
108 // Default constructor
109 //
110 fMedSens=0;
111}
112
113//_____________________________________________________________________________
114AliPMDv1::AliPMDv1(const char *name, const char *title)
115 : AliPMD(name,title)
116{
117 //
118 // Standard constructor
119 //
120 fMedSens=0;
121}
122
123//_____________________________________________________________________________
124void AliPMDv1::CreateGeometry()
125{
b1952773 126 // Create geometry for Photon Multiplicity Detector
127
c4561145 128 GetParameters();
129 CreateSupermodule();
130 CreatePMD();
131}
132
133//_____________________________________________________________________________
134void AliPMDv1::CreateSupermodule()
135{
b1952773 136 //
137 // Creates the geometry of the cells of PMD, places them in supermodule
138 // which is a rectangular object.
139 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is
140 // placed inside another hexagonal cell made of Cu (ECCU) with larger
141 // radius, compared to ECAR. The difference in radius gives the dimension
142 // of half width of each cell wall.
143 // These cells are placed in a rectangular strip which are of 2 types
144 // EST1 and EST2
145 // 2 types of unit modules are made EUM1 and EUM2 which contains these strips
146 // placed repeatedly
147 // Each supermodule (ESMA, ESMB), made of G10 is filled with following
148 //components. They have 9 unit moudles inside them
149 // ESMA, ESMB are placed in EPMD along with EMPB (Pb converter)
c4561145 150 // and EMFE (iron support)
151
c4561145 152
b1952773 153 Int_t i,j;
c4561145 154 Int_t number;
155 Int_t ihrotm,irotdm;
3cdb4e97 156 Float_t xb, yb, zb;
157
c4561145 158 Int_t *idtmed = fIdtmed->GetArray()-599;
159
160 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
161 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
162
b1952773 163 // First create the sensitive medium of a hexagon cell (ECAR)
c4561145 164 // Inner hexagon filled with gas (Ar+CO2)
b1952773 165
c4561145 166 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
3cdb4e97 167 hexd2[4] = -fgkCellDepth/2.;
168 hexd2[7] = fgkCellDepth/2.;
169 hexd2[6] = fgkCellRadius - fgkCellWall;
170 hexd2[9] = fgkCellRadius - fgkCellWall;
c4561145 171
172 gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
173 gMC->Gsatt("ECAR", "SEEN", 0);
b1952773 174
175 // Place the sensitive medium inside a hexagon copper cell (ECCU)
c4561145 176 // Outer hexagon made of Copper
b1952773 177
c4561145 178 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
3cdb4e97 179 hexd1[4] = -fgkCellDepth/2.;
180 hexd1[7] = fgkCellDepth/2.;
181 hexd1[6] = fgkCellRadius;
182 hexd1[9] = fgkCellRadius;
c4561145 183
184 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
b1952773 185 gMC->Gsatt("ECCU", "SEEN", 0);
c4561145 186
b1952773 187 // Place inner hex (sensitive volume) inside outer hex (copper)
188
a978c9e3 189 gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
b1952773 190
191 // Now create Rectangular TWO strips (EST1, EST2)
192 // of 1 column and 48 or 96 cells length
c4561145 193
b1952773 194 // volume for first strip EST1 made of AIR
c4561145 195
b1952773 196 Float_t dbox1[3];
3cdb4e97 197 dbox1[0] = fgkNcolUM1*fgkCellRadius;
198 dbox1[1] = fgkCellRadius/fgkSqroot3by2;
199 dbox1[2] = fgkCellDepth/2.;
b1952773 200
201 gMC->Gsvolu("EST1","BOX", idtmed[698], dbox1, 3);
202 gMC->Gsatt("EST1", "SEEN", 0);
c4561145 203
b1952773 204 // volume for second strip EST2
c4561145 205
b1952773 206 Float_t dbox2[3];
3cdb4e97 207 dbox2[0] = fgkNcolUM2*fgkCellRadius;
b1952773 208 dbox2[1] = dbox1[1];
209 dbox2[2] = dbox1[2];
c4561145 210
b1952773 211 gMC->Gsvolu("EST2","BOX", idtmed[698], dbox2, 3);
212 gMC->Gsatt("EST2", "SEEN", 0);
c4561145 213
b1952773 214 // Place hexagonal cells ECCU placed inside EST1
215 yb = 0.;
216 zb = 0.;
3cdb4e97 217 xb = -(dbox1[0]) + fgkCellRadius;
218 for (i = 1; i <= fgkNcolUM1; ++i)
a978c9e3 219 {
220 number = i;
221 gMC->Gspos("ECCU", number, "EST1", xb,yb,zb, ihrotm, "ONLY");
222 xb += (fgkCellRadius*2.);
223 }
b1952773 224 // Place hexagonal cells ECCU placed inside EST2
a978c9e3 225 yb = 0.;
226 zb = 0.;
227 xb = -(dbox2[0]) + fgkCellRadius;
228 for (i = 1; i <= fgkNcolUM2; ++i)
229 {
230 number = i;
231 gMC->Gspos("ECCU", number, "EST2", xb,yb,zb, ihrotm, "ONLY");
232 xb += (fgkCellRadius*2.);
233 }
c4561145 234
b1952773 235 // 2 types of rectangular shaped unit modules EUM1 and EUM2 (defined by BOX)
a978c9e3 236
b1952773 237 // Create EUM1
a978c9e3 238
b1952773 239 Float_t dbox3[3];
3cdb4e97 240 dbox3[0] = dbox1[0]+fgkCellRadius/2.;
241 dbox3[1] = (dbox1[1]*fgkNrowUM1)-(fgkCellRadius*fgkSqroot3*(fgkNrowUM1-1)/6.);
242 dbox3[2] = fgkCellDepth/2.;
b1952773 243
244 gMC->Gsvolu("EUM1","BOX", idtmed[698], dbox3, 3);
245 gMC->Gsatt("EUM1", "SEEN", 1);
246
247 // Place rectangular strips EST1 inside EUM1 unit module
a978c9e3 248
b1952773 249 yb = -dbox3[1]+dbox1[1];
3cdb4e97 250 for (j = 1; j <= fgkNrowUM1; ++j)
b1952773 251 {
252 if(j%2 == 0)
253 {
a978c9e3 254 xb = fgkCellRadius/2.0;
b1952773 255 }
256 else
257 {
3cdb4e97 258 xb = -fgkCellRadius/2.0;
b1952773 259 }
260 number = j;
a978c9e3 261 gMC->Gspos("EST1",number, "EUM1", xb, yb , 0. , 0, "MANY");
3cdb4e97 262 yb = (-dbox3[1]+dbox1[1])+j*1.0*fgkCellRadius*fgkSqroot3;
c4561145 263 }
c4561145 264
b1952773 265 // Create EUM2
c4561145 266
b1952773 267 Float_t dbox4[3];
3cdb4e97 268 dbox4[0] = dbox2[0] + fgkCellRadius/2.;
269 dbox4[1] =(dbox2[1]*fgkNrowUM2)-(fgkCellRadius*fgkSqroot3*(fgkNrowUM2-1)/6.);
b1952773 270 dbox4[2] = dbox3[2];
a978c9e3 271
b1952773 272 gMC->Gsvolu("EUM2","BOX", idtmed[698], dbox4, 3);
273 gMC->Gsatt("EUM2", "SEEN", 1);
a978c9e3 274
b1952773 275 // Place rectangular strips EST2 inside EUM2 unit module
a978c9e3 276
b1952773 277 yb = -dbox4[1]+dbox2[1];
3cdb4e97 278 for (j = 1; j <= fgkNrowUM2; ++j)
a978c9e3 279 {
b1952773 280 if(j%2 == 0)
281 {
a978c9e3 282 xb = fgkCellRadius/2.0;
b1952773 283 }
284 else
285 {
3cdb4e97 286 xb = -fgkCellRadius/2.0;
b1952773 287 }
288 number = j;
a978c9e3 289 gMC->Gspos("EST2",number, "EUM2", xb, yb , 0. , 0, "MANY");
3cdb4e97 290 yb = (-dbox4[1]+dbox2[1])+j*1.0*fgkCellRadius*fgkSqroot3;
b1952773 291 }
c4561145 292
b1952773 293 // 2 types of Rectangular shaped supermodules (BOX)
294 //each with 6 unit modules
295
296 // volume for SUPERMODULE ESMA
297 //Space added to provide a gapping for HV between UM's
298
36031625 299 Float_t dboxSM1[3];
300 dboxSM1[0] = 3.0*dbox3[0]+(2.0*0.025);
301 dboxSM1[1] = 2.0*dbox3[1]+0.025;
3cdb4e97 302 dboxSM1[2] = fgkCellDepth/2.;
a978c9e3 303
36031625 304 gMC->Gsvolu("ESMA","BOX", idtmed[698], dboxSM1, 3);
b1952773 305 gMC->Gsatt("ESMA", "SEEN", 1);
a978c9e3 306
b1952773 307 //Position the 6 unit modules in EMSA
36031625 308 Float_t xa1,xa2,xa3,ya1,ya2;
309 xa1 = -dboxSM1[0] + dbox3[0];
310 xa2 = 0.;
311 xa3 = dboxSM1[0] - dbox3[0];
312 ya1 = dboxSM1[1] - dbox3[1];
313 ya2 = -dboxSM1[1] + dbox3[1];
b1952773 314
a978c9e3 315 gMC->Gspos("EUM1", 1, "ESMA", xa1, ya1, 0., 0, "ONLY");
316 gMC->Gspos("EUM1", 2, "ESMA", xa2, ya1, 0., 0, "ONLY");
317 gMC->Gspos("EUM1", 3, "ESMA", xa3, ya1, 0., 0, "ONLY");
318 gMC->Gspos("EUM1", 4, "ESMA", xa1, ya2, 0., 0, "ONLY");
319 gMC->Gspos("EUM1", 5, "ESMA", xa2, ya2, 0., 0, "ONLY");
320 gMC->Gspos("EUM1", 6, "ESMA", xa3, ya2, 0., 0, "ONLY");
b1952773 321
322
323 // volume for SUPERMODULE ESMB
324 //Space is added to provide a gapping for HV between UM's
36031625 325 Float_t dboxSM2[3];
326 dboxSM2[0] = 2.0*dbox4[0]+0.025;
327 dboxSM2[1] = 3.0*dbox4[1]+(2.0*0.025);
3cdb4e97 328 dboxSM2[2] = fgkCellDepth/2.;
b1952773 329
36031625 330 gMC->Gsvolu("ESMB","BOX", idtmed[698], dboxSM2, 3);
b1952773 331 gMC->Gsatt("ESMB", "SEEN", 1);
36031625 332
b1952773 333 //Position the 6 unit modules in EMSB
36031625 334 Float_t xb1,xb2,yb1,yb2,yb3;
335 xb1 = -dboxSM2[0] +dbox4[0];
336 xb2 = dboxSM2[0]-dbox4[0];
337 yb1 = dboxSM2[1]-dbox4[1];
338 yb2 = 0.;
339 yb3 = -dboxSM2[1]+dbox4[1];
b1952773 340
a978c9e3 341 gMC->Gspos("EUM2", 1, "ESMB", xb1, yb1, 0., 0, "ONLY");
342 gMC->Gspos("EUM2", 2, "ESMB", xb2, yb1, 0., 0, "ONLY");
343 gMC->Gspos("EUM2", 3, "ESMB", xb1, yb2, 0., 0, "ONLY");
344 gMC->Gspos("EUM2", 4, "ESMB", xb2, yb2, 0., 0, "ONLY");
345 gMC->Gspos("EUM2", 5, "ESMB", xb1, yb3, 0., 0, "ONLY");
346 gMC->Gspos("EUM2", 6, "ESMB", xb2, yb3, 0., 0, "ONLY");
347
b1952773 348 // Make a 3mm thick G10 Base plate for ESMA
36031625 349 Float_t dboxG1a[3];
350 dboxG1a[0] = dboxSM1[0];
351 dboxG1a[1] = dboxSM1[1];
3cdb4e97 352 dboxG1a[2] = fgkThBase/2.;
b1952773 353
36031625 354 gMC->Gsvolu("EBPA","BOX", idtmed[607], dboxG1a, 3);
b1952773 355 gMC->Gsatt("EBPA", "SEEN", 1);
356
357 // Make a 1.6mm thick G10 PCB for ESMA
36031625 358 Float_t dboxG2a[3];
359 dboxG2a[0] = dboxSM1[0];
360 dboxG2a[1] = dboxSM1[1];
3cdb4e97 361 dboxG2a[2] = fgkThPCB/2.;
b1952773 362
36031625 363 gMC->Gsvolu("EPCA","BOX", idtmed[607], dboxG2a, 3);
b1952773 364 gMC->Gsatt("EPCA", "SEEN", 1);
365
366
367 // Make a Full module EFPA of AIR to place EBPA,
368 // 1mm AIR, EPCA, ESMA,EPCA for PMD
369
36031625 370 Float_t dboxAlla[3];
371 dboxAlla[0] = dboxSM1[0];
372 dboxAlla[1] = dboxSM1[1];
3cdb4e97 373 dboxAlla[2] = (fgkThBase+fgkThAir+fgkThPCB+dboxSM1[2]+fgkThPCB)/2.;
b1952773 374
36031625 375 gMC->Gsvolu("EFPA","BOX", idtmed[698], dboxAlla, 3);
b1952773 376 gMC->Gsatt("EFPA", "SEEN", 1);
377
378
379 // Make a Full module EFCA of AIR to place EBPA,
380 // 1mm AIR, EPCA, ESMA,EPC for CPV
36031625 381 Float_t dboxAlla2[3];
382 dboxAlla2[0] = dboxSM1[0];
383 dboxAlla2[1] = dboxSM1[1];
3cdb4e97 384 dboxAlla2[2] = (fgkThBase+fgkThAir+fgkThPCB+dboxSM1[2]+fgkThPCB)/2.;
b1952773 385
36031625 386 gMC->Gsvolu("EFCA","BOX", idtmed[698], dboxAlla2, 3);
b1952773 387 gMC->Gsatt("EFCA", "SEEN", 1);
388
389 // Now place everything in EFPA for PMD
390
36031625 391 Float_t zbpa,zpcba1,zpcba2,zsma;
3cdb4e97 392 zpcba1 = - dboxAlla[2]+fgkThPCB/2.0;
a978c9e3 393 gMC->Gspos("EPCA", 1, "EFPA", 0., 0., zpcba1, 0, "ONLY");
36031625 394 zsma = zpcba1+dboxSM1[2];
a978c9e3 395 gMC->Gspos("ESMA", 1, "EFPA", 0., 0., zsma, 0, "ONLY");
3cdb4e97 396 zpcba2 = zsma+fgkThPCB/2.0;
a978c9e3 397 gMC->Gspos("EPCA", 2, "EFPA", 0., 0., zpcba2, 0, "ONLY");
3cdb4e97 398 zbpa = zpcba2+fgkThAir+fgkThBase/2.0;
a978c9e3 399 gMC->Gspos("EBPA", 1, "EFPA", 0., 0., zbpa, 0, "ONLY");
b1952773 400
401 // Now place everything in EFCA for CPV
402
36031625 403 Float_t zbpa2,zpcba12,zpcba22,zsma2;
3cdb4e97 404 zbpa2 = - dboxAlla2[2]+fgkThBase/2.0;
a978c9e3 405 gMC->Gspos("EBPA", 1, "EFCA", 0., 0., zbpa2, 0, "ONLY");
3cdb4e97 406 zpcba12 = zbpa2+fgkThAir+fgkThPCB/2.0;
a978c9e3 407 gMC->Gspos("EPCA", 1, "EFCA", 0., 0., zpcba12, 0, "ONLY");
36031625 408 zsma2 = zpcba12+dboxSM1[2];
a978c9e3 409 gMC->Gspos("ESMA", 1, "EFCA", 0., 0., zsma2, 0, "ONLY");
3cdb4e97 410 zpcba22 = zsma2+fgkThPCB/2.0;
a978c9e3 411 gMC->Gspos("EPCA", 2, "EFCA", 0., 0., zpcba22, 0, "ONLY");
c4561145 412
413
c4561145 414
b1952773 415 // Make a 3mm thick G10 Base plate for ESMB
36031625 416 Float_t dboxG1b[3];
417 dboxG1b[0] = dboxSM2[0];
418 dboxG1b[1] = dboxSM2[1];
3cdb4e97 419 dboxG1b[2] = fgkThBase/2.;
b1952773 420
36031625 421 gMC->Gsvolu("EBPB","BOX", idtmed[607], dboxG1b, 3);
b1952773 422 gMC->Gsatt("EBPB", "SEEN", 1);
423
424 // Make a 1.6mm thick G10 PCB for ESMB
36031625 425 Float_t dboxG2b[3];
426 dboxG2b[0] = dboxSM2[0];
427 dboxG2b[1] = dboxSM2[1];
3cdb4e97 428 dboxG2b[2] = fgkThPCB/2.;
c4561145 429
36031625 430 gMC->Gsvolu("EPCB","BOX", idtmed[607], dboxG2b, 3);
b1952773 431 gMC->Gsatt("EPCB", "SEEN", 1);
c4561145 432
b1952773 433 // Make a Full module EFPB of AIR to place EBPB,
434 //1mm AIR, EPCB, ESMB,EPCB for PMD
36031625 435 Float_t dboxAllb[3];
436 dboxAllb[0] = dboxSM2[0];
437 dboxAllb[1] = dboxSM2[1];
3cdb4e97 438 dboxAllb[2] = (fgkThBase+fgkThAir+fgkThPCB+dboxSM2[2]+fgkThPCB)/2.;
c4561145 439
36031625 440 gMC->Gsvolu("EFPB","BOX", idtmed[698], dboxAllb, 3);
b1952773 441 gMC->Gsatt("EFPB", "SEEN", 1);
c4561145 442
b1952773 443 // Make a Full module EFCB of AIR to place EBPB,
444 //1mm AIR, EPCB, ESMB,EPCB for CPV
36031625 445 Float_t dboxAllb2[3];
446 dboxAllb2[0] = dboxSM2[0];
447 dboxAllb2[1] = dboxSM2[1];
3cdb4e97 448 dboxAllb2[2] = (fgkThBase+fgkThAir+fgkThPCB+dboxSM2[2]+fgkThPCB)/2.;
c4561145 449
36031625 450 gMC->Gsvolu("EFCB","BOX", idtmed[698], dboxAllb2, 3);
b1952773 451 gMC->Gsatt("EFCB", "SEEN", 1);
c4561145 452
c4561145 453
b1952773 454 // Now place everything in EFPB for PMD
c4561145 455
36031625 456 Float_t zbpb,zpcbb1,zpcbb2,zsmb;
3cdb4e97 457 zpcbb1 = - dboxAllb[2]+fgkThPCB/2.0;
a978c9e3 458 gMC->Gspos("EPCB", 1, "EFPB", 0., 0., zpcbb1, 0, "ONLY");
36031625 459 zsmb = zpcbb1+dboxSM2[2];
a978c9e3 460 gMC->Gspos("ESMB", 1, "EFPB", 0., 0., zsmb, 0, "ONLY");
3cdb4e97 461 zpcbb2 = zsmb+fgkThPCB/2.0;
a978c9e3 462 gMC->Gspos("EPCB", 2, "EFPB", 0., 0., zpcbb2, 0, "ONLY");
3cdb4e97 463 zbpb = zpcbb2+fgkThAir+fgkThBase/2.0;
a978c9e3 464 gMC->Gspos("EBPB", 1, "EFPB", 0., 0., zbpb, 0, "ONLY");
c4561145 465
c4561145 466
b1952773 467 // Now place everything in EFCB for CPV
468
36031625 469 Float_t zbpb2,zpcbb12,zpcbb22,zsmb2;
3cdb4e97 470 zbpb2 = - dboxAllb2[2]+fgkThBase/2.0;
a978c9e3 471 gMC->Gspos("EBPB", 1, "EFCB", 0., 0., zbpb2, 0, "ONLY");
3cdb4e97 472 zpcbb12 = zbpb2+0.1+fgkThPCB/2.0;
a978c9e3 473 gMC->Gspos("EPCB", 1, "EFCB", 0., 0., zpcbb12, 0, "ONLY");
36031625 474 zsmb2 = zpcbb12+dboxSM2[2];
a978c9e3 475 gMC->Gspos("ESMB", 1, "EFCB", 0., 0., zsmb2, 0, "ONLY");
3cdb4e97 476 zpcbb22 = zsmb2+fgkThPCB/2.0;
a978c9e3 477 gMC->Gspos("EPCB", 2, "EFCB", 0., 0., zpcbb22, 0, "ONLY");
c4561145 478
c4561145 479
b1952773 480 // Master MODULE EMPA of aluminum for PMD
3cdb4e97 481 fDboxmm1[0] = dboxSM1[0]+fgkBoundary;
482 fDboxmm1[1] = dboxSM1[1]+fgkBoundary;
36031625 483 fDboxmm1[2] = dboxAlla[2];
c4561145 484
36031625 485 gMC->Gsvolu("EMPA","BOX", idtmed[603], fDboxmm1, 3);
b1952773 486 gMC->Gsatt("EMPA", "SEEN", 1);
c4561145 487
b1952773 488 // Master MODULE EMCA of aluminum for CPV
3cdb4e97 489 fDboxmm12[0] = dboxSM1[0]+fgkBoundary;
490 fDboxmm12[1] = dboxSM1[1]+fgkBoundary;
36031625 491 fDboxmm12[2] = dboxAlla[2];
c4561145 492
36031625 493 gMC->Gsvolu("EMCA","BOX", idtmed[603], fDboxmm12, 3);
b1952773 494 gMC->Gsatt("EMCA", "SEEN", 1);
c4561145 495
496
b1952773 497 //Position EFMA inside EMMA for PMD and CPV
a978c9e3 498 gMC->Gspos("EFPA", 1, "EMPA", 0., 0., 0., 0, "ONLY");
499 gMC->Gspos("EFCA", 1, "EMCA", 0., 0., 0., 0, "ONLY");
c4561145 500
c4561145 501
b1952773 502 // Master MODULE EMPB of aluminum for PMD
3cdb4e97 503 fDboxmm2[0] = dboxSM2[0]+fgkBoundary;
504 fDboxmm2[1] = dboxSM2[1]+fgkBoundary;
36031625 505 fDboxmm2[2] = dboxAllb[2];
c4561145 506
36031625 507 gMC->Gsvolu("EMPB","BOX", idtmed[603], fDboxmm2, 3);
b1952773 508 gMC->Gsatt("EMPB", "SEEN", 1);
c4561145 509
b1952773 510 // Master MODULE EMCB of aluminum for CPV
3cdb4e97 511 fDboxmm22[0] = dboxSM2[0]+fgkBoundary;
512 fDboxmm22[1] = dboxSM2[1]+fgkBoundary;
36031625 513 fDboxmm22[2] = dboxAllb[2];
c4561145 514
36031625 515 gMC->Gsvolu("EMCB","BOX", idtmed[603], fDboxmm22, 3);
b1952773 516 gMC->Gsatt("EMCB", "SEEN", 1);
c4561145 517
b1952773 518 //Position EFMB inside EMMB
a978c9e3 519 gMC->Gspos("EFPB", 1, "EMPB", 0., 0., 0., 0, "ONLY");
520 gMC->Gspos("EFCB", 1, "EMCB", 0., 0., 0., 0, "ONLY");
c4561145 521}
522
523//_____________________________________________________________________________
524
525void AliPMDv1::CreatePMD()
526{
527 //
528 // Create final detector from supermodules
b1952773 529 // -- Author : Bedanga and Viyogi June 2003
c4561145 530
531 Float_t xp, yp, zp;
c4561145 532 Int_t jhrot12,jhrot13, irotdm;
c4561145 533 Int_t *idtmed = fIdtmed->GetArray()-599;
534
b1952773 535 //VOLUMES Names : begining with "E" for all PMD volumes,
536
537 // --- DEFINE Iron, and lead volumes for SM A
538
36031625 539 Float_t dboxPba[3];
3cdb4e97 540 dboxPba[0] = fSMLengthax;
541 dboxPba[1] = fSMLengthay;
542 dboxPba[2] = fgkThLead/2.;
c4561145 543
36031625 544 gMC->Gsvolu("EPBA","BOX", idtmed[600], dboxPba, 3);
b1952773 545 gMC->Gsatt ("EPBA", "SEEN", 0);
c4561145 546
b1952773 547 // Fe Support
36031625 548 Float_t dboxFea[3];
3cdb4e97 549 dboxFea[0] = fSMLengthax;
550 dboxFea[1] = fSMLengthay;
551 dboxFea[2] = fgkThSteel/2.;
c4561145 552
36031625 553 gMC->Gsvolu("EFEA","BOX", idtmed[618], dboxFea, 3);
b1952773 554 gMC->Gsatt ("EFEA", "SEEN", 0);
c4561145 555
b1952773 556 // --- DEFINE Iron, and lead volumes for SM B
557
36031625 558 Float_t dboxPbb[3];
3cdb4e97 559 dboxPbb[0] = fSMLengthbx;
560 dboxPbb[1] = fSMLengthby;
561 dboxPbb[2] = fgkThLead/2.;
b1952773 562
36031625 563 gMC->Gsvolu("EPBB","BOX", idtmed[600], dboxPbb, 3);
b1952773 564 gMC->Gsatt ("EPBB", "SEEN", 0);
565
566 // Fe Support
36031625 567 Float_t dboxFeb[3];
3cdb4e97 568 dboxFeb[0] = fSMLengthbx;
569 dboxFeb[1] = fSMLengthby;
570 dboxFeb[2] = fgkThSteel/2.;
b1952773 571
36031625 572 gMC->Gsvolu("EFEB","BOX", idtmed[618], dboxFeb, 3);
b1952773 573 gMC->Gsatt ("EFEB", "SEEN", 0);
c4561145 574
c4561145 575 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
b1952773 576 AliMatrix(jhrot12, 90., 180., 90., 270., 0., 0.);
c4561145 577 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
578
a978c9e3 579 // Gaspmd, the dimension of RECTANGULAR mother volume of PMD,
580 // Four mother volumes EPM1,EPM2 for A-type and
581 // volumes EPM3 and EPM4 for B-type. Four to create a hole
582 // and avoid overlap with beam pipe
583
584 Float_t gaspmd[3];
585 gaspmd[0] = fDboxmm1[0];
586 gaspmd[1] = fDboxmm1[1];
587 gaspmd[2] = 7.0; // for the entire detector, including connectors etc
588
589 gMC->Gsvolu("EPM1", "BOX", idtmed[698], gaspmd, 3);
590 gMC->Gsatt("EPM1", "SEEN", 1);
591 gMC->Gsvolu("EPM2", "BOX", idtmed[698], gaspmd, 3);
592 gMC->Gsatt("EPM2", "SEEN", 1);
b1952773 593
594 //Complete detector for Type A
595 //Position Super modules type A for both CPV and PMD in EPMD
36031625 596 Float_t zpsa,zpba,zfea,zcva;
597
a978c9e3 598 // zpsa = - gaspmd[2] + fSMthick/2.;
599 // -2.5 is given to place PMD at -361.5
600 // BM : In future after putting proper electronics
601 // -2.5 will be replaced by -gaspmd[2]
602 zpsa = -2.5 + fSMthick/2.;
36031625 603
a978c9e3 604 gMC->Gspos("EMPA", 1, "EPM1", 0., 0., zpsa, 0, "ONLY");
605 gMC->Gspos("EMPA", 2, "EPM2", 0., 0., zpsa, jhrot12, "ONLY");
3cdb4e97 606 zpba=zpsa+fSMthick/2.+dboxPba[2];
a978c9e3 607 gMC->Gspos("EPBA", 1, "EPM1", 0., 0., zpba, 0, "ONLY");
608 gMC->Gspos("EPBA", 2, "EPM2", 0., 0., zpba, 0, "ONLY");
36031625 609 zfea=zpba+dboxPba[2]+dboxFea[2];
a978c9e3 610 gMC->Gspos("EFEA", 1, "EPM1", 0., 0., zfea, 0, "ONLY");
611 gMC->Gspos("EFEA", 2, "EPM2", 0., 0., zfea, 0, "ONLY");
3cdb4e97 612 zcva=zfea+dboxFea[2]+fSMthick/2.;
a978c9e3 613 gMC->Gspos("EMCA", 1, "EPM1", 0., 0., zcva, 0, "ONLY");
614 gMC->Gspos("EMCA", 2, "EPM2", 0., 0., zcva, jhrot12, "ONLY");
b1952773 615
a978c9e3 616 gaspmd[0] = fDboxmm2[0];
617 gaspmd[1] = fDboxmm2[1];
618 gaspmd[2] = 7.0; // for the entire detector, including connectors etc
619
620 gMC->Gsvolu("EPM3", "BOX", idtmed[698], gaspmd, 3);
621 gMC->Gsatt("EPM3", "SEEN", 1);
622 gMC->Gsvolu("EPM4", "BOX", idtmed[698], gaspmd, 3);
623 gMC->Gsatt("EPM4", "SEEN", 1);
624
b1952773 625 //Complete detector for Type B
626 //Position Super modules type B for both CPV and PMD in EPMD
36031625 627 Float_t zpsb,zpbb,zfeb,zcvb;
a978c9e3 628 // zpsb = - gaspmd[2] + fSMthick/2.;
629 // -2.5 is given to place PMD at -361.5
630 // BM: In future after putting proper electronics
631 // -2.5 will be replaced by -gaspmd[2]
632
633 zpsb = -2.5 + fSMthick/2.;
634 gMC->Gspos("EMPB", 3, "EPM3", 0., 0., zpsb, 0, "ONLY");
635 gMC->Gspos("EMPB", 4, "EPM4", 0., 0., zpsb, jhrot12, "ONLY");
3cdb4e97 636 zpbb=zpsb+fSMthick/2.+dboxPbb[2];
a978c9e3 637 gMC->Gspos("EPBB", 3, "EPM3", 0., 0., zpbb, 0, "ONLY");
638 gMC->Gspos("EPBB", 4, "EPM4", 0., 0., zpbb, 0, "ONLY");
36031625 639 zfeb=zpbb+dboxPbb[2]+dboxFeb[2];
a978c9e3 640 gMC->Gspos("EFEB", 3, "EPM3", 0., 0., zfeb, 0, "ONLY");
641 gMC->Gspos("EFEB", 4, "EPM4", 0., 0., zfeb, 0, "ONLY");
3cdb4e97 642 zcvb=zfeb+dboxFeb[2]+fSMthick/2.;
a978c9e3 643 gMC->Gspos("EMCB", 3, "EPM3", 0., 0., zcvb, 0, "ONLY");
644 gMC->Gspos("EMCB", 4, "EPM4", 0., 0., zcvb, jhrot12, "ONLY");
c4561145 645
c4561145 646 // --- Place the EPMD in ALICE
647 xp = 0.;
648 yp = 0.;
3cdb4e97 649 zp = fgkZdist;
b1952773 650
a978c9e3 651 Float_t xsma,ysma;
652 Float_t xsmb,ysmb;
653 xsma = -fSMLengthbx;
654 ysma = fSMLengthby;
655 xsmb = -fSMLengthax;
656 ysmb = -fSMLengthay;
657
b1952773 658 //Position Full PMD in ALICE
a978c9e3 659 gMC->Gspos("EPM1", 1, "ALIC", xsma,ysma,zp, 0, "ONLY");
660 gMC->Gspos("EPM2", 1, "ALIC", -xsma,-ysma,zp, 0, "ONLY");
661 gMC->Gspos("EPM3", 1, "ALIC", xsmb,ysmb,zp, 0, "ONLY");
662 gMC->Gspos("EPM4", 1, "ALIC", -xsmb,-ysmb,zp, 0, "ONLY");
b1952773 663
c4561145 664}
665
666
667//_____________________________________________________________________________
36031625 668void AliPMDv1::DrawModule() const
c4561145 669{
c4561145 670 // Draw a shaded view of the Photon Multiplicity Detector
671 //
36031625 672 // cout << " Inside Draw Modules " << endl;
c4561145 673
674 gMC->Gsatt("*", "seen", -1);
675 gMC->Gsatt("alic", "seen", 0);
676 //
677 // Set the visibility of the components
678 //
679 gMC->Gsatt("ECAR","seen",0);
680 gMC->Gsatt("ECCU","seen",1);
b1952773 681 gMC->Gsatt("EST1","seen",1);
682 gMC->Gsatt("EST2","seen",1);
683 gMC->Gsatt("EUM1","seen",1);
684 gMC->Gsatt("EUM2","seen",1);
685 gMC->Gsatt("ESMA","seen",1);
686 gMC->Gsatt("EPMD","seen",1);
c4561145 687 //
688 gMC->Gdopt("hide", "on");
689 gMC->Gdopt("shad", "on");
690 gMC->Gsatt("*", "fill", 7);
691 gMC->SetClipBox(".");
692 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
693 gMC->DefaultRange();
694 gMC->Gdraw("alic", 40, 30, 0, 22, 20.5, .02, .02);
695 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
696
697 //gMC->Gdman(17, 5, "MAN");
698 gMC->Gdopt("hide", "off");
b1952773 699
700 cout << " Outside Draw Modules " << endl;
c4561145 701}
702
703//_____________________________________________________________________________
704void AliPMDv1::CreateMaterials()
705{
c4561145 706 // Create materials for the PMD
707 //
708 // ORIGIN : Y. P. VIYOGI
709 //
36031625 710 // cout << " Inside create materials " << endl;
f017d70a 711
c4561145 712 Int_t *idtmed = fIdtmed->GetArray()-599;
713 Int_t isxfld = gAlice->Field()->Integ();
714 Float_t sxmgmx = gAlice->Field()->Max();
715
716 // --- Define the various materials for GEANT ---
f017d70a 717
c4561145 718 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
f017d70a 719
720 // Argon
721
722 Float_t dAr = 0.001782; // --- Ar density in g/cm3 ---
723 Float_t x0Ar = 19.55 / dAr;
724 AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
725
726 // --- CO2 ---
727
728 Float_t aCO2[2] = { 12.,16. };
729 Float_t zCO2[2] = { 6.,8. };
730 Float_t wCO2[2] = { 1.,2. };
731 Float_t dCO2 = 0.001977;
732 AliMixture(3, "CO2 $", aCO2, zCO2, dCO2, -2, wCO2);
733
c4561145 734 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
f017d70a 735
736 // ArCO2
737
738 Float_t aArCO2[3] = {39.948,12.0107,15.9994};
739 Float_t zArCO2[3] = {18.,6.,8.};
740 Float_t wArCO2[3] = {0.7,0.08,0.22};
741 Float_t dArCO2 = dAr * 0.7 + dCO2 * 0.3;
742 AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
743
c4561145 744 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
f017d70a 745
746 // G10
c4561145 747
f017d70a 748 Float_t aG10[4]={1.,12.011,15.9994,28.086};
749 Float_t zG10[4]={1.,6.,8.,14.};
750 Float_t wG10[4]={0.148648649,0.104054054,0.483499056,0.241666667};
751 AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
c4561145 752
f017d70a 753 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
754
755 // Steel
756 Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
757 Float_t zSteel[4] = { 26.,24.,28.,14. };
758 Float_t wSteel[4] = { .715,.18,.1,.005 };
759 Float_t dSteel = 7.88;
760 AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
761
762 //Air
763
764 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
765 Float_t zAir[4]={6.,7.,8.,18.};
766 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
767 Float_t dAir1 = 1.20479E-10;
768 Float_t dAir = 1.20479E-3;
769 AliMixture(98, "Vacum$", aAir, zAir, dAir1, 4, wAir);
770 AliMixture(99, "Air $", aAir, zAir, dAir , 4, wAir);
771
c4561145 772 // Define tracking media
f017d70a 773 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
774 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
775 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
776 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
777 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
778 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
779 AliMedium(19, "S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
780 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
781 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
c4561145 782
783 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
784 gMC->Gstpar(idtmed[600], "LOSS", 3.);
785 gMC->Gstpar(idtmed[600], "DRAY", 1.);
786
787 gMC->Gstpar(idtmed[603], "LOSS", 3.);
788 gMC->Gstpar(idtmed[603], "DRAY", 1.);
789
790 gMC->Gstpar(idtmed[604], "LOSS", 3.);
791 gMC->Gstpar(idtmed[604], "DRAY", 1.);
792
793 gMC->Gstpar(idtmed[605], "LOSS", 3.);
794 gMC->Gstpar(idtmed[605], "DRAY", 1.);
795
c4561145 796 gMC->Gstpar(idtmed[607], "LOSS", 3.);
797 gMC->Gstpar(idtmed[607], "DRAY", 1.);
798
799 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
800 // --- without affecting the hit patterns ---
801 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
802 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
803 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
804 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
f017d70a 805
c4561145 806 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
807 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
808 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
809 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
f017d70a 810
c4561145 811 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
812 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
813 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
814 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
f017d70a 815
c4561145 816 gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
817 gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
818 gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
819 gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
820
821 // --- Prevent particles stopping in the gas due to energy cut-off ---
822 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
823 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
824 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
825 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
826 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
b1952773 827
828 cout << " Outside create materials " << endl;
829
c4561145 830}
831
832//_____________________________________________________________________________
833void AliPMDv1::Init()
834{
835 //
836 // Initialises PMD detector after it has been built
837 //
b1952773 838
c4561145 839 Int_t i;
3cdb4e97 840 // gAliKdet=1;
c4561145 841 //
b1952773 842 cout << " Inside Init " << endl;
1592ac65 843 if(fDebug) {
844 printf("\n%s: ",ClassName());
845 for(i=0;i<35;i++) printf("*");
846 printf(" PMD_INIT ");
847 for(i=0;i<35;i++) printf("*");
848 printf("\n%s: ",ClassName());
849 printf(" PMD simulation package (v1) initialised\n");
850 printf("%s: parameters of pmd\n",ClassName());
dee197d3 851 printf("%s: %10.2f %10.2f %10.2f \
3cdb4e97 852 %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
1592ac65 853 printf("%s: ",ClassName());
854 for(i=0;i<80;i++) printf("*");
855 printf("\n");
856 }
c4561145 857
858 Int_t *idtmed = fIdtmed->GetArray()-599;
859 fMedSens=idtmed[605-1];
b1952773 860
c4561145 861}
862
863//_____________________________________________________________________________
864void AliPMDv1::StepManager()
865{
866 //
867 // Called at each step in the PMD
868 //
b1952773 869
c4561145 870 Int_t copy;
871 Float_t hits[4], destep;
872 Float_t center[3] = {0,0,0};
3cdb4e97 873 Int_t vol[8];
b1952773 874 //const char *namep;
c4561145 875
876 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
877
878 gMC->CurrentVolID(copy);
c4561145 879 //namep=gMC->CurrentVolName();
b1952773 880 //printf("Current vol is %s \n",namep);
c4561145 881 vol[0]=copy;
c4561145 882
b1952773 883 gMC->CurrentVolOffID(1,copy);
c4561145 884 //namep=gMC->CurrentVolOffName(1);
885 //printf("Current vol 11 is %s \n",namep);
c4561145 886 vol[1]=copy;
c4561145 887
b1952773 888 gMC->CurrentVolOffID(2,copy);
c4561145 889 //namep=gMC->CurrentVolOffName(2);
890 //printf("Current vol 22 is %s \n",namep);
c4561145 891 vol[2]=copy;
892
893 // if(strncmp(namep,"EHC1",4))vol[2]=1;
894
895 gMC->CurrentVolOffID(3,copy);
c4561145 896 //namep=gMC->CurrentVolOffName(3);
897 //printf("Current vol 33 is %s \n",namep);
c4561145 898 vol[3]=copy;
c4561145 899
b1952773 900 gMC->CurrentVolOffID(4,copy);
c4561145 901 //namep=gMC->CurrentVolOffName(4);
902 //printf("Current vol 44 is %s \n",namep);
c4561145 903 vol[4]=copy;
c4561145 904
b1952773 905 gMC->CurrentVolOffID(5,copy);
906 //namep=gMC->CurrentVolOffName(5);
907 //printf("Current vol 55 is %s \n",namep);
908 vol[5]=copy;
909
910 gMC->CurrentVolOffID(6,copy);
911 //namep=gMC->CurrentVolOffName(6);
912 //printf("Current vol 66 is %s \n",namep);
913 vol[6]=copy;
914
915 gMC->CurrentVolOffID(7,copy);
916 //namep=gMC->CurrentVolOffName(7);
917 //printf("Current vol 77 is %s \n",namep);
918 vol[7]=copy;
919
920
921 //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);
922
c4561145 923 gMC->Gdtom(center,hits,1);
924 hits[3] = destep*1e9; //Number in eV
5d12ce38 925 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
b1952773 926
c4561145 927 }
928}
929
930
931//------------------------------------------------------------------------
932// Get parameters
933
934void AliPMDv1::GetParameters()
935{
36031625 936 // This gives all the parameters of the detector
3cdb4e97 937 // such as Length of Supermodules, type A, type B,
938 // thickness of the Supermodule
b1952773 939 //
36031625 940
3cdb4e97 941 fSMLengthax = (3.0*(fgkNcolUM1*fgkCellRadius+fgkCellRadius/2.)
942 + (2.0*fgkGap)) + fgkBoundary;
943 fSMLengthbx = 2.0*(fgkNcolUM2*fgkCellRadius+fgkCellRadius/2.)
944 + fgkGap + fgkBoundary;
945
946 fSMLengthay = 2.0*(((fgkCellRadius/fgkSqroot3by2)*fgkNrowUM1)
947 - (fgkCellRadius*fgkSqroot3*(fgkNrowUM1-1)/6.))
948 + fgkGap + fgkBoundary;
949 fSMLengthby = 3.0*(((fgkCellRadius/fgkSqroot3by2)*fgkNrowUM2)
950 - (fgkCellRadius*fgkSqroot3*(fgkNrowUM2-1)/6.))
951 + (2.0*fgkGap) + fgkBoundary;
952
953 fSMthick = fgkThBase + fgkThAir + fgkThPCB
954 + fgkCellDepth + fgkThPCB + fgkThAir + fgkThPCB;
36031625 955
b1952773 956}