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