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