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