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