1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////
19 // AliZDCv3 --- new ZDC geometry //
20 // with both ZDC arms geometry implemented //
22 ///////////////////////////////////////////////////////////////////////
24 // --- Standard libraries
32 #include <TVirtualMC.h>
33 #include <TGeoManager.h>
34 #include <TGeoMatrix.h>
37 #include <TGeoShape.h>
38 #include <TGeoScaledShape.h>
39 #include <TGeoCompositeShape.h>
40 #include <TParticle.h>
42 // --- AliRoot classes
57 //_____________________________________________________________________________
58 AliZDCv3::AliZDCv3() :
86 fVCollSideCAperture(7./2.),
87 fVCollSideCCentreY(0.),
88 fVCollSideAAperture(7./2.),
89 fVCollSideACentreY(0.),
93 // Default constructor for Zero Degree Calorimeter
95 for(Int_t i=0; i<3; i++){
96 fDimZN[i] = fDimZP[i] = 0.;
97 fPosZNC[i] = fPosZNA[i] = fPosZPC[i]= fPosZPA[i] = fPosZEM[i] = 0.;
98 fFibZN[i] = fFibZP[i] = 0.;
102 //_____________________________________________________________________________
103 AliZDCv3::AliZDCv3(const char *name, const char *title) :
131 fVCollSideCAperture(7./2.),
132 fVCollSideCCentreY(0.),
133 fVCollSideAAperture(7./2.),
134 fVCollSideACentreY(0.),
138 // Standard constructor for Zero Degree Calorimeter
141 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
143 AliModule* pipe=gAlice->GetModule("PIPE");
144 AliModule* abso=gAlice->GetModule("ABSO");
145 AliModule* dipo=gAlice->GetModule("DIPO");
146 AliModule* shil=gAlice->GetModule("SHIL");
147 if((!pipe) || (!abso) || (!dipo) || (!shil)) {
148 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
153 for(ip=0; ip<4; ip++){
154 for(kp=0; kp<fNalfap; kp++){
155 for(jp=0; jp<fNbep; jp++){
156 fTablep[ip][kp][jp] = 0;
161 for(in=0; in<4; in++){
162 for(kn=0; kn<fNalfan; kn++){
163 for(jn=0; jn<fNben; jn++){
164 fTablen[in][kn][jn] = 0;
169 // Parameters for hadronic calorimeters geometry
170 // Positions updated after post-installation measurements
179 fPosZNC[2] = -11397.3;
182 fPosZPC[2] = -11389.3;
185 fPosZNA[2] = 11395.8;
188 fPosZPA[2] = 11387.8;
195 // Parameters for EM calorimeter geometry
199 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
200 Float_t kDimZEMAir = 0.001; // scotch
201 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
202 Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
203 Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
204 fZEMLength = kDimZEM0;
208 //_____________________________________________________________________________
209 void AliZDCv3::CreateGeometry()
212 // Create the geometry for the Zero Degree Calorimeter version 2
213 //* Initialize COMMON block ZDC_CGEOM
220 //_____________________________________________________________________________
221 void AliZDCv3::CreateBeamLine()
224 // Create the beam line elements
227 Double_t zd1, zd2, zCorrDip, zInnTrip, zD1, zD2;
228 Double_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
230 //-- rotation matrices for the legs
231 Int_t irotpipe1, irotpipe2;
232 gMC->Matrix(irotpipe1,90.-1.0027,0.,90.,90.,1.0027,180.);
233 gMC->Matrix(irotpipe2,90.+1.0027,0.,90.,90.,1.0027,0.);
236 Int_t *idtmed = fIdtmed->GetArray();
238 ////////////////////////////////////////////////////////////////
240 // SIDE C - RB26 (dimuon side) //
242 ///////////////////////////////////////////////////////////////
245 // -- Mother of the ZDCs (Vacuum PCON)
257 gMC->Gsvolu("ZDCC", "PCON", idtmed[10], conpar, 9);
258 gMC->Gspos("ZDCC", 1, "ALIC", 0., 0., 0., 0, "ONLY");
261 // -- BEAM PIPE from compensator dipole to the beginning of D1)
264 // From beginning of ZDC volumes to beginning of D1
265 tubpar[2] = (5838.3-zd1)/2.;
266 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
267 gMC->Gspos("QT01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
269 //printf(" QT01 TUBE pipe from z = %1.2f to z= %1.2f (D1 beg.)\n",-zd1,-2*tubpar[2]-zd1);
271 //-- BEAM PIPE from the end of D1 to the beginning of D2)
273 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1
274 //-- Cylindrical pipe (r = 3.47) + conical flare
275 // -> Beginning of D1
280 tubpar[2] = (6909.8-zd1)/2.;
281 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
282 gMC->Gspos("QT02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
284 //printf(" QT02 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
290 tubpar[2] = (7022.8-zd1)/2.;
291 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
292 gMC->Gspos("QT03", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
294 //printf(" QT03 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
303 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
304 gMC->Gspos("QC01", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
306 //printf(" QC01 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
308 zd1 += conpar[0] * 2.;
310 // ******************************************************
311 // N.B.-> according to last vacuum layout
312 // private communication by D. Macina, mail 27/1/2009
313 // ******************************************************
314 // 2nd section of VCTCQ+VAMTF+TCTVB+VAMTF+TCLIA+VAMTF+1st part of VCTCP
315 Float_t totLength1 = 160.8 + 78. + 148. + 78. + 148. + 78. + 9.3;
319 tubpar[2] = totLength1/2.;
320 // gMC->Gsvolu("QE01", "ELTU", idtmed[7], tubpar, 3);
321 // temporary replace with a scaled tube (AG)
322 TGeoTube *tubeQE01 = new TGeoTube(0.,tubpar[0],tubpar[2]);
323 TGeoScale *scaleQE01 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
324 TGeoScaledShape *sshapeQE01 = new TGeoScaledShape(tubeQE01, scaleQE01);
325 new TGeoVolume("QE01", sshapeQE01, gGeoManager->GetMedium(idtmed[7]));
329 tubpar[2] = totLength1/2.;
330 // gMC->Gsvolu("QE02", "ELTU", idtmed[10], tubpar, 3);
331 // temporary replace with a scaled tube (AG)
332 TGeoTube *tubeQE02 = new TGeoTube(0.,tubpar[0],tubpar[2]);
333 TGeoScale *scaleQE02 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
334 TGeoScaledShape *sshapeQE02 = new TGeoScaledShape(tubeQE02, scaleQE02);
335 new TGeoVolume("QE02", sshapeQE02, gGeoManager->GetMedium(idtmed[10]));
337 gMC->Gspos("QE01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
338 gMC->Gspos("QE02", 1, "QE01", 0., 0., 0., 0, "ONLY");
340 //printf(" QE01 ELTU from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
342 // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
343 if(fVCollSideCAperture<3.5){
345 boxpar[1] = (3.5-fVCollSideCAperture-fVCollSideCCentreY-0.7)/2.;
346 if(boxpar[1]<0.) boxpar[1]=0.;
347 boxpar[2] = 124.4/2.;
348 printf("\n AliZDCv3 -> Setting SideC VCollimator jaw: aperture %1.2f center %1.2f mod.thickness %1.3f\n\n",
349 2*fVCollSideCAperture,fVCollSideCCentreY,2*boxpar[1]);
350 gMC->Gsvolu("QCVC" , "BOX ", idtmed[13], boxpar, 3);
351 gMC->Gspos("QCVC", 1, "QE02", -boxpar[0], fVCollSideCAperture+fVCollSideCCentreY+boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
352 gMC->Gspos("QCVC", 2, "QE02", -boxpar[0], -fVCollSideCAperture+fVCollSideCCentreY-boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
355 zd1 += tubpar[2] * 2.;
359 conpar[1] = 21.27/2.;
360 conpar[2] = 21.87/2.;
363 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
364 gMC->Gspos("QC02", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
366 //printf(" QC02 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
368 zd1 += conpar[0] * 2.;
370 // 3rd section of VCTCP+VCDWC+VMLGB
371 Float_t totLenght2 = 9.2 + 530.5+40.;
374 tubpar[2] = totLenght2/2.;
375 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
376 gMC->Gspos("QT04", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
378 //printf(" QT04 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
380 zd1 += tubpar[2] * 2.;
382 // First part of VCTCD
383 // skewed transition cone from ID=212.7 mm to ID=797 mm
387 conpar[3] = 21.27/2.;
388 conpar[4] = 21.87/2.;
389 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
390 gMC->Gspos("QC03", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
392 //printf(" QC03 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
396 // VCDGB + 1st part of VCTCH
399 tubpar[2] = (5*475.2+97.)/2.;
400 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
401 gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
403 //printf(" QT05 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
408 // Transition from ID=797 mm to ID=196 mm:
409 // in order to simulate the thin window opened in the transition cone
410 // we divide the transition cone in three cones:
411 // (1) 8 mm thick (2) 3 mm thick (3) the third 8 mm thick
414 conpar[0] = 9.09/2.; // 15 degree
415 conpar[1] = 74.82868/2.;
416 conpar[2] = 76.42868/2.; // thickness 8 mm
418 conpar[4] = 81.3/2.; // thickness 8 mm
419 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
420 gMC->Gspos("QC04", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
422 //printf(" QC04 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
427 conpar[0] = 96.2/2.; // 15 degree
428 conpar[1] = 23.19588/2.;
429 conpar[2] = 23.79588/2.; // thickness 3 mm
430 conpar[3] = 74.82868/2.;
431 conpar[4] = 75.42868/2.; // thickness 3 mm
432 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
433 gMC->Gspos("QC05", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
435 //printf(" QC05 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
440 conpar[0] = 6.71/2.; // 15 degree
442 conpar[2] = 21.2/2.;// thickness 8 mm
443 conpar[3] = 23.19588/2.;
444 conpar[4] = 24.79588/2.;// thickness 8 mm
445 gMC->Gsvolu("QC06", "CONE", idtmed[7], conpar, 5);
446 gMC->Gspos("QC06", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
448 //printf(" QC06 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
456 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
457 gMC->Gspos("QT06", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
459 //printf(" QT06 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
468 gMC->Gsvolu("QC07", "CONE", idtmed[7], conpar, 5);
469 gMC->Gspos("QC07", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
471 //printf(" QC07 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
478 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
479 gMC->Gspos("QT07", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
481 //printf(" QT07 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
490 gMC->Gsvolu("QC08", "CONE", idtmed[7], conpar, 5);
491 gMC->Gspos("QC08", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
493 //printf(" QC08 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
500 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
501 gMC->Gspos("QT08", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
503 //printf(" QT08 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
507 // Flange (ID=196 mm)(last part of VMZAR and first part of VCTYB)
511 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
512 gMC->Gspos("QT09", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
514 //printf(" QT09 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
518 //printf(" Beginning of VCTYB volume @ z = %1.2f \n",-zd1);
520 // simulation of the trousers (VCTYB)
524 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
525 gMC->Gspos("QT10", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
527 //printf(" QT10 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
531 // transition cone from ID=196. to ID=216.6
532 conpar[0] = 32.55/2.;
533 conpar[1] = 21.66/2.;
534 conpar[2] = 22.06/2.;
537 gMC->Gsvolu("QC09", "CONE", idtmed[7], conpar, 5);
538 gMC->Gspos("QC09", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
540 //printf(" QC09 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
545 tubpar[0] = 21.66/2.;
546 tubpar[1] = 22.06/2.;
548 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
549 gMC->Gspos("QT11", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
551 //printf(" QT11 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
555 //printf(" Beginning of recombination chamber @ z = %f \n",-zd1);
557 // --------------------------------------------------------
558 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
559 // author: Chiara (August 2008)
560 // --------------------------------------------------------
561 // TRANSFORMATION MATRICES
562 // Combi transformation:
563 Double_t dx = -3.970000;
564 Double_t dy = 0.000000;
567 Double_t thx = 84.989100; Double_t phx = 180.000000;
568 Double_t thy = 90.000000; Double_t phy = 90.000000;
569 Double_t thz = 185.010900; Double_t phz = 0.000000;
570 TGeoRotation *rotMatrix1c = new TGeoRotation("c",thx,phx,thy,phy,thz,phz);
571 // Combi transformation:
575 TGeoCombiTrans *rotMatrix2c = new TGeoCombiTrans("ZDCC_c1", dx,dy,dz,rotMatrix1c);
576 rotMatrix2c->RegisterYourself();
577 // Combi transformation:
582 thx = 95.010900; phx = 180.000000;
583 thy = 90.000000; phy = 90.000000;
584 thz = 180.-5.010900; phz = 0.000000;
585 TGeoRotation *rotMatrix3c = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
586 TGeoCombiTrans *rotMatrix4c = new TGeoCombiTrans("ZDCC_c2", dx,dy,dz,rotMatrix3c);
587 rotMatrix4c->RegisterYourself();
589 // VOLUMES DEFINITION
591 TGeoVolume *pZDCC = gGeoManager->GetVolume("ZDCC");
593 conpar[0] = (90.1-0.95-0.26-0.0085)/2.;
598 new TGeoCone("QCLext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
600 conpar[0] = (90.1-0.95-0.26-0.0085)/2.;
605 new TGeoCone("QCLint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
608 TGeoCompositeShape *pOutTrousersC = new TGeoCompositeShape("outTrousersC", "QCLext:ZDCC_c1+QCLext:ZDCC_c2");
611 TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRONT");
612 TGeoVolume *pQCLext = new TGeoVolume("QCLext",pOutTrousersC, medZDCFe);
613 pQCLext->SetLineColor(kGreen);
614 pQCLext->SetVisLeaves(kTRUE);
616 TGeoTranslation *tr1c = new TGeoTranslation(0., 0., (Double_t) -conpar[0]-0.95-zd1);
617 //printf(" Recombination chamber from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-0.95-zd1);
619 pZDCC->AddNode(pQCLext, 1, tr1c);
621 TGeoCompositeShape *pIntTrousersC = new TGeoCompositeShape("intTrousersC", "QCLint:ZDCC_c1+QCLint:ZDCC_c2");
623 TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
624 TGeoVolume *pQCLint = new TGeoVolume("QCLint",pIntTrousersC, medZDCvoid);
625 pQCLint->SetLineColor(kTeal);
626 pQCLint->SetVisLeaves(kTRUE);
627 pQCLext->AddNode(pQCLint, 1);
630 Double_t offset = 0.5;
633 // second section : 2 tubes (ID = 54. OD = 58.)
637 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
638 gMC->Gspos("QT12", 1, "ZDCC", -15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
639 gMC->Gspos("QT12", 2, "ZDCC", 15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
641 //printf(" QT12 TUBE from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
645 // transition x2zdc to recombination chamber : skewed cone
646 conpar[0] = (10.-0.2-offset)/2.;
651 gMC->Gsvolu("QC10", "CONE", idtmed[7], conpar, 5);
652 gMC->Gspos("QC10", 1, "ZDCC", -7.9-0.175, 0., -conpar[0]-0.1-zd1, irotpipe1, "ONLY");
653 gMC->Gspos("QC10", 2, "ZDCC", 7.9+0.175, 0., -conpar[0]-0.1-zd1, irotpipe2, "ONLY");
654 //printf(" QC10 CONE from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-0.2-zd1);
656 zd1 += 2.*conpar[0]+0.2;
658 // 2 tubes (ID = 63 mm OD=70 mm)
661 tubpar[2] = 639.8/2.;
662 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
663 gMC->Gspos("QT13", 1, "ZDCC", -16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
664 gMC->Gspos("QT13", 2, "ZDCC", 16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
665 //printf(" QT13 TUBE from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
668 //printf(" END OF SIDE C BEAM PIPE DEFINITION @ z = %f\n",-zd1);
671 // -- Luminometer (Cu box) in front of ZN - side C
674 boxpar[2] = fLumiLength/2.;
675 gMC->Gsvolu("QLUC", "BOX ", idtmed[9], boxpar, 3);
676 gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
677 //printf(" QLUC LUMINOMETER from z = %1.2f to z= %1.2f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
679 // -- END OF BEAM PIPE VOLUME DEFINITION FOR SIDE C (RB26 SIDE)
680 // ----------------------------------------------------------------
682 ////////////////////////////////////////////////////////////////
686 ///////////////////////////////////////////////////////////////
688 // Rotation Matrices definition
689 Int_t irotpipe3, irotpipe4, irotpipe5;
690 //-- rotation matrices for the tilted cone after the TDI to recenter vacuum chamber
691 gMC->Matrix(irotpipe3,90.-1.8934,0.,90.,90.,1.8934,180.);
692 //-- rotation matrices for the tilted tube before and after the TDI
693 gMC->Matrix(irotpipe4,90.-3.8,0.,90.,90.,3.8,180.);
694 //-- rotation matrix for the tilted cone after the TDI
695 gMC->Matrix(irotpipe5,90.+9.8,0.,90.,90.,9.8,0.);
697 // -- Mother of the ZDCs (Vacuum PCON)
698 zd2 = 1910.22;// zd2 initial value
709 gMC->Gsvolu("ZDCA", "PCON", idtmed[10], conpar, 9);
710 gMC->Gspos("ZDCA", 1, "ALIC", 0., 0., 0., 0, "ONLY");
712 // To avoid overlaps 1 micron are left between certain volumes!
713 Double_t dxNoOverlap = 0.0;
714 //zd2 += dxNoOverlap;
716 // BEAM PIPE from 19.10 m to inner triplet beginning (22.965 m)
719 tubpar[2] = 386.28/2. - dxNoOverlap;
720 gMC->Gsvolu("QA01", "TUBE", idtmed[7], tubpar, 3);
721 gMC->Gspos("QA01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
723 //printf(" QA01 TUBE centred in %f from z = %1.2f to z= %1.2f (IT begin)\n",tubpar[2]+zd2,zd2,2*tubpar[2]+zd2);
727 // -- FIRST SECTION OF THE BEAM PIPE (from beginning of inner triplet to
731 tubpar[2] = 3541.8/2. - dxNoOverlap;
732 gMC->Gsvolu("QA02", "TUBE", idtmed[7], tubpar, 3);
733 gMC->Gspos("QA02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
735 //printf(" QA02 TUBE from z = %1.2f to z= %1.2f (D1 begin)\n",zd2,2*tubpar[2]+zd2);
740 // -- SECOND SECTION OF THE BEAM PIPE (from the beginning of D1 to the beginning of D2)
742 // FROM (MAGNETIC) BEGINNING OF D1 TO THE (MAGNETIC) END OF D1 + 126.5 cm
743 // CYLINDRICAL PIPE of diameter increasing from 6.75 cm up to 8.0 cm
744 // from magnetic end :
745 // 1) 80.1 cm still with ID = 6.75 radial beam screen
746 // 2) 2.5 cm conical section from ID = 6.75 to ID = 8.0 cm
747 // 3) 43.9 cm straight section (tube) with ID = 8.0 cm
751 tubpar[2] = (945.0+80.1)/2.;
752 gMC->Gsvolu("QA03", "TUBE", idtmed[7], tubpar, 3);
753 gMC->Gspos("QA03", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
755 //printf(" QA03 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
759 // Transition Cone from ID=67.5 mm to ID=80 mm
765 gMC->Gsvolu("QA04", "CONE", idtmed[7], conpar, 5);
766 gMC->Gspos("QA04", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
767 //printf(" QA04 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
773 tubpar[2] = (43.9+20.+28.5+28.5)/2.;
774 gMC->Gsvolu("QA05", "TUBE", idtmed[7], tubpar, 3);
775 gMC->Gspos("QA05", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
777 //printf(" QA05 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
781 // Second section of VAEHI (transition cone from ID=80mm to ID=98mm)
787 gMC->Gsvolu("QAV1", "CONE", idtmed[7], conpar, 5);
788 gMC->Gspos("QAV1", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
789 //printf(" QAV1 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
793 //Third section of VAEHI (transition cone from ID=98mm to ID=90mm)
799 gMC->Gsvolu("QAV2", "CONE", idtmed[7], conpar, 5);
800 gMC->Gspos("QAV2", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
801 //printf(" QAV2 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
805 // Fourth section of VAEHI (tube ID=90mm)
809 gMC->Gsvolu("QAV3", "TUBE", idtmed[7], tubpar, 3);
810 gMC->Gspos("QAV3", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
812 //printf(" QAV3 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
816 //---------------------------- TCDD beginning ----------------------------------
817 // space for the insertion of the collimator TCDD (2 m)
818 // TCDD ZONE - 1st volume
824 gMC->Gsvolu("Q01T", "CONE", idtmed[7], conpar, 5);
825 gMC->Gspos("Q01T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
826 //printf(" Q01T CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
830 // TCDD ZONE - 2nd volume
834 gMC->Gsvolu("Q02T", "TUBE", idtmed[7], tubpar, 3);
835 gMC->Gspos("Q02T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
837 //printf(" Q02T TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
841 // TCDD ZONE - third volume
847 gMC->Gsvolu("Q03T", "CONE", idtmed[7], conpar, 5);
848 gMC->Gspos("Q03T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
849 //printf(" Q03T CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
853 // TCDD ZONE - 4th volume
857 gMC->Gsvolu("Q04T", "TUBE", idtmed[7], tubpar, 3);
858 gMC->Gspos("Q04T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
860 //printf(" Q04T TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
864 // TCDD ZONE - 5th volume
867 tubpar[2] = 100.12/2.;
868 gMC->Gsvolu("Q05T", "TUBE", idtmed[7], tubpar, 3);
869 gMC->Gspos("Q05T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
871 //printf(" Q05T TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
875 // TCDD ZONE - 6th volume
879 gMC->Gsvolu("Q06T", "TUBE", idtmed[7], tubpar, 3);
880 gMC->Gspos("Q06T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
882 //printf(" Q06T TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
886 // TCDD ZONE - 7th volume
887 conpar[0] = 11.34/2.;
892 gMC->Gsvolu("Q07T", "CONE", idtmed[7], conpar, 5);
893 gMC->Gspos("Q07T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
894 //printf(" Q07T CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
898 // Upper section : one single phi segment of a tube
899 // 5 parameters for tubs: inner radius = 0.,
900 // outer radius = 7. cm, half length = 50 cm
901 // phi1 = 0., phi2 = 180.
903 tubspar[1] = 14.0/2.;
904 tubspar[2] = 100.0/2.;
907 gMC->Gsvolu("Q08T", "TUBS", idtmed[7], tubspar, 5);
909 //printf(" upper part : one single phi segment of a tube (Q08T)\n");
911 // rectangular beam pipe inside TCDD upper section (Vacuum)
915 gMC->Gsvolu("Q09T", "BOX ", idtmed[10], boxpar, 3);
916 // positioning vacuum box in the upper section of TCDD
917 gMC->Gspos("Q09T", 1, "Q08T", 0., 1.1, 0., 0, "ONLY");
919 // lower section : one single phi segment of a tube
921 tubspar[1] = 14.0/2.;
922 tubspar[2] = 100.0/2.;
925 gMC->Gsvolu("Q10T", "TUBS", idtmed[7], tubspar, 5);
926 // rectangular beam pipe inside TCDD lower section (Vacuum)
930 gMC->Gsvolu("Q11T", "BOX ", idtmed[10], boxpar, 3);
931 // positioning vacuum box in the lower section of TCDD
932 gMC->Gspos("Q11T", 1, "Q10T", 0., -1.1, 0., 0, "ONLY");
934 // positioning TCDD elements in ZDCA, (inside TCDD volume)
935 gMC->Gspos("Q08T", 1, "ZDCA", 0., 2., -100.+zd2, 0, "ONLY");
936 gMC->Gspos("Q10T", 1, "ZDCA", 0., -2., -100.+zd2, 0, "ONLY");
942 gMC->Gsvolu("Q12T", "BOX ", idtmed[7], boxpar, 3);
943 // positioning RF screen at both sides of TCDD
944 gMC->Gspos("Q12T", 1, "ZDCA", tubspar[1]+boxpar[0], 0., -100.+zd2, 0, "ONLY");
945 gMC->Gspos("Q12T", 2, "ZDCA", -tubspar[1]-boxpar[0], 0., -100.+zd2, 0, "ONLY");
946 //---------------------------- TCDD end ---------------------------------------
948 // The following elliptical tube 180 mm x 70 mm
949 // (obtained positioning the void QA09 in QA08)
950 // represents VMTSA (780 mm) + space reserved to the TCTVB (1480 mm)+
951 // VMTSA (780 mm) + first part of VCTCP (93 mm)
955 tubpar[2] = 313.3/2.;
956 // gMC->Gsvolu("QA06", "ELTU", idtmed[7], tubpar, 3);
957 // temporary replace with a scaled tube (AG)
958 TGeoTube *tubeQA06 = new TGeoTube(0.,tubpar[0],tubpar[2]);
959 TGeoScale *scaleQA06 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
960 TGeoScaledShape *sshapeQA06 = new TGeoScaledShape(tubeQA06, scaleQA06);
961 new TGeoVolume("QA06", sshapeQA06, gGeoManager->GetMedium(idtmed[7]));
962 //printf(" QA06 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
966 tubpar[2] = 313.3/2.;
967 // gMC->Gsvolu("QA07", "ELTU", idtmed[10], tubpar, 3);
968 // temporary replace with a scaled tube (AG)
969 TGeoTube *tubeQA07 = new TGeoTube(0.,tubpar[0],tubpar[2]);
970 TGeoScale *scaleQA07 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
971 TGeoScaledShape *sshapeQA07 = new TGeoScaledShape(tubeQA07, scaleQA07);
972 new TGeoVolume("QA07", sshapeQA07, gGeoManager->GetMedium(idtmed[10]));
973 //printf(" QA07 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
974 gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
975 gMC->Gspos("QA07", 1, "QA06", 0., 0., 0., 0, "ONLY");
977 // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
978 if(fVCollSideAAperture<3.5){
980 boxpar[1] = (3.5-fVCollSideAAperture-fVCollSideACentreY-0.7)/2.;
981 if(boxpar[1]<0.) boxpar[1]=0.;
982 boxpar[2] = 124.4/2.;
983 gMC->Gsvolu("QCVA" , "BOX ", idtmed[13], boxpar, 3);
984 gMC->Gspos("QCVA", 1, "QA07", -boxpar[0], fVCollSideAAperture+fVCollSideACentreY+boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");
985 gMC->Gspos("QCVA", 2, "QA07", -boxpar[0], -fVCollSideAAperture+fVCollSideACentreY-boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");
990 // VCTCP second part: transition cone from ID=180 to ID=212.7
994 conpar[3] = 21.27/2.;
995 conpar[4] = 21.87/2.;
996 gMC->Gsvolu("QA08", "CONE", idtmed[7], conpar, 5);
997 gMC->Gspos("QA08", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
999 //printf(" QA08 CONE from z = %Third part of VCTCR: tube (ID=196 mm) f to z = %f\n",zd2,2*conpar[0]+zd2);
1001 zd2 += 2.*conpar[0];
1004 // Represents VCTCP third part (92 mm) + VCDWB (765 mm) + VMBGA (400 mm) +
1005 // VCDWE (300 mm) + VMBGA (400 mm)
1006 tubpar[0] = 21.27/2.;
1007 tubpar[1] = 21.87/2.;
1008 tubpar[2] = 195.7/2.;
1009 gMC->Gsvolu("QA09", "TUBE", idtmed[7], tubpar, 3);
1010 gMC->Gspos("QA09", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1011 //printf(" QA09 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1013 zd2 += 2.*tubpar[2];
1015 // skewed transition piece (ID=212.7 mm to 332 mm) (before TDI)
1016 conpar[0] = (50.0-0.73-1.13)/2.;
1017 conpar[1] = 21.27/2.;
1018 conpar[2] = 21.87/2.;
1019 conpar[3] = 33.2/2.;
1020 conpar[4] = 33.8/2.;
1021 gMC->Gsvolu("QA10", "CONE", idtmed[7], conpar, 5);
1022 gMC->Gspos("QA10", 1, "ZDCA", -1.66, 0., conpar[0]+0.73+zd2, irotpipe4, "ONLY");
1024 //printf(" QA10 skewed CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+0.73+1.13+zd2);
1026 zd2 += 2.*conpar[0]+0.73+1.13;
1028 // Vacuum chamber containing TDI
1030 tubpar[1] = 54.6/2.;
1031 tubpar[2] = 540.0/2.;
1032 gMC->Gsvolu("Q13TM", "TUBE", idtmed[10], tubpar, 3);
1033 gMC->Gspos("Q13TM", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1034 tubpar[0] = 54.0/2.;
1035 tubpar[1] = 54.6/2.;
1036 tubpar[2] = 540.0/2.;
1037 gMC->Gsvolu("Q13T", "TUBE", idtmed[7], tubpar, 3);
1038 gMC->Gspos("Q13T", 1, "Q13TM", 0., 0., 0., 0, "ONLY");
1040 //printf(" Q13T TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1042 zd2 += 2.*tubpar[2];
1044 //---------------- INSERT TDI INSIDE Q13T -----------------------------------
1045 boxpar[0] = 11.0/2.;
1047 boxpar[2] = 540.0/2.;
1048 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
1049 gMC->Gspos("QTD1", 1, "Q13TM", -3.8, 10.5, 0., 0, "ONLY");
1050 boxpar[0] = 11.0/2.;
1052 boxpar[2] = 540.0/2.;
1053 gMC->Gsvolu("QTD2", "BOX ", idtmed[7], boxpar, 3);
1054 gMC->Gspos("QTD2", 1, "Q13TM", -3.8, -10.5, 0., 0, "ONLY");
1057 boxpar[2] = 540.0/2.;
1058 gMC->Gsvolu("QTD3", "BOX ", idtmed[7], boxpar, 3);
1059 gMC->Gspos("QTD3", 1, "Q13TM", -3.8+5.5+boxpar[0], 6.1, 0., 0, "ONLY");
1060 gMC->Gspos("QTD3", 2, "Q13TM", -3.8+5.5+boxpar[0], -6.1, 0., 0, "ONLY");
1061 gMC->Gspos("QTD3", 3, "Q13TM", -3.8-5.5-boxpar[0], 6.1, 0., 0, "ONLY");
1062 gMC->Gspos("QTD3", 4, "Q13TM", -3.8-5.5-boxpar[0], -6.1, 0., 0, "ONLY");
1064 tubspar[0] = 12.0/2.;
1065 tubspar[1] = 12.4/2.;
1066 tubspar[2] = 540.0/2.;
1069 gMC->Gsvolu("QTD4", "TUBS", idtmed[7], tubspar, 5);
1070 gMC->Gspos("QTD4", 1, "Q13TM", -3.8-10.6, 0., 0., 0, "ONLY");
1071 tubspar[0] = 12.0/2.;
1072 tubspar[1] = 12.4/2.;
1073 tubspar[2] = 540.0/2.;
1076 gMC->Gsvolu("QTD5", "TUBS", idtmed[7], tubspar, 5);
1077 gMC->Gspos("QTD5", 1, "Q13TM", -3.8+10.6, 0., 0., 0, "ONLY");
1078 //---------------- END DEFINING TDI INSIDE Q13T -------------------------------
1080 // VCTCG skewed transition piece (ID=332 mm to 212.7 mm) (after TDI)
1081 conpar[0] = (50.0-2.92-1.89)/2.;
1082 conpar[1] = 33.2/2.;
1083 conpar[2] = 33.8/2.;
1084 conpar[3] = 21.27/2.;
1085 conpar[4] = 21.87/2.;
1086 gMC->Gsvolu("QA11", "CONE", idtmed[7], conpar, 5);
1087 gMC->Gspos("QA11", 1, "ZDCA", 4.32-3.8, 0., conpar[0]+2.92+zd2, irotpipe5, "ONLY");
1089 //printf(" QA11 skewed CONE from z = %f to z =%f\n",zd2,2*conpar[0]+2.92+1.89+zd2);
1091 zd2 += 2.*conpar[0]+2.92+1.89;
1093 // The following tube ID 212.7 mm
1094 // represents VMBGA (400 mm) + VCDWE (300 mm) + VMBGA (400 mm) +
1095 // BTVTS (600 mm) + VMLGB (400 mm)
1096 tubpar[0] = 21.27/2.;
1097 tubpar[1] = 21.87/2.;
1098 tubpar[2] = 210.0/2.;
1099 gMC->Gsvolu("QA12", "TUBE", idtmed[7], tubpar, 3);
1100 gMC->Gspos("QA12", 1, "ZDCA", 4., 0., tubpar[2]+zd2, 0, "ONLY");
1102 //printf(" QA12 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1104 zd2 += 2.*tubpar[2];
1106 // First part of VCTCC
1107 // skewed transition cone from ID=212.7 mm to ID=797 mm
1108 conpar[0] = (121.0-0.37-1.35)/2.;
1109 conpar[1] = 21.27/2.;
1110 conpar[2] = 21.87/2.;
1111 conpar[3] = 79.7/2.;
1112 conpar[4] = 81.3/2.;
1113 gMC->Gsvolu("QA13", "CONE", idtmed[7], conpar, 5);
1114 gMC->Gspos("QA13", 1, "ZDCA", 4.-2., 0., conpar[0]+0.37+zd2, irotpipe3, "ONLY");
1116 //printf(" QA13 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+0.37+1.35+zd2);
1118 zd2 += 2.*conpar[0]+0.37+1.35;
1120 // The following tube ID 797 mm --- (volume QA16)
1121 // represents the second part of VCTCC (4272 mm) +
1122 // 4 x VCDGA (4 x 4272 mm) +
1123 // the first part of VCTCR (850 mm)
1124 tubpar[0] = 79.7/2.;
1125 tubpar[1] = 81.3/2.;
1126 tubpar[2] = 2221./2.;
1127 gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
1128 gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1130 //printf(" QA14 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1132 zd2 += 2.*tubpar[2];
1134 // Second part of VCTCR
1135 // Transition from ID=797 mm to ID=196 mm:
1136 // in order to simulate the thin window opened in the transition cone
1137 // we divide the transition cone in three cones:
1138 // (1) 8 mm thick (2) 3 mm thick (3) the third 8 mm thick
1141 conpar[0] = 9.09/2.; // 15 degree
1142 conpar[1] = 79.7/2.;
1143 conpar[2] = 81.3/2.; // thickness 8 mm
1144 conpar[3] = 74.82868/2.;
1145 conpar[4] = 76.42868/2.; // thickness 8 mm
1146 gMC->Gsvolu("QA15", "CONE", idtmed[7], conpar, 5);
1147 gMC->Gspos("QA15", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1148 //printf(" QA15 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1150 zd2 += 2.*conpar[0];
1153 conpar[0] = 96.2/2.; // 15 degree
1154 conpar[1] = 74.82868/2.;
1155 conpar[2] = 75.42868/2.; // thickness 3 mm
1156 conpar[3] = 23.19588/2.;
1157 conpar[4] = 23.79588/2.; // thickness 3 mm
1158 gMC->Gsvolu("QA16", "CONE", idtmed[7], conpar, 5);
1159 gMC->Gspos("QA16", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1160 //printf(" QA16 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1162 zd2 += 2.*conpar[0];
1165 conpar[0] = 6.71/2.; // 15 degree
1166 conpar[1] = 23.19588/2.;
1167 conpar[2] = 24.79588/2.;// thickness 8 mm
1168 conpar[3] = 19.6/2.;
1169 conpar[4] = 21.2/2.;// thickness 8 mm
1170 gMC->Gsvolu("QA17", "CONE", idtmed[7], conpar, 5);
1171 gMC->Gspos("QA17", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1172 //printf(" QA19 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1174 zd2 += 2.*conpar[0];
1176 // Third part of VCTCR: tube (ID=196 mm)
1177 tubpar[0] = 19.6/2.;
1178 tubpar[1] = 21.2/2.;
1179 tubpar[2] = 9.55/2.;
1180 gMC->Gsvolu("QA18", "TUBE", idtmed[7], tubpar, 3);
1181 gMC->Gspos("QA18", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1183 //printf(" QA18 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1185 zd2 += 2.*tubpar[2];
1187 // Flange (ID=196 mm) (last part of VCTCR and first part of VMZAR)
1188 tubpar[0] = 19.6/2.;
1189 tubpar[1] = 25.3/2.;
1191 gMC->Gsvolu("QF01", "TUBE", idtmed[7], tubpar, 3);
1192 gMC->Gspos("QF01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1194 //printf(" QF01 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1196 zd2 += 2.*tubpar[2];
1198 // VMZAR (5 volumes)
1199 tubpar[0] = 20.2/2.;
1200 tubpar[1] = 20.6/2.;
1201 tubpar[2] = 2.15/2.;
1202 gMC->Gsvolu("QA19", "TUBE", idtmed[7], tubpar, 3);
1203 gMC->Gspos("QA19", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1205 //printf(" QA19 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1207 zd2 += 2.*tubpar[2];
1210 conpar[1] = 20.2/2.;
1211 conpar[2] = 20.6/2.;
1212 conpar[3] = 23.9/2.;
1213 conpar[4] = 24.3/2.;
1214 gMC->Gsvolu("QA20", "CONE", idtmed[7], conpar, 5);
1215 gMC->Gspos("QA20", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1217 //printf(" QA20 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1219 zd2 += 2.*conpar[0];
1221 tubpar[0] = 23.9/2.;
1222 tubpar[1] = 25.5/2.;
1223 tubpar[2] = 17.0/2.;
1224 gMC->Gsvolu("QA21", "TUBE", idtmed[7], tubpar, 3);
1225 gMC->Gspos("QA21", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1227 //printf(" QA21 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1229 zd2 += 2.*tubpar[2];
1232 conpar[1] = 23.9/2.;
1233 conpar[2] = 24.3/2.;
1234 conpar[3] = 20.2/2.;
1235 conpar[4] = 20.6/2.;
1236 gMC->Gsvolu("QA22", "CONE", idtmed[7], conpar, 5);
1237 gMC->Gspos("QA22", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1239 //printf(" QA22 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1241 zd2 += 2.*conpar[0];
1243 tubpar[0] = 20.2/2.;
1244 tubpar[1] = 20.6/2.;
1245 tubpar[2] = 2.15/2.;
1246 gMC->Gsvolu("QA23", "TUBE", idtmed[7], tubpar, 3);
1247 gMC->Gspos("QA23", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1249 //printf(" QA23 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1251 zd2 += 2.*tubpar[2];
1253 // Flange (ID=196 mm)(last part of VMZAR and first part of VCTYD)
1254 tubpar[0] = 19.6/2.;
1255 tubpar[1] = 25.3/2.;
1257 gMC->Gsvolu("QF02", "TUBE", idtmed[7], tubpar, 3);
1258 gMC->Gspos("QF02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1260 //printf(" QF02 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1262 zd2 += 2.*tubpar[2];
1264 // simulation of the trousers (VCTYB)
1265 tubpar[0] = 19.6/2.;
1266 tubpar[1] = 20.0/2.;
1268 gMC->Gsvolu("QA24", "TUBE", idtmed[7], tubpar, 3);
1269 gMC->Gspos("QA24", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1271 //printf(" QA24 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1273 zd2 += 2.*tubpar[2];
1275 // transition cone from ID=196. to ID=216.6
1276 conpar[0] = 32.55/2.;
1277 conpar[1] = 19.6/2.;
1278 conpar[2] = 20.0/2.;
1279 conpar[3] = 21.66/2.;
1280 conpar[4] = 22.06/2.;
1281 gMC->Gsvolu("QA25", "CONE", idtmed[7], conpar, 5);
1282 gMC->Gspos("QA25", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1284 //printf(" QA25 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1286 zd2 += 2.*conpar[0];
1289 tubpar[0] = 21.66/2.;
1290 tubpar[1] = 22.06/2.;
1291 tubpar[2] = 28.6/2.;
1292 gMC->Gsvolu("QA26", "TUBE", idtmed[7], tubpar, 3);
1293 gMC->Gspos("QA26", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1295 //printf(" QA26 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1297 zd2 += 2.*tubpar[2];
1299 // --------------------------------------------------------
1300 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
1301 // author: Chiara (June 2008)
1302 // --------------------------------------------------------
1303 // TRANSFORMATION MATRICES
1304 // Combi transformation:
1309 thx = 84.989100; phx = 0.000000;
1310 thy = 90.000000; phy = 90.000000;
1311 thz = 5.010900; phz = 180.000000;
1312 TGeoRotation *rotMatrix1 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1313 // Combi transformation:
1317 TGeoCombiTrans *rotMatrix2 = new TGeoCombiTrans("ZDC_c1", dx,dy,dz,rotMatrix1);
1318 rotMatrix2->RegisterYourself();
1319 // Combi transformation:
1324 thx = 95.010900; phx = 0.000000;
1325 thy = 90.000000; phy = 90.000000;
1326 thz = 5.010900; phz = 0.000000;
1327 TGeoRotation *rotMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1328 TGeoCombiTrans *rotMatrix4 = new TGeoCombiTrans("ZDC_c2", dx,dy,dz,rotMatrix3);
1329 rotMatrix4->RegisterYourself();
1332 // VOLUMES DEFINITION
1334 TGeoVolume *pZDCA = gGeoManager->GetVolume("ZDCA");
1336 conpar[0] = (90.1-0.95-0.26)/2.;
1338 conpar[2] = 21.6/2.;
1341 new TGeoCone("QALext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1343 conpar[0] = (90.1-0.95-0.26)/2.;
1345 conpar[2] = 21.2/2.;
1348 new TGeoCone("QALint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1351 TGeoCompositeShape *pOutTrousers = new TGeoCompositeShape("outTrousers", "QALext:ZDC_c1+QALext:ZDC_c2");
1354 //TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
1355 TGeoVolume *pQALext = new TGeoVolume("QALext",pOutTrousers, medZDCFe);
1356 pQALext->SetLineColor(kBlue);
1357 pQALext->SetVisLeaves(kTRUE);
1359 TGeoTranslation *tr1 = new TGeoTranslation(0., 0., (Double_t) conpar[0]+0.95+zd2);
1360 pZDCA->AddNode(pQALext, 1, tr1);
1362 TGeoCompositeShape *pIntTrousers = new TGeoCompositeShape("intTrousers", "QALint:ZDC_c1+QALint:ZDC_c2");
1364 //TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
1365 TGeoVolume *pQALint = new TGeoVolume("QALint",pIntTrousers, medZDCvoid);
1366 pQALint->SetLineColor(kAzure);
1367 pQALint->SetVisLeaves(kTRUE);
1368 pQALext->AddNode(pQALint, 1);
1372 // second section : 2 tubes (ID = 54. OD = 58.)
1375 tubpar[2] = 40.0/2.;
1376 gMC->Gsvolu("QA27", "TUBE", idtmed[7], tubpar, 3);
1377 gMC->Gspos("QA27", 1, "ZDCA", -15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1378 gMC->Gspos("QA27", 2, "ZDCA", 15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1380 //printf(" QA27 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1382 zd2 += 2.*tubpar[2];
1384 // transition x2zdc to recombination chamber : skewed cone
1385 conpar[0] = (10.-1.)/2.;
1390 gMC->Gsvolu("QA28", "CONE", idtmed[7], conpar, 5);
1391 gMC->Gspos("QA28", 1, "ZDCA", -7.9-0.175, 0., conpar[0]+0.5+zd2, irotpipe1, "ONLY");
1392 gMC->Gspos("QA28", 2, "ZDCA", 7.9+0.175, 0., conpar[0]+0.5+zd2, irotpipe2, "ONLY");
1393 //printf(" QA28 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+0.2+zd2);
1395 zd2 += 2.*conpar[0]+1.;
1397 // 2 tubes (ID = 63 mm OD=70 mm)
1400 tubpar[2] = (342.5+498.3)/2.;
1401 gMC->Gsvolu("QA29", "TUBE", idtmed[7], tubpar, 3);
1402 gMC->Gspos("QA29", 1, "ZDCA", -16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1403 gMC->Gspos("QA29", 2, "ZDCA", 16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1404 //printf(" QA29 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1406 zd2 += 2.*tubpar[2];
1408 // -- Luminometer (Cu box) in front of ZN - side A
1411 boxpar[2] = fLumiLength/2.;
1412 gMC->Gsvolu("QLUA", "BOX ", idtmed[9], boxpar, 3);
1413 gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
1414 //printf(" QLUA LUMINOMETER from z = %1.2f to z= %1.2f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
1416 //printf(" END OF BEAM PIPE VOLUME DEFINITION AT z = %f\n",zd2);
1419 // ----------------------------------------------------------------
1420 // -- MAGNET DEFINITION -> LHC OPTICS 6.5
1421 // ----------------------------------------------------------------
1422 // ***************************************************************
1423 // SIDE C - RB26 (dimuon side)
1424 // ***************************************************************
1425 // -- COMPENSATOR DIPOLE (MBXW)
1428 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1431 tubpar[2] = 153./2.;
1432 gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
1437 tubpar[2] = 153./2.;
1438 gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
1440 gMC->Gspos("MBXW", 1, "ZDCC", 0., 0., -tubpar[2]-zCorrDip, 0, "ONLY");
1441 gMC->Gspos("YMBX", 1, "ZDCC", 0., 0., -tubpar[2]-zCorrDip, 0, "ONLY");
1447 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
1449 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1452 tubpar[2] = 637./2.;
1453 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
1458 tubpar[2] = 637./2.;
1459 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
1461 gMC->Gspos("MQXL", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip, 0, "ONLY");
1462 gMC->Gspos("YMQL", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip, 0, "ONLY");
1464 gMC->Gspos("MQXL", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-2400., 0, "ONLY");
1465 gMC->Gspos("YMQL", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-2400., 0, "ONLY");
1468 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1471 tubpar[2] = 550./2.;
1472 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
1477 tubpar[2] = 550./2.;
1478 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
1480 gMC->Gspos("MQX ", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-908.5, 0, "ONLY");
1481 gMC->Gspos("YMQ ", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-908.5, 0, "ONLY");
1483 gMC->Gspos("MQX ", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-1558.5, 0, "ONLY");
1484 gMC->Gspos("YMQ ", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-1558.5, 0, "ONLY");
1486 // -- SEPARATOR DIPOLE D1
1489 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1492 tubpar[2] = 945./2.;
1493 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
1495 // -- Insert horizontal Cu plates inside D1
1496 // -- (to simulate the vacuum chamber)
1497 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2)) - 0.05;
1499 boxpar[2] = 945./2.;
1500 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
1501 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
1502 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
1506 tubpar[1] = 110./2.;
1507 tubpar[2] = 945./2.;
1508 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
1510 gMC->Gspos("YD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD1, 0, "ONLY");
1511 gMC->Gspos("MD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD1, 0, "ONLY");
1513 //printf(" MD1 from z = %1.2f to z= %1.2f cm\n",-zD1, -zD1-2*tubpar[2]);
1517 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1520 tubpar[2] = 945./2.;
1521 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
1526 tubpar[2] = 945./2.;
1527 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
1529 gMC->Gspos("YD2 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD2, 0, "ONLY");
1531 //printf(" YD2 from z = %1.2f to z= %1.2f cm\n",-zD2, -zD2-2*tubpar[2]);
1533 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
1534 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
1536 // ***************************************************************
1538 // ***************************************************************
1540 // COMPENSATOR DIPOLE (MCBWA) (2nd compensator)
1541 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1544 tubpar[2] = 153./2.;
1545 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
1546 gMC->Gspos("MCBW", 1, "ZDCA", 0., 0., tubpar[2]+zCorrDip, 0, "ONLY");
1551 tubpar[2] = 153./2.;
1552 gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
1553 gMC->Gspos("YMCB", 1, "ZDCA", 0., 0., tubpar[2]+zCorrDip, 0, "ONLY");
1556 // -- DEFINE MQX1 AND MQX2 QUADRUPOLE ELEMENT
1558 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1561 tubpar[2] = 637./2.;
1562 gMC->Gsvolu("MQX1", "TUBE", idtmed[11], tubpar, 3);
1563 gMC->Gsvolu("MQX4", "TUBE", idtmed[11], tubpar, 3);
1568 tubpar[2] = 637./2.;
1569 gMC->Gsvolu("YMQ1", "TUBE", idtmed[7], tubpar, 3);
1572 gMC->Gspos("MQX1", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip, 0, "ONLY");
1573 gMC->Gspos("YMQ1", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip, 0, "ONLY");
1575 // -- BEAM SCREEN FOR Q1
1576 tubpar[0] = 4.78/2.;
1577 tubpar[1] = 5.18/2.;
1578 tubpar[2] = 637./2.;
1579 gMC->Gsvolu("QBS1", "TUBE", idtmed[6], tubpar, 3);
1580 gMC->Gspos("QBS1", 1, "MQX1", 0., 0., 0., 0, "ONLY");
1581 // INSERT VERTICAL PLATE INSIDE Q1
1582 boxpar[0] = 0.2/2.0;
1583 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(1.9+0.2)*(1.9+0.2));
1585 gMC->Gsvolu("QBS2", "BOX ", idtmed[6], boxpar, 3);
1586 gMC->Gspos("QBS2", 1, "MQX1", 1.9+boxpar[0], 0., 0., 0, "ONLY");
1587 gMC->Gspos("QBS2", 2, "MQX1", -1.9-boxpar[0], 0., 0., 0, "ONLY");
1590 gMC->Gspos("MQX4", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+2400., 0, "ONLY");
1591 gMC->Gspos("YMQ1", 2, "ZDCA", 0., 0., tubpar[2]+zInnTrip+2400., 0, "ONLY");
1593 // -- BEAM SCREEN FOR Q3
1594 tubpar[0] = 5.79/2.;
1595 tubpar[1] = 6.14/2.;
1596 tubpar[2] = 637./2.;
1597 gMC->Gsvolu("QBS3", "TUBE", idtmed[6], tubpar, 3);
1598 gMC->Gspos("QBS3", 1, "MQX4", 0., 0., 0., 0, "ONLY");
1599 // INSERT VERTICAL PLATE INSIDE Q3
1600 boxpar[0] = 0.2/2.0;
1601 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1603 gMC->Gsvolu("QBS4", "BOX ", idtmed[6], boxpar, 3);
1604 gMC->Gspos("QBS4", 1, "MQX4", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1605 gMC->Gspos("QBS4", 2, "MQX4", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1610 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1613 tubpar[2] = 550./2.;
1614 gMC->Gsvolu("MQX2", "TUBE", idtmed[11], tubpar, 3);
1615 gMC->Gsvolu("MQX3", "TUBE", idtmed[11], tubpar, 3);
1620 tubpar[2] = 550./2.;
1621 gMC->Gsvolu("YMQ2", "TUBE", idtmed[7], tubpar, 3);
1623 // -- BEAM SCREEN FOR Q2
1624 tubpar[0] = 5.79/2.;
1625 tubpar[1] = 6.14/2.;
1626 tubpar[2] = 550./2.;
1627 gMC->Gsvolu("QBS5", "TUBE", idtmed[6], tubpar, 3);
1628 // VERTICAL PLATE INSIDE Q2
1629 boxpar[0] = 0.2/2.0;
1630 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1632 gMC->Gsvolu("QBS6", "BOX ", idtmed[6], boxpar, 3);
1635 gMC->Gspos("MQX2", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+908.5, 0, "ONLY");
1636 gMC->Gspos("QBS5", 1, "MQX2", 0., 0., 0., 0, "ONLY");
1637 gMC->Gspos("QBS6", 1, "MQX2", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1638 gMC->Gspos("QBS6", 2, "MQX2", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1639 gMC->Gspos("YMQ2", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+908.5, 0, "ONLY");
1643 gMC->Gspos("MQX3", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+1558.5, 0, "ONLY");
1644 gMC->Gspos("QBS5", 2, "MQX3", 0., 0., 0., 0, "ONLY");
1645 gMC->Gspos("QBS6", 3, "MQX3", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1646 gMC->Gspos("QBS6", 4, "MQX3", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1647 gMC->Gspos("YMQ2", 2, "ZDCA", 0., 0., tubpar[2]+zInnTrip+1558.5, 0, "ONLY");
1649 // -- SEPARATOR DIPOLE D1
1650 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1652 tubpar[1] = 6.75/2.;//3.375
1653 tubpar[2] = 945./2.;
1654 gMC->Gsvolu("MD1L", "TUBE", idtmed[11], tubpar, 3);
1656 // -- The beam screen tube is provided by the beam pipe in D1 (QA03 volume)
1657 // -- Insert the beam screen horizontal Cu plates inside D1
1658 // -- (to simulate the vacuum chamber)
1659 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.885+0.2)*(2.885+0.2));
1662 gMC->Gsvolu("QBS7", "BOX ", idtmed[6], boxpar, 3);
1663 gMC->Gspos("QBS7", 1, "MD1L", 0., 2.885+boxpar[1],0., 0, "ONLY");
1664 gMC->Gspos("QBS7", 2, "MD1L", 0., -2.885-boxpar[1],0., 0, "ONLY");
1669 tubpar[2] = 945./2.;
1670 gMC->Gsvolu("YD1L", "TUBE", idtmed[7], tubpar, 3);
1672 gMC->Gspos("YD1L", 1, "ZDCA", 0., 0., tubpar[2]+zD1, 0, "ONLY");
1673 gMC->Gspos("MD1L", 1, "ZDCA", 0., 0., tubpar[2]+zD1, 0, "ONLY");
1676 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1678 tubpar[1] = 7.5/2.; // this has to be checked
1679 tubpar[2] = 945./2.;
1680 gMC->Gsvolu("MD2L", "TUBE", idtmed[11], tubpar, 3);
1685 tubpar[2] = 945./2.;
1686 gMC->Gsvolu("YD2L", "TUBE", idtmed[7], tubpar, 3);
1688 gMC->Gspos("YD2L", 1, "ZDCA", 0., 0., tubpar[2]+zD2, 0, "ONLY");
1690 gMC->Gspos("MD2L", 1, "YD2L", -9.4, 0., 0., 0, "ONLY");
1691 gMC->Gspos("MD2L", 2, "YD2L", 9.4, 0., 0., 0, "ONLY");
1693 // -- END OF MAGNET DEFINITION
1696 //_____________________________________________________________________________
1697 void AliZDCv3::CreateZDC()
1700 // Create the various ZDCs (ZN + ZP)
1703 Float_t dimPb[6], dimVoid[6];
1705 Int_t *idtmed = fIdtmed->GetArray();
1707 // Parameters for hadronic calorimeters geometry
1708 // NB -> parameters used ONLY in CreateZDC()
1709 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
1710 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
1711 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
1712 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
1713 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
1714 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
1716 // Parameters for EM calorimeter geometry
1717 // NB -> parameters used ONLY in CreateZDC()
1718 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
1719 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
1720 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
1721 Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
1722 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
1723 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
1726 //-- Create calorimeters geometry
1728 // -------------------------------------------------------------------------------
1729 //--> Neutron calorimeter (ZN)
1731 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
1732 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
1733 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
1734 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
1735 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
1736 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
1737 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
1738 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
1739 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
1741 // Divide ZNEU in towers (for hits purposes)
1743 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
1744 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
1746 //-- Divide ZN1 in minitowers
1747 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
1748 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
1749 // (4 fibres per minitower)
1751 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
1752 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
1754 // --- Position the empty grooves in the sticks (4 grooves per stick)
1755 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
1756 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
1758 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1759 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1760 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1761 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1763 // --- Position the fibers in the grooves
1764 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
1765 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
1766 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
1767 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
1769 // --- Position the neutron calorimeter in ZDC
1770 // -- Rotation of ZDCs
1772 gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
1774 gMC->Gspos("ZNEU", 1, "ZDCC", fPosZNC[0], fPosZNC[1], fPosZNC[2]-fDimZN[2], irotzdc, "ONLY");
1776 //printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
1778 // --- Position the neutron calorimeter in ZDC2 (left line)
1779 // -- No Rotation of ZDCs
1780 gMC->Gspos("ZNEU", 2, "ZDCA", fPosZNA[0], fPosZNA[1], fPosZNA[2]+fDimZN[2], 0, "ONLY");
1782 //printf("\n ZN left -> %f < z < %f cm\n",fPosZNl[2],fPosZNl[2]+2*fDimZN[2]);
1785 // -------------------------------------------------------------------------------
1786 //--> Proton calorimeter (ZP)
1788 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
1789 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
1790 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
1791 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
1792 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
1793 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
1794 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
1795 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
1796 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
1798 //-- Divide ZPRO in towers(for hits purposes)
1800 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
1801 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
1804 //-- Divide ZP1 in minitowers
1805 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
1806 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
1807 // (4 fiber per minitower)
1809 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
1810 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
1812 // --- Position the empty grooves in the sticks (4 grooves per stick)
1813 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
1814 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
1816 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1817 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1818 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1819 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1821 // --- Position the fibers in the grooves
1822 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
1823 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
1824 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
1825 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
1828 // --- Position the proton calorimeter in ZDCC
1829 gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
1831 //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
1833 // --- Position the proton calorimeter in ZDCA
1835 gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
1837 //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);
1840 // -------------------------------------------------------------------------------
1841 // -> EM calorimeter (ZEM)
1843 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
1846 gMC->Matrix(irot1,0.,0.,90.,90.,-90.,0.); // Rotation matrix 1
1847 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]);// Rotation matrix 2
1848 //printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
1850 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
1852 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
1854 dimPb[0] = kDimZEMPb; // Lead slices
1855 dimPb[1] = fDimZEM[2];
1856 dimPb[2] = fDimZEM[1];
1857 //dimPb[3] = fDimZEM[3]; //controllare
1858 dimPb[3] = 90.-fDimZEM[3]; //originale
1861 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
1862 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
1863 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
1865 // --- Position the lead slices in the tranche
1866 Float_t zTran = fDimZEM[0]/fDivZEM[2];
1867 Float_t zTrPb = -zTran+kDimZEMPb;
1868 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
1869 gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
1871 // --- Vacuum zone (to be filled with fibres)
1872 dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
1873 dimVoid[1] = fDimZEM[2];
1874 dimVoid[2] = fDimZEM[1];
1875 dimVoid[3] = 90.-fDimZEM[3];
1878 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
1879 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
1881 // --- Divide the vacuum slice into sticks along x axis
1882 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
1883 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
1885 // --- Positioning the fibers into the sticks
1886 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
1887 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
1889 // --- Positioning the vacuum slice into the tranche
1890 //Float_t displFib = fDimZEM[1]/fDivZEM[0];
1891 gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
1892 gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., 0., 0, "ONLY");
1894 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
1895 // NB -> ZEM is positioned in ALIC (instead of in ZDC) volume
1896 gMC->Gspos("ZEM ", 1,"ALIC", -fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1898 // Second EM ZDC (same side w.r.t. IP, just on the other side w.r.t. beam pipe)
1899 gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1901 // --- Adding last slice at the end of the EM calorimeter
1902 Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
1903 gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
1905 //printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
1906 //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
1910 //_____________________________________________________________________________
1911 void AliZDCv3::CreateMaterials()
1914 // Create Materials for the Zero Degree Calorimeter
1916 Float_t dens, ubuf[1], wmat[3], a[3], z[3];
1918 // --- W alloy -> ZN passive material
1929 AliMixture(1, "WALL", a, z, dens, 3, wmat);
1931 // --- Brass (CuZn) -> ZP passive material
1939 AliMixture(2, "BRASS", a, z, dens, 2, wmat);
1949 AliMixture(3, "SIO2", a, z, dens, -2, wmat);
1953 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 0., ubuf, 1);
1955 // --- Copper (energy loss taken into account)
1957 AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1961 AliMaterial(9, "COPP1", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1963 // --- Iron (energy loss taken into account)
1965 AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1967 // --- Iron (no energy loss)
1969 AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1973 AliMaterial(13, "TANT", 183.84, 74., 19.3, 0.35, 0., ubuf, 1);
1975 // ---------------------------------------------------------
1976 Float_t aResGas[3]={1.008,12.0107,15.9994};
1977 Float_t zResGas[3]={1.,6.,8.};
1978 Float_t wResGas[3]={0.28,0.28,0.44};
1979 Float_t dResGas = 3.2E-14;
1981 // --- Vacuum (no magnetic field)
1982 AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
1984 // --- Vacuum (with magnetic field)
1985 AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
1987 // --- Air (no magnetic field)
1988 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1989 Float_t zAir[4]={6.,7.,8.,18.};
1990 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1991 Float_t dAir = 1.20479E-3;
1993 AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
1995 // --- Definition of tracking media:
1997 // --- Tantalum = 1 ;
1999 // --- Fibers (SiO2) = 3 ;
2000 // --- Fibers (SiO2) = 4 ;
2002 // --- Copper (with high thr.)= 6 ;
2003 // --- Copper (with low thr.)= 9;
2004 // --- Iron (with energy loss) = 7 ;
2005 // --- Iron (without energy loss) = 8 ;
2006 // --- Vacuum (no field) = 10
2007 // --- Vacuum (with field) = 11
2008 // --- Air (no field) = 12
2010 // ****************************************************
2011 // Tracking media parameters
2013 Float_t epsil = 0.01; // Tracking precision,
2014 Float_t stmin = 0.01; // Min. value 4 max. step (cm)
2015 Float_t stemax = 1.; // Max. step permitted (cm)
2016 Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
2017 Float_t tmaxfdv = 0.1; // Maximum angle due to field (degrees)
2018 Float_t deemax = -1.; // Maximum fractional energy loss
2019 Float_t nofieldm = 0.; // Max. field value (no field)
2020 Float_t fieldm = 45.; // Max. field value (with field)
2021 Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
2022 Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
2023 Int_t inofld = 0; // IFIELD=0 -> no magnetic field
2024 Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
2025 // *****************************************************
2027 AliMedium(1, "ZWALL", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2028 AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2029 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2030 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2031 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2032 AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2033 AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2034 AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2035 AliMedium(9, "ZCOPL", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2036 AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2037 AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfdv, stemax, deemax, epsil, stmin);
2038 AliMedium(12,"ZAIR", 12, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2039 AliMedium(13,"ZTANT",13, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2040 AliMedium(14, "ZIRONT", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2044 //_____________________________________________________________________________
2045 void AliZDCv3::AddAlignableVolumes() const
2048 // Create entries for alignable volumes associating the symbolic volume
2049 // name with the corresponding volume path. Needs to be syncronized with
2050 // eventual changes in the geometry.
2052 TString volpath1 = "ALIC_1/ZDCC_1/ZNEU_1";
2053 TString volpath2 = "ALIC_1/ZDCC_1/ZPRO_1";
2054 TString volpath3 = "ALIC_1/ZDCA_1/ZNEU_2";
2055 TString volpath4 = "ALIC_1/ZDCA_1/ZPRO_2";
2057 TString symname1="ZDC/NeutronZDC_C";
2058 TString symname2="ZDC/ProtonZDC_C";
2059 TString symname3="ZDC/NeutronZDC_A";
2060 TString symname4="ZDC/ProtonZDC_A";
2062 if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
2063 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2065 if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
2066 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2068 if(!gGeoManager->SetAlignableEntry(symname3.Data(),volpath3.Data()))
2069 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2071 if(!gGeoManager->SetAlignableEntry(symname4.Data(),volpath4.Data()))
2072 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2077 //_____________________________________________________________________________
2078 void AliZDCv3::Init()
2081 Int_t *idtmed = fIdtmed->GetArray();
2083 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
2084 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
2085 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
2086 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
2087 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
2088 fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
2089 fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
2090 fMedSensLumi = idtmed[9]; // Sensitive volume: luminometer
2091 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
2092 fMedSensVColl = idtmed[13]; // Sensitive volume: collimator jaws
2095 //_____________________________________________________________________________
2096 void AliZDCv3::InitTables()
2099 // Read light tables for Cerenkov light production parameterization
2105 // --- Reading light tables for ZN
2106 char *lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
2107 FILE *fp1 = fopen(lightfName1,"r");
2109 printf("Cannot open file fp1 \n");
2113 for(k=0; k<fNalfan; k++){
2114 for(j=0; j<fNben; j++){
2115 read = fscanf(fp1,"%f",&fTablen[0][k][j]);
2116 if(read==0) AliDebug(3, " Error in reading light table 1");
2121 char *lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
2122 FILE *fp2 = fopen(lightfName2,"r");
2124 printf("Cannot open file fp2 \n");
2128 for(k=0; k<fNalfan; k++){
2129 for(j=0; j<fNben; j++){
2130 read = fscanf(fp2,"%f",&fTablen[1][k][j]);
2131 if(read==0) AliDebug(3, " Error in reading light table 2");
2136 char *lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
2137 FILE *fp3 = fopen(lightfName3,"r");
2139 printf("Cannot open file fp3 \n");
2143 for(k=0; k<fNalfan; k++){
2144 for(j=0; j<fNben; j++){
2145 read = fscanf(fp3,"%f",&fTablen[2][k][j]);
2146 if(read==0) AliDebug(3, " Error in reading light table 3");
2151 char *lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
2152 FILE *fp4 = fopen(lightfName4,"r");
2154 printf("Cannot open file fp4 \n");
2158 for(k=0; k<fNalfan; k++){
2159 for(j=0; j<fNben; j++){
2160 read = fscanf(fp4,"%f",&fTablen[3][k][j]);
2161 if(read==0) AliDebug(3, " Error in reading light table 4");
2167 // --- Reading light tables for ZP and ZEM
2168 char *lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
2169 FILE *fp5 = fopen(lightfName5,"r");
2171 printf("Cannot open file fp5 \n");
2175 for(k=0; k<fNalfap; k++){
2176 for(j=0; j<fNbep; j++){
2177 read = fscanf(fp5,"%f",&fTablep[0][k][j]);
2178 if(read==0) AliDebug(3, " Error in reading light table 5");
2183 char *lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
2184 FILE *fp6 = fopen(lightfName6,"r");
2186 printf("Cannot open file fp6 \n");
2190 for(k=0; k<fNalfap; k++){
2191 for(j=0; j<fNbep; j++){
2192 read = fscanf(fp6,"%f",&fTablep[1][k][j]);
2193 if(read==0) AliDebug(3, " Error in reading light table 6");
2198 char *lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
2199 FILE *fp7 = fopen(lightfName7,"r");
2201 printf("Cannot open file fp7 \n");
2205 for(k=0; k<fNalfap; k++){
2206 for(j=0; j<fNbep; j++){
2207 read = fscanf(fp7,"%f",&fTablep[2][k][j]);
2208 if(read==0) AliDebug(3, " Error in reading light table 7");
2213 char *lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
2214 FILE *fp8 = fopen(lightfName8,"r");
2216 printf("Cannot open file fp8 \n");
2220 for(k=0; k<fNalfap; k++){
2221 for(j=0; j<fNbep; j++){
2222 read = fscanf(fp8,"%f",&fTablep[3][k][j]);
2223 if(read==0) AliDebug(3, " Error in reading light table 8");
2230 //_____________________________________________________________________________
2231 void AliZDCv3::StepManager()
2234 // Routine called at every step in the Zero Degree Calorimeters
2236 Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
2237 Float_t hits[13], x[3], xdet[3]={999.,999.,999.}, um[3], ud[3];
2238 Float_t destep=0., be=0., out=0.;
2239 Double_t s[3], p[4];
2242 for(j=0;j<13;j++) hits[j]=-999.;
2244 // --- This part is for no shower developement in beam pipe, TDI, VColl
2245 // If particle interacts with beam pipe, TDI, VColl -> return
2246 if(fNoShower==1 && ((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI) ||
2247 (gMC->CurrentMedium() == fMedSensVColl || (gMC->CurrentMedium() == fMedSensLumi)))){
2249 // If option NoShower is set -> StopTrack
2252 gMC->TrackPosition(s[0],s[1],s[2]);
2253 if(gMC->CurrentMedium() == fMedSensPI){
2254 knamed = gMC->CurrentVolName();
2255 if(!strncmp(knamed,"YMQ",3)){
2256 if(s[2]<0) fpLostITC += 1;
2257 else fpLostITA += 1;
2260 else if(!strncmp(knamed,"YD1",3)){
2261 if(s[2]<0) fpLostD1C += 1;
2262 else fpLostD1A += 1;
2266 else if(gMC->CurrentMedium() == fMedSensTDI){
2267 knamed = gMC->CurrentVolName();
2268 if(!strncmp(knamed,"MD1",3)){
2269 if(s[2]<0) fpLostD1C += 1;
2270 else fpLostD1A += 1;
2273 else if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
2275 else if(gMC->CurrentMedium() == fMedSensVColl){
2276 knamed = gMC->CurrentVolName();
2277 if(!strncmp(knamed,"QCVC",4)) fpcVCollC++;
2278 else if(!strncmp(knamed,"QCVA",4)) fpcVCollA++;
2282 //gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
2283 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2284 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2287 printf("\n\t **********************************\n");
2288 printf("\t ********** Side C **********\n");
2289 printf("\t # of particles in IT = %d\n",fpLostITC);
2290 printf("\t # of particles in D1 = %d\n",fpLostD1C);
2291 printf("\t # of particles in VColl = %d\n",fpcVCollC);
2292 printf("\t ********** Side A **********\n");
2293 printf("\t # of particles in IT = %d\n",fpLostITA);
2294 printf("\t # of particles in D1 = %d\n",fpLostD1A);
2295 printf("\t # of particles in TDI = %d\n",fpLostTDI);
2296 printf("\t # of particles in VColl = %d\n",fpcVCollA);
2297 printf("\t **********************************\n");
2303 if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
2304 (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
2305 (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
2308 //Particle coordinates
2309 gMC->TrackPosition(s[0],s[1],s[2]);
2310 for(j=0; j<=2; j++) x[j] = s[j];
2315 // Determine in which ZDC the particle is
2316 knamed = gMC->CurrentVolName();
2317 if(!strncmp(knamed,"ZN",2)){
2318 if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
2319 else if(x[2]>0.) vol[0]=4; //ZNA
2321 else if(!strncmp(knamed,"ZP",2)){
2322 if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
2323 else if(x[2]>0.) vol[0]=5; //ZPA
2325 else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
2327 // Determine in which quadrant the particle is
2328 if(vol[0]==1){ //Quadrant in ZNC
2329 // Calculating particle coordinates inside ZNC
2330 xdet[0] = x[0]-fPosZNC[0];
2331 xdet[1] = x[1]-fPosZNC[1];
2332 // Calculating quadrant in ZN
2334 if(xdet[1]<=0.) vol[1]=1;
2337 else if(xdet[0]>0.){
2338 if(xdet[1]<=0.) vol[1]=2;
2343 else if(vol[0]==2){ //Quadrant in ZPC
2344 // Calculating particle coordinates inside ZPC
2345 xdet[0] = x[0]-fPosZPC[0];
2346 xdet[1] = x[1]-fPosZPC[1];
2347 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2348 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2349 // Calculating tower in ZP
2350 Float_t xqZP = xdet[0]/(fDimZP[0]/2.);
2351 for(int i=1; i<=4; i++){
2352 if(xqZP>=(i-3) && xqZP<(i-2)){
2359 // Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
2360 // vol[1] = 2 -> particle in 2nd ZEM (placed at x = -8.5 cm)
2361 else if(vol[0] == 3){
2364 // Particle x-coordinate inside ZEM1
2365 xdet[0] = x[0]-fPosZEM[0];
2369 // Particle x-coordinate inside ZEM2
2370 xdet[0] = x[0]+fPosZEM[0];
2372 xdet[1] = x[1]-fPosZEM[1];
2375 else if(vol[0]==4){ //Quadrant in ZNA
2376 // Calculating particle coordinates inside ZNA
2377 xdet[0] = x[0]-fPosZNA[0];
2378 xdet[1] = x[1]-fPosZNA[1];
2379 // Calculating quadrant in ZNA
2381 if(xdet[1]<=0.) vol[1]=1;
2384 else if(xdet[0]<0.){
2385 if(xdet[1]<=0.) vol[1]=2;
2390 else if(vol[0]==5){ //Quadrant in ZPA
2391 // Calculating particle coordinates inside ZPA
2392 xdet[0] = x[0]-fPosZPA[0];
2393 xdet[1] = x[1]-fPosZPA[1];
2394 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2395 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2396 // Calculating tower in ZP
2397 Float_t xqZP = -xdet[0]/(fDimZP[0]/2.);
2398 for(int i=1; i<=4; i++){
2399 if(xqZP>=(i-3) && xqZP<(i-2)){
2405 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2406 AliError(Form(" WRONG tower for det %d: tow %d with xdet=(%f, %f)\n",
2407 vol[0], vol[1], xdet[0], xdet[1]));
2409 //printf("\t *** det %d vol %d xdet(%f, %f)\n",vol[0], vol[1], xdet[0], xdet[1]);
2412 // Store impact point and kinetic energy of the ENTERING particle
2414 if(gMC->IsTrackEntering()){
2416 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2419 // Impact point on ZDC
2420 // X takes into account the LHC x-axis sign
2421 // which is opposite to positive x on detector front face
2422 // for side A detectors (ZNA and ZPA)
2423 if(vol[0]==4 || vol[0]==5){
2435 Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
2436 TParticle *part = gAlice->GetMCApp()->Particle(curTrackN);
2437 hits[10] = part->GetPdgCode();
2438 //printf("\t PDGCode = %d\n", part->GetPdgCode());
2440 Int_t imo = part->GetFirstMother();
2442 TParticle * pmot = gAlice->GetMCApp()->Particle(imo);
2443 hits[11] = pmot->GetPdgCode();
2447 hits[12] = 1.0e09*gMC->TrackTime(); // in ns!
2448 //printf("\t TrackTime = %f\n", hits[12]);
2450 AddHit(curTrackN, vol, hits);
2455 if(fnDetectedC==1) printf(" ### Particle in ZNC\n\n");
2459 if(fpDetectedC==1) printf(" ### Particle in ZPC\n\n");
2463 if(fnDetectedA==1) printf(" ### Particle in ZNA\n\n");
2467 if(fpDetectedA==1) printf(" ### Particle in ZPA\n\n");
2470 //printf("\t Pc: x %1.2f y %1.2f z %1.2f E %1.2f GeV pz = %1.2f GeV in volume %s\n",
2471 // x[0],x[1],x[3],p[3],p[2],gMC->CurrentVolName());
2478 // Particle energy loss
2479 if(gMC->Edep() != 0){
2480 hits[9] = gMC->Edep();
2483 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2488 // *** Light production in fibres
2489 if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
2491 //Select charged particles
2492 if((destep=gMC->Edep())){
2494 // Particle velocity
2496 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2497 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2498 if(p[3] > 0.00001) beta = ptot/p[3];
2500 if(beta<0.67)return;
2501 else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
2502 else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
2503 else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
2504 else if(beta>0.95) ibeta = 3;
2506 // Angle between particle trajectory and fibre axis
2507 // 1 -> Momentum directions
2511 gMC->Gmtod(um,ud,2);
2512 // 2 -> Angle < limit angle
2513 Double_t alfar = TMath::ACos(ud[2]);
2514 Double_t alfa = alfar*kRaddeg;
2515 if(alfa>=110.) return;
2517 ialfa = Int_t(1.+alfa/2.);
2519 // Distance between particle trajectory and fibre axis
2520 gMC->TrackPosition(s[0],s[1],s[2]);
2521 for(j=0; j<=2; j++){
2524 gMC->Gmtod(x,xdet,1);
2525 if(TMath::Abs(ud[0])>0.00001){
2526 Float_t dcoeff = ud[1]/ud[0];
2527 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
2530 be = TMath::Abs(ud[0]);
2533 ibe = Int_t(be*1000.+1);
2535 //Looking into the light tables
2536 Float_t charge = gMC->TrackCharge();
2538 if(vol[0]==1 || vol[0]==4) { // (1) ZN fibres
2539 if(ibe>fNben) ibe=fNben;
2540 out = charge*charge*fTablen[ibeta][ialfa][ibe];
2541 nphe = gRandom->Poisson(out);
2543 //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
2544 //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
2545 if(gMC->CurrentMedium() == fMedSensF1){
2546 hits[7] = nphe; //fLightPMQ
2549 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2553 hits[8] = nphe; //fLightPMC
2555 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2558 else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
2559 if(ibe>fNbep) ibe=fNbep;
2560 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2561 nphe = gRandom->Poisson(out);
2562 if(gMC->CurrentMedium() == fMedSensF1){
2563 hits[7] = nphe; //fLightPMQ
2566 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2570 hits[8] = nphe; //fLightPMC
2572 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2575 else if((vol[0]==3)) { // (3) ZEM fibres
2576 if(ibe>fNbep) ibe=fNbep;
2577 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2578 gMC->TrackPosition(s[0],s[1],s[2]);
2583 // z-coordinate from ZEM front face
2584 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
2585 Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
2586 //z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
2587 //printf(" fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
2589 // Parametrization for light guide uniformity
2590 // NEW!!! Light guide tilted @ 51 degrees
2591 Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
2592 Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
2594 nphe = gRandom->Poisson(out);
2595 //printf(" out*guiEff = %f nphe = %d", out, nphe);
2598 hits[8] = nphe; //fLightPMC (ZEM1)
2600 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2603 hits[7] = nphe; //fLightPMQ (ZEM2)
2606 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);