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