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