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 // AliZDCv4 --- 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 AliZDCv4::AliZDCv4() :
86 fVCollSideCAperture(7./2.),
87 fVCollSideCApertureNeg(7./2.),
88 fVCollSideCCentreY(0.),
89 fTCDDAperturePos(2.0),
90 fTCDDApertureNeg(2.2),
96 // Default constructor for Zero Degree Calorimeter
98 for(Int_t i=0; i<3; i++){
99 fDimZN[i] = fDimZP[i] = 0.;
100 fPosZNC[i] = fPosZNA[i] = fPosZPC[i]= fPosZPA[i] = fPosZEM[i] = 0.;
101 fFibZN[i] = fFibZP[i] = 0.;
105 //_____________________________________________________________________________
106 AliZDCv4::AliZDCv4(const char *name, const char *title) :
134 fVCollSideCAperture(7./2.),
135 fVCollSideCApertureNeg(7./2.),
136 fVCollSideCCentreY(0.),
137 fTCDDAperturePos(2.0),
138 fTCDDApertureNeg(2.2),
139 fTDIAperturePos(5.5),
140 fTDIApertureNeg(5.5),
144 // Standard constructor for Zero Degree Calorimeter
147 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
149 AliModule* pipe=gAlice->GetModule("PIPE");
150 AliModule* abso=gAlice->GetModule("ABSO");
151 AliModule* dipo=gAlice->GetModule("DIPO");
152 AliModule* shil=gAlice->GetModule("SHIL");
153 if((!pipe) || (!abso) || (!dipo) || (!shil)) {
154 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
159 for(ip=0; ip<4; ip++){
160 for(kp=0; kp<fNalfap; kp++){
161 for(jp=0; jp<fNbep; jp++){
162 fTablep[ip][kp][jp] = 0;
167 for(in=0; in<4; in++){
168 for(kn=0; kn<fNalfan; kn++){
169 for(jn=0; jn<fNben; jn++){
170 fTablen[in][kn][jn] = 0;
175 // Parameters for hadronic calorimeters geometry
176 // Positions updated after post-installation measurements
185 fPosZNC[2] = -11397.3+136;
188 fPosZPC[2] = -11389.3+136;
191 fPosZNA[2] = 11395.8-136;
194 fPosZPA[2] = 11387.8-136;
201 // Parameters for EM calorimeter geometry
205 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
206 Float_t kDimZEMAir = 0.001; // scotch
207 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
208 Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
209 Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
210 fZEMLength = kDimZEM0;
214 //_____________________________________________________________________________
215 void AliZDCv4::CreateGeometry()
218 // Create the geometry for the Zero Degree Calorimeter version 2
219 //* Initialize COMMON block ZDC_CGEOM
226 //_____________________________________________________________________________
227 void AliZDCv4::CreateBeamLine()
230 // Create the beam line elements
233 Double_t zd1, zd2, zCorrDip, zInnTrip, zD1;
234 Double_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
236 //-- rotation matrices for the legs
237 Int_t irotpipe1, irotpipe2;
238 gMC->Matrix(irotpipe1,90.-1.0027,0.,90.,90.,1.0027,180.);
239 gMC->Matrix(irotpipe2,90.+1.0027,0.,90.,90.,1.0027,0.);
242 Int_t *idtmed = fIdtmed->GetArray();
244 ////////////////////////////////////////////////////////////////
246 // SIDE C - RB26 (dimuon side) //
248 ///////////////////////////////////////////////////////////////
251 // -- Mother of the ZDCs (Vacuum PCON)
263 gMC->Gsvolu("ZDCC", "PCON", idtmed[10], conpar, 9);
264 gMC->Gspos("ZDCC", 1, "ALIC", 0., 0., 0., 0, "ONLY");
267 // -- BEAM PIPE from compensator dipole to the beginning of D1)
270 // From beginning of ZDC volumes to beginning of D1
271 tubpar[2] = (5838.3-zd1)/2.;
272 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
273 gMC->Gspos("QT01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
275 //printf(" QT01 TUBE pipe from z = %1.2f to z = %1.2f (D1 begin)\n",-zd1,-2*tubpar[2]-zd1);
277 //-- BEAM PIPE from the end of D1 to the beginning of D2)
279 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1
280 //-- Cylindrical pipe (r = 3.47) + conical flare
281 // -> Beginning of D1
286 tubpar[2] = (6909.8-zd1)/2.;
287 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
288 gMC->Gspos("QT02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
290 //printf(" QT02 TUBE pipe from z = %1.2f to z = %1.2f (D1 magnetic end)\n",-zd1,-2*tubpar[2]-zd1);
296 tubpar[2] = (6958.3-zd1)/2.;
297 gMC->Gsvolu("QT0B", "TUBE", idtmed[7], tubpar, 3);
298 gMC->Gspos("QT0B", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
300 //printf(" QT0B TUBE pipe from z = %1.2f to z = %1.2f \n",-zd1,-2*tubpar[2]-zd1);
306 tubpar[2] = (7022.8-zd1)/2.;
307 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
308 gMC->Gspos("QT03", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
310 //printf(" QT03 TUBE pipe from z = %1.2f to z = %1.2f (D1 end)\n",-zd1,-2*tubpar[2]-zd1);
319 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
320 gMC->Gspos("QC01", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
322 //printf(" QC01 CONE pipe from z = %1.2f to z= %1.2f (VCTCQ-I)\n",-zd1,-2*conpar[0]-zd1);
324 zd1 += conpar[0] * 2.;
326 // ******************************************************
327 // N.B.-> according to last vacuum layout
328 // private communication by D. Macina, mail 27/1/2009
329 // updated to new ZDC installation (Janiary 2012)
330 // ******************************************************
331 // 2nd section of VCTCQ+VAMTF+TCLIA+VAMTF+1st part of VCTCP
332 Float_t totLength1 = 160.8 + 78. + 148. + 78. + 9.3;
336 tubpar[2] = totLength1/2.;
337 // gMC->Gsvolu("QE01", "ELTU", idtmed[7], tubpar, 3);
338 // temporary replace with a scaled tube (AG)
339 TGeoTube *tubeQE01 = new TGeoTube(0.,tubpar[0],tubpar[2]);
340 TGeoScale *scaleQE01 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
341 TGeoScaledShape *sshapeQE01 = new TGeoScaledShape(tubeQE01, scaleQE01);
342 new TGeoVolume("QE01", sshapeQE01, gGeoManager->GetMedium(idtmed[7]));
346 tubpar[2] = totLength1/2.;
347 // gMC->Gsvolu("QE02", "ELTU", idtmed[10], tubpar, 3);
348 // temporary replace with a scaled tube (AG)
349 TGeoTube *tubeQE02 = new TGeoTube(0.,tubpar[0],tubpar[2]);
350 TGeoScale *scaleQE02 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
351 TGeoScaledShape *sshapeQE02 = new TGeoScaledShape(tubeQE02, scaleQE02);
352 new TGeoVolume("QE02", sshapeQE02, gGeoManager->GetMedium(idtmed[10]));
354 gMC->Gspos("QE01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
355 gMC->Gspos("QE02", 1, "QE01", 0., 0., 0., 0, "ONLY");
357 //printf(" QE01 ELTU from z = %1.2f to z = %1.2f (VCTCQ-II+VAMTF+TCLIA+VAMTF+VCTCP-I)\n",-zd1,-2*tubpar[2]-zd1);
359 // TCLIA collimator jaws (defined ONLY if fVCollAperture<3.5!)
360 if(fVCollSideCAperture<3.5){
362 boxpar[1] = (3.5-fVCollSideCAperture-fVCollSideCCentreY-0.7)/2.;
363 if(boxpar[1]<0.) boxpar[1]=0.;
364 boxpar[2] = 124.4/2.;
365 printf(" AliZDCv4 -> C side injection collimator jaws: apertures +%1.2f/-%1.2f center %1.2f [cm]\n",
366 fVCollSideCAperture, fVCollSideCApertureNeg,fVCollSideCCentreY);
367 gMC->Gsvolu("QCVC" , "BOX ", idtmed[13], boxpar, 3);
368 gMC->Gspos("QCVC", 1, "QE02", -boxpar[0], fVCollSideCAperture+fVCollSideCCentreY+boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
369 gMC->Gspos("QCVC", 2, "QE02", -boxpar[0], -fVCollSideCApertureNeg+fVCollSideCCentreY-boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");
372 zd1 += tubpar[2] * 2.;
376 conpar[1] = 21.27/2.;
377 conpar[2] = 21.87/2.;
380 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
381 gMC->Gspos("QC02", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
383 //printf(" QC02 CONE pipe from z = %1.2f to z= %1.2f (VCTCP-II)\n",-zd1,-2*conpar[0]-zd1);
385 zd1 += conpar[0] * 2.;
387 // 3rd section of VCTCP+VCDWC+VMLGB
388 //Float_t totLenght2 = 9.2 + 530.5+40.;
389 Float_t totLenght2 = (8373.3-zd1);
392 tubpar[2] = totLenght2/2.;
393 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
394 gMC->Gspos("QT04", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
396 //printf(" QT04 TUBE pipe from z = %1.2f to z= %1.2f (VCTCP-III)\n",-zd1,-2*tubpar[2]-zd1);
398 zd1 += tubpar[2] * 2.;
400 // First part of VCTCD
401 // skewed transition cone from ID=212.7 mm to ID=797 mm
405 conpar[3] = 21.27/2.;
406 conpar[4] = 21.87/2.;
407 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
408 gMC->Gspos("QC03", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
410 //printf(" QC03 CONE pipe from z = %1.2f to z = %1.2f (VCTCD-I)\n",-zd1,-2*conpar[0]-zd1);
414 // VCDGB + 1st part of VCTCH
415 // Modified according to 2012 ZDC installation
418 tubpar[2] = (5*475.2+97.-136)/2.;
419 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
420 gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
422 //printf(" QT05 TUBE pipe from z = %1.2f to z = %1.2f (VCDGB+VCTCH-I)\n",-zd1,-2*tubpar[2]-zd1);
427 // Transition from ID=797 mm to ID=196 mm:
428 // in order to simulate the thin window opened in the transition cone
429 // we divide the transition cone in three cones:
430 // (1) 8 mm thick (2) 3 mm thick (3) the third 8 mm thick
433 conpar[0] = 9.09/2.; // 15 degree
434 conpar[1] = 74.82868/2.;
435 conpar[2] = 76.42868/2.; // thickness 8 mm
437 conpar[4] = 81.3/2.; // thickness 8 mm
438 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
439 gMC->Gspos("QC04", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
441 //printf(" QC04 CONE pipe from z = %1.2f to z = %1.2f (VCTCH-II)\n",-zd1,-2*conpar[0]-zd1);
446 conpar[0] = 96.2/2.; // 15 degree
447 conpar[1] = 23.19588/2.;
448 conpar[2] = 23.79588/2.; // thickness 3 mm
449 conpar[3] = 74.82868/2.;
450 conpar[4] = 75.42868/2.; // thickness 3 mm
451 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
452 gMC->Gspos("QC05", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
454 //printf(" QC05 CONE pipe from z = %1.2f to z = %1.2f (VCTCH-III)\n",-zd1,-2*conpar[0]-zd1);
459 conpar[0] = 6.71/2.; // 15 degree
461 conpar[2] = 21.2/2.;// thickness 8 mm
462 conpar[3] = 23.19588/2.;
463 conpar[4] = 24.79588/2.;// thickness 8 mm
464 gMC->Gsvolu("QC06", "CONE", idtmed[7], conpar, 5);
465 gMC->Gspos("QC06", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
467 //printf(" QC06 CONE pipe from z = %1.2f to z = %1.2f (VCTCH-III)\n",-zd1,-2*conpar[0]-zd1);
475 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
476 gMC->Gspos("QT06", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
478 //printf(" QT06 TUBE pipe from z = %1.2f to z = %1.2f (VMZAR-I)\n",-zd1,-2*tubpar[2]-zd1);
487 gMC->Gsvolu("QC07", "CONE", idtmed[7], conpar, 5);
488 gMC->Gspos("QC07", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
490 //printf(" QC07 CONE pipe from z = %1.2f to z = %1.2f (VMZAR-II)\n",-zd1,-2*conpar[0]-zd1);
497 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
498 gMC->Gspos("QT07", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
500 //printf(" QT07 TUBE pipe from z = %1.2f to z = %1.2f (VMZAR-III)\n",-zd1,-2*tubpar[2]-zd1);
509 gMC->Gsvolu("QC08", "CONE", idtmed[7], conpar, 5);
510 gMC->Gspos("QC08", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
512 //printf(" QC08 CONE pipe from z = %1.2f to z = %1.2f (VMZAR-IV)\n",-zd1,-2*conpar[0]-zd1);
519 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
520 gMC->Gspos("QT08", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
522 //printf(" QT08 TUBE pipe from z = %1.2f to z = %1.2f (VMZAR-V)\n",-zd1,-2*tubpar[2]-zd1);
526 // Flange (ID=196 mm)(last part of VMZAR and first part of VCTYB)
530 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
531 gMC->Gspos("QT09", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
533 //printf(" QT09 TUBE pipe from z = %1.2f to z = %1.2f (VMZAR-VI+VCTYB-I)\n",-zd1,-2*tubpar[2]-zd1);
537 ////printf(" Beginning of VCTYB volume @ z = %1.2f \n",-zd1);
539 // simulation of the trousers (VCTYB)
543 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
544 gMC->Gspos("QT10", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
546 //printf(" QT10 TUBE pipe from z = %1.2f to z = %1.2f (VCTYB-II)\n",-zd1,-2*tubpar[2]-zd1);
550 // transition cone from ID=196. to ID=216.6
551 conpar[0] = 32.55/2.;
552 conpar[1] = 21.66/2.;
553 conpar[2] = 22.06/2.;
556 gMC->Gsvolu("QC09", "CONE", idtmed[7], conpar, 5);
557 gMC->Gspos("QC09", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
559 //printf(" QC09 CONE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-zd1);
564 tubpar[0] = 21.66/2.;
565 tubpar[1] = 22.06/2.;
567 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
568 gMC->Gspos("QT11", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
570 //printf(" QT11 TUBE pipe from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
574 //printf(" Beginning of C side recombination chamber @ z = %f \n",-zd1);
576 // --------------------------------------------------------
577 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
578 // author: Chiara (August 2008)
579 // --------------------------------------------------------
580 // TRANSFORMATION MATRICES
581 // Combi transformation:
582 Double_t dx = -3.970000;
583 Double_t dy = 0.000000;
586 Double_t thx = 84.989100; Double_t phx = 180.000000;
587 Double_t thy = 90.000000; Double_t phy = 90.000000;
588 Double_t thz = 185.010900; Double_t phz = 0.000000;
589 TGeoRotation *rotMatrix1c = new TGeoRotation("c",thx,phx,thy,phy,thz,phz);
590 // Combi transformation:
594 TGeoCombiTrans *rotMatrix2c = new TGeoCombiTrans("ZDCC_c1", dx,dy,dz,rotMatrix1c);
595 rotMatrix2c->RegisterYourself();
596 // Combi transformation:
601 thx = 95.010900; phx = 180.000000;
602 thy = 90.000000; phy = 90.000000;
603 thz = 180.-5.010900; phz = 0.000000;
604 TGeoRotation *rotMatrix3c = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
605 TGeoCombiTrans *rotMatrix4c = new TGeoCombiTrans("ZDCC_c2", dx,dy,dz,rotMatrix3c);
606 rotMatrix4c->RegisterYourself();
608 // VOLUMES DEFINITION
610 TGeoVolume *pZDCC = gGeoManager->GetVolume("ZDCC");
612 conpar[0] = (90.1-0.95-0.26-0.0085)/2.;
617 new TGeoCone("QCLext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
619 conpar[0] = (90.1-0.95-0.26-0.0085)/2.;
624 new TGeoCone("QCLint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
627 TGeoCompositeShape *pOutTrousersC = new TGeoCompositeShape("outTrousersC", "QCLext:ZDCC_c1+QCLext:ZDCC_c2");
630 TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRONT");
631 TGeoVolume *pQCLext = new TGeoVolume("QCLext",pOutTrousersC, medZDCFe);
632 pQCLext->SetLineColor(kGreen);
633 pQCLext->SetVisLeaves(kTRUE);
635 TGeoTranslation *tr1c = new TGeoTranslation(0., 0., (Double_t) -conpar[0]-0.95-zd1);
636 //printf(" C side recombination chamber from z = %1.2f to z= %1.2f\n",-zd1,-2*conpar[0]-0.95-zd1);
638 pZDCC->AddNode(pQCLext, 1, tr1c);
640 TGeoCompositeShape *pIntTrousersC = new TGeoCompositeShape("intTrousersC", "QCLint:ZDCC_c1+QCLint:ZDCC_c2");
642 TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
643 TGeoVolume *pQCLint = new TGeoVolume("QCLint",pIntTrousersC, medZDCvoid);
644 pQCLint->SetLineColor(kTeal);
645 pQCLint->SetVisLeaves(kTRUE);
646 pQCLext->AddNode(pQCLint, 1);
649 Double_t offset = 0.5;
652 // second section : 2 tubes (ID = 54. OD = 58.)
656 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
657 gMC->Gspos("QT12", 1, "ZDCC", -15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
658 gMC->Gspos("QT12", 2, "ZDCC", 15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
660 //printf(" QT12 TUBE from z = %1.2f to z = %1.2f (separate beam pipes)\n",-zd1,-2*tubpar[2]-zd1);
664 // transition x2zdc to recombination chamber : skewed cone
665 conpar[0] = (10.-0.2-offset)/2.;
670 gMC->Gsvolu("QC10", "CONE", idtmed[7], conpar, 5);
671 gMC->Gspos("QC10", 1, "ZDCC", -7.9-0.175, 0., -conpar[0]-0.1-zd1, irotpipe1, "ONLY");
672 gMC->Gspos("QC10", 2, "ZDCC", 7.9+0.175, 0., -conpar[0]-0.1-zd1, irotpipe2, "ONLY");
673 //printf(" QC10 CONE from z = %1.2f to z = %1.2f (transition X2ZDC)\n",-zd1,-2*conpar[0]-0.2-zd1);
675 zd1 += 2.*conpar[0]+0.2;
677 // 2 tubes (ID = 63 mm OD=70 mm)
680 tubpar[2] = 639.8/2.;
681 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
682 gMC->Gspos("QT13", 1, "ZDCC", -16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
683 gMC->Gspos("QT13", 2, "ZDCC", 16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
684 //printf(" QT13 TUBE from z = %1.2f to z = %1.2f (separate beam pipes)\n",-zd1,-2*tubpar[2]-zd1);
687 printf(" END OF C SIDE BEAM PIPE DEFINITION @ z = %f m from IP2\n\n",-zd1/100.);
690 // -- Luminometer (Cu box) in front of ZN - side C
694 boxpar[2] = fLumiLength/2.;
695 gMC->Gsvolu("QLUC", "BOX ", idtmed[9], boxpar, 3);
696 gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
697 printf(" C SIDE LUMINOMETER %1.2f < z < %1.2f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
700 // -- END OF BEAM PIPE VOLUME DEFINITION FOR SIDE C (RB26 SIDE)
701 // ----------------------------------------------------------------
703 ////////////////////////////////////////////////////////////////
707 ///////////////////////////////////////////////////////////////
709 // Rotation Matrices definition
710 Int_t irotpipe3, irotpipe4, irotpipe5;
711 //-- rotation matrices for the tilted cone after the TDI to recenter vacuum chamber
712 gMC->Matrix(irotpipe3,90.-1.8934,0.,90.,90.,1.8934,180.);
713 //-- rotation matrices for the tilted tube before and after the TDI
714 gMC->Matrix(irotpipe4,90.-3.8,0.,90.,90.,3.8,180.);
715 //-- rotation matrix for the tilted cone after the TDI
716 gMC->Matrix(irotpipe5,90.+9.8,0.,90.,90.,9.8,0.);
718 // -- Mother of the ZDCs (Vacuum PCON)
719 zd2 = 1910.22;// zd2 initial value
730 gMC->Gsvolu("ZDCA", "PCON", idtmed[10], conpar, 9);
731 gMC->Gspos("ZDCA", 1, "ALIC", 0., 0., 0., 0, "ONLY");
733 // To avoid overlaps 1 micron are left between certain volumes!
734 Double_t dxNoOverlap = 0.0;
735 //zd2 += dxNoOverlap;
737 // BEAM PIPE from 19.10 m to inner triplet beginning (22.965 m)
740 tubpar[2] = 386.28/2. - dxNoOverlap;
741 gMC->Gsvolu("QA01", "TUBE", idtmed[7], tubpar, 3);
742 gMC->Gspos("QA01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
744 //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);
748 // -- FIRST SECTION OF THE BEAM PIPE (from beginning of inner triplet to
752 tubpar[2] = 3541.8/2. - dxNoOverlap;
753 gMC->Gsvolu("QA02", "TUBE", idtmed[7], tubpar, 3);
754 gMC->Gspos("QA02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
756 //printf(" QA02 TUBE from z = %1.2f to z= %1.2f (D1 begin)\n",zd2,2*tubpar[2]+zd2);
761 // -- SECOND SECTION OF THE BEAM PIPE (from the beginning of D1 to the beginning of D2)
763 // FROM (MAGNETIC) BEGINNING OF D1 TO THE (MAGNETIC) END OF D1 + 126.5 cm
764 // CYLINDRICAL PIPE of diameter increasing from 6.75 cm up to 8.0 cm
765 // from magnetic end :
766 // 1) 80.1 cm still with ID = 6.75 radial beam screen
767 // 2) 2.5 cm conical section from ID = 6.75 to ID = 8.0 cm
768 // 3) 43.9 cm straight section (tube) with ID = 8.0 cm
772 tubpar[2] = (945.0+80.1)/2.;
773 gMC->Gsvolu("QA03", "TUBE", idtmed[7], tubpar, 3);
774 gMC->Gspos("QA03", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
776 //printf(" QA03 TUBE from z = %1.2f to z = %1.2f (D1 end)\n",zd2,2*tubpar[2]+zd2);
780 // Transition Cone from ID=67.5 mm to ID=80 mm
786 gMC->Gsvolu("QA04", "CONE", idtmed[7], conpar, 5);
787 gMC->Gspos("QA04", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
788 //printf(" QA04 CONE from z = %1.2f to z = %1.2f (transition cone)\n",zd2,2*conpar[0]+zd2);
794 tubpar[2] = (43.9+20.+28.5+28.5)/2.;
795 gMC->Gsvolu("QA05", "TUBE", idtmed[7], tubpar, 3);
796 gMC->Gspos("QA05", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
798 //printf(" QA05 TUBE from z = %1.2f to z = %1.2f\n",zd2,2*tubpar[2]+zd2);
802 // Second section of VAEHI (transition cone from ID=80mm to ID=98mm)
808 gMC->Gsvolu("QAV1", "CONE", idtmed[7], conpar, 5);
809 gMC->Gspos("QAV1", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
810 //printf(" QAV1 CONE from z = %1.2f to z = %1.2f (VAEHI-I)\n",zd2,2*conpar[0]+zd2);
814 //Third section of VAEHI (transition cone from ID=98mm to ID=90mm)
820 gMC->Gsvolu("QAV2", "CONE", idtmed[7], conpar, 5);
821 gMC->Gspos("QAV2", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
822 //printf(" QAV2 CONE from z = %1.2f to z = %1.2f (VAEHI-II)\n",zd2,2*conpar[0]+zd2);
826 // Fourth section of VAEHI (tube ID=90mm)
830 gMC->Gsvolu("QAV3", "TUBE", idtmed[7], tubpar, 3);
831 gMC->Gspos("QAV3", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
833 //printf(" QAV3 TUBE from z = %1.2f to z = %1.2f (VAEHI-III)\n",zd2,2*tubpar[2]+zd2);
837 //---------------------------- TCDD beginning ----------------------------------
838 // space for the insertion of the collimator TCDD (2 m)
839 // TCDD ZONE - 1st volume
845 gMC->Gsvolu("Q01T", "CONE", idtmed[7], conpar, 5);
846 gMC->Gspos("Q01T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
847 //printf(" Q01T CONE from z = %1.2f to z = %1.2f (TCDD-I)\n",zd2,2*conpar[0]+zd2);
851 // TCDD ZONE - 2nd volume
855 gMC->Gsvolu("Q02T", "TUBE", idtmed[7], tubpar, 3);
856 gMC->Gspos("Q02T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
858 //printf(" Q02T TUBE from z = %1.2f to z= %1.2f (TCDD-II)\n",zd2,2*tubpar[2]+zd2);
862 // TCDD ZONE - third volume
868 gMC->Gsvolu("Q03T", "CONE", idtmed[7], conpar, 5);
869 gMC->Gspos("Q03T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
870 //printf(" Q03T CONE from z = %1.2f to z= %1.2f (TCDD-III)\n",zd2,2*conpar[0]+zd2);
874 // TCDD ZONE - 4th volume
878 gMC->Gsvolu("Q04T", "TUBE", idtmed[7], tubpar, 3);
879 gMC->Gspos("Q04T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
881 //printf(" Q04T TUBE from z = %1.2f to z= %1.2f (TCDD-IV)\n",zd2,2*tubpar[2]+zd2);
885 // TCDD ZONE - 5th volume
888 tubpar[2] = 100.12/2.;
889 gMC->Gsvolu("Q05T", "TUBE", idtmed[7], tubpar, 3);
890 gMC->Gspos("Q05T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
892 //printf(" Q05T TUBE from z = %1.2f to z= %1.2f (TCDD-V)\n",zd2,2*tubpar[2]+zd2);
896 // TCDD ZONE - 6th volume
900 gMC->Gsvolu("Q06T", "TUBE", idtmed[7], tubpar, 3);
901 gMC->Gspos("Q06T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
903 //printf(" Q06T TUBE from z = %1.2f to z= %1.2f (TCDD-VI)\n",zd2,2*tubpar[2]+zd2);
907 // TCDD ZONE - 7th volume
908 conpar[0] = 11.34/2.;
913 gMC->Gsvolu("Q07T", "CONE", idtmed[7], conpar, 5);
914 gMC->Gspos("Q07T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
915 //printf(" Q07T CONE from z = %1.2f to z= %1.2f (TCDD-VII)\n",zd2,2*conpar[0]+zd2);
919 // Upper section : one single phi segment of a tube
920 // 5 parameters for tubs: inner radius = 0.,
921 // outer radius = 7. cm, half length = 50 cm
922 // phi1 = 0., phi2 = 180.
924 tubspar[1] = 14.0/2.;
925 tubspar[2] = 100.0/2.;
928 gMC->Gsvolu("Q08T", "TUBS", idtmed[7], tubspar, 5);
930 // rectangular beam pipe inside TCDD upper section (Vacuum)
934 gMC->Gsvolu("Q09T", "BOX ", idtmed[10], boxpar, 3);
935 // positioning vacuum box in the upper section of TCDD
936 gMC->Gspos("Q09T", 1, "Q08T", 0., 1.1, 0., 0, "ONLY");
938 // lower section : one single phi segment of a tube
940 tubspar[1] = 14.0/2.;
941 tubspar[2] = 100.0/2.;
944 gMC->Gsvolu("Q10T", "TUBS", idtmed[7], tubspar, 5);
945 // rectangular beam pipe inside TCDD lower section (Vacuum)
949 gMC->Gsvolu("Q11T", "BOX ", idtmed[10], boxpar, 3);
950 // positioning vacuum box in the lower section of TCDD
951 gMC->Gspos("Q11T", 1, "Q10T", 0., -1.1, 0., 0, "ONLY");
953 // positioning TCDD elements in ZDCA, (inside TCDD volume)
954 gMC->Gspos("Q08T", 1, "ZDCA", 0., fTCDDAperturePos, -100.+zd2, 0, "ONLY");
955 gMC->Gspos("Q10T", 1, "ZDCA", 0., -fTCDDApertureNeg, -100.+zd2, 0, "ONLY");
956 printf(" AliZDCv4 -> TCDD apertures +%1.2f/-%1.2f cm\n",
957 fTCDDAperturePos, fTCDDApertureNeg);
963 gMC->Gsvolu("Q12T", "BOX ", idtmed[7], boxpar, 3);
964 // positioning RF screen at both sides of TCDD
965 gMC->Gspos("Q12T", 1, "ZDCA", tubspar[1]+boxpar[0], 0., -100.+zd2, 0, "ONLY");
966 gMC->Gspos("Q12T", 2, "ZDCA", -tubspar[1]-boxpar[0], 0., -100.+zd2, 0, "ONLY");
967 //---------------------------- TCDD end ---------------------------------------
969 // The following elliptical tube 180 mm x 70 mm
970 // (obtained positioning the void QA06 in QA07)
971 // represents VAMTF + first part of VCTCP (93 mm)
972 // updated according to 2012 new ZDC installation
976 tubpar[2] = (78+9.3)/2.;
977 // gMC->Gsvolu("QA06", "ELTU", idtmed[7], tubpar, 3);
978 // temporary replace with a scaled tube (AG)
979 TGeoTube *tubeQA06 = new TGeoTube(0.,tubpar[0],tubpar[2]);
980 TGeoScale *scaleQA06 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
981 TGeoScaledShape *sshapeQA06 = new TGeoScaledShape(tubeQA06, scaleQA06);
982 new TGeoVolume("QA06", sshapeQA06, gGeoManager->GetMedium(idtmed[7]));
983 //printf(" QA06 TUBE from z = %1.2f to z = %1.2f (VAMTF+VCTCP-I)\n",zd2,2*tubpar[2]+zd2);
987 tubpar[2] = (78+9.3)/2.;
988 // gMC->Gsvolu("QA07", "ELTU", idtmed[10], tubpar, 3);
989 // temporary replace with a scaled tube (AG)
990 TGeoTube *tubeQA07 = new TGeoTube(0.,tubpar[0],tubpar[2]);
991 TGeoScale *scaleQA07 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
992 TGeoScaledShape *sshapeQA07 = new TGeoScaledShape(tubeQA07, scaleQA07);
993 new TGeoVolume("QA07", sshapeQA07, gGeoManager->GetMedium(idtmed[10]));
994 ////printf(" QA07 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
995 gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
996 gMC->Gspos("QA07", 1, "QA06", 0., 0., 0., 0, "ONLY");
1000 // VCTCP second part: transition cone from ID=180 to ID=212.7
1001 conpar[0] = 31.5/2.;
1002 conpar[1] = 18.0/2.;
1003 conpar[2] = 18.6/2.;
1004 conpar[3] = 21.27/2.;
1005 conpar[4] = 21.87/2.;
1006 gMC->Gsvolu("QA08", "CONE", idtmed[7], conpar, 5);
1007 gMC->Gspos("QA08", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1009 //printf(" QA08 CONE from z = %f to z = %f (VCTCP-II)\n",zd2,2*conpar[0]+zd2);
1011 zd2 += 2.*conpar[0];
1014 // Represents VCTCP third part (92 mm) + VCDWB (765 mm) + VMBGA (400 mm) +
1015 // VCDWE (300 mm) + VMBGA (400 mm)
1016 // + TCTVB space + VAMTF space (new installation Jan 2012)
1017 tubpar[0] = 21.27/2.;
1018 tubpar[1] = 21.87/2.;
1019 tubpar[2] = (195.7+148.+78.)/2.;
1020 gMC->Gsvolu("QA09", "TUBE", idtmed[7], tubpar, 3);
1021 gMC->Gspos("QA09", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1022 //printf(" QA09 TUBE from z = %1.2f to z= %1.2f (VCTCP-III+VCDWB+VMBGA+VCDWE+VMBGA)\n",zd2,2*tubpar[2]+zd2);
1024 zd2 += 2.*tubpar[2];
1026 // skewed transition piece (ID=212.7 mm to 332 mm) (before TDI)
1027 conpar[0] = (50.0-0.73-1.13)/2.;
1028 conpar[1] = 21.27/2.;
1029 conpar[2] = 21.87/2.;
1030 conpar[3] = 33.2/2.;
1031 conpar[4] = 33.8/2.;
1032 gMC->Gsvolu("QA10", "CONE", idtmed[7], conpar, 5);
1033 gMC->Gspos("QA10", 1, "ZDCA", -1.66, 0., conpar[0]+0.73+zd2, irotpipe4, "ONLY");
1035 //printf(" QA10 skewed CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+0.73+1.13+zd2);
1037 zd2 += 2.*conpar[0]+0.73+1.13;
1039 // Vacuum chamber containing TDI
1041 tubpar[1] = 54.6/2.;
1042 tubpar[2] = 540.0/2.;
1043 gMC->Gsvolu("Q13TM", "TUBE", idtmed[10], tubpar, 3);
1044 gMC->Gspos("Q13TM", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1045 tubpar[0] = 54.0/2.;
1046 tubpar[1] = 54.6/2.;
1047 tubpar[2] = 540.0/2.;
1048 gMC->Gsvolu("Q13T", "TUBE", idtmed[7], tubpar, 3);
1049 gMC->Gspos("Q13T", 1, "Q13TM", 0., 0., 0., 0, "ONLY");
1051 //printf(" Q13T TUBE from z = %1.2f to z= %1.2f (TDI vacuum chamber)\n",zd2,2*tubpar[2]+zd2);
1053 zd2 += 2.*tubpar[2];
1055 //---------------- INSERT TDI INSIDE Q13T -----------------------------------
1056 boxpar[0] = 11.0/2.;
1058 boxpar[2] = 540.0/2.;
1059 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
1060 gMC->Gspos("QTD1", 1, "Q13TM", -3.8, boxpar[1]+fTDIAperturePos, 0., 0, "ONLY");
1061 boxpar[0] = 11.0/2.;
1063 boxpar[2] = 540.0/2.;
1064 gMC->Gsvolu("QTD2", "BOX ", idtmed[7], boxpar, 3);
1065 gMC->Gspos("QTD2", 1, "Q13TM", -3.8, -boxpar[1]-fTDIApertureNeg, 0., 0, "ONLY");
1068 boxpar[2] = 540.0/2.;
1069 gMC->Gsvolu("QTD3", "BOX ", idtmed[7], boxpar, 3);
1070 gMC->Gspos("QTD3", 1, "Q13TM", -3.8+5.5+boxpar[0], fTDIAperturePos, 0., 0, "ONLY");
1071 gMC->Gspos("QTD3", 2, "Q13TM", -3.8+5.5+boxpar[0], -fTDIApertureNeg, 0., 0, "ONLY");
1072 gMC->Gspos("QTD3", 3, "Q13TM", -3.8-5.5-boxpar[0], fTDIAperturePos, 0., 0, "ONLY");
1073 gMC->Gspos("QTD3", 4, "Q13TM", -3.8-5.5-boxpar[0], -fTDIApertureNeg, 0., 0, "ONLY");
1074 printf(" AliZDCv4 -> TDI apertures +%1.2f/-%1.2f cm\n",
1075 fTDIAperturePos, fTDIApertureNeg);
1077 tubspar[0] = 12.0/2.;
1078 tubspar[1] = 12.4/2.;
1079 tubspar[2] = 540.0/2.;
1082 gMC->Gsvolu("QTD4", "TUBS", idtmed[7], tubspar, 5);
1083 gMC->Gspos("QTD4", 1, "Q13TM", -3.8-10.6, 0., 0., 0, "ONLY");
1084 tubspar[0] = 12.0/2.;
1085 tubspar[1] = 12.4/2.;
1086 tubspar[2] = 540.0/2.;
1089 gMC->Gsvolu("QTD5", "TUBS", idtmed[7], tubspar, 5);
1090 gMC->Gspos("QTD5", 1, "Q13TM", -3.8+10.6, 0., 0., 0, "ONLY");
1091 //---------------- END DEFINING TDI INSIDE Q13T -------------------------------
1093 // VCTCG skewed transition piece (ID=332 mm to 212.7 mm) (after TDI)
1094 conpar[0] = (50.0-2.92-1.89)/2.;
1095 conpar[1] = 33.2/2.;
1096 conpar[2] = 33.8/2.;
1097 conpar[3] = 21.27/2.;
1098 conpar[4] = 21.87/2.;
1099 gMC->Gsvolu("QA11", "CONE", idtmed[7], conpar, 5);
1100 gMC->Gspos("QA11", 1, "ZDCA", 4.32-3.8, 0., conpar[0]+2.92+zd2, irotpipe5, "ONLY");
1102 //printf(" QA11 skewed CONE from z = %f to z =%f (VCTCG)\n",zd2,2*conpar[0]+2.92+1.89+zd2);
1104 zd2 += 2.*conpar[0]+2.92+1.89;
1106 // The following tube ID 212.7 mm
1107 // represents VMBGA (400 mm) + VCDWE (300 mm) + VMBGA (400 mm) +
1108 // BTVTS (600 mm) + VMLGB (400 mm)
1109 tubpar[0] = 21.27/2.;
1110 tubpar[1] = 21.87/2.;
1111 tubpar[2] = 210.0/2.;
1112 gMC->Gsvolu("QA12", "TUBE", idtmed[7], tubpar, 3);
1113 gMC->Gspos("QA12", 1, "ZDCA", 4., 0., tubpar[2]+zd2, 0, "ONLY");
1115 //printf(" QA12 TUBE from z = %1.2f to z= %1.2f (VMBGA+VCDWE+VMBGA+BTVTS+VMLGB)\n",zd2,2*tubpar[2]+zd2);
1117 zd2 += 2.*tubpar[2];
1119 // First part of VCTCC
1120 // skewed transition cone from ID=212.7 mm to ID=797 mm
1121 conpar[0] = (121.0-0.37-1.35)/2.;
1122 conpar[1] = 21.27/2.;
1123 conpar[2] = 21.87/2.;
1124 conpar[3] = 79.7/2.;
1125 conpar[4] = 81.3/2.;
1126 gMC->Gsvolu("QA13", "CONE", idtmed[7], conpar, 5);
1127 gMC->Gspos("QA13", 1, "ZDCA", 4.-2., 0., conpar[0]+0.37+zd2, irotpipe3, "ONLY");
1129 //printf(" QA13 CONE from z = %1.2f to z = %1.2f (VCTCC-I)\n",zd2,2*conpar[0]+0.37+1.35+zd2);
1131 zd2 += 2.*conpar[0]+0.37+1.35;
1133 // The following tube ID 797 mm
1134 // represents the second part of VCTCC (4272 mm) +
1135 // 4 x VCDGA (4 x 4272 mm) +
1136 // the first part of VCTCR (850 mm)
1137 // updated according to 2012 ZDC installation
1138 tubpar[0] = 79.7/2.;
1139 tubpar[1] = 81.3/2.;
1140 tubpar[2] = (2221.-136.)/2.;
1141 gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
1142 gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1144 //printf(" QA14 TUBE from z = %1.2f to z = %1.2f (VCTCC-II)\n",zd2,2*tubpar[2]+zd2);
1146 zd2 += 2.*tubpar[2];
1148 // Second part of VCTCR
1149 // Transition from ID=797 mm to ID=196 mm:
1150 // in order to simulate the thin window opened in the transition cone
1151 // we divide the transition cone in three cones:
1152 // (1) 8 mm thick (2) 3 mm thick (3) the third 8 mm thick
1155 conpar[0] = 9.09/2.; // 15 degree
1156 conpar[1] = 79.7/2.;
1157 conpar[2] = 81.3/2.; // thickness 8 mm
1158 conpar[3] = 74.82868/2.;
1159 conpar[4] = 76.42868/2.; // thickness 8 mm
1160 gMC->Gsvolu("QA15", "CONE", idtmed[7], conpar, 5);
1161 gMC->Gspos("QA15", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1162 //printf(" QA15 CONE from z = %1.2f to z= %1.2f (VCTCR-I)\n",zd2,2*conpar[0]+zd2);
1164 zd2 += 2.*conpar[0];
1167 conpar[0] = 96.2/2.; // 15 degree
1168 conpar[1] = 74.82868/2.;
1169 conpar[2] = 75.42868/2.; // thickness 3 mm
1170 conpar[3] = 23.19588/2.;
1171 conpar[4] = 23.79588/2.; // thickness 3 mm
1172 gMC->Gsvolu("QA16", "CONE", idtmed[7], conpar, 5);
1173 gMC->Gspos("QA16", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1174 //printf(" QA16 CONE from z = %1.2f to z= %1.2f\n",zd2,2*conpar[0]+zd2);
1176 zd2 += 2.*conpar[0];
1179 conpar[0] = 6.71/2.; // 15 degree
1180 conpar[1] = 23.19588/2.;
1181 conpar[2] = 24.79588/2.;// thickness 8 mm
1182 conpar[3] = 19.6/2.;
1183 conpar[4] = 21.2/2.;// thickness 8 mm
1184 gMC->Gsvolu("QA17", "CONE", idtmed[7], conpar, 5);
1185 gMC->Gspos("QA17", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1186 //printf(" QA17 CONE from z = %1.2f to z= %1.2f (VCTCR-II)\n",zd2,2*conpar[0]+zd2);
1188 zd2 += 2.*conpar[0];
1190 // Third part of VCTCR: tube (ID=196 mm)
1191 tubpar[0] = 19.6/2.;
1192 tubpar[1] = 21.2/2.;
1193 tubpar[2] = 9.55/2.;
1194 gMC->Gsvolu("QA18", "TUBE", idtmed[7], tubpar, 3);
1195 gMC->Gspos("QA18", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1197 //printf(" QA18 TUBE from z = %1.2f to z= %1.2f (VCTCR-III)\n",zd2,2*tubpar[2]+zd2);
1199 zd2 += 2.*tubpar[2];
1201 // Flange (ID=196 mm) (last part of VCTCR and first part of VMZAR)
1202 tubpar[0] = 19.6/2.;
1203 tubpar[1] = 25.3/2.;
1205 gMC->Gsvolu("QF01", "TUBE", idtmed[7], tubpar, 3);
1206 gMC->Gspos("QF01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1208 //printf(" QF01 TUBE from z = %1.2f to z= %1.2f (VMZAR-I)\n",zd2,2*tubpar[2]+zd2);
1210 zd2 += 2.*tubpar[2];
1212 // VMZAR (5 volumes)
1213 tubpar[0] = 20.2/2.;
1214 tubpar[1] = 20.6/2.;
1215 tubpar[2] = 2.15/2.;
1216 gMC->Gsvolu("QA19", "TUBE", idtmed[7], tubpar, 3);
1217 gMC->Gspos("QA19", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1219 //printf(" QA19 TUBE from z = %1.2f to z = %1.2f (VMZAR-II)\n",zd2,2*tubpar[2]+zd2);
1221 zd2 += 2.*tubpar[2];
1224 conpar[1] = 20.2/2.;
1225 conpar[2] = 20.6/2.;
1226 conpar[3] = 23.9/2.;
1227 conpar[4] = 24.3/2.;
1228 gMC->Gsvolu("QA20", "CONE", idtmed[7], conpar, 5);
1229 gMC->Gspos("QA20", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1231 //printf(" QA20 CONE from z = %1.2f to z = %1.2f (VMZAR-III)\n",zd2,2*conpar[0]+zd2);
1233 zd2 += 2.*conpar[0];
1235 tubpar[0] = 23.9/2.;
1236 tubpar[1] = 25.5/2.;
1237 tubpar[2] = 17.0/2.;
1238 gMC->Gsvolu("QA21", "TUBE", idtmed[7], tubpar, 3);
1239 gMC->Gspos("QA21", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1241 //printf(" QA21 TUBE from z = %1.2f to z = %1.2f (VMZAR-IV)\n",zd2,2*tubpar[2]+zd2);
1243 zd2 += 2.*tubpar[2];
1246 conpar[1] = 23.9/2.;
1247 conpar[2] = 24.3/2.;
1248 conpar[3] = 20.2/2.;
1249 conpar[4] = 20.6/2.;
1250 gMC->Gsvolu("QA22", "CONE", idtmed[7], conpar, 5);
1251 gMC->Gspos("QA22", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1253 //printf(" QA22 CONE from z = %1.2f to z = %1.2f (VMZAR-V)\n",zd2,2*conpar[0]+zd2);
1255 zd2 += 2.*conpar[0];
1257 tubpar[0] = 20.2/2.;
1258 tubpar[1] = 20.6/2.;
1259 tubpar[2] = 2.15/2.;
1260 gMC->Gsvolu("QA23", "TUBE", idtmed[7], tubpar, 3);
1261 gMC->Gspos("QA23", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1263 //printf(" QA23 TUBE from z = %1.2f to z= %1.2f (VMZAR-VI)\n",zd2,2*tubpar[2]+zd2);
1265 zd2 += 2.*tubpar[2];
1267 // Flange (ID=196 mm)(last part of VMZAR and first part of VCTYD)
1268 tubpar[0] = 19.6/2.;
1269 tubpar[1] = 25.3/2.;
1271 gMC->Gsvolu("QF02", "TUBE", idtmed[7], tubpar, 3);
1272 gMC->Gspos("QF02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1274 //printf(" QF02 TUBE from z = %1.2f to z= %1.2f (VMZAR-VII)\n",zd2,2*tubpar[2]+zd2);
1276 zd2 += 2.*tubpar[2];
1278 // simulation of the trousers (VCTYB)
1279 tubpar[0] = 19.6/2.;
1280 tubpar[1] = 20.0/2.;
1282 gMC->Gsvolu("QA24", "TUBE", idtmed[7], tubpar, 3);
1283 gMC->Gspos("QA24", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1285 //printf(" QA24 TUBE from z = %1.2f to z= %1.2f (VCTYB)\n",zd2,2*tubpar[2]+zd2);
1287 zd2 += 2.*tubpar[2];
1289 // transition cone from ID=196. to ID=216.6
1290 conpar[0] = 32.55/2.;
1291 conpar[1] = 19.6/2.;
1292 conpar[2] = 20.0/2.;
1293 conpar[3] = 21.66/2.;
1294 conpar[4] = 22.06/2.;
1295 gMC->Gsvolu("QA25", "CONE", idtmed[7], conpar, 5);
1296 gMC->Gspos("QA25", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1298 //printf(" QA25 CONE from z = %1.2f to z= %1.2f (transition cone)\n",zd2,2*conpar[0]+zd2);
1300 zd2 += 2.*conpar[0];
1303 tubpar[0] = 21.66/2.;
1304 tubpar[1] = 22.06/2.;
1305 tubpar[2] = 28.6/2.;
1306 gMC->Gsvolu("QA26", "TUBE", idtmed[7], tubpar, 3);
1307 gMC->Gspos("QA26", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1309 //printf(" QA26 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
1311 zd2 += 2.*tubpar[2];
1313 //printf(" Begin of recombination chamber z = %1.2f\n",zd2);
1315 // --------------------------------------------------------
1316 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
1317 // author: Chiara (June 2008)
1318 // --------------------------------------------------------
1319 // TRANSFORMATION MATRICES
1320 // Combi transformation:
1325 thx = 84.989100; phx = 0.000000;
1326 thy = 90.000000; phy = 90.000000;
1327 thz = 5.010900; phz = 180.000000;
1328 TGeoRotation *rotMatrix1 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1329 // Combi transformation:
1333 TGeoCombiTrans *rotMatrix2 = new TGeoCombiTrans("ZDC_c1", dx,dy,dz,rotMatrix1);
1334 rotMatrix2->RegisterYourself();
1335 // Combi transformation:
1340 thx = 95.010900; phx = 0.000000;
1341 thy = 90.000000; phy = 90.000000;
1342 thz = 5.010900; phz = 0.000000;
1343 TGeoRotation *rotMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1344 TGeoCombiTrans *rotMatrix4 = new TGeoCombiTrans("ZDC_c2", dx,dy,dz,rotMatrix3);
1345 rotMatrix4->RegisterYourself();
1348 // VOLUMES DEFINITION
1350 TGeoVolume *pZDCA = gGeoManager->GetVolume("ZDCA");
1352 conpar[0] = (90.1-0.95-0.26)/2.;
1354 conpar[2] = 21.6/2.;
1357 new TGeoCone("QALext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1359 conpar[0] = (90.1-0.95-0.26)/2.;
1361 conpar[2] = 21.2/2.;
1364 new TGeoCone("QALint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1367 TGeoCompositeShape *pOutTrousers = new TGeoCompositeShape("outTrousers", "QALext:ZDC_c1+QALext:ZDC_c2");
1370 //TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
1371 TGeoVolume *pQALext = new TGeoVolume("QALext",pOutTrousers, medZDCFe);
1372 pQALext->SetLineColor(kBlue);
1373 pQALext->SetVisLeaves(kTRUE);
1375 TGeoTranslation *tr1 = new TGeoTranslation(0., 0., (Double_t) conpar[0]+0.95+zd2);
1376 pZDCA->AddNode(pQALext, 1, tr1);
1378 TGeoCompositeShape *pIntTrousers = new TGeoCompositeShape("intTrousers", "QALint:ZDC_c1+QALint:ZDC_c2");
1380 //TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
1381 TGeoVolume *pQALint = new TGeoVolume("QALint",pIntTrousers, medZDCvoid);
1382 pQALint->SetLineColor(kAzure);
1383 pQALint->SetVisLeaves(kTRUE);
1384 pQALext->AddNode(pQALint, 1);
1388 //printf(" End of recombination chamber z = %1.2f\n",zd2);
1391 // second section : 2 tubes (ID = 54. OD = 58.)
1394 tubpar[2] = 40.0/2.;
1395 gMC->Gsvolu("QA27", "TUBE", idtmed[7], tubpar, 3);
1396 gMC->Gspos("QA27", 1, "ZDCA", -15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1397 gMC->Gspos("QA27", 2, "ZDCA", 15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1399 //printf(" QA27 TUBE from z = %1.2f to z= %1.2f (separate pipes)\n",zd2,2*tubpar[2]+zd2);
1401 zd2 += 2.*tubpar[2];
1403 // transition x2zdc to recombination chamber : skewed cone
1404 conpar[0] = (10.-1.)/2.;
1409 gMC->Gsvolu("QA28", "CONE", idtmed[7], conpar, 5);
1410 gMC->Gspos("QA28", 1, "ZDCA", -7.9-0.175, 0., conpar[0]+0.5+zd2, irotpipe1, "ONLY");
1411 gMC->Gspos("QA28", 2, "ZDCA", 7.9+0.175, 0., conpar[0]+0.5+zd2, irotpipe2, "ONLY");
1412 //printf(" QA28 CONE from z = %1.2f to z= %1.2f (transition X2ZDC)\n",zd2,2*conpar[0]+0.2+zd2);
1414 zd2 += 2.*conpar[0]+1.;
1416 // 2 tubes (ID = 63 mm OD=70 mm)
1419 tubpar[2] = (342.5+498.3)/2.;
1420 gMC->Gsvolu("QA29", "TUBE", idtmed[7], tubpar, 3);
1421 gMC->Gspos("QA29", 1, "ZDCA", -16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1422 gMC->Gspos("QA29", 2, "ZDCA", 16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1423 //printf(" QA29 TUBE from z = %1.2f to z= %1.2f (separate pipes)\n",zd2,2*tubpar[2]+zd2);
1425 zd2 += 2.*tubpar[2];
1427 // -- Luminometer (Cu box) in front of ZN - side A
1431 boxpar[2] = fLumiLength/2.;
1432 gMC->Gsvolu("QLUA", "BOX ", idtmed[9], boxpar, 3);
1433 gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
1434 printf(" A SIDE LUMINOMETER %1.2f < z < %1.2f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
1436 printf(" END OF A SIDE BEAM PIPE VOLUME DEFINITION AT z = %f m from IP2\n",zd2/100.);
1439 // ----------------------------------------------------------------
1440 // -- MAGNET DEFINITION -> LHC OPTICS 6.5
1441 // ----------------------------------------------------------------
1442 // ***************************************************************
1443 // SIDE C - RB26 (dimuon side)
1444 // ***************************************************************
1445 // -- COMPENSATOR DIPOLE (MBXW)
1448 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1451 tubpar[2] = 153./2.;
1452 gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
1457 tubpar[2] = 153./2.;
1458 gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
1460 gMC->Gspos("MBXW", 1, "ZDCC", 0., 0., -tubpar[2]-zCorrDip, 0, "ONLY");
1461 gMC->Gspos("YMBX", 1, "ZDCC", 0., 0., -tubpar[2]-zCorrDip, 0, "ONLY");
1467 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
1469 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1472 tubpar[2] = 637./2.;
1473 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
1478 tubpar[2] = 637./2.;
1479 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
1481 gMC->Gspos("MQXL", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip, 0, "ONLY");
1482 gMC->Gspos("YMQL", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip, 0, "ONLY");
1484 gMC->Gspos("MQXL", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-2400., 0, "ONLY");
1485 gMC->Gspos("YMQL", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-2400., 0, "ONLY");
1488 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1491 tubpar[2] = 550./2.;
1492 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
1497 tubpar[2] = 550./2.;
1498 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
1500 gMC->Gspos("MQX ", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-908.5, 0, "ONLY");
1501 gMC->Gspos("YMQ ", 1, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-908.5, 0, "ONLY");
1503 gMC->Gspos("MQX ", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-1558.5, 0, "ONLY");
1504 gMC->Gspos("YMQ ", 2, "ZDCC", 0., 0., -tubpar[2]-zInnTrip-1558.5, 0, "ONLY");
1506 // -- SEPARATOR DIPOLE D1
1509 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1512 tubpar[2] = 945./2.;
1513 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
1515 // -- Insert horizontal Cu plates inside D1
1516 // -- (to simulate the vacuum chamber)
1517 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2)) - 0.05;
1519 boxpar[2] = 945./2.;
1520 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
1521 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
1522 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
1526 tubpar[1] = 110./2.;
1527 tubpar[2] = 945./2.;
1528 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
1530 gMC->Gspos("YD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD1, 0, "ONLY");
1531 gMC->Gspos("MD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD1, 0, "ONLY");
1533 //printf(" MD1 from z = %1.2f to z= %1.2f cm\n",-zD1, -zD1-2*tubpar[2]);
1537 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1540 tubpar[2] = 945./2.;
1541 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
1546 tubpar[2] = 945./2.;
1547 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
1549 gMC->Gspos("YD2 ", 1, "ZDCC", 0., 0., -tubpar[2]-zD2, 0, "ONLY");
1551 //printf(" YD2 from z = %1.2f to z= %1.2f cm\n",-zD2, -zD2-2*tubpar[2]);
1553 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
1554 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
1556 // ***************************************************************
1558 // ***************************************************************
1560 // COMPENSATOR DIPOLE (MCBWA) (2nd compensator)
1561 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1564 tubpar[2] = 153./2.;
1565 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
1566 gMC->Gspos("MCBW", 1, "ZDCA", 0., 0., tubpar[2]+zCorrDip, 0, "ONLY");
1571 tubpar[2] = 153./2.;
1572 gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
1573 gMC->Gspos("YMCB", 1, "ZDCA", 0., 0., tubpar[2]+zCorrDip, 0, "ONLY");
1576 // -- DEFINE MQX1 AND MQX2 QUADRUPOLE ELEMENT
1578 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1581 tubpar[2] = 637./2.;
1582 gMC->Gsvolu("MQX1", "TUBE", idtmed[11], tubpar, 3);
1583 gMC->Gsvolu("MQX4", "TUBE", idtmed[11], tubpar, 3);
1588 tubpar[2] = 637./2.;
1589 gMC->Gsvolu("YMQ1", "TUBE", idtmed[7], tubpar, 3);
1592 gMC->Gspos("MQX1", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip, 0, "ONLY");
1593 gMC->Gspos("YMQ1", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip, 0, "ONLY");
1595 // -- BEAM SCREEN FOR Q1
1596 tubpar[0] = 4.78/2.;
1597 tubpar[1] = 5.18/2.;
1598 tubpar[2] = 637./2.;
1599 gMC->Gsvolu("QBS1", "TUBE", idtmed[6], tubpar, 3);
1600 gMC->Gspos("QBS1", 1, "MQX1", 0., 0., 0., 0, "ONLY");
1601 // INSERT VERTICAL PLATE INSIDE Q1
1602 boxpar[0] = 0.2/2.0;
1603 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(1.9+0.2)*(1.9+0.2));
1605 gMC->Gsvolu("QBS2", "BOX ", idtmed[6], boxpar, 3);
1606 gMC->Gspos("QBS2", 1, "MQX1", 1.9+boxpar[0], 0., 0., 0, "ONLY");
1607 gMC->Gspos("QBS2", 2, "MQX1", -1.9-boxpar[0], 0., 0., 0, "ONLY");
1610 gMC->Gspos("MQX4", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+2400., 0, "ONLY");
1611 gMC->Gspos("YMQ1", 2, "ZDCA", 0., 0., tubpar[2]+zInnTrip+2400., 0, "ONLY");
1613 // -- BEAM SCREEN FOR Q3
1614 tubpar[0] = 5.79/2.;
1615 tubpar[1] = 6.14/2.;
1616 tubpar[2] = 637./2.;
1617 gMC->Gsvolu("QBS3", "TUBE", idtmed[6], tubpar, 3);
1618 gMC->Gspos("QBS3", 1, "MQX4", 0., 0., 0., 0, "ONLY");
1619 // INSERT VERTICAL PLATE INSIDE Q3
1620 boxpar[0] = 0.2/2.0;
1621 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1623 gMC->Gsvolu("QBS4", "BOX ", idtmed[6], boxpar, 3);
1624 gMC->Gspos("QBS4", 1, "MQX4", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1625 gMC->Gspos("QBS4", 2, "MQX4", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1630 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1633 tubpar[2] = 550./2.;
1634 gMC->Gsvolu("MQX2", "TUBE", idtmed[11], tubpar, 3);
1635 gMC->Gsvolu("MQX3", "TUBE", idtmed[11], tubpar, 3);
1640 tubpar[2] = 550./2.;
1641 gMC->Gsvolu("YMQ2", "TUBE", idtmed[7], tubpar, 3);
1643 // -- BEAM SCREEN FOR Q2
1644 tubpar[0] = 5.79/2.;
1645 tubpar[1] = 6.14/2.;
1646 tubpar[2] = 550./2.;
1647 gMC->Gsvolu("QBS5", "TUBE", idtmed[6], tubpar, 3);
1648 // VERTICAL PLATE INSIDE Q2
1649 boxpar[0] = 0.2/2.0;
1650 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1652 gMC->Gsvolu("QBS6", "BOX ", idtmed[6], boxpar, 3);
1655 gMC->Gspos("MQX2", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+908.5, 0, "ONLY");
1656 gMC->Gspos("QBS5", 1, "MQX2", 0., 0., 0., 0, "ONLY");
1657 gMC->Gspos("QBS6", 1, "MQX2", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1658 gMC->Gspos("QBS6", 2, "MQX2", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1659 gMC->Gspos("YMQ2", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+908.5, 0, "ONLY");
1663 gMC->Gspos("MQX3", 1, "ZDCA", 0., 0., tubpar[2]+zInnTrip+1558.5, 0, "ONLY");
1664 gMC->Gspos("QBS5", 2, "MQX3", 0., 0., 0., 0, "ONLY");
1665 gMC->Gspos("QBS6", 3, "MQX3", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1666 gMC->Gspos("QBS6", 4, "MQX3", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1667 gMC->Gspos("YMQ2", 2, "ZDCA", 0., 0., tubpar[2]+zInnTrip+1558.5, 0, "ONLY");
1669 // -- SEPARATOR DIPOLE D1
1670 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1672 tubpar[1] = 6.75/2.;//3.375
1673 tubpar[2] = 945./2.;
1674 gMC->Gsvolu("MD1L", "TUBE", idtmed[11], tubpar, 3);
1676 // -- The beam screen tube is provided by the beam pipe in D1 (QA03 volume)
1677 // -- Insert the beam screen horizontal Cu plates inside D1
1678 // -- (to simulate the vacuum chamber)
1679 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.885+0.2)*(2.885+0.2));
1682 gMC->Gsvolu("QBS7", "BOX ", idtmed[6], boxpar, 3);
1683 gMC->Gspos("QBS7", 1, "MD1L", 0., 2.885+boxpar[1],0., 0, "ONLY");
1684 gMC->Gspos("QBS7", 2, "MD1L", 0., -2.885-boxpar[1],0., 0, "ONLY");
1689 tubpar[2] = 945./2.;
1690 gMC->Gsvolu("YD1L", "TUBE", idtmed[7], tubpar, 3);
1692 gMC->Gspos("YD1L", 1, "ZDCA", 0., 0., tubpar[2]+zD1, 0, "ONLY");
1693 gMC->Gspos("MD1L", 1, "ZDCA", 0., 0., tubpar[2]+zD1, 0, "ONLY");
1696 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1698 tubpar[1] = 7.5/2.; // this has to be checked
1699 tubpar[2] = 945./2.;
1700 gMC->Gsvolu("MD2L", "TUBE", idtmed[11], tubpar, 3);
1705 tubpar[2] = 945./2.;
1706 gMC->Gsvolu("YD2L", "TUBE", idtmed[7], tubpar, 3);
1708 gMC->Gspos("YD2L", 1, "ZDCA", 0., 0., tubpar[2]+zD2, 0, "ONLY");
1710 gMC->Gspos("MD2L", 1, "YD2L", -9.4, 0., 0., 0, "ONLY");
1711 gMC->Gspos("MD2L", 2, "YD2L", 9.4, 0., 0., 0, "ONLY");
1713 // -- END OF MAGNET DEFINITION
1716 //_____________________________________________________________________________
1717 void AliZDCv4::CreateZDC()
1720 // Create the various ZDCs (ZN + ZP)
1723 Float_t dimPb[6], dimVoid[6];
1725 Int_t *idtmed = fIdtmed->GetArray();
1727 // Parameters for hadronic calorimeters geometry
1728 // NB -> parameters used ONLY in CreateZDC()
1729 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
1730 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
1731 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
1732 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
1733 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
1734 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
1736 // Parameters for EM calorimeter geometry
1737 // NB -> parameters used ONLY in CreateZDC()
1738 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
1739 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
1740 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
1741 Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
1742 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
1743 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
1746 //-- Create calorimeters geometry
1748 // -------------------------------------------------------------------------------
1749 //--> Neutron calorimeter (ZN)
1751 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
1752 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
1753 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
1754 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
1755 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
1756 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
1757 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
1758 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
1759 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
1761 // Divide ZNEU in towers (for hits purposes)
1763 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
1764 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
1766 //-- Divide ZN1 in minitowers
1767 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
1768 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
1769 // (4 fibres per minitower)
1771 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
1772 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
1774 // --- Position the empty grooves in the sticks (4 grooves per stick)
1775 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
1776 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
1778 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1779 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1780 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1781 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1783 // --- Position the fibers in the grooves
1784 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
1785 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
1786 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
1787 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
1789 // --- Position the neutron calorimeter in ZDC
1790 // -- Rotation of ZDCs
1792 gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
1794 gMC->Gspos("ZNEU", 1, "ZDCC", fPosZNC[0], fPosZNC[1], fPosZNC[2]-fDimZN[2], irotzdc, "ONLY");
1796 //printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
1798 // --- Position the neutron calorimeter in ZDC2 (left line)
1799 // -- No Rotation of ZDCs
1800 gMC->Gspos("ZNEU", 2, "ZDCA", fPosZNA[0], fPosZNA[1], fPosZNA[2]+fDimZN[2], 0, "ONLY");
1802 //printf("\n ZN left -> %f < z < %f cm\n",fPosZNl[2],fPosZNl[2]+2*fDimZN[2]);
1805 // -------------------------------------------------------------------------------
1806 //--> Proton calorimeter (ZP)
1808 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
1809 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
1810 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
1811 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
1812 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
1813 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
1814 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
1815 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
1816 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
1818 //-- Divide ZPRO in towers(for hits purposes)
1820 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
1821 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
1824 //-- Divide ZP1 in minitowers
1825 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
1826 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
1827 // (4 fiber per minitower)
1829 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
1830 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
1832 // --- Position the empty grooves in the sticks (4 grooves per stick)
1833 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
1834 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
1836 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1837 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1838 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1839 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1841 // --- Position the fibers in the grooves
1842 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
1843 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
1844 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
1845 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
1848 // --- Position the proton calorimeter in ZDCC
1849 gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
1851 //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
1853 // --- Position the proton calorimeter in ZDCA
1855 gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
1857 //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);
1860 // -------------------------------------------------------------------------------
1861 // -> EM calorimeter (ZEM)
1863 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
1866 gMC->Matrix(irot1,0.,0.,90.,90.,-90.,0.); // Rotation matrix 1
1867 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]);// Rotation matrix 2
1868 //printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
1870 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
1872 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
1874 dimPb[0] = kDimZEMPb; // Lead slices
1875 dimPb[1] = fDimZEM[2];
1876 dimPb[2] = fDimZEM[1];
1877 //dimPb[3] = fDimZEM[3]; //controllare
1878 dimPb[3] = 90.-fDimZEM[3]; //originale
1881 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
1882 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
1883 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
1885 // --- Position the lead slices in the tranche
1886 Float_t zTran = fDimZEM[0]/fDivZEM[2];
1887 Float_t zTrPb = -zTran+kDimZEMPb;
1888 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
1889 gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
1891 // --- Vacuum zone (to be filled with fibres)
1892 dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
1893 dimVoid[1] = fDimZEM[2];
1894 dimVoid[2] = fDimZEM[1];
1895 dimVoid[3] = 90.-fDimZEM[3];
1898 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
1899 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
1901 // --- Divide the vacuum slice into sticks along x axis
1902 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
1903 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
1905 // --- Positioning the fibers into the sticks
1906 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
1907 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
1909 // --- Positioning the vacuum slice into the tranche
1910 //Float_t displFib = fDimZEM[1]/fDivZEM[0];
1911 gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
1912 gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., 0., 0, "ONLY");
1914 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
1915 // NB -> ZEM is positioned in ALIC (instead of in ZDC) volume
1916 gMC->Gspos("ZEM ", 1,"ALIC", -fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1918 // Second EM ZDC (same side w.r.t. IP, just on the other side w.r.t. beam pipe)
1919 gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1921 // --- Adding last slice at the end of the EM calorimeter
1922 Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
1923 gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
1925 //printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
1926 //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
1930 //_____________________________________________________________________________
1931 void AliZDCv4::CreateMaterials()
1934 // Create Materials for the Zero Degree Calorimeter
1936 Float_t dens, ubuf[1], wmat[3], a[3], z[3];
1938 // --- W alloy -> ZN passive material
1949 AliMixture(1, "WALL", a, z, dens, 3, wmat);
1951 // --- Brass (CuZn) -> ZP passive material
1959 AliMixture(2, "BRASS", a, z, dens, 2, wmat);
1969 AliMixture(3, "SIO2", a, z, dens, -2, wmat);
1973 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 0., ubuf, 1);
1975 // --- Copper (energy loss taken into account)
1977 AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1981 AliMaterial(9, "COPP1", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1983 // --- Iron (energy loss taken into account)
1985 AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1987 // --- Iron (no energy loss)
1989 AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1993 AliMaterial(13, "TANT", 183.84, 74., 19.3, 0.35, 0., ubuf, 1);
1995 // ---------------------------------------------------------
1996 Float_t aResGas[3]={1.008,12.0107,15.9994};
1997 Float_t zResGas[3]={1.,6.,8.};
1998 Float_t wResGas[3]={0.28,0.28,0.44};
1999 Float_t dResGas = 3.2E-14;
2001 // --- Vacuum (no magnetic field)
2002 AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
2004 // --- Vacuum (with magnetic field)
2005 AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
2007 // --- Air (no magnetic field)
2008 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
2009 Float_t zAir[4]={6.,7.,8.,18.};
2010 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
2011 Float_t dAir = 1.20479E-3;
2013 AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
2015 // --- Definition of tracking media:
2017 // --- Tantalum = 1 ;
2019 // --- Fibers (SiO2) = 3 ;
2020 // --- Fibers (SiO2) = 4 ;
2022 // --- Copper (with high thr.)= 6 ;
2023 // --- Copper (with low thr.)= 9;
2024 // --- Iron (with energy loss) = 7 ;
2025 // --- Iron (without energy loss) = 8 ;
2026 // --- Vacuum (no field) = 10
2027 // --- Vacuum (with field) = 11
2028 // --- Air (no field) = 12
2030 // ****************************************************
2031 // Tracking media parameters
2033 Float_t epsil = 0.01; // Tracking precision,
2034 Float_t stmin = 0.01; // Min. value 4 max. step (cm)
2035 Float_t stemax = 1.; // Max. step permitted (cm)
2036 Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
2037 Float_t tmaxfdv = 0.1; // Maximum angle due to field (degrees)
2038 Float_t deemax = -1.; // Maximum fractional energy loss
2039 Float_t nofieldm = 0.; // Max. field value (no field)
2040 Float_t fieldm = 45.; // Max. field value (with field)
2041 Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
2042 Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
2043 Int_t inofld = 0; // IFIELD=0 -> no magnetic field
2044 Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
2045 // *****************************************************
2047 AliMedium(1, "ZWALL", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2048 AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2049 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2050 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2051 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2052 AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2053 AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2054 AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2055 AliMedium(9, "ZCOPL", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2056 AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2057 AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfdv, stemax, deemax, epsil, stmin);
2058 AliMedium(12,"ZAIR", 12, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2059 AliMedium(13,"ZTANT",13, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2060 AliMedium(14, "ZIRONT", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2064 //_____________________________________________________________________________
2065 void AliZDCv4::AddAlignableVolumes() const
2068 // Create entries for alignable volumes associating the symbolic volume
2069 // name with the corresponding volume path. Needs to be syncronized with
2070 // eventual changes in the geometry.
2072 TString volpath1 = "ALIC_1/ZDCC_1/ZNEU_1";
2073 TString volpath2 = "ALIC_1/ZDCC_1/ZPRO_1";
2074 TString volpath3 = "ALIC_1/ZDCA_1/ZNEU_2";
2075 TString volpath4 = "ALIC_1/ZDCA_1/ZPRO_2";
2077 TString symname1="ZDC/NeutronZDC_C";
2078 TString symname2="ZDC/ProtonZDC_C";
2079 TString symname3="ZDC/NeutronZDC_A";
2080 TString symname4="ZDC/ProtonZDC_A";
2082 if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
2083 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2085 if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
2086 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2088 if(!gGeoManager->SetAlignableEntry(symname3.Data(),volpath3.Data()))
2089 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2091 if(!gGeoManager->SetAlignableEntry(symname4.Data(),volpath4.Data()))
2092 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2097 //_____________________________________________________________________________
2098 void AliZDCv4::Init()
2101 Int_t *idtmed = fIdtmed->GetArray();
2103 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
2104 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
2105 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
2106 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
2107 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
2108 fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
2109 fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
2110 fMedSensLumi = idtmed[9]; // Sensitive volume: luminometer
2111 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
2112 fMedSensVColl = idtmed[13]; // Sensitive volume: collimator jaws
2115 //_____________________________________________________________________________
2116 void AliZDCv4::InitTables()
2119 // Read light tables for Cerenkov light production parameterization
2125 // --- Reading light tables for ZN
2126 char *lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
2127 FILE *fp1 = fopen(lightfName1,"r");
2129 printf("Cannot open file fp1 \n");
2133 for(k=0; k<fNalfan; k++){
2134 for(j=0; j<fNben; j++){
2135 read = fscanf(fp1,"%f",&fTablen[0][k][j]);
2136 if(read==0) AliDebug(3, " Error in reading light table 1");
2141 char *lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
2142 FILE *fp2 = fopen(lightfName2,"r");
2144 printf("Cannot open file fp2 \n");
2148 for(k=0; k<fNalfan; k++){
2149 for(j=0; j<fNben; j++){
2150 read = fscanf(fp2,"%f",&fTablen[1][k][j]);
2151 if(read==0) AliDebug(3, " Error in reading light table 2");
2156 char *lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
2157 FILE *fp3 = fopen(lightfName3,"r");
2159 printf("Cannot open file fp3 \n");
2163 for(k=0; k<fNalfan; k++){
2164 for(j=0; j<fNben; j++){
2165 read = fscanf(fp3,"%f",&fTablen[2][k][j]);
2166 if(read==0) AliDebug(3, " Error in reading light table 3");
2171 char *lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
2172 FILE *fp4 = fopen(lightfName4,"r");
2174 printf("Cannot open file fp4 \n");
2178 for(k=0; k<fNalfan; k++){
2179 for(j=0; j<fNben; j++){
2180 read = fscanf(fp4,"%f",&fTablen[3][k][j]);
2181 if(read==0) AliDebug(3, " Error in reading light table 4");
2187 // --- Reading light tables for ZP and ZEM
2188 char *lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
2189 FILE *fp5 = fopen(lightfName5,"r");
2191 printf("Cannot open file fp5 \n");
2195 for(k=0; k<fNalfap; k++){
2196 for(j=0; j<fNbep; j++){
2197 read = fscanf(fp5,"%f",&fTablep[0][k][j]);
2198 if(read==0) AliDebug(3, " Error in reading light table 5");
2203 char *lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
2204 FILE *fp6 = fopen(lightfName6,"r");
2206 printf("Cannot open file fp6 \n");
2210 for(k=0; k<fNalfap; k++){
2211 for(j=0; j<fNbep; j++){
2212 read = fscanf(fp6,"%f",&fTablep[1][k][j]);
2213 if(read==0) AliDebug(3, " Error in reading light table 6");
2218 char *lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
2219 FILE *fp7 = fopen(lightfName7,"r");
2221 printf("Cannot open file fp7 \n");
2225 for(k=0; k<fNalfap; k++){
2226 for(j=0; j<fNbep; j++){
2227 read = fscanf(fp7,"%f",&fTablep[2][k][j]);
2228 if(read==0) AliDebug(3, " Error in reading light table 7");
2233 char *lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
2234 FILE *fp8 = fopen(lightfName8,"r");
2236 printf("Cannot open file fp8 \n");
2240 for(k=0; k<fNalfap; k++){
2241 for(j=0; j<fNbep; j++){
2242 read = fscanf(fp8,"%f",&fTablep[3][k][j]);
2243 if(read==0) AliDebug(3, " Error in reading light table 8");
2250 //_____________________________________________________________________________
2251 void AliZDCv4::StepManager()
2254 // Routine called at every step in the Zero Degree Calorimeters
2256 Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
2257 Float_t hits[13], x[3], xdet[3]={999.,999.,999.}, um[3], ud[3];
2258 Float_t destep=0., be=0., out=0.;
2259 Double_t s[3], p[4];
2262 for(j=0;j<13;j++) hits[j]=-999.;
2264 // --- This part is for no shower developement in beam pipe, TDI, VColl
2265 // If particle interacts with beam pipe, TDI, VColl -> return
2266 if(fNoShower==1 && ((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI) ||
2267 (gMC->CurrentMedium() == fMedSensVColl || (gMC->CurrentMedium() == fMedSensLumi)))){
2269 // If option NoShower is set -> StopTrack
2272 gMC->TrackPosition(s[0],s[1],s[2]);
2273 if(gMC->CurrentMedium() == fMedSensPI){
2274 knamed = gMC->CurrentVolName();
2275 if(!strncmp(knamed,"YMQ",3)){
2276 if(s[2]<0) fpLostITC += 1;
2277 else fpLostITA += 1;
2280 else if(!strncmp(knamed,"YD1",3)){
2281 if(s[2]<0) fpLostD1C += 1;
2282 else fpLostD1A += 1;
2286 else if(gMC->CurrentMedium() == fMedSensTDI){
2287 knamed = gMC->CurrentVolName();
2288 if(!strncmp(knamed,"MD1",3)){
2289 if(s[2]<0) fpLostD1C += 1;
2290 else fpLostD1A += 1;
2293 else if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
2295 else if(gMC->CurrentMedium() == fMedSensVColl){
2296 knamed = gMC->CurrentVolName();
2297 if(!strncmp(knamed,"QCVC",4)) fpcVCollC++;
2298 else if(!strncmp(knamed,"QCVA",4)) fpcVCollA++;
2302 //gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
2303 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2304 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2307 printf("\n\t **********************************\n");
2308 printf("\t ********** Side C **********\n");
2309 printf("\t # of particles in IT = %d\n",fpLostITC);
2310 printf("\t # of particles in D1 = %d\n",fpLostD1C);
2311 printf("\t # of particles in VColl = %d\n",fpcVCollC);
2312 printf("\t ********** Side A **********\n");
2313 printf("\t # of particles in IT = %d\n",fpLostITA);
2314 printf("\t # of particles in D1 = %d\n",fpLostD1A);
2315 printf("\t # of particles in TDI = %d\n",fpLostTDI);
2316 printf("\t # of particles in VColl = %d\n",fpcVCollA);
2317 printf("\t **********************************\n");
2323 if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
2324 (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
2325 (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
2328 //Particle coordinates
2329 gMC->TrackPosition(s[0],s[1],s[2]);
2330 for(j=0; j<=2; j++) x[j] = s[j];
2335 // Determine in which ZDC the particle is
2336 knamed = gMC->CurrentVolName();
2337 if(!strncmp(knamed,"ZN",2)){
2338 if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
2339 else if(x[2]>0.) vol[0]=4; //ZNA
2341 else if(!strncmp(knamed,"ZP",2)){
2342 if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
2343 else if(x[2]>0.) vol[0]=5; //ZPA
2345 else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
2347 // Determine in which quadrant the particle is
2348 if(vol[0]==1){ //Quadrant in ZNC
2349 // Calculating particle coordinates inside ZNC
2350 xdet[0] = x[0]-fPosZNC[0];
2351 xdet[1] = x[1]-fPosZNC[1];
2352 // Calculating quadrant in ZN
2354 if(xdet[1]<=0.) vol[1]=1;
2357 else if(xdet[0]>0.){
2358 if(xdet[1]<=0.) vol[1]=2;
2363 else if(vol[0]==2){ //Quadrant in ZPC
2364 // Calculating particle coordinates inside ZPC
2365 xdet[0] = x[0]-fPosZPC[0];
2366 xdet[1] = x[1]-fPosZPC[1];
2367 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2368 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2369 // Calculating tower in ZP
2370 Float_t xqZP = xdet[0]/(fDimZP[0]/2.);
2371 for(int i=1; i<=4; i++){
2372 if(xqZP>=(i-3) && xqZP<(i-2)){
2379 // Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
2380 // vol[1] = 2 -> particle in 2nd ZEM (placed at x = -8.5 cm)
2381 else if(vol[0] == 3){
2384 // Particle x-coordinate inside ZEM1
2385 xdet[0] = x[0]-fPosZEM[0];
2389 // Particle x-coordinate inside ZEM2
2390 xdet[0] = x[0]+fPosZEM[0];
2392 xdet[1] = x[1]-fPosZEM[1];
2395 else if(vol[0]==4){ //Quadrant in ZNA
2396 // Calculating particle coordinates inside ZNA
2397 xdet[0] = x[0]-fPosZNA[0];
2398 xdet[1] = x[1]-fPosZNA[1];
2399 // Calculating quadrant in ZNA
2401 if(xdet[1]<=0.) vol[1]=1;
2404 else if(xdet[0]<0.){
2405 if(xdet[1]<=0.) vol[1]=2;
2410 else if(vol[0]==5){ //Quadrant in ZPA
2411 // Calculating particle coordinates inside ZPA
2412 xdet[0] = x[0]-fPosZPA[0];
2413 xdet[1] = x[1]-fPosZPA[1];
2414 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2415 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2416 // Calculating tower in ZP
2417 Float_t xqZP = -xdet[0]/(fDimZP[0]/2.);
2418 for(int i=1; i<=4; i++){
2419 if(xqZP>=(i-3) && xqZP<(i-2)){
2425 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2426 AliError(Form(" WRONG tower for det %d: tow %d with xdet=(%f, %f)\n",
2427 vol[0], vol[1], xdet[0], xdet[1]));
2429 //printf("\t *** det %d vol %d xdet(%f, %f)\n",vol[0], vol[1], xdet[0], xdet[1]);
2432 // Store impact point and kinetic energy of the ENTERING particle
2434 if(gMC->IsTrackEntering()){
2436 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2439 // Impact point on ZDC
2440 // X takes into account the LHC x-axis sign
2441 // which is opposite to positive x on detector front face
2442 // for side A detectors (ZNA and ZPA)
2443 if(vol[0]==4 || vol[0]==5){
2455 Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
2456 TParticle *part = gAlice->GetMCApp()->Particle(curTrackN);
2457 hits[10] = part->GetPdgCode();
2458 //printf("\t PDGCode = %d\n", part->GetPdgCode());
2460 Int_t imo = part->GetFirstMother();
2462 TParticle * pmot = gAlice->GetMCApp()->Particle(imo);
2463 hits[11] = pmot->GetPdgCode();
2467 hits[12] = 1.0e09*gMC->TrackTime(); // in ns!
2468 //printf("\t TrackTime = %f\n", hits[12]);
2470 AddHit(curTrackN, vol, hits);
2475 if(fnDetectedC==1) printf(" ### Particle in ZNC\n\n");
2479 if(fpDetectedC==1) printf(" ### Particle in ZPC\n\n");
2483 if(fnDetectedA==1) printf(" ### Particle in ZNA\n\n");
2487 if(fpDetectedA==1) printf(" ### Particle in ZPA\n\n");
2490 //printf("\t Pc: x %1.2f y %1.2f z %1.2f E %1.2f GeV pz = %1.2f GeV in volume %s\n",
2491 // x[0],x[1],x[3],p[3],p[2],gMC->CurrentVolName());
2498 // Particle energy loss
2499 if(gMC->Edep() != 0){
2500 hits[9] = gMC->Edep();
2503 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2508 // *** Light production in fibres
2509 if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
2511 //Select charged particles
2512 if((destep=gMC->Edep())){
2514 // Particle velocity
2516 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2517 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2518 if(p[3] > 0.00001) beta = ptot/p[3];
2520 if(beta<0.67)return;
2521 else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
2522 else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
2523 else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
2524 else if(beta>0.95) ibeta = 3;
2526 // Angle between particle trajectory and fibre axis
2527 // 1 -> Momentum directions
2531 gMC->Gmtod(um,ud,2);
2532 // 2 -> Angle < limit angle
2533 Double_t alfar = TMath::ACos(ud[2]);
2534 Double_t alfa = alfar*kRaddeg;
2535 if(alfa>=110.) return;
2537 ialfa = Int_t(1.+alfa/2.);
2539 // Distance between particle trajectory and fibre axis
2540 gMC->TrackPosition(s[0],s[1],s[2]);
2541 for(j=0; j<=2; j++){
2544 gMC->Gmtod(x,xdet,1);
2545 if(TMath::Abs(ud[0])>0.00001){
2546 Float_t dcoeff = ud[1]/ud[0];
2547 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
2550 be = TMath::Abs(ud[0]);
2553 ibe = Int_t(be*1000.+1);
2555 //Looking into the light tables
2556 Float_t charge = gMC->TrackCharge();
2558 if(vol[0]==1 || vol[0]==4) { // (1) ZN fibres
2559 if(ibe>fNben) ibe=fNben;
2560 out = charge*charge*fTablen[ibeta][ialfa][ibe];
2561 nphe = gRandom->Poisson(out);
2563 //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
2564 //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
2565 if(gMC->CurrentMedium() == fMedSensF1){
2566 hits[7] = nphe; //fLightPMQ
2569 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2573 hits[8] = nphe; //fLightPMC
2575 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2578 else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
2579 if(ibe>fNbep) ibe=fNbep;
2580 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2581 nphe = gRandom->Poisson(out);
2582 if(gMC->CurrentMedium() == fMedSensF1){
2583 hits[7] = nphe; //fLightPMQ
2586 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2590 hits[8] = nphe; //fLightPMC
2592 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2595 else if(vol[0]==3) { // (3) ZEM fibres
2596 if(ibe>fNbep) ibe=fNbep;
2597 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2598 gMC->TrackPosition(s[0],s[1],s[2]);
2603 // z-coordinate from ZEM front face
2604 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
2605 Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
2606 //z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
2607 //printf(" fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
2609 // Parametrization for light guide uniformity
2610 // NEW!!! Light guide tilted @ 51 degrees
2611 Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
2612 Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
2614 nphe = gRandom->Poisson(out);
2615 //printf(" out*guiEff = %f nphe = %d", out, nphe);
2618 hits[8] = nphe; //fLightPMC (ZEM1)
2620 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2623 hits[7] = nphe; //fLightPMQ (ZEM2)
2626 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);