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