Tune hists for jet trigger
[u/mrichter/AliRoot.git] / ZDC / AliZDCv3.cxx
CommitLineData
8d433671 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16
17///////////////////////////////////////////////////////////////////////
18// //
19// AliZDCv3 --- new ZDC geometry //
20// with the both ZDC set geometry implemented //
21// //
22///////////////////////////////////////////////////////////////////////
23
24// --- Standard libraries
25#include "stdio.h"
26
27// --- ROOT system
28#include <TBRIK.h>
8d433671 29#include <TMath.h>
30#include <TNode.h>
31#include <TRandom.h>
32#include <TSystem.h>
33#include <TTree.h>
34#include <TVirtualMC.h>
35#include <TGeoManager.h>
36
8d433671 37// --- AliRoot classes
38#include "AliConst.h"
39#include "AliMagF.h"
8d433671 40#include "AliRun.h"
41#include "AliZDCv3.h"
42#include "AliMC.h"
43
44class AliZDCHit;
45class AliPDG;
46class AliDetector;
47
48
49ClassImp(AliZDCv3)
50
51//_____________________________________________________________________________
f853b9aa 52AliZDCv3::AliZDCv3() :
53 AliZDC(),
54 fMedSensF1(0),
55 fMedSensF2(0),
56 fMedSensZP(0),
57 fMedSensZN(0),
58 fMedSensZEM(0),
59 fMedSensGR(0),
60 fMedSensPI(0),
29c8f0dc 61 fMedSensTDI(0),
f853b9aa 62 fNalfan(0),
63 fNalfap(0),
64 fNben(0),
65 fNbep(0),
66 fZEMLength(0),
67 fpLostITC(0),
68 fpLostD1C(0),
69 fpDetectedC(0),
70 fnDetectedC(0),
71 fpLostITA(0),
72 fpLostD1A(0),
73 fpLostTDI(0),
74 fpDetectedA(0),
75 fnDetectedA(0)
8d433671 76{
77 //
78 // Default constructor for Zero Degree Calorimeter
79 //
80
8d433671 81}
82
83//_____________________________________________________________________________
a718c993 84AliZDCv3::AliZDCv3(const char *name, const char *title) :
f853b9aa 85 AliZDC(name,title),
86 fMedSensF1(0),
87 fMedSensF2(0),
88 fMedSensZP(0),
89 fMedSensZN(0),
90 fMedSensZEM(0),
91 fMedSensGR(0),
92 fMedSensPI(0),
29c8f0dc 93 fMedSensTDI(0),
f853b9aa 94 fNalfan(90),
95 fNalfap(90),
96 fNben(18),
97 fNbep(28),
64d8b611 98 fZEMLength(0),
f853b9aa 99 fpLostITC(0),
100 fpLostD1C(0),
101 fpDetectedC(0),
102 fnDetectedC(0),
103 fpLostITA(0),
104 fpLostD1A(0),
105 fpLostTDI(0),
106 fpDetectedA(0),
a718c993 107 fnDetectedA(0)
8d433671 108{
109 //
110 // Standard constructor for Zero Degree Calorimeter
111 //
112 //
113 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
114
115 AliModule* pipe=gAlice->GetModule("PIPE");
116 AliModule* abso=gAlice->GetModule("ABSO");
117 AliModule* dipo=gAlice->GetModule("DIPO");
118 AliModule* shil=gAlice->GetModule("SHIL");
119 if((!pipe) || (!abso) || (!dipo) || (!shil)) {
120 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
121 exit(1);
122 }
f853b9aa 123 //
8d433671 124 Int_t ip,jp,kp;
125 for(ip=0; ip<4; ip++){
126 for(kp=0; kp<fNalfap; kp++){
127 for(jp=0; jp<fNbep; jp++){
128 fTablep[ip][kp][jp] = 0;
129 }
130 }
131 }
132 Int_t in,jn,kn;
133 for(in=0; in<4; in++){
134 for(kn=0; kn<fNalfan; kn++){
135 for(jn=0; jn<fNben; jn++){
136 fTablen[in][kn][jn] = 0;
137 }
138 }
139 }
f853b9aa 140 //
8d433671 141 // Parameters for hadronic calorimeters geometry
142 fDimZN[0] = 3.52;
143 fDimZN[1] = 3.52;
144 fDimZN[2] = 50.;
145 fDimZP[0] = 11.2;
146 fDimZP[1] = 6.;
147 fDimZP[2] = 75.;
f853b9aa 148 fPosZNC[0] = 0.;
149 fPosZNC[1] = 1.2;
150 fPosZNC[2] = -11650.;
151 fPosZPC[0] = 23.9;
cd807e71 152 fPosZPC[1] = 0.;
153 fPosZPC[2] = -11600.;
f853b9aa 154 fPosZNA[0] = 0.;
155 fPosZNA[1] = 1.2;
156 fPosZNA[2] = 11620.;
cd807e71 157 fPosZPA[0] = 24.;
158 fPosZPA[1] = 0.;
159 fPosZPA[2] = 11620.;
8d433671 160 fFibZN[0] = 0.;
161 fFibZN[1] = 0.01825;
162 fFibZN[2] = 50.;
163 fFibZP[0] = 0.;
164 fFibZP[1] = 0.0275;
165 fFibZP[2] = 75.;
8d433671 166 // Parameters for EM calorimeter geometry
167 fPosZEM[0] = 8.5;
168 fPosZEM[1] = 0.;
169 fPosZEM[2] = 735.;
8d433671 170 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
171 Float_t kDimZEMAir = 0.001; // scotch
172 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
173 Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
174 Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
175 fZEMLength = kDimZEM0;
176
177}
178
179//_____________________________________________________________________________
180void AliZDCv3::CreateGeometry()
181{
182 //
183 // Create the geometry for the Zero Degree Calorimeter version 2
184 //* Initialize COMMON block ZDC_CGEOM
185 //*
186
187 CreateBeamLine();
188 CreateZDC();
189}
190
191//_____________________________________________________________________________
192void AliZDCv3::CreateBeamLine()
193{
194 //
195 // Create the beam line elements
196 //
197
198 Float_t zc, zq, zd1, zd2, zql, zd2l;
199 Float_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
200 Int_t im1, im2;
f853b9aa 201 //
8d433671 202 Int_t *idtmed = fIdtmed->GetArray();
203
204 ////////////////////////////////////////////////////////////////
205 // //
206 // SIDE C - RB26 (dimuon side) //
207 // //
208 ///////////////////////////////////////////////////////////////
209
210
211 // -- Mother of the ZDCs (Vacuum PCON)
212 zd1 = 1921.6;
213
214 conpar[0] = 0.;
215 conpar[1] = 360.;
216 conpar[2] = 2.;
217 conpar[3] = -13500.;
218 conpar[4] = 0.;
219 conpar[5] = 55.;
220 conpar[6] = -zd1;
221 conpar[7] = 0.;
222 conpar[8] = 55.;
cd807e71 223 gMC->Gsvolu("ZDCC", "PCON", idtmed[10], conpar, 9);
f853b9aa 224 gMC->Gspos("ZDCC", 1, "ALIC", 0., 0., 0., 0, "ONLY");
8d433671 225
226
227 // -- FIRST SECTION OF THE BEAM PIPE (from compensator dipole to
228 // the beginning of D1)
229 tubpar[0] = 6.3/2.;
230 tubpar[1] = 6.7/2.;
231 // From beginning of ZDC volumes to beginning of D1
232 tubpar[2] = (5838.3-zd1)/2.;
233 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 234 gMC->Gspos("QT01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 235 // Ch.debug
236 //printf("\n QT01 TUBE pipe from z = %f to z= %f (D1 beg.)\n",-zd1,-2*tubpar[2]-zd1);
237
238 //-- SECOND SECTION OF THE BEAM PIPE (from the end of D1 to the
239 // beginning of D2)
240
241 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1 + 13.5 cm
242 //-- Cylindrical pipe (r = 3.47) + conical flare
243
244 // -> Beginning of D1
245 zd1 += 2.*tubpar[2];
246
247 tubpar[0] = 3.47;
248 tubpar[1] = 3.47+0.2;
249 tubpar[2] = 958.5/2.;
250 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 251 gMC->Gspos("QT02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 252 // Ch.debug
253 //printf("\n QT02 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
254
255 zd1 += 2.*tubpar[2];
256
257 conpar[0] = 25./2.;
258 conpar[1] = 10./2.;
259 conpar[2] = 10.4/2.;
260 conpar[3] = 6.44/2.;
261 conpar[4] = 6.84/2.;
262 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
f853b9aa 263 gMC->Gspos("QC01", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 264 // Ch.debug
265 //printf("\n QC01 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
266
267 zd1 += 2.*conpar[0];
268
269 tubpar[0] = 10./2.;
270 tubpar[1] = 10.4/2.;
271 tubpar[2] = 50./2.;
272 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 273 gMC->Gspos("QT03", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 274 // Ch.debug
275 //printf("\n QT03 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
276
277 zd1 += tubpar[2]*2.;
278
279 tubpar[0] = 10./2.;
280 tubpar[1] = 10.4/2.;
281 tubpar[2] = 10./2.;
282 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 283 gMC->Gspos("QT04", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 284 // Ch.debug
285 //printf("\n QT04 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
286
287 zd1 += tubpar[2] * 2.;
288
289 tubpar[0] = 10./2.;
290 tubpar[1] = 10.4/2.;
291 tubpar[2] = 3.16/2.;
292 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 293 gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[0]-zd1, 0, "ONLY");
8d433671 294 // Ch.debug
295 //printf("\n QT05 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
296
297 zd1 += tubpar[2] * 2.;
298
299 tubpar[0] = 10.0/2.;
300 tubpar[1] = 10.4/2;
301 tubpar[2] = 190./2.;
302 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 303 gMC->Gspos("QT06", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 304 // Ch.debug
305 //printf("\n QT06 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
306
307 zd1 += tubpar[2] * 2.;
308
309 conpar[0] = 30./2.;
310 conpar[1] = 20.6/2.;
311 conpar[2] = 21./2.;
312 conpar[3] = 10./2.;
313 conpar[4] = 10.4/2.;
314 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
f853b9aa 315 gMC->Gspos("QC02", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 316 // Ch.debug
317 //printf("\n QC02 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
318
319 zd1 += conpar[0] * 2.;
320
321 tubpar[0] = 20.6/2.;
322 tubpar[1] = 21./2.;
323 tubpar[2] = 450./2.;
324 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 325 gMC->Gspos("QT07", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 326 // Ch.debug
327 //printf("\n QT07 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
328
329 zd1 += tubpar[2] * 2.;
330
331 conpar[0] = 13.6/2.;
332 conpar[1] = 25.4/2.;
333 conpar[2] = 25.8/2.;
334 conpar[3] = 20.6/2.;
335 conpar[4] = 21./2.;
336 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
f853b9aa 337 gMC->Gspos("QC03", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 338 // Ch.debug
339 //printf("\n QC03 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
340
341 zd1 += conpar[0] * 2.;
342
343 tubpar[0] = 25.4/2.;
344 tubpar[1] = 25.8/2.;
345 tubpar[2] = 205.8/2.;
346 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 347 gMC->Gspos("QT08", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 348 // Ch.debug
349 //printf("\n QT08 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
350
351 zd1 += tubpar[2] * 2.;
352
353 tubpar[0] = 50./2.;
354 tubpar[1] = 50.4/2.;
355 // QT09 is 10 cm longer to accomodate TDI
356 tubpar[2] = 515.4/2.;
357 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 358 gMC->Gspos("QT09", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 359 // Ch.debug
360 //printf("\n QT09 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
361
8d433671 362 zd1 += tubpar[2] * 2.;
363
364 tubpar[0] = 50./2.;
365 tubpar[1] = 50.4/2.;
366 // QT10 is 10 cm shorter
367 tubpar[2] = 690./2.;
368 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 369 gMC->Gspos("QT10", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 370 // Ch.debug
371 //printf("\n QT10 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
372
373 zd1 += tubpar[2] * 2.;
374
375 tubpar[0] = 50./2.;
376 tubpar[1] = 50.4/2.;
377 tubpar[2] = 778.5/2.;
378 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 379 gMC->Gspos("QT11", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 380 // Ch.debug
381 //printf("\n QT11 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
382
383 zd1 += tubpar[2] * 2.;
384
385 conpar[0] = 14.18/2.;
386 conpar[1] = 55./2.;
387 conpar[2] = 55.4/2.;
388 conpar[3] = 50./2.;
389 conpar[4] = 50.4/2.;
390 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
f853b9aa 391 gMC->Gspos("QC04", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 392 // Ch.debug
393 //printf("\n QC04 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
394
395 zd1 += conpar[0] * 2.;
396
397 tubpar[0] = 55./2.;
398 tubpar[1] = 55.4/2.;
399 tubpar[2] = 730./2.;
400 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 401 gMC->Gspos("QT12", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 402 // Ch.debug
403 //printf("\n QT12 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
404
405 zd1 += tubpar[2] * 2.;
406
407 conpar[0] = 36.86/2.;
408 conpar[1] = 68./2.;
409 conpar[2] = 68.4/2.;
410 conpar[3] = 55./2.;
411 conpar[4] = 55.4/2.;
412 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
f853b9aa 413 gMC->Gspos("QC05", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 414 // Ch.debug
415 //printf("\n QC05 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
416
417 zd1 += conpar[0] * 2.;
418
419 tubpar[0] = 68./2.;
420 tubpar[1] = 68.4/2.;
421 tubpar[2] = 927.3/2.;
422 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 423 gMC->Gspos("QT13", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 424 // Ch.debug
425 //printf("\n QT13 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
426
427 zd1 += tubpar[2] * 2.;
428
429 tubpar[0] = 0./2.;
430 tubpar[1] = 68.4/2.;
431 tubpar[2] = 0.2/2.;
432 gMC->Gsvolu("QT14", "TUBE", idtmed[8], tubpar, 3);
f853b9aa 433 gMC->Gspos("QT14", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 434 // Ch.debug
435 //printf("\n QT14 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
436
437 zd1 += tubpar[2] * 2.;
438
439 tubpar[0] = 0./2.;
440 tubpar[1] = 6.4/2.;
441 tubpar[2] = 0.2/2.;
442 gMC->Gsvolu("QT15", "TUBE", idtmed[11], tubpar, 3);
443 //-- Position QT15 inside QT14
444 gMC->Gspos("QT15", 1, "QT14", -7.7, 0., 0., 0, "ONLY");
445
446 gMC->Gsvolu("QT16", "TUBE", idtmed[11], tubpar, 3);
447 //-- Position QT16 inside QT14
448 gMC->Gspos("QT16", 1, "QT14", 7.7, 0., 0., 0, "ONLY");
449
450
451 //-- BEAM PIPE BETWEEN END OF CONICAL PIPE AND BEGINNING OF D2
452
453 tubpar[0] = 6.4/2.;
454 tubpar[1] = 6.8/2.;
455 tubpar[2] = 680.8/2.;
456 gMC->Gsvolu("QT17", "TUBE", idtmed[7], tubpar, 3);
457
458 tubpar[0] = 6.4/2.;
459 tubpar[1] = 6.8/2.;
460 tubpar[2] = 680.8/2.;
461 gMC->Gsvolu("QT18", "TUBE", idtmed[7], tubpar, 3);
462
463 // -- ROTATE PIPES
464 Float_t angle = 0.143*kDegrad; // Rotation angle
465
466 //AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
467 gMC->Matrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
f853b9aa 468 gMC->Gspos("QT17", 1, "ZDCC", TMath::Sin(angle) * 680.8/ 2. - 9.4,
8d433671 469 0., -tubpar[2]-zd1, im1, "ONLY");
2fdd1072 470 //printf("\n QT17-18 pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
8d433671 471
472 //AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
473 gMC->Matrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
f853b9aa 474 gMC->Gspos("QT18", 1, "ZDCC", 9.7 - TMath::Sin(angle) * 680.8 / 2.,
8d433671 475 0., -tubpar[2]-zd1, im2, "ONLY");
2fdd1072 476
477 // -- Luminometer (Cu box) in front of ZN - side C
478 boxpar[0] = 8.0/2.;
479 boxpar[1] = 8.0/2.;
480 boxpar[2] = 15./2.;
481 gMC->Gsvolu("QLUC", "BOX ", idtmed[6], boxpar, 3);
482 gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
483 //printf("\n QLUC LUMINOMETER from z = %f to z= %f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
8d433671 484
485 // -- END OF BEAM PIPE VOLUME DEFINITION FOR SIDE C (RB26 SIDE)
486 // ----------------------------------------------------------------
487
488 ////////////////////////////////////////////////////////////////
489 // //
490 // SIDE A - RB24 //
491 // //
492 ///////////////////////////////////////////////////////////////
493
494 // Rotation Matrices definition
495 Int_t irotpipe2, irotpipe1,irotpipe5, irotpipe6, irotpipe7, irotpipe8;
496 //-- rotation matrices for the tilted tube before and after the TDI
497 gMC->Matrix(irotpipe2,90.+6.3025,0.,90.,90.,6.3025,0.);
498 //-- rotation matrices for the tilted cone after the TDI to recenter vacuum chamber
499 gMC->Matrix(irotpipe1,90.-2.2918,0.,90.,90.,2.2918,180.);
500 //-- rotation matrices for the legs
501 gMC->Matrix(irotpipe5,90.-5.0109,0.,90.,90.,5.0109,180.);
502 gMC->Matrix(irotpipe6,90.+5.0109,0.,90.,90.,5.0109,0.);
503 gMC->Matrix(irotpipe7,90.-1.0027,0.,90.,90.,1.0027,180.);
504 gMC->Matrix(irotpipe8,90.+1.0027,0.,90.,90.,1.0027,0.);
505
506 // -- Mother of the ZDCs (Vacuum PCON)
507 zd2 = 1910.;// zd2 initial value
508
509 conpar[0] = 0.;
510 conpar[1] = 360.;
511 conpar[2] = 2.;
512 conpar[3] = zd2;
513 conpar[4] = 0.;
514 conpar[5] = 55.;
515 conpar[6] = 13500.;
516 conpar[7] = 0.;
517 conpar[8] = 55.;
f853b9aa 518 gMC->Gsvolu("ZDCA", "PCON", idtmed[10], conpar, 9);
519 gMC->Gspos("ZDCA", 1, "ALIC", 0., 0., 0., 0, "ONLY");
8d433671 520
f853b9aa 521 // BEAM PIPE from 19.10 m to inner triplet beginning (22.965 m)
8d433671 522 tubpar[0] = 6.0/2.;
523 tubpar[1] = 6.4/2.;
524 tubpar[2] = 386.5/2.;
cd807e71 525 gMC->Gsvolu("QA01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 526 gMC->Gspos("QA01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 527 // Ch.debug
f853b9aa 528 //printf("\n QA01 TUBE from z = %f to z= %f (Inner triplet beg.)\n",zd2,2*tubpar[2]+zd2);
8d433671 529
530 zd2 += 2.*tubpar[2];
531
532 // -- FIRST SECTION OF THE BEAM PIPE (from beginning of inner triplet to
f853b9aa 533 // beginning of D1)
8d433671 534 tubpar[0] = 6.3/2.;
535 tubpar[1] = 6.7/2.;
536 tubpar[2] = 3541.8/2.;
cd807e71 537 gMC->Gsvolu("QA02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 538 gMC->Gspos("QA02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 539 // Ch.debug
f853b9aa 540 //printf("\n QA02 TUBE from z = %f to z= %f (D1 beg.)\n",zd2,2*tubpar[2]+zd2);
8d433671 541
542 zd2 += 2.*tubpar[2];
543
544
545 // -- SECOND SECTION OF THE BEAM PIPE (from the beginning of D1 to the beginning of D2)
546 //
547 // FROM (MAGNETIC) BEGINNING OF D1 TO THE (MAGNETIC) END OF D1 + 126.5 cm
548 // CYLINDRICAL PIPE of diameter increasing from 6.75 cm up to 8.0 cm
549 // from magnetic end :
550 // 1) 80.1 cm still with ID = 6.75 radial beam screen
551 // 2) 2.5 cm conical section from ID = 6.75 to ID = 8.0 cm
552 // 3) 43.9 cm straight section (tube) with ID = 8.0 cm
f853b9aa 553 //
554 //printf("\n Beginning of D1 at z= %f\n",zd2);
8d433671 555
556 tubpar[0] = 6.75/2.;
557 tubpar[1] = 7.15/2.;
558 tubpar[2] = (945.0+80.1)/2.;
cd807e71 559 gMC->Gsvolu("QA03", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 560 gMC->Gspos("QA03", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 561 // Ch.debug
f853b9aa 562 //printf("\n QA03 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 563
564 zd2 += 2.*tubpar[2];
565
566 // Transition Cone from ID=67.5 mm to ID=80 mm
8d433671 567 conpar[0] = 2.5/2.;
568 conpar[1] = 6.75/2.;
569 conpar[2] = 7.15/2.;
570 conpar[3] = 8.0/2.;
571 conpar[4] = 8.4/2.;
cd807e71 572 gMC->Gsvolu("QA04", "CONE", idtmed[7], conpar, 5);
f853b9aa 573 gMC->Gspos("QA04", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
574 //printf(" QA04 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 575
576 zd2 += 2.*conpar[0];
577
578 tubpar[0] = 8.0/2.;
579 tubpar[1] = 8.4/2.;
580 tubpar[2] = 43.9/2.;
cd807e71 581 gMC->Gsvolu("QA05", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 582 gMC->Gspos("QA05", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 583 // Ch.debug
f853b9aa 584 //printf("\n QA05 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 585
586 zd2 += 2.*tubpar[2];
8d433671 587
588 // Bellow (ID=80 mm) - length = 0.2 m - VMAA
8d433671 589 tubpar[0] = 8.0/2.;
590 tubpar[1] = 8.4/2.;
591 tubpar[2] = 20./2.;
cd807e71 592 gMC->Gsvolu("QA06", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 593 gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 594 // Ch.debug
f853b9aa 595 //printf(" QA06 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 596
597 zd2 += 2.*tubpar[2];
598
f853b9aa 599 // Beam Position Monitor (ID=80 mm) Cu - BPMSX
8d433671 600 tubpar[0] = 8.0/2.;
601 tubpar[1] = 8.4/2.;
602 tubpar[2] = 28.5/2.;
cd807e71 603 gMC->Gsvolu("QA07", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 604 gMC->Gspos("QA07", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 605 // Ch.debug
f853b9aa 606 //printf(" QA07 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 607
608 zd2 += 2.*tubpar[2];
609
f853b9aa 610 // First section of VAEHI (tube ID=80mm)
8d433671 611 tubpar[0] = 8.0/2.;
612 tubpar[1] = 8.4/2.;
613 tubpar[2] = 28.5/2.;
cd807e71 614 gMC->Gsvolu("QAV1", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 615 gMC->Gspos("QAV1", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 616 // Ch.debug
f853b9aa 617 //printf(" QAV1 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 618
619 zd2 += 2.*tubpar[2];
620
f853b9aa 621 // Second section of VAEHI (transition cone from ID=80mm to ID=98mm)
8d433671 622 conpar[0] = 4.0/2.;
623 conpar[1] = 8.0/2.;
624 conpar[2] = 8.4/2.;
625 conpar[3] = 9.8/2.;
626 conpar[4] = 10.2/2.;
cd807e71 627 gMC->Gsvolu("QAV2", "CONE", idtmed[7], conpar, 5);
f853b9aa 628 gMC->Gspos("QAV2", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
629 //printf(" QAV2 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 630
631 zd2 += 2.*conpar[0];
632
f853b9aa 633 //Third section of VAEHI (transition cone from ID=98mm to ID=90mm)
8d433671 634 conpar[0] = 1.0/2.;
635 conpar[1] = 9.8/2.;
636 conpar[2] = 10.2/2.;
637 conpar[3] = 9.0/2.;
638 conpar[4] = 9.4/2.;
cd807e71 639 gMC->Gsvolu("QAV3", "CONE", idtmed[7], conpar, 5);
f853b9aa 640 gMC->Gspos("QAV3", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
641 //printf(" QAV3 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 642
643 zd2 += 2.*conpar[0];
644
f853b9aa 645 // Fourth section of VAEHI (tube ID=90mm)
8d433671 646 tubpar[0] = 9.0/2.;
647 tubpar[1] = 9.4/2.;
648 tubpar[2] = 31.0/2.;
cd807e71 649 gMC->Gsvolu("QAV4", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 650 gMC->Gspos("QAV4", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 651 // Ch.debug
f853b9aa 652 //printf(" QAV4 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 653
654 zd2 += 2.*tubpar[2];
655
8d433671 656 //---------------------------- TCDD beginning ----------------------------------
657 // space for the insertion of the collimator TCDD (2 m)
8d433671 658 // TCDD ZONE - 1st volume
659 conpar[0] = 1.3/2.;
660 conpar[1] = 9.0/2.;
661 conpar[2] = 13.0/2.;
662 conpar[3] = 9.6/2.;
663 conpar[4] = 13.0/2.;
cd807e71 664 gMC->Gsvolu("Q01T", "CONE", idtmed[7], conpar, 5);
f853b9aa 665 gMC->Gspos("Q01T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
666 //printf(" Q01T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 667
668 zd2 += 2.*conpar[0];
669
670 // TCDD ZONE - 2nd volume
671 tubpar[0] = 9.6/2.;
672 tubpar[1] = 10.0/2.;
673 tubpar[2] = 1.0/2.;
cd807e71 674 gMC->Gsvolu("Q02T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 675 gMC->Gspos("Q02T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 676 // Ch.debug
f853b9aa 677 //printf(" Q02T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 678
679 zd2 += 2.*tubpar[2];
680
681 // TCDD ZONE - third volume
682 conpar[0] = 9.04/2.;
683 conpar[1] = 9.6/2.;
684 conpar[2] = 10.0/2.;
685 conpar[3] = 13.8/2.;
686 conpar[4] = 14.2/2.;
cd807e71 687 gMC->Gsvolu("Q03T", "CONE", idtmed[7], conpar, 5);
f853b9aa 688 gMC->Gspos("Q03T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
689 //printf(" Q03T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 690
691 zd2 += 2.*conpar[0];
692
693 // TCDD ZONE - 4th volume
694 tubpar[0] = 13.8/2.;
695 tubpar[1] = 14.2/2.;
696 tubpar[2] = 38.6/2.;
cd807e71 697 gMC->Gsvolu("Q04T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 698 gMC->Gspos("Q04T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 699 // Ch.debug
f853b9aa 700 //printf(" Q04T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 701
702 zd2 += 2.*tubpar[2];
703
704 // TCDD ZONE - 5th volume
705 tubpar[0] = 21.0/2.;
706 tubpar[1] = 21.4/2.;
707 tubpar[2] = 100.12/2.;
cd807e71 708 gMC->Gsvolu("Q05T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 709 gMC->Gspos("Q05T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 710 // Ch.debug
f853b9aa 711 //printf(" Q05T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 712
713 zd2 += 2.*tubpar[2];
714
715 // TCDD ZONE - 6th volume
716 tubpar[0] = 13.8/2.;
717 tubpar[1] = 14.2/2.;
718 tubpar[2] = 38.6/2.;
cd807e71 719 gMC->Gsvolu("Q06T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 720 gMC->Gspos("Q06T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 721 // Ch.debug
f853b9aa 722 //printf(" Q06T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 723
724 zd2 += 2.*tubpar[2];
725
726 // TCDD ZONE - 7th volume
727 conpar[0] = 11.34/2.;
728 conpar[1] = 13.8/2.;
729 conpar[2] = 14.2/2.;
730 conpar[3] = 18.0/2.;
731 conpar[4] = 18.4/2.;
cd807e71 732 gMC->Gsvolu("Q07T", "CONE", idtmed[7], conpar, 5);
f853b9aa 733 gMC->Gspos("Q07T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
734 //printf(" Q07T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 735
736 zd2 += 2.*conpar[0];
737
f853b9aa 738 // Upper section : one single phi segment of a tube
739 // 5 parameters for tubs: inner radius = 0.,
740 // outer radius = 7.5 cm, half length = 50 cm
741 // phi1 = 0., phi2 = 180.
8d433671 742 tubspar[0] = 0.0/2.;
743 tubspar[1] = 15.0/2.;
744 tubspar[2] = 100.0/2.;
745 tubspar[3] = 0.;
746 tubspar[4] = 180.;
cd807e71 747 gMC->Gsvolu("Q08T", "TUBS", idtmed[7], tubspar, 5);
8d433671 748 // Ch.debug
f853b9aa 749 //printf("\n upper part : one single phi segment of a tube (Q08T)\n");
750
751 // rectangular beam pipe inside TCDD upper section (Vacuum)
8d433671 752 boxpar[0] = 7.0/2.;
753 boxpar[1] = 2.5/2.;
754 boxpar[2] = 100./2.;
755 gMC->Gsvolu("Q09T", "BOX ", idtmed[10], boxpar, 3);
f853b9aa 756 // positioning vacuum box in the upper section of TCDD
8d433671 757 gMC->Gspos("Q09T", 1, "Q08T", 0., 1.25, 0., 0, "ONLY");
758
f853b9aa 759 // lower section : one single phi segment of a tube
8d433671 760 tubspar[0] = 0.0/2.;
761 tubspar[1] = 15.0/2.;
762 tubspar[2] = 100.0/2.;
763 tubspar[3] = 180.;
764 tubspar[4] = 360.;
cd807e71 765 gMC->Gsvolu("Q10T", "TUBS", idtmed[7], tubspar, 5);
f853b9aa 766 // rectangular beam pipe inside TCDD lower section (Vacuum)
8d433671 767 boxpar[0] = 7.0/2.;
768 boxpar[1] = 2.5/2.;
769 boxpar[2] = 100./2.;
770 gMC->Gsvolu("Q11T", "BOX ", idtmed[10], boxpar, 3);
f853b9aa 771 // positioning vacuum box in the lower section of TCDD
8d433671 772 gMC->Gspos("Q11T", 1, "Q10T", 0., -1.25, 0., 0, "ONLY");
773
774 // positioning TCDD elements in ZDC2, (inside TCDD volume)
f853b9aa 775 gMC->Gspos("Q08T", 1, "ZDCA", 0., 2.5, -100+zd2, 0, "ONLY");
776 gMC->Gspos("Q10T", 1, "ZDCA", 0., -2.5, -100+zd2, 0, "ONLY");
8d433671 777
778 // RF screen
779 boxpar[0] = 0.2/2.;
780 boxpar[1] = 5.0/2.;
781 boxpar[2] = 100./2.;
cd807e71 782 gMC->Gsvolu("Q12T", "BOX ", idtmed[7], boxpar, 3);
8d433671 783 // positioning RF screen at both sides of TCDD
f853b9aa 784 gMC->Gspos("Q12T", 1, "ZDCA", tubspar[1]+boxpar[0], 0., -100+zd2, 0, "ONLY");
785 gMC->Gspos("Q12T", 2, "ZDCA", -tubspar[1]-boxpar[0], 0., -100+zd2, 0, "ONLY");
8d433671 786 //---------------------------- TCDD end ---------------------------------------
787
788 // Bellow (ID=80 mm) - length = 0.3 m - VMAAB
789 tubpar[0] = 8.0/2.;
790 tubpar[1] = 8.4/2.;
791 tubpar[2] = 30.0/2.;
cd807e71 792 gMC->Gsvolu("QA08", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 793 gMC->Gspos("QA08", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 794 // Ch.debug
f853b9aa 795 //printf(" QA08 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 796
797 zd2 += 2.*tubpar[2];
798
f853b9aa 799 // Flange (ID=80 mm) Cu (first section of VCTCE)
8d433671 800 tubpar[0] = 8.0/2.;
801 tubpar[1] = 8.4/2.;
802 tubpar[2] = 2.0/2.;
cd807e71 803 gMC->Gsvolu("QA09", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 804 gMC->Gspos("QA09", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 805 // Ch.debug
f853b9aa 806 //printf(" QA09 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 807
808 zd2 += 2.*tubpar[2];
809
f853b9aa 810 // transition cone from ID=80 to ID=212 (second section of VCTCE)
8d433671 811 conpar[0] = 25.0/2.;
812 conpar[1] = 8.0/2.;
813 conpar[2] = 8.4/2.;
814 conpar[3] = 21.2/2.;
815 conpar[4] = 21.8/2.;
cd807e71 816 gMC->Gsvolu("QA10", "CONE", idtmed[7], conpar, 5);
f853b9aa 817 gMC->Gspos("QA10", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
818 //printf(" QA10 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 819
820 zd2 += 2.*conpar[0];
821
f853b9aa 822 // tube (ID=212 mm) Cu (third section of VCTCE)
8d433671 823 tubpar[0] = 21.2/2.;
824 tubpar[1] = 21.8/2.;
825 tubpar[2] = 403.54/2.;
cd807e71 826 gMC->Gsvolu("QA11", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 827 gMC->Gspos("QA11", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 828 // Ch.debug
f853b9aa 829 //printf(" QA11 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 830
831 zd2 += 2.*tubpar[2];
832
833 // bellow (ID=212 mm) (VMBGA)
8d433671 834 tubpar[0] = 21.2/2.;
835 tubpar[1] = 21.8/2.;
836 tubpar[2] = 40.0/2.;
cd807e71 837 gMC->Gsvolu("QA12", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 838 gMC->Gspos("QA12", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 839 // Ch.debug
f853b9aa 840 //printf(" QA12 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 841
842 zd2 += 2.*tubpar[2];
843
844 // TDI valve assembly (ID=212 mm)
8d433671 845 tubpar[0] = 21.2/2.;
846 tubpar[1] = 21.8/2.;
847 tubpar[2] = 30.0/2.;
cd807e71 848 gMC->Gsvolu("QA13", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 849 gMC->Gspos("QA13", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 850 // Ch.debug
f853b9aa 851 //printf(" QA13 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 852
853 zd2 += 2.*tubpar[2];
854
855 // bellow (ID=212 mm) (VMBGA)
8d433671 856 tubpar[0] = 21.2/2.;
857 tubpar[1] = 21.8/2.;
858 tubpar[2] = 40.0/2.;
cd807e71 859 gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 860 gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 861 // Ch.debug
f853b9aa 862 //printf(" QA14 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 863
864 zd2 += 2.*tubpar[2];
865
866 // skewed transition piece (ID=212 mm) (before TDI)
8d433671 867 tubpar[0] = 21.2/2.;
868 tubpar[1] = 21.8/2.;
869 tubpar[2] = 20.0/2.;
cd807e71 870 gMC->Gsvolu("QA15", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 871 gMC->Gspos("QA15", 1, "ZDCA", 1.10446, 0., tubpar[2]+zd2, irotpipe2, "ONLY");
8d433671 872 // Ch.debug
f853b9aa 873 //printf(" QA15 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 874
875 zd2 += 2.*tubpar[2];
876
f853b9aa 877 // Vacuum chamber containing TDI
8d433671 878 tubpar[0] = 54.0/2.;
879 tubpar[1] = 54.6/2.;
880 tubpar[2] = 540.0/2.;
cd807e71 881 gMC->Gsvolu("Q13T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 882 gMC->Gspos("Q13T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 883 // Ch.debug
f853b9aa 884 //printf(" Q13T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 885
886 zd2 += 2.*tubpar[2];
887
f853b9aa 888 //---------------- INSERT TDI INSIDE Q13T -----------------------------------
8d433671 889 boxpar[0] = 11.0/2.;
890 boxpar[1] = 9.0/2.;
891 boxpar[2] = 540.0/2.;
cd807e71 892 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
8d433671 893 gMC->Gspos("QTD1", 1, "Q13T", -3.8, 10.5, 0., 0, "ONLY");
894 boxpar[0] = 11.0/2.;
895 boxpar[1] = 9.0/2.;
896 boxpar[2] = 540.0/2.;
cd807e71 897 gMC->Gsvolu("QTD2", "BOX ", idtmed[7], boxpar, 3);
8d433671 898 gMC->Gspos("QTD2", 1, "Q13T", -3.8, -10.5, 0., 0, "ONLY");
899 boxpar[0] = 5.1/2.;
900 boxpar[1] = 0.2/2.;
901 boxpar[2] = 540.0/2.;
cd807e71 902 gMC->Gsvolu("QTD3", "BOX ", idtmed[7], boxpar, 3);
8d433671 903 gMC->Gspos("QTD3", 1, "Q13T", -3.8+5.5+boxpar[0], 6.1, 0., 0, "ONLY");
904 gMC->Gspos("QTD3", 2, "Q13T", -3.8+5.5+boxpar[0], -6.1, 0., 0, "ONLY");
905 gMC->Gspos("QTD3", 3, "Q13T", -3.8-5.5-boxpar[0], 6.1, 0., 0, "ONLY");
906 gMC->Gspos("QTD3", 4, "Q13T", -3.8-5.5-boxpar[0], -6.1, 0., 0, "ONLY");
f853b9aa 907 //
8d433671 908 tubspar[0] = 12.0/2.;
909 tubspar[1] = 12.4/2.;
910 tubspar[2] = 540.0/2.;
911 tubspar[3] = 90.;
912 tubspar[4] = 270.;
cd807e71 913 gMC->Gsvolu("QTD4", "TUBS", idtmed[7], tubspar, 5);
8d433671 914 gMC->Gspos("QTD4", 1, "Q13T", -3.8-10.6, 0., 0., 0, "ONLY");
915 tubspar[0] = 12.0/2.;
916 tubspar[1] = 12.4/2.;
917 tubspar[2] = 540.0/2.;
918 tubspar[3] = -90.;
919 tubspar[4] = 90.;
cd807e71 920 gMC->Gsvolu("QTD5", "TUBS", idtmed[7], tubspar, 5);
8d433671 921 gMC->Gspos("QTD5", 1, "Q13T", -3.8+10.6, 0., 0., 0, "ONLY");
8d433671 922 //---------------- END DEFINING TDI INSIDE Q13T -------------------------------
923
924 // skewed transition piece (ID=212 mm) (after TDI)
925 tubpar[0] = 21.2/2.;
926 tubpar[1] = 21.8/2.;
927 tubpar[2] = 20.0/2.;
cd807e71 928 gMC->Gsvolu("QA16", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 929 gMC->Gspos("QA16", 1, "ZDCA", 1.10446+2.2, 0., tubpar[2]+zd2, irotpipe2, "ONLY");
8d433671 930 // Ch.debug
f853b9aa 931 //printf(" QA16 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 932
933 zd2 += 2.*tubpar[2];
934
935 // bellow (ID=212 mm) (VMBGA)
936 tubpar[0] = 21.2/2.;
937 tubpar[1] = 21.8/2.;
938 tubpar[2] = 40.0/2.;
cd807e71 939 gMC->Gsvolu("QA17", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 940 gMC->Gspos("QA17", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 941 // Ch.debug
f853b9aa 942 //printf(" QA17 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 943
944 zd2 += 2.*tubpar[2];
945
946 // TDI valve assembly (ID=212 mm)
947 tubpar[0] = 21.2/2.;
948 tubpar[1] = 21.8/2.;
949 tubpar[2] = 30.0/2.;
cd807e71 950 gMC->Gsvolu("QA18", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 951 gMC->Gspos("QA18", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 952 // Ch.debug
f853b9aa 953 //printf(" QA18 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 954
955 zd2 += 2.*tubpar[2];
956
957 // bellow (ID=212 mm) (VMBGA)
958 tubpar[0] = 21.2/2.;
959 tubpar[1] = 21.8/2.;
960 tubpar[2] = 40.0/2.;
cd807e71 961 gMC->Gsvolu("QA19", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 962 gMC->Gspos("QA19", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 963 // Ch.debug
f853b9aa 964 //printf(" QA19 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 965
966 zd2 += 2.*tubpar[2];
967
968 // vacuum chamber (ID=212 mm) (BTVST)
969 tubpar[0] = 21.2/2.;
970 tubpar[1] = 21.8/2.;
971 tubpar[2] = 50.0/2.;
cd807e71 972 gMC->Gsvolu("QA20", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 973 gMC->Gspos("QA20", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 974 // Ch.debug
f853b9aa 975 //printf(" QA20 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 976
977 zd2 += 2.*tubpar[2];
978
979 // bellow (ID=212 mm) (VMBGA) repeated 3 times
980 tubpar[0] = 21.2/2.;
981 tubpar[1] = 21.8/2.;
982 tubpar[2] = 120.0/2.;
cd807e71 983 gMC->Gsvolu("QA21", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 984 gMC->Gspos("QA21", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 985 // Ch.debug
f853b9aa 986 //printf(" QA21 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 987
988 zd2 += 2.*tubpar[2];
989
990 // skewed transition cone from ID=212 mm to ID=797 mm SS for the moment
991 conpar[0] = 110.0/2.;
992 conpar[1] = 21.2/2.;
993 conpar[2] = 21.8/2.;
994 conpar[3] = 79.7/2.;
995 conpar[4] = 81.3/2.;
cd807e71 996 gMC->Gsvolu("QA22", "CONE", idtmed[7], conpar, 5);
f853b9aa 997 gMC->Gspos("QA22", 1, "ZDCA", 4.4-2.201, 0., conpar[0]+zd2, irotpipe1, "ONLY");
998 //printf(" QA22 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 999
1000 zd2 += 2.*conpar[0];
1001
1002 // beam pipe (ID=797 mm) SS
1003 tubpar[0] = 79.7/2.;
1004 tubpar[1] = 81.3/2.;
1005 tubpar[2] = 2393.05/2.;
cd807e71 1006 gMC->Gsvolu("QA23", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1007 gMC->Gspos("QA23", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1008 // Ch.debug
9c374a22 1009 //printf(" QA23 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1010
1011 zd2 += 2.*tubpar[2];
1012
1013 // Transition from ID=797 mm to ID=196 mm SS for the moment:
1014 //
1015 // in order to simulate the thin window opened in the transition cone
1016 // we divide the transition cone in three cones:
1017 // the first 8 mm thick
1018 // the second 3 mm thick
1019 // the third 8 mm thick
f853b9aa 1020 //
1021 // First section
8d433671 1022 conpar[0] = 9.09/2.; // 15 degree
1023 conpar[1] = 79.7/2.;
1024 conpar[2] = 81.3/2.; // thickness 8 mm
1025 conpar[3] = 74.82868/2.;
1026 conpar[4] = 76.42868/2.; // thickness 8 mm
cd807e71 1027 gMC->Gsvolu("Q24A", "CONE", idtmed[7], conpar, 5);
f853b9aa 1028 gMC->Gspos("Q24A", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1029 //printf(" Q24A CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1030
1031 zd2 += 2.*conpar[0];
1032
f853b9aa 1033 // Second section
8d433671 1034 conpar[0] = 96.2/2.; // 15 degree
1035 conpar[1] = 74.82868/2.;
1036 conpar[2] = 75.42868/2.; // thickness 3 mm
1037 conpar[3] = 23.19588/2.;
1038 conpar[4] = 23.79588/2.; // thickness 3 mm
cd807e71 1039 gMC->Gsvolu("QA25", "CONE", idtmed[7], conpar, 5);
f853b9aa 1040 gMC->Gspos("QA25", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1041 //printf(" QA25 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1042
1043 zd2 += 2.*conpar[0];
1044
f853b9aa 1045 // Third section
8d433671 1046 conpar[0] = 6.71/2.; // 15 degree
1047 conpar[1] = 23.19588/2.;
1048 conpar[2] = 24.79588/2.;// thickness 8 mm
1049 conpar[3] = 19.6/2.;
1050 conpar[4] = 21.2/2.;// thickness 8 mm
cd807e71 1051 gMC->Gsvolu("QA26", "CONE", idtmed[7], conpar, 5);
f853b9aa 1052 gMC->Gspos("QA26", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1053 //printf(" QA26 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1054
1055 zd2 += 2.*conpar[0];
1056
1057 // beam pipe (ID=196 mm)
1058 tubpar[0] = 19.6/2.;
1059 tubpar[1] = 21.2/2.;
1060 tubpar[2] = 9.55/2.;
cd807e71 1061 gMC->Gsvolu("QA27", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1062 gMC->Gspos("QA27", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1063 // Ch.debug
f853b9aa 1064 //printf(" QA27 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1065
1066 zd2 += 2.*tubpar[2];
1067
1068 // Flange (ID=196 mm)
1069 tubpar[0] = 19.6/2.;
1070 tubpar[1] = 25.3/2.;
1071 tubpar[2] = 4.9/2.;
cd807e71 1072 gMC->Gsvolu("QF01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1073 gMC->Gspos("QF01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1074 // Ch.debug
f853b9aa 1075 //printf(" QF01 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1076
1077 zd2 += 2.*tubpar[2];
1078
1079 // Special Warm Module (made by 5 volumes)
8d433671 1080 tubpar[0] = 20.2/2.;
1081 tubpar[1] = 20.6/2.;
1082 tubpar[2] = 2.15/2.;
cd807e71 1083 gMC->Gsvolu("QA28", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1084 gMC->Gspos("QA28", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1085 // Ch.debug
f853b9aa 1086 //printf(" QA28 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1087
1088 zd2 += 2.*tubpar[2];
1089
1090 conpar[0] = 6.9/2.;
1091 conpar[1] = 20.2/2.;
1092 conpar[2] = 20.6/2.;
1093 conpar[3] = 23.9/2.;
1094 conpar[4] = 24.3/2.;
cd807e71 1095 gMC->Gsvolu("QA29", "CONE", idtmed[7], conpar, 5);
f853b9aa 1096 gMC->Gspos("QA29", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1097 // Ch.debug
f853b9aa 1098 //printf(" QA29 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1099
1100 zd2 += 2.*conpar[0];
1101
1102 tubpar[0] = 23.9/2.;
1103 tubpar[1] = 25.5/2.;
1104 tubpar[2] = 17.0/2.;
cd807e71 1105 gMC->Gsvolu("QA30", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1106 gMC->Gspos("QA30", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1107 // Ch.debug
f853b9aa 1108 //printf(" QA30 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1109
1110 zd2 += 2.*tubpar[2];
1111
1112 conpar[0] = 6.9/2.;
1113 conpar[1] = 23.9/2.;
1114 conpar[2] = 24.3/2.;
1115 conpar[3] = 20.2/2.;
1116 conpar[4] = 20.6/2.;
cd807e71 1117 gMC->Gsvolu("QA31", "CONE", idtmed[7], conpar, 5);
f853b9aa 1118 gMC->Gspos("QA31", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1119 // Ch.debug
f853b9aa 1120 //printf(" QA31 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1121
1122 zd2 += 2.*conpar[0];
1123
1124 tubpar[0] = 20.2/2.;
1125 tubpar[1] = 20.6/2.;
1126 tubpar[2] = 2.15/2.;
cd807e71 1127 gMC->Gsvolu("QA32", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1128 gMC->Gspos("QA32", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1129 // Ch.debug
f853b9aa 1130 //printf(" QA32 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1131
1132 zd2 += 2.*tubpar[2];
1133
1134 // Flange (ID=196 mm)
1135 tubpar[0] = 19.6/2.;
1136 tubpar[1] = 25.3/2.;
1137 tubpar[2] = 4.9/2.;
cd807e71 1138 gMC->Gsvolu("QF02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1139 gMC->Gspos("QF02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1140 // Ch.debug
f853b9aa 1141 //printf(" QF02 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1142
1143 zd2 += 2.*tubpar[2];
1144
1145 // simulation of the trousers (VCTYB)
addda976 1146 // (last design -mail 3/6/05)
8d433671 1147 // pipe: a tube (ID = 196. OD = 200.)
1148 tubpar[0] = 19.6/2.;
1149 tubpar[1] = 20.0/2.;
1150 tubpar[2] = 3.9/2.;
cd807e71 1151 gMC->Gsvolu("QA33", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1152 gMC->Gspos("QA33", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1153 // Ch.debug
f853b9aa 1154 //printf(" QA33 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1155
1156 zd2 += 2.*tubpar[2];
1157
1158 // transition cone from ID=196. to ID=216.6
1159 conpar[0] = 32.55/2.;
1160 conpar[1] = 19.6/2.;
1161 conpar[2] = 20.0/2.;
1162 conpar[3] = 21.66/2.;
1163 conpar[4] = 22.06/2.;
cd807e71 1164 gMC->Gsvolu("QA34", "CONE", idtmed[7], conpar, 5);
f853b9aa 1165 gMC->Gspos("QA34", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1166 // Ch.debug
f853b9aa 1167 //printf(" QA34 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1168
1169 zd2 += 2.*conpar[0];
1170
1171 // Flange: first support for the trousers
1172 boxpar[0] = 25.3/2.;
1173 boxpar[1] = 25.3/2.;
1174 boxpar[2] = 2.5/2.;
cd807e71 1175 gMC->Gsvolu("QF03", "BOX ", idtmed[7], boxpar, 3);
8d433671 1176 tubpar[0] = 0.0/2.;
1177 tubpar[1] = 22.06/2.;
1178 tubpar[2] = 2.5/2.;
1179 gMC->Gsvolu("QFV1", "TUBE", idtmed[10], tubpar, 3);
1180 gMC->Gspos("QFV1", 1, "QF03", 0., 0., 0., 0, "MANY");
f853b9aa 1181 gMC->Gspos("QF03", 1, "ZDCA", 0., 0., 14.3+zd2, 0, "MANY");
8d433671 1182
1183 // tube
1184 tubpar[0] = 21.66/2.;
1185 tubpar[1] = 22.06/2.;
1186 tubpar[2] = 28.6/2.;
cd807e71 1187 gMC->Gsvolu("QA35", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1188 gMC->Gspos("QA35", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1189 // Ch.debug
f853b9aa 1190 //printf("\n QA35 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1191
1192 zd2 += 2.*tubpar[2];
1193
1194 // legs of the trousers
8d433671 1195 conpar[0] = (90.1+0.8)/2.;
1196 conpar[1] = 0.0/2.;
1197 conpar[2] = 21.6/2.;
1198 conpar[3] = 0.0/2.;
1199 conpar[4] = 5.8/2.;
cd807e71 1200 gMC->Gsvolu("QAL1", "CONE", idtmed[7], conpar, 5);
1201 gMC->Gsvolu("QAL2", "CONE", idtmed[7], conpar, 5);
f853b9aa 1202 gMC->Gspos("QAL1", 1, "ZDCA", -3.45-0.52, 0., (90.1/2.)+zd2, irotpipe5, "MANY");
1203 gMC->Gspos("QAL2", 1, "ZDCA", 3.45+0.52, 0., (90.1/2.)+zd2, irotpipe6, "MANY");
8d433671 1204
1205 conpar[0] = (90.1+0.8)/2.;
1206 conpar[1] = 0.0/2.;
1207 conpar[2] = 21.2/2.;
1208 conpar[3] = 0.0/2.;
1209 conpar[4] = 5.4/2.;
1210 gMC->Gsvolu("QAL3", "CONE", idtmed[10], conpar, 5);
1211 gMC->Gsvolu("QAL4", "CONE", idtmed[10], conpar, 5);
f853b9aa 1212 gMC->Gspos("QAL3", 1, "ZDCA", -3.45-0.52, 0., (90.1/2.)+zd2, irotpipe5, "ONLY");
1213 gMC->Gspos("QAL4", 1, "ZDCA", 3.45+0.52, 0., (90.1/2.)+zd2, irotpipe6, "ONLY");
8d433671 1214
8d433671 1215 zd2 += 90.1;
1216
f853b9aa 1217 // second section : 2 tubes (ID = 54. OD = 58.)
8d433671 1218 tubpar[0] = 5.4/2.;
1219 tubpar[1] = 5.8/2.;
1220 tubpar[2] = 40.0/2.;
cd807e71 1221 gMC->Gsvolu("QA36", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1222 gMC->Gspos("QA36", 1, "ZDCA", -15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1223 gMC->Gspos("QA36", 2, "ZDCA", 15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1224 // Ch.debug
f853b9aa 1225 //printf(" QA36 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1226
1227 zd2 += 2.*tubpar[2];
1228
1229 // transition x2zdc to recombination chamber : skewed cone
1230 conpar[0] = 10./2.;
1231 conpar[1] = 5.4/2.;
1232 conpar[2] = 5.8/2.;
1233 conpar[3] = 6.3/2.;
1234 conpar[4] = 7.0/2.;
cd807e71 1235 gMC->Gsvolu("QA37", "CONE", idtmed[7], conpar, 5);
f853b9aa 1236 gMC->Gspos("QA37", 1, "ZDCA", -7.9-0.175, 0., conpar[0]+zd2, irotpipe7, "ONLY");
1237 gMC->Gspos("QA37", 2, "ZDCA", 7.9+0.175, 0., conpar[0]+zd2, irotpipe8, "ONLY");
1238 //printf(" QA37 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1239
1240 zd2 += 2.*conpar[0];
1241
1242 // Flange: second support for the trousers
8d433671 1243 boxpar[0] = 25.9/2.;
1244 boxpar[1] = 9.4/2.;
1245 boxpar[2] = 1./2.;
cd807e71 1246 gMC->Gsvolu("QF04", "BOX ", idtmed[7], boxpar, 3);
8d433671 1247 boxpar[0] = 16.5/2.;
1248 boxpar[1] = 7./2.;
1249 boxpar[2] = 1./2.;
1250 gMC->Gsvolu("QFV2", "BOX ", idtmed[10], boxpar, 3);
1251 gMC->Gspos("QFV2", 1, "QF04", 0., 0., 0., 0, "MANY");
1252 tubspar[0] = 0.0/2.;
1253 tubspar[1] = 7./2.;
1254 tubspar[2] = 1./2.;
1255 tubspar[3] = 90.;
1256 tubspar[4] = 270.;
1257 gMC->Gsvolu("QFV3", "TUBS", idtmed[10], tubspar, 5);
1258 gMC->Gspos("QFV3", 1, "QF04", -16.5/2., 0., 0., 0, "MANY");
1259 tubspar[0] = 0.0/2.;
1260 tubspar[1] = 7./2.;
1261 tubspar[2] = 1./2.;
1262 tubspar[3] = -90.;
1263 tubspar[4] = 90.;
1264 gMC->Gsvolu("QFV4", "TUBS", idtmed[10], tubspar, 5);
1265 gMC->Gspos("QFV4", 1, "QF04", 16.5/2., 0., 0., 0, "MANY");
f853b9aa 1266 gMC->Gspos("QF04", 1, "ZDCA", 0., 0., 18.5+zd2, 0, "MANY");
8d433671 1267
8d433671 1268 // 2 tubes (ID = 63 mm OD=70 mm)
1269 tubpar[0] = 6.3/2.;
1270 tubpar[1] = 7.0/2.;
1271 tubpar[2] = 512.9/2.;
cd807e71 1272 gMC->Gsvolu("QA38", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1273 gMC->Gspos("QA38", 1, "ZDCA", -16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1274 gMC->Gspos("QA38", 2, "ZDCA", 16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1275 //printf(" QA38 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1276
1277 zd2 += 2.*tubpar[2];
f853b9aa 1278 //printf("\n END OF BEAM PIPE VOLUME DEFINITION AT z= %f\n",zd2);
2fdd1072 1279
1280 // -- Luminometer (Cu box) in front of ZN - side A
1281 boxpar[0] = 8.0/2.;
1282 boxpar[1] = 8.0/2.;
1283 boxpar[2] = 15./2.;
cd807e71 1284 gMC->Gsvolu("QLUA", "BOX ", idtmed[7], boxpar, 3);
2fdd1072 1285 gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
1286 //printf("\n QLUC LUMINOMETER from z = %f to z= %f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
8d433671 1287
1288
1289 // ----------------------------------------------------------------
1290 // -- MAGNET DEFINITION -> LHC OPTICS 6.5
1291 // ----------------------------------------------------------------
1292 // ***************************************************************
1293 // SIDE C - RB26 (dimuon side)
1294 // ***************************************************************
1295 // -- COMPENSATOR DIPOLE (MBXW)
1296 zc = 1921.6;
1297
1298 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1299 tubpar[0] = 0.;
1300 tubpar[1] = 4.5;
1301 tubpar[2] = 170./2.;
1302 gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
1303
1304 // -- YOKE
1305 tubpar[0] = 4.5;
1306 tubpar[1] = 55.;
1307 tubpar[2] = 170./2.;
cd807e71 1308 gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
8d433671 1309
f853b9aa 1310 gMC->Gspos("MBXW", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
1311 gMC->Gspos("YMBX", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
8d433671 1312
1313
1314 // -- INNER TRIPLET
1315 zq = 2296.5;
1316
1317 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
1318 // -- MQXL
1319 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1320 tubpar[0] = 0.;
1321 tubpar[1] = 3.5;
1322 tubpar[2] = 637./2.;
1323 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
f853b9aa 1324
8d433671 1325 // -- YOKE
1326 tubpar[0] = 3.5;
1327 tubpar[1] = 22.;
1328 tubpar[2] = 637./2.;
1329 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
1330
f853b9aa 1331 gMC->Gspos("MQXL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
1332 gMC->Gspos("YMQL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
8d433671 1333
f853b9aa 1334 gMC->Gspos("MQXL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2430., 0, "ONLY");
1335 gMC->Gspos("YMQL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2430., 0, "ONLY");
8d433671 1336
1337 // -- MQX
1338 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1339 tubpar[0] = 0.;
1340 tubpar[1] = 3.5;
1341 tubpar[2] = 550./2.;
1342 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
1343
1344 // -- YOKE
1345 tubpar[0] = 3.5;
1346 tubpar[1] = 22.;
1347 tubpar[2] = 550./2.;
1348 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
1349
f853b9aa 1350 gMC->Gspos("MQX ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
1351 gMC->Gspos("YMQ ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
8d433671 1352
f853b9aa 1353 gMC->Gspos("MQX ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
1354 gMC->Gspos("YMQ ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
8d433671 1355
1356 // -- SEPARATOR DIPOLE D1
1357 zd1 = 5838.3;
1358
1359 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1360 tubpar[0] = 0.;
1361 tubpar[1] = 6.94/2.;
1362 tubpar[2] = 945./2.;
1363 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
1364
1365 // -- Insert horizontal Cu plates inside D1
1366 // -- (to simulate the vacuum chamber)
1367 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2)) - 0.05;
1368 boxpar[1] = 0.2/2.;
1369 boxpar[2] =945./2.;
1370 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
1371 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
1372 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
1373
1374 // -- YOKE
1375 tubpar[0] = 0.;
1376 tubpar[1] = 110./2;
1377 tubpar[2] = 945./2.;
1378 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
1379
f853b9aa 1380 gMC->Gspos("YD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 1381 gMC->Gspos("MD1 ", 1, "YD1 ", 0., 0., 0., 0, "ONLY");
1382
1383 // -- DIPOLE D2
1384 // --- LHC optics v6.4
1385 zd2 = 12147.6;
1386
1387 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1388 tubpar[0] = 0.;
1389 tubpar[1] = 7.5/2.;
1390 tubpar[2] = 945./2.;
1391 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
1392
1393 // -- YOKE
1394 tubpar[0] = 0.;
1395 tubpar[1] = 55.;
1396 tubpar[2] = 945./2.;
1397 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
1398
f853b9aa 1399 gMC->Gspos("YD2 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd2, 0, "ONLY");
8d433671 1400
1401 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
1402 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
1403
1404 // ***************************************************************
1405 // SIDE A - RB24
1406 // ***************************************************************
1407
1408 // COMPENSATOR DIPOLE (MCBWA) (2nd compensator)
1409 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1410 tubpar[0] = 0.;
1411 tubpar[1] = 4.5;
1412 tubpar[2] = 153./2.;
1413 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
f853b9aa 1414 gMC->Gspos("MCBW", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
8d433671 1415
1416 // -- YOKE
1417 tubpar[0] = 4.5;
1418 tubpar[1] = 55.;
1419 tubpar[2] = 153./2.;
cd807e71 1420 gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1421 gMC->Gspos("YMCB", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
8d433671 1422
1423
1424 // -- INNER TRIPLET
1425 zql = 2296.5;
1426
1427 // -- DEFINE MQX1 AND MQX2 QUADRUPOLE ELEMENT
1428 // -- MQX1
1429 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1430 tubpar[0] = 0.;
1431 tubpar[1] = 3.5;
1432 tubpar[2] = 637./2.;
1433 gMC->Gsvolu("MQX1", "TUBE", idtmed[11], tubpar, 3);
1434
1435 // -- YOKE
1436 tubpar[0] = 3.5;
1437 tubpar[1] = 22.;
1438 tubpar[2] = 637./2.;
cd807e71 1439 gMC->Gsvolu("YMQ1", "TUBE", idtmed[7], tubpar, 3);
8d433671 1440
1441 // -- BEAM SCREEN FOR Q1
1442 tubpar[0] = 4.78/2.;
1443 tubpar[1] = 5.18/2.;
1444 tubpar[2] = 637./2.;
1445 gMC->Gsvolu("QBS1", "TUBE", idtmed[6], tubpar, 3);
f853b9aa 1446 gMC->Gspos("QBS1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
8d433671 1447 // INSERT VERTICAL PLATE INSIDE Q1
1448 boxpar[0] = 0.2/2.0;
1449 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(1.9+0.2)*(1.9+0.2));
1450 boxpar[2] =637./2.;
1451 gMC->Gsvolu("QBS2", "BOX ", idtmed[6], boxpar, 3);
f853b9aa 1452 gMC->Gspos("QBS2", 1, "ZDCA", 1.9+boxpar[0], 0., boxpar[2]+zql, 0, "ONLY");
1453 gMC->Gspos("QBS2", 2, "ZDCA", -1.9-boxpar[0], 0., boxpar[2]+zql, 0, "ONLY");
8d433671 1454
1455 // -- BEAM SCREEN FOR Q3
1456 tubpar[0] = 5.79/2.;
1457 tubpar[1] = 6.14/2.;
1458 tubpar[2] = 637./2.;
1459 gMC->Gsvolu("QBS3", "TUBE", idtmed[6], tubpar, 3);
f853b9aa 1460 gMC->Gspos("QBS3", 1, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
8d433671 1461 // INSERT VERTICAL PLATE INSIDE Q3
1462 boxpar[0] = 0.2/2.0;
1463 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1464 boxpar[2] =637./2.;
1465 gMC->Gsvolu("QBS4", "BOX ", idtmed[6], boxpar, 3);
f853b9aa 1466 gMC->Gspos("QBS4", 1, "ZDCA", 2.405+boxpar[0], 0., boxpar[2]+zql+2400., 0, "ONLY");
1467 gMC->Gspos("QBS4", 2, "ZDCA", -2.405-boxpar[0], 0., boxpar[2]+zql+2400., 0, "ONLY");
8d433671 1468
1469 // -- Q1
f853b9aa 1470 gMC->Gspos("MQX1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "MANY");
1471 gMC->Gspos("YMQ1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
8d433671 1472
1473 // -- Q3
f853b9aa 1474 gMC->Gspos("MQX1", 2, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "MANY");
1475 gMC->Gspos("YMQ1", 2, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
8d433671 1476
1477
1478 // -- MQX2
1479 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1480 tubpar[0] = 0.;
1481 tubpar[1] = 3.5;
1482 tubpar[2] = 550./2.;
1483 gMC->Gsvolu("MQX2", "TUBE", idtmed[11], tubpar, 3);
1484
1485 // -- YOKE
1486 tubpar[0] = 3.5;
1487 tubpar[1] = 22.;
1488 tubpar[2] = 550./2.;
cd807e71 1489 gMC->Gsvolu("YMQ2", "TUBE", idtmed[7], tubpar, 3);
8d433671 1490
1491
1492 // -- BEAM SCREEN FOR Q2
1493 tubpar[0] = 5.79/2.;
1494 tubpar[1] = 6.14/2.;
1495 tubpar[2] = 550./2.;
1496 gMC->Gsvolu("QBS5", "TUBE", idtmed[6], tubpar, 3);
1497 // VERTICAL PLATE INSIDE Q2
1498 boxpar[0] = 0.2/2.0;
1499 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1500 boxpar[2] =550./2.;
1501 gMC->Gsvolu("QBS6", "BOX ", idtmed[6], boxpar, 3);
1502
1503 // -- Q2A
f853b9aa 1504 gMC->Gspos("MQX2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "MANY");
1505 gMC->Gspos("QBS5", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
1506 gMC->Gspos("QBS6", 1, "ZDCA", 2.405+boxpar[0], 0., boxpar[2]+zql+908.5, 0, "ONLY");
1507 gMC->Gspos("QBS6", 2, "ZDCA", -2.405-boxpar[0], 0., boxpar[2]+zql+908.5, 0, "ONLY");
1508 gMC->Gspos("YMQ2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
8d433671 1509
1510
1511 // -- Q2B
f853b9aa 1512 gMC->Gspos("MQX2", 2, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "MANY");
1513 gMC->Gspos("QBS5", 2, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
1514 gMC->Gspos("QBS6", 3, "ZDCA", 2.405+boxpar[0], 0., boxpar[2]+zql+1558.5, 0, "ONLY");
1515 gMC->Gspos("QBS6", 4, "ZDCA", -2.405-boxpar[0], 0., boxpar[2]+zql+1558.5, 0, "ONLY");
1516 gMC->Gspos("YMQ2", 2, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
8d433671 1517
1518 // -- SEPARATOR DIPOLE D1
1519 zd2 = 5838.3;
1520
1521 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1522 tubpar[0] = 0.;
1523 tubpar[1] = 6.75/2.;
1524 tubpar[2] = 945./2.;
1525 gMC->Gsvolu("MD1L", "TUBE", idtmed[11], tubpar, 3);
1526
1527 // -- The beam screen tube is provided by the beam pipe in D1 (QA03 volume)
1528 // -- Insert the beam screen horizontal Cu plates inside D1
1529 // -- (to simulate the vacuum chamber)
1530 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.885+0.2)*(2.885+0.2));
1531 boxpar[1] = 0.2/2.;
1532 boxpar[2] =(945.+80.1)/2.;
1533 gMC->Gsvolu("QBS7", "BOX ", idtmed[6], boxpar, 3);
f853b9aa 1534 gMC->Gspos("QBS7", 1, "ZDCA", 0., 2.885+boxpar[1],boxpar[2]+zd2, 0, "ONLY");
1535 gMC->Gspos("QBS7", 2, "ZDCA", 0., -2.885-boxpar[1],boxpar[2]+zd2, 0, "ONLY");
8d433671 1536
1537 // -- YOKE
1538 tubpar[0] = 7.34/2.; // to be checked
1539 tubpar[1] = 110./2;
1540 tubpar[2] = 945./2.;
cd807e71 1541 gMC->Gsvolu("YD1L", "TUBE", idtmed[7], tubpar, 3);
8d433671 1542
f853b9aa 1543 gMC->Gspos("YD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1544 gMC->Gspos("MD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "MANY");
8d433671 1545
1546
1547 // -- DIPOLE D2
1548 // --- LHC optics v6.5
1549 zd2l = 12167.8;
1550
1551 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1552 tubpar[0] = 0.;
1553 tubpar[1] = 7.5/2.; // this has to be checked
1554 tubpar[2] = 945./2.;
1555 gMC->Gsvolu("MD2L", "TUBE", idtmed[11], tubpar, 3);
1556
1557 // -- YOKE
1558 tubpar[0] = 0.;
1559 tubpar[1] = 55.;
1560 tubpar[2] = 945./2.;
cd807e71 1561 gMC->Gsvolu("YD2L", "TUBE", idtmed[7], tubpar, 3);
8d433671 1562
f853b9aa 1563 gMC->Gspos("YD2L", 1, "ZDCA", 0., 0., tubpar[2]+zd2l, 0, "ONLY");
8d433671 1564
1565 gMC->Gspos("MD2L", 1, "YD2L", -9.4, 0., 0., 0, "ONLY");
1566 gMC->Gspos("MD2L", 2, "YD2L", 9.4, 0., 0., 0, "ONLY");
1567
1568 // -- END OF MAGNET DEFINITION
1569}
1570
1571//_____________________________________________________________________________
1572void AliZDCv3::CreateZDC()
1573{
1574 //
1575 // Create the various ZDCs (ZN + ZP)
1576 //
1577
1578 Float_t dimPb[6], dimVoid[6];
1579
1580 Int_t *idtmed = fIdtmed->GetArray();
1581
1582 // Parameters for hadronic calorimeters geometry
1583 // NB -> parameters used ONLY in CreateZDC()
1584 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
1585 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
1586 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
1587 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
1588 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
1589 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
1590
1591 // Parameters for EM calorimeter geometry
1592 // NB -> parameters used ONLY in CreateZDC()
1593 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
1594 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
1595 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
1596 Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
1597 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
1598 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
1599
1600
1601 //-- Create calorimeters geometry
1602
1603 // -------------------------------------------------------------------------------
1604 //--> Neutron calorimeter (ZN)
1605
1606 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
1607 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
1608 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
1609 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
1610 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
1611 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
1612 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
1613 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
1614 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
1615
1616 // Divide ZNEU in towers (for hits purposes)
1617
1618 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
1619 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
1620
1621 //-- Divide ZN1 in minitowers
1622 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
1623 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
1624 // (4 fibres per minitower)
1625
1626 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
1627 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
1628
1629 // --- Position the empty grooves in the sticks (4 grooves per stick)
1630 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
1631 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
1632
1633 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1634 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1635 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1636 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1637
1638 // --- Position the fibers in the grooves
1639 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
1640 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
1641 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
1642 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
1643
1644 // --- Position the neutron calorimeter in ZDC
1645 // -- Rotation of ZDCs
1646 Int_t irotzdc;
1647 gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
1648 //
f853b9aa 1649 gMC->Gspos("ZNEU", 1, "ZDCC", fPosZNC[0], fPosZNC[1], fPosZNC[2]-fDimZN[2], irotzdc, "ONLY");
8d433671 1650 //Ch debug
1651 //printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
1652
1653 // --- Position the neutron calorimeter in ZDC2 (left line)
1654 // -- No Rotation of ZDCs
f853b9aa 1655 gMC->Gspos("ZNEU", 2, "ZDCA", fPosZNA[0], fPosZNA[1], fPosZNA[2]+fDimZN[2], 0, "ONLY");
8d433671 1656 //Ch debug
1657 //printf("\n ZN left -> %f < z < %f cm\n",fPosZNl[2],fPosZNl[2]+2*fDimZN[2]);
1658
1659
1660 // -------------------------------------------------------------------------------
1661 //--> Proton calorimeter (ZP)
1662
1663 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
1664 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
1665 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
1666 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
1667 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
1668 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
1669 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
1670 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
1671 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
1672
1673 //-- Divide ZPRO in towers(for hits purposes)
1674
1675 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
1676 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
1677
1678
1679 //-- Divide ZP1 in minitowers
1680 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
1681 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
1682 // (4 fiber per minitower)
1683
1684 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
1685 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
1686
1687 // --- Position the empty grooves in the sticks (4 grooves per stick)
1688 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
1689 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
1690
1691 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1692 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1693 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1694 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1695
1696 // --- Position the fibers in the grooves
1697 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
1698 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
1699 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
1700 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
1701
1702
f853b9aa 1703 // --- Position the proton calorimeter in ZDCC
921be7cf 1704 gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
8d433671 1705 //Ch debug
1706 //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
1707
f853b9aa 1708 // --- Position the proton calorimeter in ZDCA
1709 // --- No rotation
921be7cf 1710 gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
8d433671 1711 //Ch debug
1712 //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);
1713
1714
1715 // -------------------------------------------------------------------------------
1716 // -> EM calorimeter (ZEM)
1717
1718 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
1719
1720 Int_t irot1, irot2;
1721 gMC->Matrix(irot1,0.,0.,90.,90.,-90.,0.); // Rotation matrix 1
1722 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]);// Rotation matrix 2
1723 //printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
1724
1725 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
1726
1727 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
1728
1729 dimPb[0] = kDimZEMPb; // Lead slices
1730 dimPb[1] = fDimZEM[2];
1731 dimPb[2] = fDimZEM[1];
1732 //dimPb[3] = fDimZEM[3]; //controllare
1733 dimPb[3] = 90.-fDimZEM[3]; //originale
1734 dimPb[4] = 0.;
1735 dimPb[5] = 0.;
1736 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
1737 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
1738 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
1739
1740 // --- Position the lead slices in the tranche
1741 Float_t zTran = fDimZEM[0]/fDivZEM[2];
1742 Float_t zTrPb = -zTran+kDimZEMPb;
1743 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
1744 gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
1745
1746 // --- Vacuum zone (to be filled with fibres)
1747 dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
1748 dimVoid[1] = fDimZEM[2];
1749 dimVoid[2] = fDimZEM[1];
1750 dimVoid[3] = 90.-fDimZEM[3];
1751 dimVoid[4] = 0.;
1752 dimVoid[5] = 0.;
1753 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
1754 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
1755
1756 // --- Divide the vacuum slice into sticks along x axis
1757 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
1758 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
1759
1760 // --- Positioning the fibers into the sticks
1761 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
1762 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
1763
1764 // --- Positioning the vacuum slice into the tranche
1765 Float_t displFib = fDimZEM[1]/fDivZEM[0];
1766 gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
1767 gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., displFib, 0, "ONLY");
1768
1769 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
f853b9aa 1770 // NB -> ZEM is positioned in ALIC (instead of in ZDC) volume
8d433671 1771 gMC->Gspos("ZEM ", 1,"ALIC", -fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1772
1773 // Second EM ZDC (same side w.r.t. IP, just on the other side w.r.t. beam pipe)
1774 gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1775
1776 // --- Adding last slice at the end of the EM calorimeter
1777 Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
1778 gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
1779 //Ch debug
1780 //printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
1781 //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
1782
1783}
1784
1785//_____________________________________________________________________________
1786void AliZDCv3::DrawModule() const
1787{
1788 //
1789 // Draw a shaded view of the Zero Degree Calorimeter version 1
1790 //
1791
1792 // Set everything unseen
1793 gMC->Gsatt("*", "seen", -1);
1794 //
1795 // Set ALIC mother transparent
1796 gMC->Gsatt("ALIC","SEEN",0);
1797 //
1798 // Set the volumes visible
f853b9aa 1799 gMC->Gsatt("ZDCC","SEEN",0);
8d433671 1800 gMC->Gsatt("QT01","SEEN",1);
1801 gMC->Gsatt("QT02","SEEN",1);
1802 gMC->Gsatt("QT03","SEEN",1);
1803 gMC->Gsatt("QT04","SEEN",1);
1804 gMC->Gsatt("QT05","SEEN",1);
1805 gMC->Gsatt("QT06","SEEN",1);
1806 gMC->Gsatt("QT07","SEEN",1);
1807 gMC->Gsatt("QT08","SEEN",1);
1808 gMC->Gsatt("QT09","SEEN",1);
1809 gMC->Gsatt("QT10","SEEN",1);
1810 gMC->Gsatt("QT11","SEEN",1);
1811 gMC->Gsatt("QT12","SEEN",1);
1812 gMC->Gsatt("QT13","SEEN",1);
1813 gMC->Gsatt("QT14","SEEN",1);
1814 gMC->Gsatt("QT15","SEEN",1);
1815 gMC->Gsatt("QT16","SEEN",1);
1816 gMC->Gsatt("QT17","SEEN",1);
1817 gMC->Gsatt("QT18","SEEN",1);
1818 gMC->Gsatt("QC01","SEEN",1);
1819 gMC->Gsatt("QC02","SEEN",1);
1820 gMC->Gsatt("QC03","SEEN",1);
1821 gMC->Gsatt("QC04","SEEN",1);
1822 gMC->Gsatt("QC05","SEEN",1);
1823 gMC->Gsatt("QTD1","SEEN",1);
1824 gMC->Gsatt("QTD2","SEEN",1);
1825 gMC->Gsatt("QTD3","SEEN",1);
1826 gMC->Gsatt("MQXL","SEEN",1);
1827 gMC->Gsatt("YMQL","SEEN",1);
1828 gMC->Gsatt("MQX ","SEEN",1);
1829 gMC->Gsatt("YMQ ","SEEN",1);
1830 gMC->Gsatt("ZQYX","SEEN",1);
1831 gMC->Gsatt("MD1 ","SEEN",1);
1832 gMC->Gsatt("MD1V","SEEN",1);
1833 gMC->Gsatt("YD1 ","SEEN",1);
1834 gMC->Gsatt("MD2 ","SEEN",1);
1835 gMC->Gsatt("YD2 ","SEEN",1);
1836 gMC->Gsatt("ZNEU","SEEN",0);
1837 gMC->Gsatt("ZNF1","SEEN",0);
1838 gMC->Gsatt("ZNF2","SEEN",0);
1839 gMC->Gsatt("ZNF3","SEEN",0);
1840 gMC->Gsatt("ZNF4","SEEN",0);
1841 gMC->Gsatt("ZNG1","SEEN",0);
1842 gMC->Gsatt("ZNG2","SEEN",0);
1843 gMC->Gsatt("ZNG3","SEEN",0);
1844 gMC->Gsatt("ZNG4","SEEN",0);
1845 gMC->Gsatt("ZNTX","SEEN",0);
1846 gMC->Gsatt("ZN1 ","COLO",4);
1847 gMC->Gsatt("ZN1 ","SEEN",1);
1848 gMC->Gsatt("ZNSL","SEEN",0);
1849 gMC->Gsatt("ZNST","SEEN",0);
1850 gMC->Gsatt("ZPRO","SEEN",0);
1851 gMC->Gsatt("ZPF1","SEEN",0);
1852 gMC->Gsatt("ZPF2","SEEN",0);
1853 gMC->Gsatt("ZPF3","SEEN",0);
1854 gMC->Gsatt("ZPF4","SEEN",0);
1855 gMC->Gsatt("ZPG1","SEEN",0);
1856 gMC->Gsatt("ZPG2","SEEN",0);
1857 gMC->Gsatt("ZPG3","SEEN",0);
1858 gMC->Gsatt("ZPG4","SEEN",0);
1859 gMC->Gsatt("ZPTX","SEEN",0);
1860 gMC->Gsatt("ZP1 ","COLO",6);
1861 gMC->Gsatt("ZP1 ","SEEN",1);
1862 gMC->Gsatt("ZPSL","SEEN",0);
1863 gMC->Gsatt("ZPST","SEEN",0);
1864 gMC->Gsatt("ZEM ","COLO",7);
1865 gMC->Gsatt("ZEM ","SEEN",1);
1866 gMC->Gsatt("ZEMF","SEEN",0);
1867 gMC->Gsatt("ZETR","SEEN",0);
1868 gMC->Gsatt("ZEL0","SEEN",0);
1869 gMC->Gsatt("ZEL1","SEEN",0);
1870 gMC->Gsatt("ZEL2","SEEN",0);
1871 gMC->Gsatt("ZEV0","SEEN",0);
1872 gMC->Gsatt("ZEV1","SEEN",0);
1873 gMC->Gsatt("ZES0","SEEN",0);
1874 gMC->Gsatt("ZES1","SEEN",0);
1875
1876 //
1877 gMC->Gdopt("hide", "on");
1878 gMC->Gdopt("shad", "on");
1879 gMC->Gsatt("*", "fill", 7);
1880 gMC->SetClipBox(".");
1881 gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
1882 gMC->DefaultRange();
1883 gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
f853b9aa 1884 gMC->Gdhead(1111, "Zero Degree Calorimeter Version 3");
8d433671 1885 gMC->Gdman(18, 4, "MAN");
1886}
1887
1888//_____________________________________________________________________________
1889void AliZDCv3::CreateMaterials()
1890{
1891 //
1892 // Create Materials for the Zero Degree Calorimeter
1893 //
1894
8d433671 1895 Float_t dens, ubuf[1], wmat[2], a[2], z[2];
f853b9aa 1896
8d433671 1897 // --- Store in UBUF r0 for nuclear radius calculation R=r0*A**1/3
1898
1899 // --- Tantalum -> ZN passive material
1900 ubuf[0] = 1.1;
1901 AliMaterial(1, "TANT", 180.95, 73., 16.65, .4, 11.9, ubuf, 1);
8d433671 1902
1903 // --- Brass (CuZn) -> ZP passive material
1904 dens = 8.48;
1905 a[0] = 63.546;
1906 a[1] = 65.39;
1907 z[0] = 29.;
1908 z[1] = 30.;
1909 wmat[0] = .63;
1910 wmat[1] = .37;
cd807e71 1911 AliMixture(2, "BRASS", a, z, dens, 2, wmat);
8d433671 1912
1913 // --- SiO2
1914 dens = 2.64;
1915 a[0] = 28.086;
1916 a[1] = 15.9994;
1917 z[0] = 14.;
1918 z[1] = 8.;
1919 wmat[0] = 1.;
1920 wmat[1] = 2.;
cd807e71 1921 AliMixture(3, "SIO2", a, z, dens, -2, wmat);
8d433671 1922
1923 // --- Lead
1924 ubuf[0] = 1.12;
1925 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
1926
1927 // --- Copper (energy loss taken into account)
1928 ubuf[0] = 1.10;
1929 AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1930
8d433671 1931 // --- Iron (energy loss taken into account)
1932 ubuf[0] = 1.1;
1933 AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1934
1935 // --- Iron (no energy loss)
1936 ubuf[0] = 1.1;
cd807e71 1937 AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
f853b9aa 1938 AliMaterial(13, "IRON2", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1939
8d433671 1940 // ---------------------------------------------------------
1941 Float_t aResGas[3]={1.008,12.0107,15.9994};
1942 Float_t zResGas[3]={1.,6.,8.};
1943 Float_t wResGas[3]={0.28,0.28,0.44};
1944 Float_t dResGas = 3.2E-14;
1945
1946 // --- Vacuum (no magnetic field)
1947 AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
8d433671 1948
1949 // --- Vacuum (with magnetic field)
1950 AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
8d433671 1951
1952 // --- Air (no magnetic field)
1953 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1954 Float_t zAir[4]={6.,7.,8.,18.};
1955 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1956 Float_t dAir = 1.20479E-3;
1957 //
1958 AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
8d433671 1959
1960 // --- Definition of tracking media:
1961
1962 // --- Tantalum = 1 ;
1963 // --- Brass = 2 ;
1964 // --- Fibers (SiO2) = 3 ;
1965 // --- Fibers (SiO2) = 4 ;
1966 // --- Lead = 5 ;
1967 // --- Copper (with energy loss)= 6 ;
1968 // --- Copper (with energy loss)= 13 ;
1969 // --- Iron (with energy loss) = 7 ;
1970 // --- Iron (without energy loss) = 8 ;
1971 // --- Vacuum (no field) = 10
1972 // --- Vacuum (with field) = 11
1973 // --- Air (no field) = 12
1974
1975 // ****************************************************
1976 // Tracking media parameters
1977 //
1978 Float_t epsil = 0.01; // Tracking precision,
1979 Float_t stmin = 0.01; // Min. value 4 max. step (cm)
1980 Float_t stemax = 1.; // Max. step permitted (cm)
1981 Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
1982 Float_t deemax = -1.; // Maximum fractional energy loss
1983 Float_t nofieldm = 0.; // Max. field value (no field)
1984 Float_t fieldm = 45.; // Max. field value (with field)
1985 Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
1986 Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
1987 Int_t inofld = 0; // IFIELD=0 -> no magnetic field
1988 Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
1989 // *****************************************************
1990
1991 AliMedium(1, "ZTANT", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1992 AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1993 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1994 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1995 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1996 AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1997 AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1998 AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
1999 AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2000 AliMedium(12,"ZAIR", 12, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2001 //
2002 AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
f853b9aa 2003 AliMedium(13,"ZIRONE",13, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
2004
2005}
2006
2007//_____________________________________________________________________________
2008void AliZDCv3::AddAlignableVolumes() const
2009{
2010 //
2011 // Create entries for alignable volumes associating the symbolic volume
2012 // name with the corresponding volume path. Needs to be syncronized with
2013 // eventual changes in the geometry.
2014 //
63e6d88e 2015 TString volpath1 = "ALIC_1/ZDCC_1/ZNEU_1";
2016 TString volpath2 = "ALIC_1/ZDCC_1/ZPRO_1";
2017 TString volpath3 = "ALIC_1/ZDCA_1/ZNEU_2";
2018 TString volpath4 = "ALIC_1/ZDCA_1/ZPRO_2";
f853b9aa 2019
63e6d88e 2020 TString symname1="ZDC/NeutronZDC_C";
2021 TString symname2="ZDC/ProtonZDC_C";
2022 TString symname3="ZDC/NeutronZDC_A";
2023 TString symname4="ZDC/ProtonZDC_A";
f853b9aa 2024
2025 if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
2026 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2027
2028 if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
2029 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
63e6d88e 2030
2031 if(!gGeoManager->SetAlignableEntry(symname3.Data(),volpath3.Data()))
2032 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2033
2034 if(!gGeoManager->SetAlignableEntry(symname4.Data(),volpath4.Data()))
2035 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2036
f853b9aa 2037}
2038
2039
2040//_____________________________________________________________________________
2041void AliZDCv3::Init()
2042{
2043 InitTables();
2044 Int_t *idtmed = fIdtmed->GetArray();
2045 Int_t i;
8d433671 2046 // Thresholds for showering in the ZDCs
2047 i = 1; //tantalum
2048 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2049 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2050 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2051 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2052 i = 2; //brass
2053 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2054 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2055 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2056 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2057 i = 5; //lead
2058 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2059 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2060 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2061 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2062
2063 // Avoid too detailed showering in TDI
f853b9aa 2064 i = 6; //copper
8d433671 2065 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2066 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2067 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2068 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2069
8d433671 2070 // Avoid too detailed showering along the beam line
2071 i = 7; //iron with energy loss (ZIRON)
2072 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2073 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2074 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2075 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2076
2077 // Avoid too detailed showering along the beam line
2078 i = 8; //iron with energy loss (ZIRONN)
2079 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2080 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2081 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2082 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
cd807e71 2083
8d433671 2084 // Avoid too detailed showering along the beam line
f853b9aa 2085 i = 13; //iron with energy loss (ZIRONN)
2086 gMC->Gstpar(idtmed[i], "CUTGAM", 1.);
2087 gMC->Gstpar(idtmed[i], "CUTELE", 1.);
8d433671 2088 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
f853b9aa 2089 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
8d433671 2090
2091 // Avoid interaction in fibers (only energy loss allowed)
2092 i = 3; //fibers (ZSI02)
2093 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2094 gMC->Gstpar(idtmed[i], "MULS", 0.);
2095 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2096 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2097 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2098 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2099 gMC->Gstpar(idtmed[i], "COMP", 0.);
2100 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2101 gMC->Gstpar(idtmed[i], "BREM", 0.);
2102 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2103 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2104 gMC->Gstpar(idtmed[i], "HADR", 0.);
2105 i = 4; //fibers (ZQUAR)
2106 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2107 gMC->Gstpar(idtmed[i], "MULS", 0.);
2108 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2109 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2110 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2111 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2112 gMC->Gstpar(idtmed[i], "COMP", 0.);
2113 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2114 gMC->Gstpar(idtmed[i], "BREM", 0.);
2115 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2116 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2117 gMC->Gstpar(idtmed[i], "HADR", 0.);
2118
2119 // Avoid interaction in void
2120 i = 11; //void with field
2121 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2122 gMC->Gstpar(idtmed[i], "MULS", 0.);
2123 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2124 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2125 gMC->Gstpar(idtmed[i], "LOSS", 0.);
2126 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2127 gMC->Gstpar(idtmed[i], "COMP", 0.);
2128 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2129 gMC->Gstpar(idtmed[i], "BREM", 0.);
2130 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2131 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2132 gMC->Gstpar(idtmed[i], "HADR", 0.);
2133
2134 //
2135 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
2136 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
2137 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
2138 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
2139 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
f853b9aa 2140 fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
8d433671 2141 fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
2142 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
8d433671 2143}
2144
2145//_____________________________________________________________________________
2146void AliZDCv3::InitTables()
2147{
2148 //
2149 // Read light tables for Cerenkov light production parameterization
2150 //
2151
2152 Int_t k, j;
2153
2154 char *lightfName1,*lightfName2,*lightfName3,*lightfName4,
2155 *lightfName5,*lightfName6,*lightfName7,*lightfName8;
2156 FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
2157
2158 // --- Reading light tables for ZN
f853b9aa 2159 lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
8d433671 2160 if((fp1 = fopen(lightfName1,"r")) == NULL){
2161 printf("Cannot open file fp1 \n");
2162 return;
2163 }
f853b9aa 2164 lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
8d433671 2165 if((fp2 = fopen(lightfName2,"r")) == NULL){
2166 printf("Cannot open file fp2 \n");
2167 return;
2168 }
f853b9aa 2169 lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
8d433671 2170 if((fp3 = fopen(lightfName3,"r")) == NULL){
2171 printf("Cannot open file fp3 \n");
2172 return;
2173 }
f853b9aa 2174 lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
8d433671 2175 if((fp4 = fopen(lightfName4,"r")) == NULL){
2176 printf("Cannot open file fp4 \n");
2177 return;
2178 }
2179
2180 for(k=0; k<fNalfan; k++){
2181 for(j=0; j<fNben; j++){
2182 fscanf(fp1,"%f",&fTablen[0][k][j]);
2183 fscanf(fp2,"%f",&fTablen[1][k][j]);
2184 fscanf(fp3,"%f",&fTablen[2][k][j]);
2185 fscanf(fp4,"%f",&fTablen[3][k][j]);
2186 }
2187 }
2188 fclose(fp1);
2189 fclose(fp2);
2190 fclose(fp3);
2191 fclose(fp4);
2192
2193 // --- Reading light tables for ZP and ZEM
f853b9aa 2194 lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
8d433671 2195 if((fp5 = fopen(lightfName5,"r")) == NULL){
2196 printf("Cannot open file fp5 \n");
2197 return;
2198 }
f853b9aa 2199 lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
8d433671 2200 if((fp6 = fopen(lightfName6,"r")) == NULL){
2201 printf("Cannot open file fp6 \n");
2202 return;
2203 }
f853b9aa 2204 lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
8d433671 2205 if((fp7 = fopen(lightfName7,"r")) == NULL){
2206 printf("Cannot open file fp7 \n");
2207 return;
2208 }
f853b9aa 2209 lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
8d433671 2210 if((fp8 = fopen(lightfName8,"r")) == NULL){
2211 printf("Cannot open file fp8 \n");
2212 return;
2213 }
2214
2215 for(k=0; k<fNalfap; k++){
2216 for(j=0; j<fNbep; j++){
2217 fscanf(fp5,"%f",&fTablep[0][k][j]);
2218 fscanf(fp6,"%f",&fTablep[1][k][j]);
2219 fscanf(fp7,"%f",&fTablep[2][k][j]);
2220 fscanf(fp8,"%f",&fTablep[3][k][j]);
2221 }
2222 }
2223 fclose(fp5);
2224 fclose(fp6);
2225 fclose(fp7);
2226 fclose(fp8);
2227}
2228//_____________________________________________________________________________
2229void AliZDCv3::StepManager()
2230{
2231 //
2232 // Routine called at every step in the Zero Degree Calorimeters
2233 //
2234
2235 Int_t j, vol[2], ibeta=0, ialfa, ibe, nphe;
2236 Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, out;
2237 //Float_t radius;
f853b9aa 2238 Float_t xalic[3], z, guiEff;
61424d1c 2239 // Parametrization for light guide uniformity
2240 // -> OBSOLETE!!!! For guide tilted @ 46 degrees
2241 //Float_t guiPar[4]={0.31,-0.0004,0.0197,0.7958};
2242 // NEW!!! Light guide tilted @ 51 degrees
2243 Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
f853b9aa 2244 Double_t s[3], p[3];
8d433671 2245 const char *knamed;
f853b9aa 2246 //
8d433671 2247 for (j=0;j<10;j++) hits[j]=-999.;
f853b9aa 2248 //
8d433671 2249 // --- This part is for no shower developement in beam pipe and TDI
2250 // If particle interacts with beam pipe or TDI -> return
f853b9aa 2251 if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){
8d433671 2252 // If option NoShower is set -> StopTrack
cd807e71 2253 if(fNoShower==1){
f853b9aa 2254 gMC->TrackPosition(s[0],s[1],s[2]);
cd807e71 2255 if(gMC->CurrentMedium() == fMedSensPI){
8d433671 2256 knamed = gMC->CurrentVolName();
f853b9aa 2257 if(!strncmp(knamed,"YMQ",3)){
2258 if(s[2]<0) fpLostITC += 1;
2259 else fpLostITA += 1;
2260 }
2261 if(!strncmp(knamed,"YD1",3)){
2262 if(s[2]<0) fpLostD1C += 1;
2263 else fpLostD1A += 1;
2264 }
8d433671 2265 }
f853b9aa 2266 else if(gMC->CurrentMedium() == fMedSensTDI){
8d433671 2267 knamed = gMC->CurrentVolName();
f853b9aa 2268 if(!strncmp(knamed,"MD1",3)){
2269 if(s[2]<0) fpLostD1C += 1;
2270 else fpLostD1A += 1;
2271 }
2272 if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
8d433671 2273 }
cd807e71 2274 //
2275 gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
2276 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2277 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2278 //
2279 printf("\t ----------------------------\n");
2280 printf("\t ---------- Side C ----------\n");
2281 printf(" # of spectators lost in IT = %d\n",fpLostITC);
2282 printf(" # of spectators lost in D1 = %d\n",fpLostD1C);
2283 printf("\t ---------- Side A ----------\n");
2284 printf(" # of spectators lost in IT = %d\n",fpLostITA);
2285 printf(" # of spectators lost in D1 = %d\n",fpLostD1A);
2286 printf(" # of spectators lost in TDI = %d\n\n",fpLostTDI);
2287 printf("\t ----------------------------\n");
8d433671 2288 gMC->StopTrack();
2289 }
2290 return;
2291 }
2292
2293
2294 if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
2295 (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
2296 (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
2297
2298
2299 //Particle coordinates
f853b9aa 2300 gMC->TrackPosition(s[0],s[1],s[2]);
8d433671 2301 for(j=0; j<=2; j++) x[j] = s[j];
2302 hits[0] = x[0];
2303 hits[1] = x[1];
2304 hits[2] = x[2];
2305
2306 // Determine in which ZDC the particle is
2307 knamed = gMC->CurrentVolName();
2308 if(!strncmp(knamed,"ZN",2)){
921be7cf 2309 if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
2310 else if(x[2]>0.) vol[0]=4; //ZNA
8d433671 2311 }
2312 else if(!strncmp(knamed,"ZP",2)){
921be7cf 2313 if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
2314 else if(x[2]>0.) vol[0]=5; //ZPA
8d433671 2315 }
921be7cf 2316 else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
8d433671 2317
2318 // Determine in which quadrant the particle is
f853b9aa 2319 if(vol[0]==1){ //Quadrant in ZNC
61424d1c 2320 // Calculating particle coordinates inside ZNC
f853b9aa 2321 xdet[0] = x[0]-fPosZNC[0];
2322 xdet[1] = x[1]-fPosZNC[1];
8d433671 2323 // Calculating quadrant in ZN
2324 if(xdet[0]<=0.){
f853b9aa 2325 if(xdet[1]<=0.) vol[1]=1;
2326 else vol[1]=3;
8d433671 2327 }
2328 else if(xdet[0]>0.){
f853b9aa 2329 if(xdet[1]<=0.) vol[1]=2;
2330 else vol[1]=4;
8d433671 2331 }
2332 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2333 printf("\n ZDC StepManager->ERROR in ZN!!! vol[1] = %d, xdet[0] = %f,"
2334 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2335 }
2336
f853b9aa 2337 else if(vol[0]==2){ //Quadrant in ZPC
61424d1c 2338 // Calculating particle coordinates inside ZPC
f853b9aa 2339 xdet[0] = x[0]-fPosZPA[0];
2340 xdet[1] = x[1]-fPosZPA[1];
8d433671 2341 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2342 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2343 // Calculating tower in ZP
2344 Float_t xqZP = xdet[0]/(fDimZP[0]/2.);
2345 for(int i=1; i<=4; i++){
2346 if(xqZP>=(i-3) && xqZP<(i-2)){
2347 vol[1] = i;
2348 break;
2349 }
2350 }
2351 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2352 printf(" ZDC StepManager->ERROR in ZP!!! vol[1] = %d, xdet[0] = %f,"
2353 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2354 }
f853b9aa 2355 //
8d433671 2356 // Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
2357 // vol[1] = 2 -> particle in 2nd ZEM (placed at x = -8.5 cm)
2358 else if(vol[0] == 3){
2359 if(x[0]>0.){
2360 vol[1] = 1;
2361 // Particle x-coordinate inside ZEM1
2362 xdet[0] = x[0]-fPosZEM[0];
2363 }
2364 else{
2365 vol[1] = 2;
2366 // Particle x-coordinate inside ZEM2
2367 xdet[0] = x[0]+fPosZEM[0];
2368 }
2369 xdet[1] = x[1]-fPosZEM[1];
2370 }
f853b9aa 2371 //
2372 else if(vol[0]==4){ //Quadrant in ZNA
2373 // Calculating particle coordinates inside ZNA
2374 xdet[0] = x[0]-fPosZNA[0];
2375 xdet[1] = x[1]-fPosZNA[1];
2376 // Calculating quadrant in ZNA
2377 if(xdet[0]>=0.){
2378 if(xdet[1]<=0.) vol[1]=1;
2379 else vol[1]=3;
8d433671 2380 }
f853b9aa 2381 else if(xdet[0]<0.){
2382 if(xdet[1]<=0.) vol[1]=2;
2383 else vol[1]=4;
8d433671 2384 }
2385 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
f853b9aa 2386 printf("\n ZDC StepManager->ERROR in ZNA!!! vol[1] = %d, xdet[0] = %f,"
8d433671 2387 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2388 }
f853b9aa 2389 //
2390 else if(vol[0]==5){ //Quadrant in ZPA
2391 // Calculating particle coordinates inside ZPA
2392 xdet[0] = x[0]-fPosZPC[0];
2393 xdet[1] = x[1]-fPosZPC[1];
8d433671 2394 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2395 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2396 // Calculating tower in ZP
f853b9aa 2397 Float_t xqZP = -xdet[0]/(fDimZP[0]/2.);
8d433671 2398 for(int i=1; i<=4; i++){
2399 if(xqZP>=(i-3) && xqZP<(i-2)){
2400 vol[1] = i;
2401 break;
2402 }
2403 }
2404 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
f853b9aa 2405 printf(" ZDC StepManager->ERROR in ZPA!!! vol[1] = %d, xdet[0] = %f,"
8d433671 2406 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2407 }
2408
2409
2410 // Store impact point and kinetic energy of the ENTERING particle
2411
2412 if(gMC->IsTrackEntering()){
2413 //Particle energy
f853b9aa 2414 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2415 hits[3] = p[3];
2416 // Impact point on ZDC
2417 hits[4] = xdet[0];
2418 hits[5] = xdet[1];
2419 hits[6] = 0;
2420 hits[7] = 0;
2421 hits[8] = 0;
2422 hits[9] = 0;
2423
2424 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2425
2426 if(fNoShower==1){
921be7cf 2427 //printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n",
2428 //knamed, vol[0], vol[1], x[0], x[1], x[2]);
2429 if(vol[0]==1){
2430 fnDetectedC += 1;
2431 printf("\n # of detected neutrons in ZNC = %d\n\n",fnDetectedC);
2432 }
2433 else if(vol[0]==2){
2434 fpDetectedC += 1;
2435 printf("\n # of detected protons in ZPC = %d\n\n",fpDetectedC);
2436 }
2437 else if(vol[0]==4){
2438 fnDetectedA += 1;
2439 printf("\n # of detected neutrons in ZNA = %d\n\n",fnDetectedA);
2440 }
2441 else if(vol[0]==5){
2442 fpDetectedA += 1;
2443 printf("\n # of detected protons in ZPA = %d\n\n",fpDetectedA);
2444 }
cd807e71 2445 //
2446 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2447 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2448 //
8d433671 2449 gMC->StopTrack();
8d433671 2450 return;
2451 }
2452 }
2453
2454 // Charged particles -> Energy loss
2455 if((destep=gMC->Edep())){
2456 if(gMC->IsTrackStop()){
f853b9aa 2457 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2458 m = gMC->TrackMass();
2459 ekin = p[3]-m;
2460 hits[9] = ekin;
2461 hits[7] = 0.;
2462 hits[8] = 0.;
2463 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2464 }
2465 else{
2466 hits[9] = destep;
2467 hits[7] = 0.;
2468 hits[8] = 0.;
2469 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2470 }
2471 }
2472 }
2473
2474
2475 // *** Light production in fibres
2476 if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
2477
2478 //Select charged particles
2479 if((destep=gMC->Edep())){
2480
2481 // Particle velocity
2482 Float_t beta = 0.;
f853b9aa 2483 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2484 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2485 if(p[3] > 0.00001) beta = ptot/p[3];
2486 else return;
2487 if(beta<0.67)return;
2488 else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
2489 else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
2490 else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
2491 else if(beta>0.95) ibeta = 3;
2492
2493 // Angle between particle trajectory and fibre axis
2494 // 1 -> Momentum directions
2495 um[0] = p[0]/ptot;
2496 um[1] = p[1]/ptot;
2497 um[2] = p[2]/ptot;
2498 gMC->Gmtod(um,ud,2);
2499 // 2 -> Angle < limit angle
2500 Double_t alfar = TMath::ACos(ud[2]);
2501 Double_t alfa = alfar*kRaddeg;
2502 if(alfa>=110.) return;
2503 //
2504 ialfa = Int_t(1.+alfa/2.);
2505
2506 // Distance between particle trajectory and fibre axis
f853b9aa 2507 gMC->TrackPosition(s[0],s[1],s[2]);
8d433671 2508 for(j=0; j<=2; j++){
2509 x[j] = s[j];
2510 }
2511 gMC->Gmtod(x,xdet,1);
2512 if(TMath::Abs(ud[0])>0.00001){
2513 Float_t dcoeff = ud[1]/ud[0];
2514 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
2515 }
2516 else{
2517 be = TMath::Abs(ud[0]);
2518 }
2519
2520 ibe = Int_t(be*1000.+1);
2521 //if((vol[0]==1)) radius = fFibZN[1];
2522 //else if((vol[0]==2)) radius = fFibZP[1];
2523
2524 //Looking into the light tables
2525 Float_t charge = gMC->TrackCharge();
2526
80e87581 2527 if(vol[0]==1 || vol[0]==4) { // (1) ZN fibres
8d433671 2528 if(ibe>fNben) ibe=fNben;
2529 out = charge*charge*fTablen[ibeta][ialfa][ibe];
2530 nphe = gRandom->Poisson(out);
2531 // Ch. debug
2532 //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
2533 //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
2534 if(gMC->CurrentMedium() == fMedSensF1){
2535 hits[7] = nphe; //fLightPMQ
2536 hits[8] = 0;
2537 hits[9] = 0;
2538 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2539 }
2540 else{
2541 hits[7] = 0;
2542 hits[8] = nphe; //fLightPMC
2543 hits[9] = 0;
2544 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2545 }
2546 }
80e87581 2547 else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
8d433671 2548 if(ibe>fNbep) ibe=fNbep;
2549 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2550 nphe = gRandom->Poisson(out);
2551 if(gMC->CurrentMedium() == fMedSensF1){
2552 hits[7] = nphe; //fLightPMQ
2553 hits[8] = 0;
2554 hits[9] = 0;
2555 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2556 }
2557 else{
2558 hits[7] = 0;
2559 hits[8] = nphe; //fLightPMC
2560 hits[9] = 0;
2561 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2562 }
2563 }
2564 else if((vol[0]==3)) { // (3) ZEM fibres
2565 if(ibe>fNbep) ibe=fNbep;
2566 out = charge*charge*fTablep[ibeta][ialfa][ibe];
f853b9aa 2567 gMC->TrackPosition(s[0],s[1],s[2]);
8d433671 2568 for(j=0; j<=2; j++){
2569 xalic[j] = s[j];
2570 }
2571 // z-coordinate from ZEM front face
2572 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
2573 z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
2574// z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
2575// printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
2576 guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
2577 out = out*guiEff;
2578 nphe = gRandom->Poisson(out);
2579// printf(" out*guiEff = %f nphe = %d", out, nphe);
2580 if(vol[1] == 1){
2581 hits[7] = 0;
2582 hits[8] = nphe; //fLightPMC (ZEM1)
2583 hits[9] = 0;
2584 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2585 }
2586 else{
2587 hits[7] = nphe; //fLightPMQ (ZEM2)
2588 hits[8] = 0;
2589 hits[9] = 0;
2590 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2591 }
2592 }
2593 }
2594 }
2595}