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