Removing direct reference to ROOTSYS (K.Shileev)
[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
88cb7938 16/* $Id$ */
68ca986e 17
18///////////////////////////////////////////////////////////////////////////////
19// //
47388856 20// AliZDCv1 --- ZDC geometry as designed in TDR (obsolete!) //
21// with the EM ZDC at 116 m from IP //
22// Just one set of ZDC is inserted, on the same side of the dimuon arm //
68ca986e 23// //
24///////////////////////////////////////////////////////////////////////////////
25
cc9c0243 26// --- Standard libraries
27#include "stdio.h"
28
5ce39387 29// --- ROOT system
68ca986e 30#include <TBRIK.h>
88cb7938 31#include <TLorentzVector.h>
68ca986e 32#include <TMath.h>
88cb7938 33#include <TNode.h>
5ce39387 34#include <TRandom.h>
866ab5a2 35#include <TSystem.h>
5ce39387 36#include <TTree.h>
88cb7938 37#include <TVirtualMC.h>
5ce39387 38
39// --- AliRoot classes
88cb7938 40#include "AliConst.h"
5ce39387 41#include "AliDetector.h"
94de3818 42#include "AliMagF.h"
68ca986e 43#include "AliPDG.h"
88cb7938 44#include "AliRun.h"
45#include "AliZDCHit.h"
46#include "AliZDCv1.h"
5d12ce38 47#include "AliMC.h"
68ca986e 48
49
50ClassImp(AliZDCv1)
51
68ca986e 52//_____________________________________________________________________________
53AliZDCv1::AliZDCv1() : AliZDC()
54{
55 //
56 // Default constructor for Zero Degree Calorimeter
57 //
5ce39387 58
866ab5a2 59 fMedSensF1 = 0;
60 fMedSensF2 = 0;
61 fMedSensZN = 0;
62 fMedSensZP = 0;
866ab5a2 63 fMedSensZEM = 0;
5a881c97 64 fMedSensGR = 0;
de28527d 65// fMedSensPI = 0;
66// fMedSensTDI = 0;
68ca986e 67}
68
69//_____________________________________________________________________________
70AliZDCv1::AliZDCv1(const char *name, const char *title)
71 : AliZDC(name,title)
72{
73 //
74 // Standard constructor for Zero Degree Calorimeter
75 //
a2216698 76 //
77 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
78
47388856 79 AliModule *PIPE=gAlice->GetModule("PIPE");
80 AliModule *ABSO=gAlice->GetModule("ABSO");
81 AliModule *DIPO=gAlice->GetModule("DIPO");
82 AliModule *SHIL=gAlice->GetModule("SHIL");
a2216698 83 if((!PIPE) || (!ABSO) || (!DIPO) || (!SHIL)) {
84 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
85 exit(1);
86 }
5ce39387 87
866ab5a2 88 fMedSensF1 = 0;
89 fMedSensF2 = 0;
90 fMedSensZN = 0;
91 fMedSensZP = 0;
866ab5a2 92 fMedSensZEM = 0;
5a881c97 93 fMedSensGR = 0;
de28527d 94// fMedSensPI = 0;
95// fMedSensTDI = 0;
5a881c97 96
97
98 // Parameters for light tables
99 fNalfan = 90; // Number of Alfa (neutrons)
100 fNalfap = 90; // Number of Alfa (protons)
101 fNben = 18; // Number of beta (neutrons)
102 fNbep = 28; // Number of beta (protons)
103 Int_t ip,jp,kp;
104 for(ip=0; ip<4; ip++){
105 for(kp=0; kp<fNalfap; kp++){
106 for(jp=0; jp<fNbep; jp++){
107 fTablep[ip][kp][jp] = 0;
108 }
109 }
110 }
111 Int_t in,jn,kn;
112 for(in=0; in<4; in++){
113 for(kn=0; kn<fNalfan; kn++){
114 for(jn=0; jn<fNben; jn++){
115 fTablen[in][kn][jn] = 0;
116 }
117 }
118 }
119
120 // Parameters for hadronic calorimeters geometry
121 fDimZP[0] = 11.2;
122 fDimZP[1] = 6.;
123 fDimZP[2] = 75.;
124 fPosZN[0] = 0.;
47388856 125 fPosZN[1] = 1.2;
5a881c97 126 fPosZN[2] = 11650.;
a2216698 127 fPosZP[0] = -24.;
5a881c97 128 fPosZP[1] = 0.;
129 fPosZP[2] = 11600.;
130 fFibZN[0] = 0.;
131 fFibZN[1] = 0.01825;
132 fFibZN[2] = 50.;
133 fFibZP[0] = 0.;
134 fFibZP[1] = 0.0275;
135 fFibZP[2] = 75.;
136
137 // Parameters for EM calorimeter geometry
138 fPosZEM[0] = 0.;
139 fPosZEM[1] = 5.8;
140 fPosZEM[2] = 11600.;
141
68ca986e 142}
143
144//_____________________________________________________________________________
145void AliZDCv1::CreateGeometry()
146{
147 //
148 // Create the geometry for the Zero Degree Calorimeter version 1
149 //* Initialize COMMON block ZDC_CGEOM
150 //*
151
152 CreateBeamLine();
153 CreateZDC();
154}
155
156//_____________________________________________________________________________
157void AliZDCv1::CreateBeamLine()
158{
159
a2216698 160 Float_t zq, zd1, zd2;
161 Float_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
68ca986e 162 Int_t im1, im2;
68ca986e 163
164 Int_t *idtmed = fIdtmed->GetArray();
165
a2216698 166 // -- Mother of the ZDCs (Vacuum PCON)
68ca986e 167
168 conpar[0] = 0.;
169 conpar[1] = 360.;
170 conpar[2] = 2.;
0014adbc 171 conpar[3] = 2000.;
68ca986e 172 conpar[4] = 0.;
173 conpar[5] = 55.;
174 conpar[6] = 13060.;
175 conpar[7] = 0.;
176 conpar[8] = 55.;
a2216698 177 gMC->Gsvolu("ZDC ", "PCON", idtmed[11], conpar, 9);
68ca986e 178 gMC->Gspos("ZDC ", 1, "ALIC", 0., 0., 0., 0, "ONLY");
179
180 // -- FIRST SECTION OF THE BEAM PIPE (from compensator dipole to
a2216698 181 // the beginning of D1)
68ca986e 182
0014adbc 183 zd1 = 2000.;
68ca986e 184
185 tubpar[0] = 6.3/2.;
186 tubpar[1] = 6.7/2.;
0014adbc 187 tubpar[2] = 3838.3/2.;
a2216698 188 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
189 gMC->Gspos("QT01", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
190
191 //-- SECOND SECTION OF THE BEAM PIPE (from the end of D1 to the
192 // beginning of D2)
193
194 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1 + 13.5 cm
195 //-- Cylindrical pipe (r = 3.47) + conical flare
196
197 // -> Beginning of D1
198 zd1 += 2.*tubpar[2];
199
200 tubpar[0] = 3.47;
201 tubpar[1] = 3.47+0.2;
202 tubpar[2] = 958.5/2.;
203 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
204 gMC->Gspos("QT02", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
205
206 zd1 += 2.*tubpar[2];
68ca986e 207
208 conpar[0] = 25./2.;
209 conpar[1] = 6.44/2.;
210 conpar[2] = 6.84/2.;
211 conpar[3] = 10./2.;
212 conpar[4] = 10.4/2.;
a2216698 213 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
214 gMC->Gspos("QC01", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
68ca986e 215
216 zd1 += 2.*conpar[0];
217
218 tubpar[0] = 10./2.;
219 tubpar[1] = 10.4/2.;
220 tubpar[2] = 50./2.;
a2216698 221 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
222 gMC->Gspos("QT03", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 223
5a881c97 224 zd1 += tubpar[2]*2.;
68ca986e 225
226 tubpar[0] = 10./2.;
227 tubpar[1] = 10.4/2.;
228 tubpar[2] = 10./2.;
a2216698 229 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
230 gMC->Gspos("QT04", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 231
232 zd1 += tubpar[2] * 2.;
233
234 tubpar[0] = 10./2.;
235 tubpar[1] = 10.4/2.;
236 tubpar[2] = 3.16/2.;
a2216698 237 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
238 gMC->Gspos("QT05", 1, "ZDC ", 0., 0., tubpar[0] + zd1, 0, "ONLY");
68ca986e 239
240 zd1 += tubpar[2] * 2.;
241
242 tubpar[0] = 10.0/2.;
243 tubpar[1] = 10.4/2;
244 tubpar[2] = 190./2.;
a2216698 245 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
246 gMC->Gspos("QT06", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 247
248 zd1 += tubpar[2] * 2.;
249
250 conpar[0] = 30./2.;
251 conpar[1] = 10./2.;
252 conpar[2] = 10.4/2.;
253 conpar[3] = 20.6/2.;
254 conpar[4] = 21./2.;
a2216698 255 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
256 gMC->Gspos("QC02", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
68ca986e 257
258 zd1 += conpar[0] * 2.;
259
260 tubpar[0] = 20.6/2.;
261 tubpar[1] = 21./2.;
262 tubpar[2] = 450./2.;
a2216698 263 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
264 gMC->Gspos("QT07", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 265
266 zd1 += tubpar[2] * 2.;
267
268 conpar[0] = 13.6/2.;
269 conpar[1] = 20.6/2.;
270 conpar[2] = 21./2.;
271 conpar[3] = 25.4/2.;
272 conpar[4] = 25.8/2.;
a2216698 273 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
274 gMC->Gspos("QC03", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
68ca986e 275
276 zd1 += conpar[0] * 2.;
277
278 tubpar[0] = 25.4/2.;
279 tubpar[1] = 25.8/2.;
280 tubpar[2] = 205.8/2.;
a2216698 281 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
282 gMC->Gspos("QT08", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 283
284 zd1 += tubpar[2] * 2.;
285
286 tubpar[0] = 50./2.;
287 tubpar[1] = 50.4/2.;
a2216698 288 // QT09 is 10 cm longer to accomodate TDI
289 tubpar[2] = 515.4/2.;
290 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
47388856 291 gMC->Gspos("QT09", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
7cc664ae 292
a2216698 293 // --- Insert TDI (inside ZDC volume)
294
295 boxpar[0] = 5.6;
296 boxpar[1] = 5.6;
297 boxpar[2] = 400./2.;
298 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
7cc664ae 299 gMC->Gspos("QTD1", 1, "ZDC ", 3., 10.6, tubpar[2] + zd1 + 56.3, 0, "ONLY");
300 gMC->Gspos("QTD1", 2, "ZDC ", 3., -10.6, tubpar[2] + zd1 + 56.3, 0, "ONLY");
a2216698 301
302 boxpar[0] = 0.2/2.;
303 boxpar[1] = 5.6;
304 boxpar[2] = 400./2.;
305 gMC->Gsvolu("QTD2", "BOX ", idtmed[6], boxpar, 3);
7cc664ae 306 gMC->Gspos("QTD2", 1, "ZDC ", 8.6+boxpar[0], 0., tubpar[2] + zd1 + 56.3, 0, "ONLY");
a2216698 307
6d5d9c06 308// tubspar[0] = 6.2; // R = 6.2 cm----------------------------------------
309// tubspar[1] = 6.4;
7cc664ae 310// tubspar[2] = 400./2.;
6d5d9c06 311// tubspar[3] = 180.-62.5;
312// tubspar[4] = 180.+62.5;
313 tubspar[0] = 10.5; // R = 10.5 cm------------------------------------------
314 tubspar[1] = 10.7;
315 tubspar[2] = 400./2.;
316 tubspar[3] = 180.-75.5;
317 tubspar[4] = 180.+75.5;
a2216698 318 gMC->Gsvolu("QTD3", "TUBS", idtmed[6], tubspar, 5);
7cc664ae 319 gMC->Gspos("QTD3", 1, "ZDC ", 0., 0., tubpar[2] + zd1 + 56.3, 0, "ONLY");
a2216698 320
68ca986e 321 zd1 += tubpar[2] * 2.;
322
323 tubpar[0] = 50./2.;
324 tubpar[1] = 50.4/2.;
a2216698 325 // QT10 is 10 cm shorter
326 tubpar[2] = 690./2.;
327 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
328 gMC->Gspos("QT10", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 329
330 zd1 += tubpar[2] * 2.;
331
332 tubpar[0] = 50./2.;
333 tubpar[1] = 50.4/2.;
334 tubpar[2] = 778.5/2.;
a2216698 335 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
336 gMC->Gspos("QT11", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 337
338 zd1 += tubpar[2] * 2.;
339
340 conpar[0] = 14.18/2.;
341 conpar[1] = 50./2.;
342 conpar[2] = 50.4/2.;
343 conpar[3] = 55./2.;
344 conpar[4] = 55.4/2.;
a2216698 345 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
346 gMC->Gspos("QC04", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
68ca986e 347
348 zd1 += conpar[0] * 2.;
349
350 tubpar[0] = 55./2.;
351 tubpar[1] = 55.4/2.;
352 tubpar[2] = 730./2.;
a2216698 353 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
354 gMC->Gspos("QT12", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 355
356 zd1 += tubpar[2] * 2.;
357
358 conpar[0] = 36.86/2.;
359 conpar[1] = 55./2.;
360 conpar[2] = 55.4/2.;
361 conpar[3] = 68./2.;
362 conpar[4] = 68.4/2.;
a2216698 363 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
364 gMC->Gspos("QC05", 1, "ZDC ", 0., 0., conpar[0] + zd1, 0, "ONLY");
68ca986e 365
366 zd1 += conpar[0] * 2.;
367
368 tubpar[0] = 68./2.;
369 tubpar[1] = 68.4/2.;
370 tubpar[2] = 927.3/2.;
a2216698 371 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
372 gMC->Gspos("QT13", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 373
374 zd1 += tubpar[2] * 2.;
375
376 tubpar[0] = 0./2.;
377 tubpar[1] = 68.4/2.;
378 tubpar[2] = 0.2/2.;
a2216698 379 gMC->Gsvolu("QT14", "TUBE", idtmed[8], tubpar, 3);
380 gMC->Gspos("QT14", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
68ca986e 381
382 zd1 += tubpar[2] * 2.;
383
384 tubpar[0] = 0./2.;
a2216698 385 tubpar[1] = 6.4/2.;
68ca986e 386 tubpar[2] = 0.2/2.;
a2216698 387 gMC->Gsvolu("QT15", "TUBE", idtmed[11], tubpar, 3);
68ca986e 388
a2216698 389 //-- Position QT15 inside QT14
390 gMC->Gspos("QT15", 1, "QT14", -7.7, 0., 0., 0, "ONLY");
68ca986e 391
392 tubpar[0] = 0./2.;
a2216698 393 tubpar[1] = 6.4/2.;
68ca986e 394 tubpar[2] = 0.2/2.;
a2216698 395 gMC->Gsvolu("QT16", "TUBE", idtmed[11], tubpar, 3);
396
397 //-- Position QT16 inside QT14
398 gMC->Gspos("QT16", 1, "QT14", 7.7, 0., 0., 0, "ONLY");
68ca986e 399
68ca986e 400
401 //-- BEAM PIPE BETWEEN END OF CONICAL PIPE AND BEGINNING OF D2
402
a2216698 403 tubpar[0] = 6.4/2.;
404 tubpar[1] = 6.8/2.;
405 tubpar[2] = 680.8/2.;
406 gMC->Gsvolu("QT17", "TUBE", idtmed[7], tubpar, 3);
68ca986e 407
a2216698 408 tubpar[0] = 6.4/2.;
409 tubpar[1] = 6.8/2.;
410 tubpar[2] = 680.8/2.;
411 gMC->Gsvolu("QT18", "TUBE", idtmed[7], tubpar, 3);
68ca986e 412
413 // -- ROTATE PIPES
414
a2216698 415 Float_t angle = 0.143*kDegrad;
68ca986e 416
a2216698 417 AliMatrix(im1, 90.-0.143, 0., 90., 90., 0.143, 180.);
418 gMC->Gspos("QT17", 1, "ZDC ", TMath::Sin(angle) * 680.8/ 2. - 9.4,
419 0., tubpar[2] + zd1, im1, "ONLY");
420
421 AliMatrix(im2, 90.+0.143, 0., 90., 90., 0.143, 0.);
422 gMC->Gspos("QT18", 1, "ZDC ", 9.7 - TMath::Sin(angle) * 680.8 / 2.,
423 0., tubpar[2] + zd1, im2, "ONLY");
424
425
426 // -- END OF BEAM PIPE VOLUME DEFINITION.
427 // ----------------------------------------------------------------
428
429 // -- MAGNET DEFINITION -> LHC OPTICS 6.2 (preliminary version)
68ca986e 430
0014adbc 431 // ----------------------------------------------------------------
432 // Replaced by the muon dipole
433 // ----------------------------------------------------------------
68ca986e 434 // -- COMPENSATOR DIPOLE (MBXW)
435 // GAP (VACUUM WITH MAGNETIC FIELD)
436
5ce39387 437// tubpar[0] = 0.;
438// tubpar[1] = 4.5;
439// tubpar[2] = 340./2.;
440// gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
441// gMC->Gspos("MBXW", 1, "ZDC ", 0., 0., tubpar[2] + 805., 0, "ONLY");
68ca986e 442
443 // -- YOKE (IRON WITHOUT MAGNETIC FIELD)
444
5ce39387 445// tubpar[0] = 4.5;
446// tubpar[1] = 55.;
447// tubpar[2] = 340./2.;
a2216698 448// gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
5ce39387 449// gMC->Gspos("YMBX", 1, "ZDC ", 0., 0., tubpar[2] + 805., 0, "ONLY");
68ca986e 450
0014adbc 451 // ----------------------------------------------------------------
a2216698 452 // Replaced by the second dipole
0014adbc 453 // ----------------------------------------------------------------
68ca986e 454 // -- COMPENSATOR DIPOLE (MCBWA)
455 // GAP (VACUUM WITH MAGNETIC FIELD)
456
0014adbc 457// tubpar[0] = 0.;
458// tubpar[1] = 4.5;
459// tubpar[2] = 170./2.;
460// gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
461// gMC->Gspos("MCBW", 1, "ZDC ", 0., 0., tubpar[2] + 1921.6, 0, "ONLY");
68ca986e 462
463 // -- YOKE (IRON WITHOUT MAGNETIC FIELD)
464
0014adbc 465// tubpar[0] = 4.5;
466// tubpar[1] = 55.;
467// tubpar[2] = 170./2.;
a2216698 468// gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
0014adbc 469// gMC->Gspos("YMCB", 1, "ZDC ", 0., 0., tubpar[2] + 1921.6, 0, "ONLY");
68ca986e 470
471 // -- INNER TRIPLET
472
a2216698 473 zq = 2296.5;
68ca986e 474
475 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
476
477 // MQXL
478 // -- GAP (VACUUM WITH MAGNETIC FIELD)
479
480 tubpar[0] = 0.;
481 tubpar[1] = 3.5;
a2216698 482 tubpar[2] = 637./2.;
68ca986e 483 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
484
485 // -- YOKE
486
487 tubpar[0] = 3.5;
488 tubpar[1] = 22.;
a2216698 489 tubpar[2] = 637./2.;
490 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
68ca986e 491
492 gMC->Gspos("MQXL", 1, "ZDC ", 0., 0., tubpar[2] + zq, 0, "ONLY");
493 gMC->Gspos("YMQL", 1, "ZDC ", 0., 0., tubpar[2] + zq, 0, "ONLY");
494
495 gMC->Gspos("MQXL", 2, "ZDC ", 0., 0., tubpar[2] + zq + 2430., 0, "ONLY");
496 gMC->Gspos("YMQL", 2, "ZDC ", 0., 0., tubpar[2] + zq + 2430., 0, "ONLY");
497
498 // -- MQX
499 // -- GAP (VACUUM WITH MAGNETIC FIELD)
500
501 tubpar[0] = 0.;
502 tubpar[1] = 3.5;
503 tubpar[2] = 550./2.;
504 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
505
506 // -- YOKE
507
508 tubpar[0] = 3.5;
509 tubpar[1] = 22.;
510 tubpar[2] = 550./2.;
a2216698 511 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
68ca986e 512
a2216698 513 gMC->Gspos("MQX ", 1, "ZDC ", 0., 0., tubpar[2] + zq + 883.5, 0, "ONLY");
514 gMC->Gspos("YMQ ", 1, "ZDC ", 0., 0., tubpar[2] + zq + 883.5, 0, "ONLY");
68ca986e 515
a2216698 516 gMC->Gspos("MQX ", 2, "ZDC ", 0., 0., tubpar[2] + zq + 1533.5, 0, "ONLY");
517 gMC->Gspos("YMQ ", 2, "ZDC ", 0., 0., tubpar[2] + zq + 1533.5, 0, "ONLY");
68ca986e 518
519 // -- SEPARATOR DIPOLE D1
520
521 zd1 = 5838.3;
522
523 // -- GAP (VACUUM WITH MAGNETIC FIELD)
524
525 tubpar[0] = 0.;
a2216698 526 tubpar[1] = 6.94/2.;
68ca986e 527 tubpar[2] = 945./2.;
a2216698 528 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
529
530 // -- Insert horizontal Cu plates inside D1
531 // -- (to simulate the vacuum chamber)
68ca986e 532
a2216698 533 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2));
534 boxpar[1] = 0.2/2.;
535 boxpar[2] =945./2.;
536 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
537 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
538 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
539
68ca986e 540 // -- YOKE
541
542 tubpar[0] = 0.;
543 tubpar[1] = 110./2;
544 tubpar[2] = 945./2.;
a2216698 545 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
68ca986e 546
547 gMC->Gspos("YD1 ", 1, "ZDC ", 0., 0., tubpar[2] + zd1, 0, "ONLY");
a2216698 548 gMC->Gspos("MD1 ", 1, "YD1 ", 0., 0., 0., 0, "ONLY");
68ca986e 549
550 // -- DIPOLE D2
551
552 zd2 = 12147.6;
553
554 // -- GAP (VACUUM WITH MAGNETIC FIELD)
555
556 tubpar[0] = 0.;
557 tubpar[1] = 7.5/2.;
558 tubpar[2] = 945./2.;
a2216698 559 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
68ca986e 560
561 // -- YOKE
562
563 tubpar[0] = 0.;
564 tubpar[1] = 55.;
565 tubpar[2] = 945./2.;
a2216698 566 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
68ca986e 567
568 gMC->Gspos("YD2 ", 1, "ZDC ", 0., 0., tubpar[2] + zd2, 0, "ONLY");
569
a2216698 570 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
571 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
68ca986e 572
573 // -- END OF MAGNET DEFINITION
574}
575
576//_____________________________________________________________________________
577void AliZDCv1::CreateZDC()
578{
579
866ab5a2 580 Float_t DimPb[6], DimVoid[6];
5a881c97 581
582 Int_t *idtmed = fIdtmed->GetArray();
583
584 // Parameters for hadronic calorimeters geometry
585 // NB -> parameters used ONLY in CreateZDC()
586 Float_t fDimZN[3] = {3.52, 3.52, 50.}; // Dimensions of neutron detector
587 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
588 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
589 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
590 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
591 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
592 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
593
594 // Parameters for EM calorimeter geometry
595 // NB -> parameters used ONLY in CreateZDC()
596 Float_t fDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
597 Float_t fDimZEMAir = 0.001; // scotch
598 Float_t fFibRadZEM = 0.0315; // External fiber radius (including cladding)
599 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
600 Float_t fDimZEM0 = 2*fDivZEM[2]*(fDimZEMPb+fDimZEMAir+fFibRadZEM*(TMath::Sqrt(2.)));
601 Float_t fDimZEM[6] = {fDimZEM0, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
602 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-fFibRadZEM;
603 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
866ab5a2 604
68ca986e 605
606 //-- Create calorimeters geometry
607
a2216698 608 // -------------------------------------------------------------------------------
68ca986e 609 //--> Neutron calorimeter (ZN)
610
611 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
612 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
613 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
614 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
615 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
616 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
617 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
618 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
619 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
620
621 // Divide ZNEU in towers (for hits purposes)
622
623 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
624 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
625
626 //-- Divide ZN1 in minitowers
627 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
628 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
629 // (4 fibres per minitower)
630
631 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
632 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
633
634 // --- Position the empty grooves in the sticks (4 grooves per stick)
635 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
636 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
637
638 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
639 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
640 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
641 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
642
643 // --- Position the fibers in the grooves
644 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
645 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
646 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
647 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
648
649 // --- Position the neutron calorimeter in ZDC
650 gMC->Gspos("ZNEU", 1, "ZDC ", fPosZN[0], fPosZN[1], fPosZN[2] + fDimZN[2], 0, "ONLY");
651
866ab5a2 652
a2216698 653 // -------------------------------------------------------------------------------
866ab5a2 654 //--> Proton calorimeter (ZP)
68ca986e 655
656 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
657 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
658 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
659 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
660 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
661 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
662 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
663 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
664 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
665
666 //-- Divide ZPRO in towers(for hits purposes)
667
668 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
669 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
670
671
672 //-- Divide ZP1 in minitowers
673 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
674 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
675 // (4 fiber per minitower)
676
677 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
678 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
679
680 // --- Position the empty grooves in the sticks (4 grooves per stick)
681 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
682 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
683
684 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
685 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
686 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
687 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
688
689 // --- Position the fibers in the grooves
690 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
691 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
692 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
693 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
694
695
696 // --- Position the proton calorimeter in ZDC
697 gMC->Gspos("ZPRO", 1, "ZDC ", fPosZP[0], fPosZP[1], fPosZP[2] + fDimZP[2], 0, "ONLY");
866ab5a2 698
699
a2216698 700 // -------------------------------------------------------------------------------
701 // -> EM calorimeter (ZEM)
866ab5a2 702
703 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
a2216698 704
705 Int_t irot1, irot2;
866ab5a2 706
a2216698 707 gMC->Matrix(irot1,0.,0.,90.,90.,90.,180.); // Rotation matrix 1
866ab5a2 708 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]); // Rotation matrix 2
709// printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
710
711 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
712
713 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
714
715 DimPb[0] = fDimZEMPb; // Lead slices
716 DimPb[1] = fDimZEM[2];
717 DimPb[2] = fDimZEM[1];
718 DimPb[3] = 90.-fDimZEM[3];
719 DimPb[4] = 0.;
720 DimPb[5] = 0.;
a2216698 721 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], DimPb, 6);
722 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], DimPb, 6);
723 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], DimPb, 6);
866ab5a2 724
725 // --- Position the lead slices in the tranche
726 Float_t zTran = fDimZEM[0]/fDivZEM[2];
727 Float_t zTrPb = -zTran+fDimZEMPb;
728 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
729 gMC->Gspos("ZEL1", 1, "ZETR", fDimZEMPb, 0., 0., 0, "ONLY");
730
731 // --- Vacuum zone (to be filled with fibres)
732 DimVoid[0] = (zTran-2*fDimZEMPb)/2.;
733 DimVoid[1] = fDimZEM[2];
734 DimVoid[2] = fDimZEM[1];
735 DimVoid[3] = 90.-fDimZEM[3];
736 DimVoid[4] = 0.;
737 DimVoid[5] = 0.;
738 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], DimVoid,6);
739 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], DimVoid,6);
740
741 // --- Divide the vacuum slice into sticks along x axis
742 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
743 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
744
745 // --- Positioning the fibers into the sticks
746 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
747 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
748
749 // --- Positioning the vacuum slice into the tranche
750 Float_t DisplFib = fDimZEM[1]/fDivZEM[0];
751 gMC->Gspos("ZEV0", 1,"ZETR", -DimVoid[0], 0., 0., 0, "ONLY");
752 gMC->Gspos("ZEV1", 1,"ZETR", -DimVoid[0]+zTran, 0., DisplFib, 0, "ONLY");
753
754 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
755 gMC->Gspos("ZEM ", 1,"ZDC ", fPosZEM[0], fPosZEM[1], fPosZEM[2], irot1, "ONLY");
756
757 // --- Adding last slice at the end of the EM calorimeter
758 Float_t zLastSlice = fPosZEM[2]+fDimZEMPb+fDimZEM[0];
759 gMC->Gspos("ZEL2", 1,"ZDC ", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
68ca986e 760
761}
762
763//_____________________________________________________________________________
764void AliZDCv1::DrawModule()
765{
766 //
767 // Draw a shaded view of the Zero Degree Calorimeter version 1
768 //
769
770 // Set everything unseen
771 gMC->Gsatt("*", "seen", -1);
772 //
773 // Set ALIC mother transparent
774 gMC->Gsatt("ALIC","SEEN",0);
775 //
776 // Set the volumes visible
777 gMC->Gsatt("ZDC ","SEEN",0);
a2216698 778 gMC->Gsatt("QT01","SEEN",1);
779 gMC->Gsatt("QT02","SEEN",1);
780 gMC->Gsatt("QT03","SEEN",1);
781 gMC->Gsatt("QT04","SEEN",1);
782 gMC->Gsatt("QT05","SEEN",1);
783 gMC->Gsatt("QT06","SEEN",1);
784 gMC->Gsatt("QT07","SEEN",1);
785 gMC->Gsatt("QT08","SEEN",1);
786 gMC->Gsatt("QT09","SEEN",1);
787 gMC->Gsatt("QT10","SEEN",1);
788 gMC->Gsatt("QT11","SEEN",1);
789 gMC->Gsatt("QT12","SEEN",1);
790 gMC->Gsatt("QT13","SEEN",1);
791 gMC->Gsatt("QT14","SEEN",1);
792 gMC->Gsatt("QT15","SEEN",1);
793 gMC->Gsatt("QT16","SEEN",1);
794 gMC->Gsatt("QT17","SEEN",1);
795 gMC->Gsatt("QT18","SEEN",1);
796 gMC->Gsatt("QC01","SEEN",1);
797 gMC->Gsatt("QC02","SEEN",1);
798 gMC->Gsatt("QC03","SEEN",1);
799 gMC->Gsatt("QC04","SEEN",1);
800 gMC->Gsatt("QC05","SEEN",1);
801 gMC->Gsatt("QTD1","SEEN",1);
802 gMC->Gsatt("QTD2","SEEN",1);
803 gMC->Gsatt("QTD3","SEEN",1);
68ca986e 804 gMC->Gsatt("MQXL","SEEN",1);
805 gMC->Gsatt("YMQL","SEEN",1);
806 gMC->Gsatt("MQX ","SEEN",1);
807 gMC->Gsatt("YMQ ","SEEN",1);
a2216698 808 gMC->Gsatt("ZQYX","SEEN",1);
809 gMC->Gsatt("MD1 ","SEEN",1);
810 gMC->Gsatt("MD1V","SEEN",1);
68ca986e 811 gMC->Gsatt("YD1 ","SEEN",1);
a2216698 812 gMC->Gsatt("MD2 ","SEEN",1);
68ca986e 813 gMC->Gsatt("YD2 ","SEEN",1);
814 gMC->Gsatt("ZNEU","SEEN",0);
815 gMC->Gsatt("ZNF1","SEEN",0);
816 gMC->Gsatt("ZNF2","SEEN",0);
817 gMC->Gsatt("ZNF3","SEEN",0);
818 gMC->Gsatt("ZNF4","SEEN",0);
819 gMC->Gsatt("ZNG1","SEEN",0);
820 gMC->Gsatt("ZNG2","SEEN",0);
821 gMC->Gsatt("ZNG3","SEEN",0);
822 gMC->Gsatt("ZNG4","SEEN",0);
823 gMC->Gsatt("ZNTX","SEEN",0);
a2216698 824 gMC->Gsatt("ZN1 ","COLO",4);
68ca986e 825 gMC->Gsatt("ZN1 ","SEEN",1);
826 gMC->Gsatt("ZNSL","SEEN",0);
827 gMC->Gsatt("ZNST","SEEN",0);
828 gMC->Gsatt("ZPRO","SEEN",0);
829 gMC->Gsatt("ZPF1","SEEN",0);
830 gMC->Gsatt("ZPF2","SEEN",0);
831 gMC->Gsatt("ZPF3","SEEN",0);
832 gMC->Gsatt("ZPF4","SEEN",0);
833 gMC->Gsatt("ZPG1","SEEN",0);
834 gMC->Gsatt("ZPG2","SEEN",0);
835 gMC->Gsatt("ZPG3","SEEN",0);
836 gMC->Gsatt("ZPG4","SEEN",0);
837 gMC->Gsatt("ZPTX","SEEN",0);
a2216698 838 gMC->Gsatt("ZP1 ","COLO",6);
68ca986e 839 gMC->Gsatt("ZP1 ","SEEN",1);
840 gMC->Gsatt("ZPSL","SEEN",0);
841 gMC->Gsatt("ZPST","SEEN",0);
a2216698 842 gMC->Gsatt("ZEM ","COLO",7);
866ab5a2 843 gMC->Gsatt("ZEM ","SEEN",1);
844 gMC->Gsatt("ZEMF","SEEN",0);
845 gMC->Gsatt("ZETR","SEEN",0);
846 gMC->Gsatt("ZEL0","SEEN",0);
847 gMC->Gsatt("ZEL1","SEEN",0);
848 gMC->Gsatt("ZEL2","SEEN",0);
849 gMC->Gsatt("ZEV0","SEEN",0);
850 gMC->Gsatt("ZEV1","SEEN",0);
851 gMC->Gsatt("ZES0","SEEN",0);
852 gMC->Gsatt("ZES1","SEEN",0);
68ca986e 853
854 //
855 gMC->Gdopt("hide", "on");
856 gMC->Gdopt("shad", "on");
857 gMC->Gsatt("*", "fill", 7);
858 gMC->SetClipBox(".");
859 gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
860 gMC->DefaultRange();
861 gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
862 gMC->Gdhead(1111, "Zero Degree Calorimeter Version 1");
863 gMC->Gdman(18, 4, "MAN");
864}
865
866//_____________________________________________________________________________
867void AliZDCv1::CreateMaterials()
868{
869 //
870 // Create Materials for the Zero Degree Calorimeter
871 //
68ca986e 872
873 Int_t *idtmed = fIdtmed->GetArray();
874
a2216698 875 Float_t dens, ubuf[1], wmat[2], a[2], z[2], deemax = -1;
876 Int_t i;
68ca986e 877
878 // --- Store in UBUF r0 for nuclear radius calculation R=r0*A**1/3
879
880 // --- Tantalum -> ZN passive material
881 ubuf[0] = 1.1;
882 AliMaterial(1, "TANT", 180.95, 73., 16.65, .4, 11.9, ubuf, 1);
883
884 // --- Tungsten
885// ubuf[0] = 1.11;
886// AliMaterial(1, "TUNG", 183.85, 74., 19.3, .35, 10.3, ubuf, 1);
887
888 // --- Brass (CuZn) -> ZP passive material
889 dens = 8.48;
890 a[0] = 63.546;
891 a[1] = 65.39;
892 z[0] = 29.;
893 z[1] = 30.;
894 wmat[0] = .63;
895 wmat[1] = .37;
896 AliMixture(2, "BRASS ", a, z, dens, 2, wmat);
897
898 // --- SiO2
899 dens = 2.64;
900 a[0] = 28.086;
901 a[1] = 15.9994;
902 z[0] = 14.;
903 z[1] = 8.;
904 wmat[0] = 1.;
905 wmat[1] = 2.;
a2216698 906 AliMixture(3, "SIO2 ", a, z, dens, -2, wmat);
866ab5a2 907
908 // --- Lead
909 ubuf[0] = 1.12;
910 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
68ca986e 911
912 // --- Copper
a2216698 913 ubuf[0] = 1.10;
914 AliMaterial(6, "COPP", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
68ca986e 915
866ab5a2 916 // --- Iron (energy loss taken into account)
917 ubuf[0] = 1.1;
a2216698 918 AliMaterial(7, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
68ca986e 919
866ab5a2 920 // --- Iron (no energy loss)
68ca986e 921 ubuf[0] = 1.1;
a2216698 922 AliMaterial(8, "IRON", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
68ca986e 923
924 // --- Vacuum (no magnetic field)
925 AliMaterial(10, "VOID", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
926
927 // --- Vacuum (with magnetic field)
928 AliMaterial(11, "VOIM", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf,0);
929
930 // --- Air (no magnetic field)
931 AliMaterial(12, "Air $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 0);
932
933 // --- Definition of tracking media:
934
935 // --- Tantalum = 1 ;
936 // --- Brass = 2 ;
937 // --- Fibers (SiO2) = 3 ;
938 // --- Fibers (SiO2) = 4 ;
866ab5a2 939 // --- Lead = 5 ;
a2216698 940 // --- Copper = 6 ;
941 // --- Iron (with energy loss) = 7 ;
942 // --- Iron (without energy loss) = 8 ;
68ca986e 943 // --- Vacuum (no field) = 10
944 // --- Vacuum (with field) = 11
945 // --- Air (no field) = 12
946
947
948 // --- Tracking media parameters
a2216698 949 Float_t epsil = .01, stmin=0.01, stemax = 1.;
7cc664ae 950// Int_t isxfld = gAlice->Field()->Integ();
d213f1fa 951// Float_t fieldm = gAlice->Field()->Max();
de28527d 952 Float_t fieldm = 0., tmaxfd = 0.;
a2216698 953 Int_t ifield = 0, isvolActive = 1, isvol = 0, inofld = 0;
68ca986e 954
955 AliMedium(1, "ZTANT", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
956// AliMedium(1, "ZW", 1, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
a2216698 957 AliMedium(2, "ZBRASS",2, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
68ca986e 958 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
959 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
a2216698 960 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
de28527d 961// AliMedium(6, "ZCOPP", 6, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
962// AliMedium(7, "ZIRON", 7, isvolActive, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
963 AliMedium(6, "ZCOPP", 6, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
964 AliMedium(7, "ZIRON", 7, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
a2216698 965 AliMedium(8, "ZIRONN",8, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
966 AliMedium(10,"ZVOID",10, isvol, inofld, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
967 AliMedium(12,"ZAIR", 12, 0, inofld, fieldm, tmaxfd, stemax,deemax, epsil, stmin);
968
969 ifield =2;
68ca986e 970 fieldm = 45.;
7cc664ae 971 AliMedium(11, "ZVOIM", 11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
68ca986e 972
973 // Thresholds for showering in the ZDCs
a2216698 974 i = 1; //tantalum
68ca986e 975 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
976 gMC->Gstpar(idtmed[i], "CUTELE", .001);
977 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
978 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
a2216698 979 i = 2; //brass
68ca986e 980 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
981 gMC->Gstpar(idtmed[i], "CUTELE", .001);
982 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
983 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
a2216698 984 i = 5; //lead
866ab5a2 985 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
986 gMC->Gstpar(idtmed[i], "CUTELE", .001);
987 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
988 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
68ca986e 989
d213f1fa 990 // Avoid too detailed showering in TDI
991 i = 6; //copper
992 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
993 gMC->Gstpar(idtmed[i], "CUTELE", .1);
994 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
995 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
996
68ca986e 997 // Avoid too detailed showering along the beam line
a2216698 998 i = 7; //iron with energy loss (ZIRON)
68ca986e 999 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
1000 gMC->Gstpar(idtmed[i], "CUTELE", .1);
1001 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
1002 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
1003
d213f1fa 1004 // Avoid too detailed showering along the beam line
1005 i = 8; //iron with energy loss (ZIRONN)
1006 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
1007 gMC->Gstpar(idtmed[i], "CUTELE", .1);
1008 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
1009 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
1010
68ca986e 1011 // Avoid interaction in fibers (only energy loss allowed)
a2216698 1012 i = 3; //fibers (ZSI02)
68ca986e 1013 gMC->Gstpar(idtmed[i], "DCAY", 0.);
1014 gMC->Gstpar(idtmed[i], "MULS", 0.);
1015 gMC->Gstpar(idtmed[i], "PFIS", 0.);
1016 gMC->Gstpar(idtmed[i], "MUNU", 0.);
1017 gMC->Gstpar(idtmed[i], "LOSS", 1.);
1018 gMC->Gstpar(idtmed[i], "PHOT", 0.);
1019 gMC->Gstpar(idtmed[i], "COMP", 0.);
1020 gMC->Gstpar(idtmed[i], "PAIR", 0.);
1021 gMC->Gstpar(idtmed[i], "BREM", 0.);
1022 gMC->Gstpar(idtmed[i], "DRAY", 0.);
1023 gMC->Gstpar(idtmed[i], "ANNI", 0.);
1024 gMC->Gstpar(idtmed[i], "HADR", 0.);
a2216698 1025 i = 4; //fibers (ZQUAR)
68ca986e 1026 gMC->Gstpar(idtmed[i], "DCAY", 0.);
1027 gMC->Gstpar(idtmed[i], "MULS", 0.);
1028 gMC->Gstpar(idtmed[i], "PFIS", 0.);
1029 gMC->Gstpar(idtmed[i], "MUNU", 0.);
1030 gMC->Gstpar(idtmed[i], "LOSS", 1.);
1031 gMC->Gstpar(idtmed[i], "PHOT", 0.);
1032 gMC->Gstpar(idtmed[i], "COMP", 0.);
1033 gMC->Gstpar(idtmed[i], "PAIR", 0.);
1034 gMC->Gstpar(idtmed[i], "BREM", 0.);
1035 gMC->Gstpar(idtmed[i], "DRAY", 0.);
1036 gMC->Gstpar(idtmed[i], "ANNI", 0.);
1037 gMC->Gstpar(idtmed[i], "HADR", 0.);
866ab5a2 1038
1039 // Avoid interaction in void
d213f1fa 1040 i = 11; //void with field
1041 gMC->Gstpar(idtmed[i], "DCAY", 0.);
1042 gMC->Gstpar(idtmed[i], "MULS", 0.);
1043 gMC->Gstpar(idtmed[i], "PFIS", 0.);
1044 gMC->Gstpar(idtmed[i], "MUNU", 0.);
1045 gMC->Gstpar(idtmed[i], "LOSS", 0.);
1046 gMC->Gstpar(idtmed[i], "PHOT", 0.);
1047 gMC->Gstpar(idtmed[i], "COMP", 0.);
1048 gMC->Gstpar(idtmed[i], "PAIR", 0.);
1049 gMC->Gstpar(idtmed[i], "BREM", 0.);
1050 gMC->Gstpar(idtmed[i], "DRAY", 0.);
1051 gMC->Gstpar(idtmed[i], "ANNI", 0.);
1052 gMC->Gstpar(idtmed[i], "HADR", 0.);
866ab5a2 1053
68ca986e 1054 //
866ab5a2 1055 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
1056 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
a2216698 1057 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
1058 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
1059 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
de28527d 1060// fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
1061// fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
866ab5a2 1062 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
68ca986e 1063}
1064
1065//_____________________________________________________________________________
1066void AliZDCv1::Init()
1067{
1068 InitTables();
68ca986e 1069}
1070
1071//_____________________________________________________________________________
1072void AliZDCv1::InitTables()
1073{
c0ceba4c 1074 Int_t k, j;
5a881c97 1075
866ab5a2 1076 char *lightfName1,*lightfName2,*lightfName3,*lightfName4,
1077 *lightfName5,*lightfName6,*lightfName7,*lightfName8;
68ca986e 1078 FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
1079
a2216698 1080 // --- Reading light tables for ZN
866ab5a2 1081 lightfName1 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362207s");
1082 if((fp1 = fopen(lightfName1,"r")) == NULL){
68ca986e 1083 printf("Cannot open file fp1 \n");
1084 return;
1085 }
866ab5a2 1086 lightfName2 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362208s");
1087 if((fp2 = fopen(lightfName2,"r")) == NULL){
68ca986e 1088 printf("Cannot open file fp2 \n");
1089 return;
1090 }
866ab5a2 1091 lightfName3 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362209s");
1092 if((fp3 = fopen(lightfName3,"r")) == NULL){
68ca986e 1093 printf("Cannot open file fp3 \n");
1094 return;
1095 }
866ab5a2 1096 lightfName4 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620362210s");
1097 if((fp4 = fopen(lightfName4,"r")) == NULL){
68ca986e 1098 printf("Cannot open file fp4 \n");
1099 return;
1100 }
a2216698 1101
c0ceba4c 1102 for(k=0; k<fNalfan; k++){
1103 for(j=0; j<fNben; j++){
68ca986e 1104 fscanf(fp1,"%f",&fTablen[0][k][j]);
1105 fscanf(fp2,"%f",&fTablen[1][k][j]);
1106 fscanf(fp3,"%f",&fTablen[2][k][j]);
1107 fscanf(fp4,"%f",&fTablen[3][k][j]);
1108 }
1109 }
1110 fclose(fp1);
1111 fclose(fp2);
1112 fclose(fp3);
1113 fclose(fp4);
1114
a2216698 1115 // --- Reading light tables for ZP and ZEM
866ab5a2 1116 lightfName5 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552207s");
1117 if((fp5 = fopen(lightfName5,"r")) == NULL){
68ca986e 1118 printf("Cannot open file fp5 \n");
1119 return;
1120 }
866ab5a2 1121 lightfName6 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552208s");
1122 if((fp6 = fopen(lightfName6,"r")) == NULL){
68ca986e 1123 printf("Cannot open file fp6 \n");
1124 return;
1125 }
866ab5a2 1126 lightfName7 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552209s");
1127 if((fp7 = fopen(lightfName7,"r")) == NULL){
68ca986e 1128 printf("Cannot open file fp7 \n");
1129 return;
1130 }
866ab5a2 1131 lightfName8 = gSystem->ExpandPathName("$ALICE/$ALICE_LEVEL/ZDC/light22620552210s");
1132 if((fp8 = fopen(lightfName8,"r")) == NULL){
68ca986e 1133 printf("Cannot open file fp8 \n");
1134 return;
1135 }
a2216698 1136
c0ceba4c 1137 for(k=0; k<fNalfap; k++){
1138 for(j=0; j<fNbep; j++){
68ca986e 1139 fscanf(fp5,"%f",&fTablep[0][k][j]);
1140 fscanf(fp6,"%f",&fTablep[1][k][j]);
1141 fscanf(fp7,"%f",&fTablep[2][k][j]);
1142 fscanf(fp8,"%f",&fTablep[3][k][j]);
1143 }
1144 }
1145 fclose(fp5);
1146 fclose(fp6);
1147 fclose(fp7);
1148 fclose(fp8);
1149}
68ca986e 1150//_____________________________________________________________________________
1151void AliZDCv1::StepManager()
1152{
1153 //
1154 // Routine called at every step in the Zero Degree Calorimeters
1155 //
1156
a2216698 1157 Int_t j, vol[2], ibeta=0, ialfa, ibe, nphe;
366ff5c2 1158 Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, radius, out;
47388856 1159 Float_t xalic[3], z, GuiEff, GuiPar[4]={0.31,-0.0004,0.0197,0.7958};
68ca986e 1160 TLorentzVector s, p;
1161 const char *knamed;
866ab5a2 1162
de6bc247 1163 for (j=0;j<10;j++) hits[j]=0;
866ab5a2 1164
68ca986e 1165 if((gMC->GetMedium() == fMedSensZN) || (gMC->GetMedium() == fMedSensZP) ||
1166 (gMC->GetMedium() == fMedSensGR) || (gMC->GetMedium() == fMedSensF1) ||
d213f1fa 1167 (gMC->GetMedium() == fMedSensF2) || (gMC->GetMedium() == fMedSensZEM)){
47388856 1168
1169// --- This part is for no shower developement in beam pipe and TDI
d213f1fa 1170// (gMC->GetMedium() == fMedSensPI) || (gMC->GetMedium() == fMedSensTDI)){
cc9c0243 1171
866ab5a2 1172 // If particle interacts with beam pipe -> return
d213f1fa 1173// if((gMC->GetMedium() == fMedSensPI) || (gMC->GetMedium() == fMedSensTDI)){
a2216698 1174 // If option NoShower is set -> StopTrack
d213f1fa 1175// if(fNoShower==1) {
4f9ca16e 1176// if(gMC->GetMedium() == fMedSensPI) {
1177// knamed = gMC->CurrentVolName();
1178// if((!strncmp(knamed,"MQ",2)) || (!strncmp(knamed,"YM",2))) fpLostIT += 1;
1179// if((!strncmp(knamed,"MD1",3))|| (!strncmp(knamed,"YD1",2))) fpLostD1 += 1;
1180// }
1181// if(gMC->GetMedium() == fMedSensTDI) fpLostTDI += 1;
d213f1fa 1182// gMC->StopTrack();
a2216698 1183// printf("\n # of p lost in Inner Triplet = %d\n",fpLostIT);
1184// printf("\n # of p lost in D1 = %d\n",fpLostD1);
1185// printf("\n # of p lost in TDI = %d\n",fpLostTDI);
d213f1fa 1186// }
7cc664ae 1187// return;
d213f1fa 1188// }
866ab5a2 1189
68ca986e 1190 //Particle coordinates
1191 gMC->TrackPosition(s);
c0ceba4c 1192 for(j=0; j<=2; j++){
68ca986e 1193 x[j] = s[j];
1194 }
1195 hits[0] = x[0];
1196 hits[1] = x[1];
1197 hits[2] = x[2];
1198
1199 // Determine in which ZDC the particle is
1200 knamed = gMC->CurrentVolName();
47388856 1201 if(!strncmp(knamed,"ZN",2)){
1202 vol[0]=1;
1203 }
1204 else if(!strncmp(knamed,"ZP",2)){
1205 vol[0]=2;
1206 }
1207 else if(!strncmp(knamed,"ZE",2)){
1208 vol[0]=3;
1209 }
68ca986e 1210
1211 // Determine in which quadrant the particle is
47388856 1212
1213 if(vol[0]==1){ //Quadrant in ZN
866ab5a2 1214 xdet[0] = x[0]-fPosZN[0];
1215 xdet[1] = x[1]-fPosZN[1];
5a881c97 1216 if((xdet[0]<=0.) && (xdet[1]>=0.)) vol[1]=1;
1217 if((xdet[0]>0.) && (xdet[1]>0.)) vol[1]=2;
1218 if((xdet[0]<0.) && (xdet[1]<0.)) vol[1]=3;
1219 if((xdet[0]>0.) && (xdet[1]<0.)) vol[1]=4;
68ca986e 1220 }
47388856 1221 else if(vol[0]==2){ //Quadrant in ZP
866ab5a2 1222 xdet[0] = x[0]-fPosZP[0];
1223 xdet[1] = x[1]-fPosZP[1];
1224 if(xdet[0]>fDimZP[0])xdet[0]=fDimZP[0]-0.01;
1225 if(xdet[0]<-fDimZP[0])xdet[0]=-fDimZP[0]+0.01;
68ca986e 1226 Float_t xqZP = xdet[0]/(fDimZP[0]/2);
1227 for(int i=1; i<=4; i++){
866ab5a2 1228 if(xqZP>=(i-3) && xqZP<(i-2)){
68ca986e 1229 vol[1] = i;
1230 break;
5a881c97 1231 }
1232 }
68ca986e 1233 }
47388856 1234 else if(vol[0] == 3){ //ZEM has only 1 quadrant
866ab5a2 1235 vol[1] = 1;
1236 xdet[0] = x[0]-fPosZEM[0];
1237 xdet[1] = x[1]-fPosZEM[1];
866ab5a2 1238 }
1239
68ca986e 1240 // Store impact point and kinetic energy of the ENTERING particle
1241
68ca986e 1242// if(Curtrack==Prim){
1243 if(gMC->IsTrackEntering()){
1244 //Particle energy
1245 gMC->TrackMomentum(p);
68ca986e 1246 hits[3] = p[3];
866ab5a2 1247 // Impact point on ZDC
68ca986e 1248 hits[4] = xdet[0];
1249 hits[5] = xdet[1];
866ab5a2 1250 hits[6] = 0;
68ca986e 1251 hits[7] = 0;
1252 hits[8] = 0;
1253 hits[9] = 0;
1254
866ab5a2 1255// Int_t PcID = gMC->TrackPid();
1256// printf("Pc ID -> %d\n",PcID);
5d12ce38 1257 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
866ab5a2 1258
1259 if(fNoShower==1){
4f9ca16e 1260// fpDetected += 1;
a2216698 1261 gMC->StopTrack();
1262// printf("\n # of detected p = %d\n",fpDetected);
1263 return;
866ab5a2 1264 }
68ca986e 1265 }
a2216698 1266// } // Curtrack IF
68ca986e 1267
1268 // Charged particles -> Energy loss
1269 if((destep=gMC->Edep())){
1270 if(gMC->IsTrackStop()){
1271 gMC->TrackMomentum(p);
1272 m = gMC->TrackMass();
1273 ekin = p[3]-m;
68ca986e 1274 hits[9] = ekin;
1275 hits[7] = 0.;
1276 hits[8] = 0.;
5d12ce38 1277 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1278 }
1279 else{
1280 hits[9] = destep;
1281 hits[7] = 0.;
1282 hits[8] = 0.;
5d12ce38 1283 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1284 }
a2216698 1285// printf(" Dep. E = %f \n",hits[9]);
1286 }
1287 }// NB -> Questa parentesi (chiude il primo IF) io la sposterei al fondo!???
68ca986e 1288
1289
1290 // *** Light production in fibres
1291 if((gMC->GetMedium() == fMedSensF1) || (gMC->GetMedium() == fMedSensF2)){
68ca986e 1292
1293 //Select charged particles
1294 if((destep=gMC->Edep())){
68ca986e 1295
1296 // Particle velocity
1297 gMC->TrackMomentum(p);
1298 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
1299 Float_t beta = ptot/p[3];
47388856 1300 if(beta<0.67){
1301 return;
1302 }
1303 else if((beta>=0.67) && (beta<=0.75)){
1304 ibeta = 0;
1305 }
1306 if((beta>0.75) && (beta<=0.85)){
1307 ibeta = 1;
1308 }
1309 if((beta>0.85) && (beta<=0.95)){
1310 ibeta = 2;
1311 }
1312 if(beta>0.95){
1313 ibeta = 3;
1314 }
68ca986e 1315
1316 // Angle between particle trajectory and fibre axis
1317 // 1 -> Momentum directions
1318 um[0] = p[0]/ptot;
1319 um[1] = p[1]/ptot;
1320 um[2] = p[2]/ptot;
1321 gMC->Gmtod(um,ud,2);
1322 // 2 -> Angle < limit angle
1323 Double_t alfar = TMath::ACos(ud[2]);
1324 Double_t alfa = alfar*kRaddeg;
866ab5a2 1325 if(alfa>=110.) return;
68ca986e 1326 ialfa = Int_t(1.+alfa/2.);
1327
1328 // Distance between particle trajectory and fibre axis
1329 gMC->TrackPosition(s);
c0ceba4c 1330 for(j=0; j<=2; j++){
68ca986e 1331 x[j] = s[j];
1332 }
1333 gMC->Gmtod(x,xdet,1);
1334 if(TMath::Abs(ud[0])>0.00001){
1335 Float_t dcoeff = ud[1]/ud[0];
1336 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
1337 }
1338 else{
1339 be = TMath::Abs(ud[0]);
1340 }
1341
47388856 1342 if((vol[0]==1)){
1343 radius = fFibZN[1];
1344 }
1345 else if((vol[0]==2)){
1346 radius = fFibZP[1];
1347 }
68ca986e 1348 ibe = Int_t(be*1000.+1);
1349
1350 //Looking into the light tables
1351 Float_t charge = gMC->TrackCharge();
1352
47388856 1353 if((vol[0]==1)) { // (1) ZN fibres
68ca986e 1354 if(ibe>fNben) ibe=fNben;
1355 out = charge*charge*fTablen[ibeta][ialfa][ibe];
5ce39387 1356 nphe = gRandom->Poisson(out);
a2216698 1357// printf("ZN --- ibeta = %d, ialfa = %d, ibe = %d"
1358// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
68ca986e 1359 if(gMC->GetMedium() == fMedSensF1){
5ce39387 1360 hits[7] = nphe; //fLightPMQ
68ca986e 1361 hits[8] = 0;
1362 hits[9] = 0;
5d12ce38 1363 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1364 }
1365 else{
1366 hits[7] = 0;
5ce39387 1367 hits[8] = nphe; //fLightPMC
68ca986e 1368 hits[9] = 0;
5d12ce38 1369 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1370 }
1371 }
47388856 1372 else if((vol[0]==2)) { // (2) ZP fibres
68ca986e 1373 if(ibe>fNbep) ibe=fNbep;
1374 out = charge*charge*fTablep[ibeta][ialfa][ibe];
5ce39387 1375 nphe = gRandom->Poisson(out);
a2216698 1376// printf("ZP --- ibeta = %d, ialfa = %d, ibe = %d"
1377// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
68ca986e 1378 if(gMC->GetMedium() == fMedSensF1){
5ce39387 1379 hits[7] = nphe; //fLightPMQ
68ca986e 1380 hits[8] = 0;
1381 hits[9] = 0;
5d12ce38 1382 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1383 }
1384 else{
1385 hits[7] = 0;
5ce39387 1386 hits[8] = nphe; //fLightPMC
68ca986e 1387 hits[9] = 0;
5d12ce38 1388 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
68ca986e 1389 }
1390 }
47388856 1391 else if((vol[0]==3)) { // (3) ZEM fibres
866ab5a2 1392 if(ibe>fNbep) ibe=fNbep;
1393 out = charge*charge*fTablep[ibeta][ialfa][ibe];
47388856 1394 gMC->TrackPosition(s);
1395 for(j=0; j<=2; j++){
1396 xalic[j] = s[j];
1397 }
1398 // z-coordinate from ZEM front face
1399 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
1400 z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
1401// z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
1402// printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
1403 GuiEff = GuiPar[0]*(GuiPar[1]*z*z+GuiPar[2]*z+GuiPar[3]);
1404// printf("\n xalic[0] = %f xalic[1] = %f xalic[2] = %f z = %f \n",
1405// xalic[0],xalic[1],xalic[2],z);
1406 out = out*GuiEff;
5ce39387 1407 nphe = gRandom->Poisson(out);
47388856 1408// printf(" out*GuiEff = %f nphe = %d", out, nphe);
a2216698 1409// printf("ZEM --- ibeta = %d, ialfa = %d, ibe = %d"
1410// " -> out = %f, nphe = %d\n", ibeta, ialfa, ibe, out, nphe);
0c9b76ab 1411 hits[7] = 0;
1412 hits[8] = nphe; //fLightPMC
5ce39387 1413 hits[9] = 0;
5d12ce38 1414 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
a2216698 1415 }
68ca986e 1416 }
68ca986e 1417 }
1418}