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