]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ZDC/AliZDCv1.cxx
Code review
[u/mrichter/AliRoot.git] / ZDC / AliZDCv1.cxx
CommitLineData
68ca986e 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 **************************************************************************/
15
16/*
17$Log$
5cf7bbad 18Revision 1.14 2001/02/23 16:48:28 coppedis
19Correct bug in ZEM hit definition
20
0c9b76ab 21Revision 1.13 2001/02/07 18:07:41 coppedis
22Modif for splitting
23
7d285fe3 24Revision 1.12 2001/01/26 19:56:27 hristov
25Major upgrade of AliRoot code
26
2ab0c725 27Revision 1.11 2001/01/16 07:43:33 hristov
28Initialisation of ZDC hits
29
de6bc247 30Revision 1.10 2000/12/14 15:20:02 coppedis
31Hits2Digits method for digitization
32
cc9c0243 33Revision 1.9 2000/12/13 10:33:49 coppedis
34Prints only if fDebug==1
35
9d7316ac 36Revision 1.8 2000/12/12 14:10:02 coppedis
37Correction suggested by M. Masera
38
bdee0299 39Revision 1.7 2000/11/30 17:23:47 coppedis
40Remove first corrector dipole and introduce digitization
41
5ce39387 42Revision 1.6 2000/11/22 11:33:10 coppedis
43Major code revision
44
866ab5a2 45Revision 1.5 2000/10/02 21:28:20 fca
46Removal of useless dependecies via forward declarations
47
48Revision 1.3.2.1 2000/08/24 09:25:47 hristov
49Patch by P.Hristov: Bug in ZDC geometry corrected by E.Scomparin
50
94de3818 51Revision 1.4 2000/08/24 09:23:59 hristov
52Bug in ZDC geometry corrected by E.Scomparin
53
0500bdfc 54Revision 1.3 2000/07/12 06:59:16 fca
55Fixing dimension of hits array
56
366ff5c2 57Revision 1.2 2000/07/11 11:12:34 fca
58Some syntax corrections for non standard HP aCC
59
c0ceba4c 60Revision 1.1 2000/07/10 13:58:01 fca
61New version of ZDC from E.Scomparin & C.Oppedisano
62
68ca986e 63Revision 1.7 2000/01/19 17:17:40 fca
64
65Revision 1.6 1999/09/29 09:24:35 fca
66Introduction of the Copyright and cvs Log
67
68*/
69
70///////////////////////////////////////////////////////////////////////////////
71// //
72// Zero Degree Calorimeter //
866ab5a2 73// This class contains the basic functions for the ZDC //
74// Functions specific to one particular geometry are //
68ca986e 75// contained in the derived classes //
76// //
77///////////////////////////////////////////////////////////////////////////////
78
cc9c0243 79// --- Standard libraries
80#include "stdio.h"
81
5ce39387 82// --- ROOT system
68ca986e 83#include <TBRIK.h>
84#include <TNode.h>
85#include <TMath.h>
5ce39387 86#include <TRandom.h>
866ab5a2 87#include <TSystem.h>
5ce39387 88#include <TTree.h>
68ca986e 89
5ce39387 90
91// --- AliRoot classes
68ca986e 92#include "AliZDCv1.h"
5ce39387 93#include "AliZDCHit.h"
94#include "AliZDCDigit.h"
68ca986e 95#include "AliRun.h"
5ce39387 96#include "AliDetector.h"
94de3818 97#include "AliMagF.h"
68ca986e 98#include "AliMC.h"
99#include "AliCallf77.h"
100#include "AliConst.h"
101#include "AliPDG.h"
5ce39387 102#include "TLorentzVector.h"
68ca986e 103
104
105ClassImp(AliZDCv1)
106
107
108///////////////////////////////////////////////////////////////////////////////
109// //
110// Zero Degree Calorimeter version 1 //
111// //
112///////////////////////////////////////////////////////////////////////////////
113
114//_____________________________________________________________________________
115AliZDCv1::AliZDCv1() : AliZDC()
116{
117 //
118 // Default constructor for Zero Degree Calorimeter
119 //
5ce39387 120
866ab5a2 121 fMedSensF1 = 0;
122 fMedSensF2 = 0;
123 fMedSensZN = 0;
124 fMedSensZP = 0;
125 fMedSensGR = 0;
126 fMedSensZEM = 0;
127 fMedSensPI = 0;
128 fNoShower = 0;
68ca986e 129}
130
131//_____________________________________________________________________________
132AliZDCv1::AliZDCv1(const char *name, const char *title)
133 : AliZDC(name,title)
134{
135 //
136 // Standard constructor for Zero Degree Calorimeter
137 //
5ce39387 138
139 fDigits = new TClonesArray("AliZDCDigit",1000);
140
866ab5a2 141 fMedSensF1 = 0;
142 fMedSensF2 = 0;
143 fMedSensZN = 0;
144 fMedSensZP = 0;
145 fMedSensGR = 0;
146 fMedSensZEM = 0;
147 fMedSensPI = 0;
148 fNoShower = 0;
68ca986e 149}
150
151//_____________________________________________________________________________
152void AliZDCv1::CreateGeometry()
153{
154 //
155 // Create the geometry for the Zero Degree Calorimeter version 1
156 //* Initialize COMMON block ZDC_CGEOM
157 //*
158
159 CreateBeamLine();
160 CreateZDC();
161}
162
163//_____________________________________________________________________________
164void AliZDCv1::CreateBeamLine()
165{
166
167 Float_t angle;
168 Float_t zq, conpar[9], elpar[3], tubpar[3];
169 Int_t im1, im2;
170 Float_t zd1, zd2;
171
172
173 Int_t *idtmed = fIdtmed->GetArray();
174
175 // -- Mother of the ZDC
176
177 conpar[0] = 0.;
178 conpar[1] = 360.;
179 conpar[2] = 2.;
0500bdfc 180 conpar[3] = 805.;
68ca986e 181 conpar[4] = 0.;
182 conpar[5] = 55.;
183 conpar[6] = 13060.;
184 conpar[7] = 0.;
185 conpar[8] = 55.;
186 gMC->Gsvolu("ZDC ", "PCON", idtmed[10], conpar, 9);
187 gMC->Gspos("ZDC ", 1, "ALIC", 0., 0., 0., 0, "ONLY");
188
189 // -- FIRST SECTION OF THE BEAM PIPE (from compensator dipole to
190 // beginning of D1)
191
192 zd1 = 1921.6;
193
194 tubpar[0] = 6.3/2.;
195 tubpar[1] = 6.7/2.;
196 tubpar[2] = 3916.7/2.;
197 gMC->Gsvolu("P001", "TUBE", idtmed[5], tubpar, 3);
198 gMC->Gspos("P001", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
199
200 //-- SECOND SECTION OF THE BEAM PIPE (FROM THE END OF D1 TO THE BEGINNING OF
201 // D2)
202
203 //-- FROM MAGNETIC BEGINNING OG D1 TO MAGNETIC END OF D1 + 23.5 cm
204 //-- Elliptic pipe
205
206 zd1 = 6310.8-472.5;
207
208 elpar[0] = 6.84/2.;
209 elpar[1] = 5.86/2.;
210 elpar[2] = 945./2.;
866ab5a2 211// gMC->Gsvolu("E001", "ELTU", idtmed[5], elpar, 3);
212// gMC->Gspos("E001", 1, "ZDC ", 0., 0., elpar[2] + zd1, 0, "ONLY");
213//
68ca986e 214 elpar[0] = 6.44/2.;
215 elpar[1] = 5.46/2.;
216 elpar[2] = 945./2.;
866ab5a2 217// gMC->Gsvolu("E002", "ELTU", idtmed[10], elpar, 3);
218// gMC->Gspos("E002", 1, "E001", 0., 0., 0., 0, "ONLY");
68ca986e 219
220 zd1 += 2.*elpar[2];
221
222 elpar[0] = 6.84/2.;
223 elpar[1] = 5.86/2.;
224 elpar[2] = 13.5/2.;
866ab5a2 225// gMC->Gsvolu("E003", "ELTU", idtmed[5], elpar, 3);
226// gMC->Gspos("E002", 1, "ZDC ", 0., 0., elpar[2] + zd1, 0, "ONLY");
68ca986e 227
228 elpar[0] = 6.44/2.;
229 elpar[1] = 5.46/2.;
230 elpar[2] = 13.5/2.;
866ab5a2 231// gMC->Gsvolu("E004", "ELTU", idtmed[10], elpar, 3);
232// gMC->Gspos("E004", 1, "E003", 0., 0., 0., 0, "ONLY");
68ca986e 233
234 zd1 += 2.*elpar[2];
235
236 conpar[0] = 25./2.;
237 conpar[1] = 6.44/2.;
238 conpar[2] = 6.84/2.;
239 conpar[3] = 10./2.;
240 conpar[4] = 10.4/2.;
241 gMC->Gsvolu("C001", "CONE", idtmed[5], conpar, 5);
242 gMC->Gspos("C001", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
243
244 zd1 += 2.*conpar[0];
245
246 tubpar[0] = 10./2.;
247 tubpar[1] = 10.4/2.;
248 tubpar[2] = 50./2.;
249 gMC->Gsvolu("P002", "TUBE", idtmed[5], tubpar, 3);
250 gMC->Gspos("P002", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
251
252 zd1 += tubpar[2] * 2.;
253
254 tubpar[0] = 10./2.;
255 tubpar[1] = 10.4/2.;
256 tubpar[2] = 10./2.;
257 gMC->Gsvolu("P003", "TUBE", idtmed[5], tubpar, 3);
258 gMC->Gspos("P003", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
259
260 zd1 += tubpar[2] * 2.;
261
262 tubpar[0] = 10./2.;
263 tubpar[1] = 10.4/2.;
264 tubpar[2] = 3.16/2.;
265 gMC->Gsvolu("P004", "TUBE", idtmed[5], tubpar, 3);
266 gMC->Gspos("P004", 1, "ZDC ", 0., 0., tubpar[0] + zd1, 0, "ONLY");
267
268 zd1 += tubpar[2] * 2.;
269
270 tubpar[0] = 10.0/2.;
271 tubpar[1] = 10.4/2;
272 tubpar[2] = 190./2.;
273 gMC->Gsvolu("P005", "TUBE", idtmed[5], tubpar, 3);
274 gMC->Gspos("P005", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
275
276 zd1 += tubpar[2] * 2.;
277
278 conpar[0] = 30./2.;
279 conpar[1] = 10./2.;
280 conpar[2] = 10.4/2.;
281 conpar[3] = 20.6/2.;
282 conpar[4] = 21./2.;
283 gMC->Gsvolu("P006", "CONE", idtmed[5], conpar, 5);
284 gMC->Gspos("P006", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
285
286 zd1 += conpar[0] * 2.;
287
288 tubpar[0] = 20.6/2.;
289 tubpar[1] = 21./2.;
290 tubpar[2] = 450./2.;
291 gMC->Gsvolu("P007", "TUBE", idtmed[5], tubpar, 3);
292 gMC->Gspos("P007", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
293
294 zd1 += tubpar[2] * 2.;
295
296 conpar[0] = 13.6/2.;
297 conpar[1] = 20.6/2.;
298 conpar[2] = 21./2.;
299 conpar[3] = 25.4/2.;
300 conpar[4] = 25.8/2.;
301 gMC->Gsvolu("P008", "CONE", idtmed[5], conpar, 5);
302 gMC->Gspos("P008", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
303
304 zd1 += conpar[0] * 2.;
305
306 tubpar[0] = 25.4/2.;
307 tubpar[1] = 25.8/2.;
308 tubpar[2] = 205.8/2.;
309 gMC->Gsvolu("P009", "TUBE", idtmed[5], tubpar, 3);
310 gMC->Gspos("P009", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
311
312 zd1 += tubpar[2] * 2.;
313
314 tubpar[0] = 50./2.;
315 tubpar[1] = 50.4/2.;
316 tubpar[2] = 505.4/2.;
317 gMC->Gsvolu("P010", "TUBE", idtmed[5], tubpar, 3);
318 gMC->Gspos("P010", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
319
320 zd1 += tubpar[2] * 2.;
321
322 tubpar[0] = 50./2.;
323 tubpar[1] = 50.4/2.;
324 tubpar[2] = 700./2.;
325 gMC->Gsvolu("P011", "TUBE", idtmed[5], tubpar, 3);
326 gMC->Gspos("P011", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
327
328 zd1 += tubpar[2] * 2.;
329
330 tubpar[0] = 50./2.;
331 tubpar[1] = 50.4/2.;
332 tubpar[2] = 778.5/2.;
333 gMC->Gsvolu("P012", "TUBE", idtmed[5], tubpar, 3);
334 gMC->Gspos("P012", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
335
336 zd1 += tubpar[2] * 2.;
337
338 conpar[0] = 14.18/2.;
339 conpar[1] = 50./2.;
340 conpar[2] = 50.4/2.;
341 conpar[3] = 55./2.;
342 conpar[4] = 55.4/2.;
343 gMC->Gsvolu("P013", "CONE", idtmed[5], conpar, 5);
344 gMC->Gspos("P013", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
345
346 zd1 += conpar[0] * 2.;
347
348 tubpar[0] = 55./2.;
349 tubpar[1] = 55.4/2.;
350 tubpar[2] = 730./2.;
351 gMC->Gsvolu("P014", "TUBE", idtmed[5], tubpar, 3);
352 gMC->Gspos("P014", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
353
354 zd1 += tubpar[2] * 2.;
355
356 conpar[0] = 36.86/2.;
357 conpar[1] = 55./2.;
358 conpar[2] = 55.4/2.;
359 conpar[3] = 68./2.;
360 conpar[4] = 68.4/2.;
361 gMC->Gsvolu("P015", "CONE", idtmed[5], conpar, 5);
362 gMC->Gspos("P015", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
363
364 zd1 += conpar[0] * 2.;
365
366 tubpar[0] = 68./2.;
367 tubpar[1] = 68.4/2.;
368 tubpar[2] = 927.3/2.;
369 gMC->Gsvolu("P016", "TUBE", idtmed[5], tubpar, 3);
370 gMC->Gspos("P016", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
371
372 zd1 += tubpar[2] * 2.;
373
374 tubpar[0] = 0./2.;
375 tubpar[1] = 68.4/2.;
376 tubpar[2] = 0.2/2.;
866ab5a2 377 gMC->Gsvolu("P017", "TUBE", idtmed[8], tubpar, 3);
68ca986e 378 gMC->Gspos("P017", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
379
380 zd1 += tubpar[2] * 2.;
381
382 tubpar[0] = 0./2.;
383 tubpar[1] = 5./2.;
384 tubpar[2] = 0.2/2.;
385 gMC->Gsvolu("Q017", "TUBE", idtmed[10], tubpar, 3);
386
387 //-- Position Q017 inside P017
388 gMC->Gspos("Q017", 1, "P017", -7.7, 0., 0., 0, "ONLY");
389
390 tubpar[0] = 0./2.;
391 tubpar[1] = 7./2.;
392 tubpar[2] = 0.2/2.;
393 gMC->Gsvolu("R017", "TUBE", idtmed[10], tubpar, 3);
394
395 //-- Position R017 inside P017
396 gMC->Gspos("R017", 1, "P017", 7.7, 0., 0., 0, "ONLY");
397
398 //-- BEAM PIPE BETWEEN END OF CONICAL PIPE AND BEGINNING OF D2
399
400 tubpar[0] = 5./2.;
401 tubpar[1] = 5.4/2.;
402 tubpar[2] = 678./2.;
403 gMC->Gsvolu("P018", "TUBE", idtmed[5], tubpar, 3);
404
405 tubpar[0] = 7./2.;
406 tubpar[1] = 7.4/2.;
407 tubpar[2] = 678./2.;
408 gMC->Gsvolu("P019", "TUBE", idtmed[5], tubpar, 3);
409
410 // -- ROTATE PIPES
411
412 AliMatrix(im1, 90.-0.071, 0., 90., 90., .071, 180.);
413 angle = .071*kDegrad;
414 gMC->Gspos("P018", 1, "ZDC ", TMath::Sin(angle) * 645. / 2. - 9.7 +
415 TMath::Sin(angle) * 945. / 2., 0., tubpar[2] + zd1, im1, "ONLY");
416 AliMatrix(im2, 90.+0.071, 0., 90., 90., .071, 0.);
417 gMC->Gspos("P019", 1, "ZDC ", 9.7 - TMath::Sin(angle) * 645. / 2., 0.,
418 tubpar[2] + zd1, im2, "ONLY");
419
420 // -- END OF BEAM PIPE VOLUME DEFINITION. MAGNET DEFINITION FOLLOWS
421 // (LHC OPTICS 6)
422
423 // -- COMPENSATOR DIPOLE (MBXW)
424 // GAP (VACUUM WITH MAGNETIC FIELD)
425
5ce39387 426// tubpar[0] = 0.;
427// tubpar[1] = 4.5;
428// tubpar[2] = 340./2.;
429// gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
430// gMC->Gspos("MBXW", 1, "ZDC ", 0., 0., tubpar[2] + 805., 0, "ONLY");
68ca986e 431
432 // -- YOKE (IRON WITHOUT MAGNETIC FIELD)
433
5ce39387 434// tubpar[0] = 4.5;
435// tubpar[1] = 55.;
436// tubpar[2] = 340./2.;
437// gMC->Gsvolu("YMBX", "TUBE", idtmed[5], tubpar, 3);
438// gMC->Gspos("YMBX", 1, "ZDC ", 0., 0., tubpar[2] + 805., 0, "ONLY");
68ca986e 439
440 // -- COMPENSATOR DIPOLE (MCBWA)
441 // GAP (VACUUM WITH MAGNETIC FIELD)
442
443 tubpar[0] = 0.;
444 tubpar[1] = 4.5;
445 tubpar[2] = 170./2.;
446 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
447 gMC->Gspos("MCBW", 1, "ZDC ", 0., 0., tubpar[2] + 1921.6, 0, "ONLY");
448
449 // -- YOKE (IRON WITHOUT MAGNETIC FIELD)
450
451 tubpar[0] = 4.5;
452 tubpar[1] = 55.;
453 tubpar[2] = 170./2.;
454 gMC->Gsvolu("YMCB", "TUBE", idtmed[5], tubpar, 3);
455 gMC->Gspos("YMCB", 1, "ZDC ", 0., 0., tubpar[2] + 1921.6, 0, "ONLY");
456
457 // -- INNER TRIPLET
458
459 zq = 2300.;
460
461 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
462
463 // MQXL
464 // -- GAP (VACUUM WITH MAGNETIC FIELD)
465
466 tubpar[0] = 0.;
467 tubpar[1] = 3.5;
468 tubpar[2] = 630./2.;
469 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
470
471 // -- YOKE
472
473 tubpar[0] = 3.5;
474 tubpar[1] = 22.;
475 tubpar[2] = 630./2.;
476 gMC->Gsvolu("YMQL", "TUBE", idtmed[5], tubpar, 3);
477
478 gMC->Gspos("MQXL", 1, "ZDC ", 0., 0., tubpar[2] + zq, 0, "ONLY");
479 gMC->Gspos("YMQL", 1, "ZDC ", 0., 0., tubpar[2] + zq, 0, "ONLY");
480
481 gMC->Gspos("MQXL", 2, "ZDC ", 0., 0., tubpar[2] + zq + 2430., 0, "ONLY");
482 gMC->Gspos("YMQL", 2, "ZDC ", 0., 0., tubpar[2] + zq + 2430., 0, "ONLY");
483
484 // -- MQX
485 // -- GAP (VACUUM WITH MAGNETIC FIELD)
486
487 tubpar[0] = 0.;
488 tubpar[1] = 3.5;
489 tubpar[2] = 550./2.;
490 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
491
492 // -- YOKE
493
494 tubpar[0] = 3.5;
495 tubpar[1] = 22.;
496 tubpar[2] = 550./2.;
497 gMC->Gsvolu("YMQ ", "TUBE", idtmed[5], tubpar, 3);
498
499 gMC->Gspos("MQX ", 1, "ZDC ", 0., 0., tubpar[2] + zq + 880., 0, "ONLY");
500 gMC->Gspos("YMQ ", 1, "ZDC ", 0., 0., tubpar[2] + zq + 880., 0, "ONLY");
501
502 gMC->Gspos("MQX ", 2, "ZDC ", 0., 0., tubpar[2] + zq + 1530., 0, "ONLY");
503 gMC->Gspos("YMQ ", 2, "ZDC ", 0., 0., tubpar[2] + zq + 1530., 0, "ONLY");
504
505 // -- SEPARATOR DIPOLE D1
506
507 zd1 = 5838.3;
508
509 // -- GAP (VACUUM WITH MAGNETIC FIELD)
510
511 tubpar[0] = 0.;
512 tubpar[1] = 7.5/2.;
513 tubpar[2] = 945./2.;
514 gMC->Gsvolu("D1 ", "TUBE", idtmed[11], tubpar, 3);
515
516 // -- YOKE
517
518 tubpar[0] = 0.;
519 tubpar[1] = 110./2;
520 tubpar[2] = 945./2.;
521 gMC->Gsvolu("YD1 ", "TUBE", idtmed[5], tubpar, 3);
522
523 gMC->Gspos("YD1 ", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
524 gMC->Gspos("D1 ", 1, "YD1 ", 0., 0., 0., 0, "ONLY");
525
526 // -- DIPOLE D2
527
528 zd2 = 12147.6;
529
530 // -- GAP (VACUUM WITH MAGNETIC FIELD)
531
532 tubpar[0] = 0.;
533 tubpar[1] = 7.5/2.;
534 tubpar[2] = 945./2.;
535 gMC->Gsvolu("D2 ", "TUBE", idtmed[11], tubpar, 3);
536
537 // -- YOKE
538
539 tubpar[0] = 0.;
540 tubpar[1] = 55.;
541 tubpar[2] = 945./2.;
542 gMC->Gsvolu("YD2 ", "TUBE", idtmed[5], tubpar, 3);
543
544 gMC->Gspos("YD2 ", 1, "ZDC ", 0., 0., tubpar[2] + zd2, 0, "ONLY");
545
546 gMC->Gspos("D2 ", 1, "YD2 ", -9.7, 0., 0., 0, "ONLY");
547 gMC->Gspos("D2 ", 2, "YD2 ", 9.7, 0., 0., 0, "ONLY");
548
549 // -- END OF MAGNET DEFINITION
550}
551
552//_____________________________________________________________________________
553void AliZDCv1::CreateZDC()
554{
555
556 Int_t *idtmed = fIdtmed->GetArray();
866ab5a2 557 Int_t irot1, irot2;
558 Float_t DimPb[6], DimVoid[6];
559
68ca986e 560
561 //-- Create calorimeters geometry
562
563 //--> Neutron calorimeter (ZN)
564
565 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
566 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
567 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
568 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
569 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
570 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
571 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
572 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
573 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
574
575 // Divide ZNEU in towers (for hits purposes)
576
577 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
578 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
579
580 //-- Divide ZN1 in minitowers
581 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
582 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
583 // (4 fibres per minitower)
584
585 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
586 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
587
588 // --- Position the empty grooves in the sticks (4 grooves per stick)
589 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
590 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
591
592 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
593 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
594 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
595 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
596
597 // --- Position the fibers in the grooves
598 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
599 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
600 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
601 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
602
603 // --- Position the neutron calorimeter in ZDC
604 gMC->Gspos("ZNEU", 1, "ZDC ", fPosZN[0], fPosZN[1], fPosZN[2] + fDimZN[2], 0, "ONLY");
605
866ab5a2 606
607 //--> Proton calorimeter (ZP)
68ca986e 608
609 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
610 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
611 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
612 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
613 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
614 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
615 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
616 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
617 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
618
619 //-- Divide ZPRO in towers(for hits purposes)
620
621 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
622 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
623
624
625 //-- Divide ZP1 in minitowers
626 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
627 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
628 // (4 fiber per minitower)
629
630 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
631 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
632
633 // --- Position the empty grooves in the sticks (4 grooves per stick)
634 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
635 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
636
637 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
638 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
639 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
640 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
641
642 // --- Position the fibers in the grooves
643 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
644 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
645 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
646 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
647
648
649 // --- Position the proton calorimeter in ZDC
650 gMC->Gspos("ZPRO", 1, "ZDC ", fPosZP[0], fPosZP[1], fPosZP[2] + fDimZP[2], 0, "ONLY");
866ab5a2 651
652
653
654 //--> EM calorimeter (ZEM)
655
656 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
657
658 gMC->Matrix(irot1,0.,0.,90.,90.,90.,180.); // Rotation matrix 1
659 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]); // Rotation matrix 2
660// printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
661
662 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
663
664 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
665
666 DimPb[0] = fDimZEMPb; // Lead slices
667 DimPb[1] = fDimZEM[2];
668 DimPb[2] = fDimZEM[1];
669 DimPb[3] = 90.-fDimZEM[3];
670 DimPb[4] = 0.;
671 DimPb[5] = 0.;
672 gMC->Gsvolu("ZEL0", "PARA", idtmed[6], DimPb, 6);
673 gMC->Gsvolu("ZEL1", "PARA", idtmed[6], DimPb, 6);
674 gMC->Gsvolu("ZEL2", "PARA", idtmed[6], DimPb, 6);
675
676 // --- Position the lead slices in the tranche
677 Float_t zTran = fDimZEM[0]/fDivZEM[2];
678 Float_t zTrPb = -zTran+fDimZEMPb;
679 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
680 gMC->Gspos("ZEL1", 1, "ZETR", fDimZEMPb, 0., 0., 0, "ONLY");
681
682 // --- Vacuum zone (to be filled with fibres)
683 DimVoid[0] = (zTran-2*fDimZEMPb)/2.;
684 DimVoid[1] = fDimZEM[2];
685 DimVoid[2] = fDimZEM[1];
686 DimVoid[3] = 90.-fDimZEM[3];
687 DimVoid[4] = 0.;
688 DimVoid[5] = 0.;
689 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], DimVoid,6);
690 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], DimVoid,6);
691
692 // --- Divide the vacuum slice into sticks along x axis
693 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
694 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
695
696 // --- Positioning the fibers into the sticks
697 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
698 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
699
700 // --- Positioning the vacuum slice into the tranche
701 Float_t DisplFib = fDimZEM[1]/fDivZEM[0];
702 gMC->Gspos("ZEV0", 1,"ZETR", -DimVoid[0], 0., 0., 0, "ONLY");
703 gMC->Gspos("ZEV1", 1,"ZETR", -DimVoid[0]+zTran, 0., DisplFib, 0, "ONLY");
704
705 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
706 gMC->Gspos("ZEM ", 1,"ZDC ", fPosZEM[0], fPosZEM[1], fPosZEM[2], irot1, "ONLY");
707
708 // --- Adding last slice at the end of the EM calorimeter
709 Float_t zLastSlice = fPosZEM[2]+fDimZEMPb+fDimZEM[0];
710 gMC->Gspos("ZEL2", 1,"ZDC ", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
68ca986e 711
712}
713
714//_____________________________________________________________________________
715void AliZDCv1::DrawModule()
716{
717 //
718 // Draw a shaded view of the Zero Degree Calorimeter version 1
719 //
720
721 // Set everything unseen
722 gMC->Gsatt("*", "seen", -1);
723 //
724 // Set ALIC mother transparent
725 gMC->Gsatt("ALIC","SEEN",0);
726 //
727 // Set the volumes visible
728 gMC->Gsatt("ZDC ","SEEN",0);
729 gMC->Gsatt("P001","SEEN",1);
730 gMC->Gsatt("E001","SEEN",1);
731 gMC->Gsatt("E002","SEEN",1);
732 gMC->Gsatt("E003","SEEN",1);
733 gMC->Gsatt("E004","SEEN",1);
734 gMC->Gsatt("C001","SEEN",1);
735 gMC->Gsatt("P002","SEEN",1);
736 gMC->Gsatt("P003","SEEN",1);
737 gMC->Gsatt("P004","SEEN",1);
738 gMC->Gsatt("P005","SEEN",1);
739 gMC->Gsatt("P006","SEEN",1);
740 gMC->Gsatt("P007","SEEN",1);
741 gMC->Gsatt("P008","SEEN",1);
742 gMC->Gsatt("P009","SEEN",1);
743 gMC->Gsatt("P010","SEEN",1);
744 gMC->Gsatt("P011","SEEN",1);
745 gMC->Gsatt("P012","SEEN",1);
746 gMC->Gsatt("P013","SEEN",1);
747 gMC->Gsatt("P014","SEEN",1);
748 gMC->Gsatt("P015","SEEN",1);
749 gMC->Gsatt("P016","SEEN",1);
750 gMC->Gsatt("P017","SEEN",1);
751 gMC->Gsatt("Q017","SEEN",1);
752 gMC->Gsatt("R017","SEEN",1);
753 gMC->Gsatt("P018","SEEN",1);
754 gMC->Gsatt("P019","SEEN",1);
5ce39387 755// gMC->Gsatt("MBXW","SEEN",1);
756// gMC->Gsatt("YMBX","SEEN",1);
68ca986e 757 gMC->Gsatt("MCBW","SEEN",1);
758 gMC->Gsatt("YMCB","SEEN",1);
759 gMC->Gsatt("MQXL","SEEN",1);
760 gMC->Gsatt("YMQL","SEEN",1);
761 gMC->Gsatt("MQX ","SEEN",1);
762 gMC->Gsatt("YMQ ","SEEN",1);
763 gMC->Gsatt("D1 ","SEEN",1);
764 gMC->Gsatt("YD1 ","SEEN",1);
765 gMC->Gsatt("D2 ","SEEN",1);
766 gMC->Gsatt("YD2 ","SEEN",1);
767 gMC->Gsatt("ZNEU","SEEN",0);
768 gMC->Gsatt("ZNF1","SEEN",0);
769 gMC->Gsatt("ZNF2","SEEN",0);
770 gMC->Gsatt("ZNF3","SEEN",0);
771 gMC->Gsatt("ZNF4","SEEN",0);
772 gMC->Gsatt("ZNG1","SEEN",0);
773 gMC->Gsatt("ZNG2","SEEN",0);
774 gMC->Gsatt("ZNG3","SEEN",0);
775 gMC->Gsatt("ZNG4","SEEN",0);
776 gMC->Gsatt("ZNTX","SEEN",0);
777 gMC->Gsatt("ZN1 ","COLO",2);
778 gMC->Gsatt("ZN1 ","SEEN",1);
779 gMC->Gsatt("ZNSL","SEEN",0);
780 gMC->Gsatt("ZNST","SEEN",0);
781 gMC->Gsatt("ZPRO","SEEN",0);
782 gMC->Gsatt("ZPF1","SEEN",0);
783 gMC->Gsatt("ZPF2","SEEN",0);
784 gMC->Gsatt("ZPF3","SEEN",0);
785 gMC->Gsatt("ZPF4","SEEN",0);
786 gMC->Gsatt("ZPG1","SEEN",0);
787 gMC->Gsatt("ZPG2","SEEN",0);
788 gMC->Gsatt("ZPG3","SEEN",0);
789 gMC->Gsatt("ZPG4","SEEN",0);
790 gMC->Gsatt("ZPTX","SEEN",0);
791 gMC->Gsatt("ZP1 ","COLO",2);
792 gMC->Gsatt("ZP1 ","SEEN",1);
793 gMC->Gsatt("ZPSL","SEEN",0);
794 gMC->Gsatt("ZPST","SEEN",0);
866ab5a2 795 gMC->Gsatt("ZEM ","COLO",2);
796 gMC->Gsatt("ZEM ","SEEN",1);
797 gMC->Gsatt("ZEMF","SEEN",0);
798 gMC->Gsatt("ZETR","SEEN",0);
799 gMC->Gsatt("ZEL0","SEEN",0);
800 gMC->Gsatt("ZEL1","SEEN",0);
801 gMC->Gsatt("ZEL2","SEEN",0);
802 gMC->Gsatt("ZEV0","SEEN",0);
803 gMC->Gsatt("ZEV1","SEEN",0);
804 gMC->Gsatt("ZES0","SEEN",0);
805 gMC->Gsatt("ZES1","SEEN",0);
68ca986e 806
807 //
808 gMC->Gdopt("hide", "on");
809 gMC->Gdopt("shad", "on");
810 gMC->Gsatt("*", "fill", 7);
811 gMC->SetClipBox(".");
812 gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
813 gMC->DefaultRange();
814 gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
815 gMC->Gdhead(1111, "Zero Degree Calorimeter Version 1");
816 gMC->Gdman(18, 4, "MAN");
817}
818
819//_____________________________________________________________________________
820void AliZDCv1::CreateMaterials()
821{
822 //
823 // Create Materials for the Zero Degree Calorimeter
824 //
825 // Origin : E. Scomparin
826
827 Int_t *idtmed = fIdtmed->GetArray();
828
866ab5a2 829 Float_t dens, ubuf[1], wmat[2], a[2], z[2], epsil=0.001, stmin=0.01;
830 Int_t i, isvolActive, isvol, inofld;
68ca986e 831 Float_t fieldm = gAlice->Field()->Max();
68ca986e 832 Float_t tmaxfd=gAlice->Field()->Max();
866ab5a2 833 Int_t isxfld = gAlice->Field()->Integ();
834 Float_t deemax=-1;
68ca986e 835 Float_t stemax;
836
837 // --- Store in UBUF r0 for nuclear radius calculation R=r0*A**1/3
838
839 // --- Tantalum -> ZN passive material
840 ubuf[0] = 1.1;
841 AliMaterial(1, "TANT", 180.95, 73., 16.65, .4, 11.9, ubuf, 1);
842
843 // --- Tungsten
844// ubuf[0] = 1.11;
845// AliMaterial(1, "TUNG", 183.85, 74., 19.3, .35, 10.3, ubuf, 1);
846
847 // --- Brass (CuZn) -> ZP passive material
848 dens = 8.48;
849 a[0] = 63.546;
850 a[1] = 65.39;
851 z[0] = 29.;
852 z[1] = 30.;
853 wmat[0] = .63;
854 wmat[1] = .37;
855 AliMixture(2, "BRASS ", a, z, dens, 2, wmat);
856
857 // --- SiO2
858 dens = 2.64;
859 a[0] = 28.086;
860 a[1] = 15.9994;
861 z[0] = 14.;
862 z[1] = 8.;
863 wmat[0] = 1.;
864 wmat[1] = 2.;
865 AliMixture(3, "SIO2 ", a, z, dens, -2, wmat);
866ab5a2 866
867
868 // --- Lead
869 ubuf[0] = 1.12;
870 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
68ca986e 871
872 // --- Copper
873// ubuf[0] = 1.1;
874// AliMaterial(7, "COPP", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
875
866ab5a2 876 // --- Iron (energy loss taken into account)
877 ubuf[0] = 1.1;
878 AliMaterial(6, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
68ca986e 879
866ab5a2 880 // --- Iron (no energy loss)
68ca986e 881 ubuf[0] = 1.1;
866ab5a2 882 AliMaterial(7, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
68ca986e 883
884 // --- Vacuum (no magnetic field)
885 AliMaterial(10, "VOID", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
886
887 // --- Vacuum (with magnetic field)
888 AliMaterial(11, "VOIM", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
889
890 // --- Air (no magnetic field)
891 AliMaterial(12, "Air $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 0);
892
893 // --- Definition of tracking media:
894
895 // --- Tantalum = 1 ;
896 // --- Brass = 2 ;
897 // --- Fibers (SiO2) = 3 ;
898 // --- Fibers (SiO2) = 4 ;
866ab5a2 899 // --- Lead = 5 ;
900 // --- Iron (with energy loss) = 6 ;
901 // --- Iron (without energy loss) = 7 ;
68ca986e 902 // --- Vacuum (no field) = 10
903 // --- Vacuum (with field) = 11
904 // --- Air (no field) = 12
905
906
907 // --- Tracking media parameters
908 epsil = .01;
909 stemax = 1.;
910 isvol = 0;
911 isvolActive = 1;
912 inofld = 0;
913 fieldm = 0.;
914
915 AliMedium(1, "ZTANT", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
916// AliMedium(1, "ZW", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
917 AliMedium(2, "ZBRASS", 2, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
918 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
919 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
866ab5a2 920 AliMedium(6, "ZLEAD", 5, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
68ca986e 921// AliMedium(7, "ZCOPP", 7, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
866ab5a2 922 AliMedium(5, "ZIRON", 6, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
923 AliMedium(8, "ZIRONN", 7, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
68ca986e 924 AliMedium(10, "ZVOID", 10, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
925 AliMedium(12, "ZAIR", 12, 0, inofld, fieldm, tmaxfd, stemax,deemax, epsil, stmin);
926
927 fieldm = 45.;
928 AliMedium(11, "ZVOIM", 11, isvol, isxfld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
929
930 // Thresholds for showering in the ZDCs
931
932 i = 1;
933 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
934 gMC->Gstpar(idtmed[i], "CUTELE", .001);
935 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
936 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
937 i = 2;
938 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
939 gMC->Gstpar(idtmed[i], "CUTELE", .001);
940 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
941 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
866ab5a2 942 i = 6;
943 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
944 gMC->Gstpar(idtmed[i], "CUTELE", .001);
945 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
946 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
68ca986e 947
948 // Avoid too detailed showering along the beam line
949
950 i = 5;
951 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
952 gMC->Gstpar(idtmed[i], "CUTELE", .1);
953 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
954 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
955
956 // Avoid interaction in fibers (only energy loss allowed)
957 i = 3;
958 gMC->Gstpar(idtmed[i], "DCAY", 0.);
959 gMC->Gstpar(idtmed[i], "MULS", 0.);
960 gMC->Gstpar(idtmed[i], "PFIS", 0.);
961 gMC->Gstpar(idtmed[i], "MUNU", 0.);
962 gMC->Gstpar(idtmed[i], "LOSS", 1.);
963 gMC->Gstpar(idtmed[i], "PHOT", 0.);
964 gMC->Gstpar(idtmed[i], "COMP", 0.);
965 gMC->Gstpar(idtmed[i], "PAIR", 0.);
966 gMC->Gstpar(idtmed[i], "BREM", 0.);
967 gMC->Gstpar(idtmed[i], "DRAY", 0.);
968 gMC->Gstpar(idtmed[i], "ANNI", 0.);
969 gMC->Gstpar(idtmed[i], "HADR", 0.);
970 i = 4;
971 gMC->Gstpar(idtmed[i], "DCAY", 0.);
972 gMC->Gstpar(idtmed[i], "MULS", 0.);
973 gMC->Gstpar(idtmed[i], "PFIS", 0.);
974 gMC->Gstpar(idtmed[i], "MUNU", 0.);
975 gMC->Gstpar(idtmed[i], "LOSS", 1.);
976 gMC->Gstpar(idtmed[i], "PHOT", 0.);
977 gMC->Gstpar(idtmed[i], "COMP", 0.);
978 gMC->Gstpar(idtmed[i], "PAIR", 0.);
979 gMC->Gstpar(idtmed[i], "BREM", 0.);
980 gMC->Gstpar(idtmed[i], "DRAY", 0.);
981 gMC->Gstpar(idtmed[i], "ANNI", 0.);
982 gMC->Gstpar(idtmed[i], "HADR", 0.);
866ab5a2 983
984 // Avoid interaction in void
985 i = 10;
986 gMC->Gstpar(idtmed[i], "DCAY", 0.);
987 gMC->Gstpar(idtmed[i], "MULS", 0.);
988 gMC->Gstpar(idtmed[i], "PFIS", 0.);
989 gMC->Gstpar(idtmed[i], "MUNU", 0.);
990 gMC->Gstpar(idtmed[i], "LOSS", 0.);
991 gMC->Gstpar(idtmed[i], "PHOT", 0.);
992 gMC->Gstpar(idtmed[i], "COMP", 0.);
993 gMC->Gstpar(idtmed[i], "PAIR", 0.);
994 gMC->Gstpar(idtmed[i], "BREM", 0.);
995 gMC->Gstpar(idtmed[i], "DRAY", 0.);
996 gMC->Gstpar(idtmed[i], "ANNI", 0.);
997 gMC->Gstpar(idtmed[i], "HADR", 0.);
998
68ca986e 999 //
866ab5a2 1000 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
1001 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
1002 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
1003 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
1004 fMedSensZEM = idtmed[6]; // Sensitive volume: ZEM passive material
1005 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
1006 fMedSensPI = idtmed[5]; // Sensitive volume: beam pipes
68ca986e 1007}
1008
1009//_____________________________________________________________________________
1010void AliZDCv1::Init()
1011{
1012 InitTables();
68ca986e 1013}
1014
1015//_____________________________________________________________________________
1016void AliZDCv1::InitTables()
1017{
c0ceba4c 1018 Int_t k, j;
68ca986e 1019 //Initialize parameters for light tables and read them
1020 fNalfan = 90;
1021 fNalfap = 90;
1022 fNben = 18;
1023 fNbep = 28;
1024
866ab5a2 1025 char *lightfName1,*lightfName2,*lightfName3,*lightfName4,
1026 *lightfName5,*lightfName6,*lightfName7,*lightfName8;
68ca986e 1027 FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
1028
866ab5a2 1029 lightfName1 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362207s");
1030 if((fp1 = fopen(lightfName1,"r")) == NULL){
68ca986e 1031 printf("Cannot open file fp1 \n");
1032 return;
1033 }
866ab5a2 1034 lightfName2 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362208s");
1035 if((fp2 = fopen(lightfName2,"r")) == NULL){
68ca986e 1036 printf("Cannot open file fp2 \n");
1037 return;
1038 }
866ab5a2 1039 lightfName3 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362209s");
1040 if((fp3 = fopen(lightfName3,"r")) == NULL){
68ca986e 1041 printf("Cannot open file fp3 \n");
1042 return;
1043 }
866ab5a2 1044 lightfName4 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362210s");
1045 if((fp4 = fopen(lightfName4,"r")) == NULL){
68ca986e 1046 printf("Cannot open file fp4 \n");
1047 return;
1048 }
1049// printf(" --- Reading light tables for ZN \n");
c0ceba4c 1050 for(k=0; k<fNalfan; k++){
1051 for(j=0; j<fNben; j++){
68ca986e 1052 fscanf(fp1,"%f",&fTablen[0][k][j]);
1053 fscanf(fp2,"%f",&fTablen[1][k][j]);
1054 fscanf(fp3,"%f",&fTablen[2][k][j]);
1055 fscanf(fp4,"%f",&fTablen[3][k][j]);
1056 }
1057 }
1058 fclose(fp1);
1059 fclose(fp2);
1060 fclose(fp3);
1061 fclose(fp4);
1062
866ab5a2 1063 lightfName5 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552207s");
1064 if((fp5 = fopen(lightfName5,"r")) == NULL){
68ca986e 1065 printf("Cannot open file fp5 \n");
1066 return;
1067 }
866ab5a2 1068 lightfName6 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552208s");
1069 if((fp6 = fopen(lightfName6,"r")) == NULL){
68ca986e 1070 printf("Cannot open file fp6 \n");
1071 return;
1072 }
866ab5a2 1073 lightfName7 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552209s");
1074 if((fp7 = fopen(lightfName7,"r")) == NULL){
68ca986e 1075 printf("Cannot open file fp7 \n");
1076 return;
1077 }
866ab5a2 1078 lightfName8 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552210s");
1079 if((fp8 = fopen(lightfName8,"r")) == NULL){
68ca986e 1080 printf("Cannot open file fp8 \n");
1081 return;
1082 }
866ab5a2 1083// printf(" --- Reading light tables for ZP and ZEM \n");
c0ceba4c 1084 for(k=0; k<fNalfap; k++){
1085 for(j=0; j<fNbep; j++){
68ca986e 1086 fscanf(fp5,"%f",&fTablep[0][k][j]);
1087 fscanf(fp6,"%f",&fTablep[1][k][j]);
1088 fscanf(fp7,"%f",&fTablep[2][k][j]);
1089 fscanf(fp8,"%f",&fTablep[3][k][j]);
1090 }
1091 }
1092 fclose(fp5);
1093 fclose(fp6);
1094 fclose(fp7);
1095 fclose(fp8);
1096}
5ce39387 1097
1098//_____________________________________________________________________________
1099Int_t AliZDCv1::Digitize(Int_t Det, Int_t Quad, Int_t Light)
1100{
1101 // Evaluation of the ADC channel corresponding to the light yield Light
1102
9d7316ac 1103 if(fDebug == 1){
1104 printf("\n Digitize -> Det = %d, Quad = %d, Light = %d\n", Det, Quad, Light);
1105 }
5ce39387 1106
1107 Int_t j,i;
1108 for(i=0; i<3; i++){
1109 for(j=0; j<5; j++){
0c9b76ab 1110// fPedMean[i][j] = 50.;
1111// fPedSigma[i][j] = 10.;
1112 fPMGain[i][j] = 100000.;
5ce39387 1113 }
1114 }
1115 fADCRes = 0.00000064; // ADC Resolution: 250 fC/ADCch
1116
0c9b76ab 1117// Float_t Ped = gRandom->Gaus(fPedMean[Det-1][Quad],fPedSigma[Det-1][Quad]);
1118// Int_t ADCch = Int_t(Light*fPMGain[Det-1][Quad]*fADCRes+Ped);
1119 Int_t ADCch = Int_t(Light*fPMGain[Det-1][Quad]*fADCRes);
5ce39387 1120
0c9b76ab 1121// if(fDebug == 1){
1122// printf(" Ped = %f, ADCch = %d\n", Ped, ADCch);
1123// }
9d7316ac 1124
5ce39387 1125 return ADCch;
1126}
2ab0c725 1127
1128//____________________________________________________________________________
0c9b76ab 1129//void AliZDCv1::FinishEvent()
1130//{
2ab0c725 1131// Code moved to Hits2SDigits();
0c9b76ab 1132//}
5ce39387 1133
2ab0c725 1134//_____________________________________________________________________________
1135void AliZDCv1::SDigits2Digits()
1136{
1137 Hits2Digits(gAlice->GetNtrack());
1138}
5ce39387 1139
2ab0c725 1140//_____________________________________________________________________________
1141void AliZDCv1::Hits2Digits(Int_t ntracks)
1142{
5ce39387 1143 AliZDCDigit *newdigit;
1144 AliZDCHit *hit;
1145
1146 Int_t PMCZN = 0, PMCZP = 0, PMQZN[4], PMQZP[4], PMZEM = 0;
1147
cc9c0243 1148 Int_t i;
1149 for(i=0; i<4; i++){
1150 PMQZN[i] =0;
1151 PMQZP[i] =0;
5ce39387 1152 }
1153
cc9c0243 1154 Int_t itrack = 0;
1155 for(itrack=0; itrack<ntracks; itrack++){
1156 gAlice->ResetHits();
1157 gAlice->TreeH()->GetEvent(itrack);
1158 for(i=0; i<fHits->GetEntries(); i++){
1159 hit = (AliZDCHit*)fHits->At(i);
1160 Int_t det = hit->GetVolume(0);
1161 Int_t quad = hit->GetVolume(1);
1162 Int_t lightQ = Int_t(hit->GetLightPMQ());
1163 Int_t lightC = Int_t(hit->GetLightPMC());
1164 if(fDebug == 1)
1165 printf(" \n itrack = %d, fNhits = %d, det = %d, quad = %d,"
1166 "lightC = %d lightQ = %d\n", itrack, fNhits, det, quad, lightC, lightQ);
1167
1168 if(det == 1){ //ZN
1169 PMCZN = PMCZN + lightC;
1170 PMQZN[quad-1] = PMQZN[quad-1] + lightQ;
1171 }
5ce39387 1172
cc9c0243 1173 if(det == 2){ //ZP
1174 PMCZP = PMCZP + lightC;
1175 PMQZP[quad-1] = PMQZP[quad-1] + lightQ;
1176 }
5ce39387 1177
cc9c0243 1178 if(det == 3){ //ZEM
1179 PMZEM = PMZEM + lightC;
1180 }
1181 } // Hits loop
1182
0c9b76ab 1183 } // Tracks loop
1184
cc9c0243 1185 if(fDebug == 1){
1186 printf("\n PMCZN = %d, PMQZN[0] = %d, PMQZN[1] = %d, PMQZN[2] = %d, PMQZN[3] = %d\n"
1187 , PMCZN, PMQZN[0], PMQZN[1], PMQZN[2], PMQZN[3]);
1188 printf("\n PMCZP = %d, PMQZP[0] = %d, PMQZP[1] = %d, PMQZP[2] = %d, PMQZP[3] = %d\n"
1189 , PMCZP, PMQZP[0], PMQZP[1], PMQZP[2], PMQZP[3]);
1190 printf("\n PMZEM = %d\n", PMZEM);
5ce39387 1191 }
5ce39387 1192
1193 // ------------------------------------ Hits2Digits
1194 // Digits for ZN
cc9c0243 1195 newdigit = new AliZDCDigit(1, 0, Digitize(1, 0, PMCZN));
1196 new((*fDigits)[fNdigits]) AliZDCDigit(*newdigit);
1197 fNdigits++;
1198 delete newdigit;
5ce39387 1199
cc9c0243 1200 Int_t j;
1201 for(j=0; j<4; j++){
1202 newdigit = new AliZDCDigit(1, j+1, Digitize(1, j+1, PMQZN[j]));
1203 new((*fDigits)[fNdigits]) AliZDCDigit(*newdigit);
1204 fNdigits++;
1205 delete newdigit;
1206 }
1207
1208 // Digits for ZP
1209 newdigit = new AliZDCDigit(2, 0, Digitize(2, 0, PMCZP));
1210 new((*fDigits)[fNdigits]) AliZDCDigit(*newdigit);
5ce39387 1211 fNdigits++;
1212 delete newdigit;
5ce39387 1213
cc9c0243 1214 Int_t k;
1215 for(k=0; k<4; k++){
1216 newdigit = new AliZDCDigit(2, k+1, Digitize(2, k+1, PMQZP[k]));
1217 new((*fDigits)[fNdigits]) AliZDCDigit(*newdigit);
1218 fNdigits++;
1219 delete newdigit;
1220 }
5ce39387 1221
cc9c0243 1222 // Digits for ZEM
1223 newdigit = new AliZDCDigit(3, 0, Digitize(3, 0, PMZEM));
1224 new((*fDigits)[fNdigits]) AliZDCDigit(*newdigit);
5ce39387 1225 fNdigits++;
1226 delete newdigit;
5ce39387 1227
1228
1229 gAlice->TreeD()->Fill();
cc9c0243 1230 gAlice->TreeD()->Write(0,TObject::kOverwrite);
5ce39387 1231
9d7316ac 1232 if(fDebug == 1){
5ce39387 1233 printf("\n Event Digits -----------------------------------------------------\n");
1234 fDigits->Print("");
9d7316ac 1235 }
5ce39387 1236
1237}
1238//_____________________________________________________________________________
2ab0c725 1239 void AliZDCv1::MakeBranch(Option_t *opt, char *file)
5ce39387 1240{
1241 //
1242 // Create a new branch in the current Root Tree
1243 //
1244
1245 AliDetector::MakeBranch(opt);
1246
2ab0c725 1247 Char_t branchname[10];
5ce39387 1248 sprintf(branchname,"%s",GetName());
5cf7bbad 1249 const char *cD = strstr(opt,"D");
5ce39387 1250
7d285fe3 1251 if (gAlice->TreeD() && cD) {
2ab0c725 1252
1253 // Creation of the digits from hits
1254
1255 if(fDigits!=0) fDigits->Clear();
1256 else fDigits = new TClonesArray ("AliZDCDigit",1000);
1257 char branchname[10];
1258 sprintf(branchname,"%s",GetName());
1259 gAlice->MakeBranchInTree(gAlice->TreeD(),
1260 branchname, &fDigits, fBufferSize, file) ;
5ce39387 1261 printf("* AliZDCv1::MakeBranch * Making Branch %s for digits\n\n",branchname);
1262 }
1263}
68ca986e 1264//_____________________________________________________________________________
1265void AliZDCv1::StepManager()
1266{
1267 //
1268 // Routine called at every step in the Zero Degree Calorimeters
1269 //
1270
c0ceba4c 1271 Int_t j;
1272
5ce39387 1273 Int_t vol[2], ibeta=0, ialfa, ibe, nphe;
366ff5c2 1274 Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, radius, out;
68ca986e 1275 TLorentzVector s, p;
1276 const char *knamed;
866ab5a2 1277
de6bc247 1278 for (j=0;j<10;j++) hits[j]=0;
866ab5a2 1279
68ca986e 1280 if((gMC->GetMedium() == fMedSensZN) || (gMC->GetMedium() == fMedSensZP) ||
1281 (gMC->GetMedium() == fMedSensGR) || (gMC->GetMedium() == fMedSensF1) ||
866ab5a2 1282 (gMC->GetMedium() == fMedSensF2) || (gMC->GetMedium() == fMedSensZEM) ||
1283 (gMC->GetMedium() == fMedSensPI)){
cc9c0243 1284
866ab5a2 1285 // If particle interacts with beam pipe -> return
1286 if(gMC->GetMedium() == fMedSensPI){
1287
1288 // If option NoShower is set -> StopTrack
1289 if(fNoShower==1) gMC->StopTrack();
1290 return;
1291 }
1292
68ca986e 1293 //Particle coordinates
1294 gMC->TrackPosition(s);
c0ceba4c 1295 for(j=0; j<=2; j++){
68ca986e 1296 x[j] = s[j];
1297 }
1298 hits[0] = x[0];
1299 hits[1] = x[1];
1300 hits[2] = x[2];
1301
1302 // Determine in which ZDC the particle is
1303 knamed = gMC->CurrentVolName();
1304 if(!strncmp(knamed,"ZN",2))vol[0]=1;
1305 if(!strncmp(knamed,"ZP",2))vol[0]=2;
866ab5a2 1306 if(!strncmp(knamed,"ZE",2))vol[0]=3;
68ca986e 1307
1308 // Determine in which quadrant the particle is
1309
1310 //Quadrant in ZN
68ca986e 1311 if(vol[0]==1){
866ab5a2 1312 xdet[0] = x[0]-fPosZN[0];
1313 xdet[1] = x[1]-fPosZN[1];
1314 if((xdet[0]<=0.) && (xdet[1]>=0.)) vol[1]=1;
0c9b76ab 1315 if((xdet[0]>0.) && (xdet[1]>0.)) vol[1]=2;
1316 if((xdet[0]<0.) && (xdet[1]<0.)) vol[1]=3;
1317 if((xdet[0]>0.) && (xdet[1]<0.)) vol[1]=4;
68ca986e 1318 }
1319
1320 //Quadrant in ZP
1321 if(vol[0]==2){
866ab5a2 1322 xdet[0] = x[0]-fPosZP[0];
1323 xdet[1] = x[1]-fPosZP[1];
1324 if(xdet[0]>fDimZP[0])xdet[0]=fDimZP[0]-0.01;
1325 if(xdet[0]<-fDimZP[0])xdet[0]=-fDimZP[0]+0.01;
68ca986e 1326 Float_t xqZP = xdet[0]/(fDimZP[0]/2);
1327 for(int i=1; i<=4; i++){
866ab5a2 1328 if(xqZP>=(i-3) && xqZP<(i-2)){
68ca986e 1329 vol[1] = i;
1330 break;
1331 }
1332 }
1333 }
866ab5a2 1334
1335 //ZEM has only 1 quadrant
1336 if(vol[0] == 3){
1337 vol[1] = 1;
1338 xdet[0] = x[0]-fPosZEM[0];
1339 xdet[1] = x[1]-fPosZEM[1];
1340// printf("x %f %f xdet %f %f\n",x[0],x[1],xdet[0],xdet[1]);
1341 }
1342
9d7316ac 1343// if(vol[1]>4){
1344// printf("\n-> Det. %d Quad. %d \n", vol[0], vol[1]);
1345// printf("x %f %f xdet %f %f\n",x[0],x[1],xdet[0],xdet[1]);}
68ca986e 1346
1347 // Store impact point and kinetic energy of the ENTERING particle
1348
1349// Int_t Curtrack = gAlice->CurrentTrack();
1350// Int_t Prim = gAlice->GetPrimary(Curtrack);
1351// printf ("Primary: %d, Current Track: %d \n", Prim, Curtrack);
1352
1353// if(Curtrack==Prim){
1354 if(gMC->IsTrackEntering()){
1355 //Particle energy
1356 gMC->TrackMomentum(p);
1357// printf("p[0] = %f, p[1] = %f, p[2] = %f, p[3] = %f \n",
1358// p[0], p[1], p[2], p[3]);
1359 hits[3] = p[3];
1360
866ab5a2 1361 // Impact point on ZDC
68ca986e 1362 hits[4] = xdet[0];
1363 hits[5] = xdet[1];
866ab5a2 1364 hits[6] = 0;
68ca986e 1365 hits[7] = 0;
1366 hits[8] = 0;
1367 hits[9] = 0;
1368
866ab5a2 1369// Int_t PcID = gMC->TrackPid();
1370// printf("Pc ID -> %d\n",PcID);
1371 AddHit(gAlice->CurrentTrack(), vol, hits);
1372
1373 if(fNoShower==1){
1374 gMC->StopTrack();
1375 return;
1376 }
68ca986e 1377 }
1378// }
1379
1380 // Charged particles -> Energy loss
1381 if((destep=gMC->Edep())){
1382 if(gMC->IsTrackStop()){
1383 gMC->TrackMomentum(p);
1384 m = gMC->TrackMass();
1385 ekin = p[3]-m;
1386 if(ekin<0.) printf("ATTENTION!!!!!!!!!!!!!!! -> ekin = %f <0 (?)",ekin);
1387 hits[9] = ekin;
1388 hits[7] = 0.;
1389 hits[8] = 0.;
1390 AddHit(gAlice->CurrentTrack(), vol, hits);
1391 }
1392 else{
1393 hits[9] = destep;
1394 hits[7] = 0.;
1395 hits[8] = 0.;
1396 AddHit(gAlice->CurrentTrack(), vol, hits);
1397 }
1398// printf(" -> Charged particle -> Dep. E = %f eV \n",hits[8]);
1399 }
1400// printf(" \n");
1401 }
1402
1403
1404 // *** Light production in fibres
1405 if((gMC->GetMedium() == fMedSensF1) || (gMC->GetMedium() == fMedSensF2)){
68ca986e 1406
1407 //Select charged particles
1408 if((destep=gMC->Edep())){
1409// printf(" -> CHARGED particle!!! \n");
1410
1411 // Particle velocity
1412 gMC->TrackMomentum(p);
1413 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
1414 Float_t beta = ptot/p[3];
68ca986e 1415// Int_t pcID = gMC->TrackPid();
1416// printf(" Pc %d in quadrant %d -> beta = %f \n", pcID, vol[1], beta);
1417 if(beta<0.67) return;
866ab5a2 1418 if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
1419 if((beta>0.75) && (beta<=0.85)) ibeta = 1;
1420 if((beta>0.85) && (beta<=0.95)) ibeta = 2;
1421// if((beta>0.95) && (beta<=1.00)) ibeta = 3;
1422 if(beta>0.95) ibeta = 3;
68ca986e 1423
1424 // Angle between particle trajectory and fibre axis
1425 // 1 -> Momentum directions
1426 um[0] = p[0]/ptot;
1427 um[1] = p[1]/ptot;
1428 um[2] = p[2]/ptot;
1429 gMC->Gmtod(um,ud,2);
1430 // 2 -> Angle < limit angle
1431 Double_t alfar = TMath::ACos(ud[2]);
1432 Double_t alfa = alfar*kRaddeg;
866ab5a2 1433 if(alfa>=110.) return;
68ca986e 1434 ialfa = Int_t(1.+alfa/2.);
1435
1436 // Distance between particle trajectory and fibre axis
1437 gMC->TrackPosition(s);
c0ceba4c 1438 for(j=0; j<=2; j++){
68ca986e 1439 x[j] = s[j];
1440 }
1441 gMC->Gmtod(x,xdet,1);
1442 if(TMath::Abs(ud[0])>0.00001){
1443 Float_t dcoeff = ud[1]/ud[0];
1444 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
1445 }
1446 else{
1447 be = TMath::Abs(ud[0]);
1448 }
1449
1450 if((vol[0]==1)) radius = fFibZN[1];
1451 if((vol[0]==2)) radius = fFibZP[1];
1452 ibe = Int_t(be*1000.+1);
1453
1454 //Looking into the light tables
1455 Float_t charge = gMC->TrackCharge();
1456
1457 // (1) ZN
1458 if((vol[0]==1)) {
1459 if(ibe>fNben) ibe=fNben;
1460 out = charge*charge*fTablen[ibeta][ialfa][ibe];
5ce39387 1461 nphe = gRandom->Poisson(out);
68ca986e 1462 if(gMC->GetMedium() == fMedSensF1){
5ce39387 1463 hits[7] = nphe; //fLightPMQ
68ca986e 1464 hits[8] = 0;
1465 hits[9] = 0;
1466 AddHit(gAlice->CurrentTrack(), vol, hits);
1467 }
1468 else{
1469 hits[7] = 0;
5ce39387 1470 hits[8] = nphe; //fLightPMC
68ca986e 1471 hits[9] = 0;
1472 AddHit(gAlice->CurrentTrack(), vol, hits);
1473 }
1474 }
1475
1476 // (2) ZP
1477 if((vol[0]==2)) {
1478 if(ibe>fNbep) ibe=fNbep;
1479 out = charge*charge*fTablep[ibeta][ialfa][ibe];
5ce39387 1480 nphe = gRandom->Poisson(out);
68ca986e 1481 if(gMC->GetMedium() == fMedSensF1){
5ce39387 1482 hits[7] = nphe; //fLightPMQ
68ca986e 1483 hits[8] = 0;
1484 hits[9] = 0;
1485 AddHit(gAlice->CurrentTrack(), vol, hits);
1486 }
1487 else{
1488 hits[7] = 0;
5ce39387 1489 hits[8] = nphe; //fLightPMC
68ca986e 1490 hits[9] = 0;
1491 AddHit(gAlice->CurrentTrack(), vol, hits);
1492 }
1493 }
866ab5a2 1494 // (3) ZEM
1495 if((vol[0]==3)) {
1496 if(ibe>fNbep) ibe=fNbep;
1497 out = charge*charge*fTablep[ibeta][ialfa][ibe];
5ce39387 1498 nphe = gRandom->Poisson(out);
0c9b76ab 1499 hits[7] = 0;
1500 hits[8] = nphe; //fLightPMC
5ce39387 1501 hits[9] = 0;
1502 AddHit(gAlice->CurrentTrack(), vol, hits);
866ab5a2 1503 }
68ca986e 1504 }
866ab5a2 1505
68ca986e 1506 }
1507}