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>
36 #include <TGeoShape.h>
37 #include <TGeoCompositeShape.h>
38 #include <TParticle.h>
40 // --- AliRoot classes
54 //_____________________________________________________________________________
55 AliZDCv3::AliZDCv3() :
84 // Default constructor for Zero Degree Calorimeter
89 //_____________________________________________________________________________
90 AliZDCv3::AliZDCv3(const char *name, const char *title) :
119 // Standard constructor for Zero Degree Calorimeter
122 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
124 AliModule* pipe=gAlice->GetModule("PIPE");
125 AliModule* abso=gAlice->GetModule("ABSO");
126 AliModule* dipo=gAlice->GetModule("DIPO");
127 AliModule* shil=gAlice->GetModule("SHIL");
128 if((!pipe) || (!abso) || (!dipo) || (!shil)) {
129 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
134 for(ip=0; ip<4; ip++){
135 for(kp=0; kp<fNalfap; kp++){
136 for(jp=0; jp<fNbep; jp++){
137 fTablep[ip][kp][jp] = 0;
142 for(in=0; in<4; in++){
143 for(kn=0; kn<fNalfan; kn++){
144 for(jn=0; jn<fNben; jn++){
145 fTablen[in][kn][jn] = 0;
150 // Parameters for hadronic calorimeters geometry
159 fPosZNC[2] = -11600.;
162 fPosZPC[2] = -11600.;
175 // Parameters for EM calorimeter geometry
179 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
180 Float_t kDimZEMAir = 0.001; // scotch
181 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
182 Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
183 Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
184 fZEMLength = kDimZEM0;
188 //_____________________________________________________________________________
189 void AliZDCv3::CreateGeometry()
192 // Create the geometry for the Zero Degree Calorimeter version 2
193 //* Initialize COMMON block ZDC_CGEOM
200 //_____________________________________________________________________________
201 void AliZDCv3::CreateBeamLine()
204 // Create the beam line elements
207 Double_t zc, zq, zd1, zd2, zql, zd2l;
208 Double_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
210 //-- rotation matrices for the legs
211 Int_t irotpipe7, irotpipe8;
212 gMC->Matrix(irotpipe7,90.-1.0027,0.,90.,90.,1.0027,180.);
213 gMC->Matrix(irotpipe8,90.+1.0027,0.,90.,90.,1.0027,0.);
216 Int_t *idtmed = fIdtmed->GetArray();
218 ////////////////////////////////////////////////////////////////
220 // SIDE C - RB26 (dimuon side) //
222 ///////////////////////////////////////////////////////////////
225 // -- Mother of the ZDCs (Vacuum PCON)
237 gMC->Gsvolu("ZDCC", "PCON", idtmed[10], conpar, 9);
238 gMC->Gspos("ZDCC", 1, "ALIC", 0., 0., 0., 0, "ONLY");
241 // -- FIRST SECTION OF THE BEAM PIPE (from compensator dipole to
242 // the beginning of D1)
245 // From beginning of ZDC volumes to beginning of D1
246 tubpar[2] = (5838.3-zd1)/2.;
247 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
248 gMC->Gspos("QT01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
250 //printf(" QT01 TUBE pipe from z = %f to z= %f (D1 beg.)\n",-zd1,-2*tubpar[2]-zd1);
252 //-- SECOND SECTION OF THE BEAM PIPE (from the end of D1 to the
255 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1 + 13.5 cm
256 //-- Cylindrical pipe (r = 3.47) + conical flare
258 // -> Beginning of D1
262 tubpar[1] = 3.47+0.2;
263 tubpar[2] = 958.5/2.;
264 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
265 gMC->Gspos("QT02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
267 //printf(" QT02 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
276 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
277 gMC->Gspos("QC01", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
279 //printf(" QC01 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
286 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
287 gMC->Gspos("QT03", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
289 //printf(" QT03 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
296 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
297 gMC->Gspos("QT04", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
299 //printf(" QT04 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
301 zd1 += tubpar[2] * 2.;
306 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
307 gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
309 //printf(" QT05 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
311 zd1 += tubpar[2] * 2.;
316 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
317 gMC->Gspos("QT06", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
319 //printf(" QT06 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
321 zd1 += tubpar[2] * 2.;
328 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
329 gMC->Gspos("QC02", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
331 //printf(" QC02 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
333 zd1 += conpar[0] * 2.;
338 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
339 gMC->Gspos("QT07", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
341 //printf(" QT07 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
343 zd1 += tubpar[2] * 2.;
350 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
351 gMC->Gspos("QC03", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
353 //printf(" QC03 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
355 zd1 += conpar[0] * 2.;
359 tubpar[2] = 205.8/2.;
360 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
361 gMC->Gspos("QT08", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
363 //printf(" QT08 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
365 zd1 += tubpar[2] * 2.;
369 // QT09 is 10 cm longer to accomodate TDI
370 tubpar[2] = 515.4/2.;
371 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
372 gMC->Gspos("QT09", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
374 //printf(" QT09 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
376 zd1 += tubpar[2] * 2.;
380 // QT10 is 10 cm shorter
382 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
383 gMC->Gspos("QT10", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
385 //printf(" QT10 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
387 zd1 += tubpar[2] * 2.;
391 tubpar[2] = 778.5/2.;
392 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
393 gMC->Gspos("QT11", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
395 //printf(" QT11 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
397 zd1 += tubpar[2] * 2.;
399 conpar[0] = 14.18/2.;
404 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
405 gMC->Gspos("QC04", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
407 //printf(" QC04 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
409 zd1 += conpar[0] * 2.;
414 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
415 gMC->Gspos("QT12", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
417 //printf(" QT12 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
419 zd1 += tubpar[2] * 2.;
421 conpar[0] = 36.86/2.;
426 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
427 gMC->Gspos("QC05", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
429 //printf(" QC05 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
431 zd1 += conpar[0] * 2.;
435 tubpar[2] = 848.6/2.;
436 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
437 gMC->Gspos("QT13", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
439 //printf(" QT13 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
441 zd1 += tubpar[2] * 2.;
443 // --------------------------------------------------------
444 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
445 // author: Chiara (August 2008)
446 // --------------------------------------------------------
447 // TRANSFORMATION MATRICES
448 // Combi transformation:
449 Double_t dx = -3.970000;
450 Double_t dy = 0.000000;
453 Double_t thx = 84.989100; Double_t phx = 0.000000;
454 Double_t thy = 90.000000; Double_t phy = 90.000000;
455 Double_t thz = 5.010900; Double_t phz = 180.000000;
456 TGeoRotation *rotMatrix1c = new TGeoRotation("c",thx,phx,thy,phy,thz,phz);
457 // Combi transformation:
461 TGeoCombiTrans *rotMatrix2c = new TGeoCombiTrans("ZDCC_c1", dx,dy,dz,rotMatrix1c);
462 rotMatrix2c->RegisterYourself();
463 // Combi transformation:
468 thx = 95.010900; phx = 0.000000;
469 thy = 90.000000; phy = 90.000000;
470 thz = 5.010900; phz = 0.000000;
471 TGeoRotation *rotMatrix3c = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
472 TGeoCombiTrans *rotMatrix4c = new TGeoCombiTrans("ZDCC_c2", dx,dy,dz,rotMatrix3c);
473 rotMatrix4c->RegisterYourself();
475 // VOLUMES DEFINITION
477 TGeoVolume *pZDCC = gGeoManager->GetVolume("ZDCC");
479 conpar[0] = (90.1-0.95-0.26)/2.;
484 new TGeoCone("QCLext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
486 conpar[0] = (90.1-0.95-0.26)/2.;
491 new TGeoCone("QCLint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
494 TGeoCompositeShape *pOutTrousersC = new TGeoCompositeShape("outTrousersC", "QCLext:ZDCC_c1+QCLext:ZDCC_c2");
497 TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
498 TGeoVolume *pQCLext = new TGeoVolume("QCLext",pOutTrousersC, medZDCFe);
499 pQCLext->SetLineColor(kGreen);
500 pQCLext->SetVisLeaves(kTRUE);
502 TGeoTranslation *tr1c = new TGeoTranslation(0., 0., (Double_t) -conpar[0]-0.95-zd1);
503 //printf(" Trousers from z = %f to z= %f\n",-zd1,-2*conpar[0]-0.95-zd1);
505 pZDCC->AddNode(pQCLext, 1, tr1c);
507 TGeoCompositeShape *pIntTrousersC = new TGeoCompositeShape("intTrousersC", "QCLint:ZDCC_c1+QCLint:ZDCC_c2");
509 TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
510 TGeoVolume *pQCLint = new TGeoVolume("QCLint",pIntTrousersC, medZDCvoid);
511 pQCLint->SetLineColor(kTeal);
512 pQCLint->SetVisLeaves(kTRUE);
513 pQCLext->AddNode(pQCLint, 1);
517 // second section : 2 tubes (ID = 54. OD = 58.)
520 tubpar[2] = (40.0-0.458422)/2.;
521 gMC->Gsvolu("QC14", "TUBE", idtmed[7], tubpar, 3);
522 gMC->Gspos("QC14", 1, "ZDCC", -15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
523 gMC->Gspos("QC14", 2, "ZDCC", 15.8/2., 0., -tubpar[2]-zd1, 0, "ONLY");
525 //printf(" QC14 TUBE from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
529 // transition x2zdc to recombination chamber : skewed cone
530 conpar[0] = (10.-0.2)/2.;
535 gMC->Gsvolu("QC15", "CONE", idtmed[7], conpar, 5);
536 gMC->Gspos("QC15", 1, "ZDCC", -7.9-0.175, 0., -conpar[0]-0.1-zd1, irotpipe7, "ONLY");
537 gMC->Gspos("QC15", 2, "ZDCC", 7.9+0.175, 0., -conpar[0]-0.1-zd1, irotpipe8, "ONLY");
538 //printf(" QC15 CONE from z = %f to z= %f\n",-zd1,-2*conpar[0]-0.2-zd1);
540 zd1 += 2.*conpar[0]+0.2;
542 // 2 tubes (ID = 63 mm OD=70 mm)
545 tubpar[2] = 512.9/2.;
546 gMC->Gsvolu("QC16", "TUBE", idtmed[7], tubpar, 3);
547 gMC->Gspos("QC16", 1, "ZDCC", -16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
548 gMC->Gspos("QC16", 2, "ZDCC", 16.5/2., 0., -tubpar[2]-zd1, 0, "ONLY");
549 //printf(" QA16 TUBE from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
552 //printf("\n END OF SIDE C BEAM PIPE DEFINITION @ z = %f\n",-zd1);
555 // -- Luminometer (Cu box) in front of ZN - side C
559 gMC->Gsvolu("QLUC", "BOX ", idtmed[6], boxpar, 3);
560 gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
561 //printf(" QLUC LUMINOMETER from z = %f to z= %f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
563 // -- END OF BEAM PIPE VOLUME DEFINITION FOR SIDE C (RB26 SIDE)
564 // ----------------------------------------------------------------
566 ////////////////////////////////////////////////////////////////
570 ///////////////////////////////////////////////////////////////
572 // Rotation Matrices definition
573 Int_t irotpipe1, irotpipe2;
574 //-- rotation matrices for the tilted cone after the TDI to recenter vacuum chamber
575 gMC->Matrix(irotpipe1,90.-2.2918,0.,90.,90.,2.2918,180.);
576 //-- rotation matrices for the tilted tube before and after the TDI
577 gMC->Matrix(irotpipe2,90.+6.3025,0.,90.,90.,6.3025,0.);
578 /* //-- rotation matrices for the legs
579 Int_t irotpipe7, irotpipe8;
580 gMC->Matrix(irotpipe7,90.-1.0027,0.,90.,90.,1.0027,180.);
581 gMC->Matrix(irotpipe8,90.+1.0027,0.,90.,90.,1.0027,0.);
584 // -- Mother of the ZDCs (Vacuum PCON)
585 zd2 = 1910.22;// zd2 initial value
596 gMC->Gsvolu("ZDCA", "PCON", idtmed[10], conpar, 9);
597 gMC->Gspos("ZDCA", 1, "ALIC", 0., 0., 0., 0, "ONLY");
599 // To avoid overlaps 1 micron are left between certain volumes!
600 Double_t dxNoOverlap = 0.0001;
603 // BEAM PIPE from 19.10 m to inner triplet beginning (22.965 m)
606 tubpar[2] = 386.28/2. - dxNoOverlap;
607 gMC->Gsvolu("QA01", "TUBE", idtmed[7], tubpar, 3);
608 gMC->Gspos("QA01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
610 //printf(" QA01 TUBE centred in %f from z = %f to z = %f (IT begin)\n",tubpar[2]+zd2,zd2,2*tubpar[2]+zd2);
614 // -- FIRST SECTION OF THE BEAM PIPE (from beginning of inner triplet to
618 tubpar[2] = 3541.8/2. - dxNoOverlap;
619 gMC->Gsvolu("QA02", "TUBE", idtmed[7], tubpar, 3);
620 gMC->Gspos("QA02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
622 //printf(" QA02 TUBE from z = %f to z = %f (D1 begin)\n",zd2,2*tubpar[2]+zd2);
627 // -- SECOND SECTION OF THE BEAM PIPE (from the beginning of D1 to the beginning of D2)
629 // FROM (MAGNETIC) BEGINNING OF D1 TO THE (MAGNETIC) END OF D1 + 126.5 cm
630 // CYLINDRICAL PIPE of diameter increasing from 6.75 cm up to 8.0 cm
631 // from magnetic end :
632 // 1) 80.1 cm still with ID = 6.75 radial beam screen
633 // 2) 2.5 cm conical section from ID = 6.75 to ID = 8.0 cm
634 // 3) 43.9 cm straight section (tube) with ID = 8.0 cm
636 //printf(" Beginning of D1 at z= %f\n",zd2);
640 tubpar[2] = (945.0+80.1)/2.;
641 gMC->Gsvolu("QA03", "TUBE", idtmed[7], tubpar, 3);
642 gMC->Gspos("QA03", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
644 //printf(" QA03 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
648 // Transition Cone from ID=67.5 mm to ID=80 mm
654 gMC->Gsvolu("QA04", "CONE", idtmed[7], conpar, 5);
655 gMC->Gspos("QA04", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
656 //printf(" QA04 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
663 gMC->Gsvolu("QA05", "TUBE", idtmed[7], tubpar, 3);
664 gMC->Gspos("QA05", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
666 //printf(" QA05 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
670 // Bellow (ID=80 mm) - length = 0.2 m - VMAA
674 gMC->Gsvolu("QA06", "TUBE", idtmed[7], tubpar, 3);
675 gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
677 //printf(" QA06 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
681 // Beam Position Monitor (ID=80 mm) Cu - BPMSX
685 gMC->Gsvolu("QA07", "TUBE", idtmed[7], tubpar, 3);
686 gMC->Gspos("QA07", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
688 //printf(" QA07 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
692 // First section of VAEHI (tube ID=80mm)
696 gMC->Gsvolu("QAV1", "TUBE", idtmed[7], tubpar, 3);
697 gMC->Gspos("QAV1", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
699 //printf(" QAV1 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
703 // Second section of VAEHI (transition cone from ID=80mm to ID=98mm)
709 gMC->Gsvolu("QAV2", "CONE", idtmed[7], conpar, 5);
710 gMC->Gspos("QAV2", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
711 //printf(" QAV2 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
715 //Third section of VAEHI (transition cone from ID=98mm to ID=90mm)
721 gMC->Gsvolu("QAV3", "CONE", idtmed[7], conpar, 5);
722 gMC->Gspos("QAV3", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
723 //printf(" QAV3 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
727 // Fourth section of VAEHI (tube ID=90mm)
731 gMC->Gsvolu("QAV4", "TUBE", idtmed[7], tubpar, 3);
732 gMC->Gspos("QAV4", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
734 //printf(" QAV4 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
738 //---------------------------- TCDD beginning ----------------------------------
739 // space for the insertion of the collimator TCDD (2 m)
740 // TCDD ZONE - 1st volume
746 gMC->Gsvolu("Q01T", "CONE", idtmed[7], conpar, 5);
747 gMC->Gspos("Q01T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
748 //printf(" Q01T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
752 // TCDD ZONE - 2nd volume
756 gMC->Gsvolu("Q02T", "TUBE", idtmed[7], tubpar, 3);
757 gMC->Gspos("Q02T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
759 //printf(" Q02T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
763 // TCDD ZONE - third volume
769 gMC->Gsvolu("Q03T", "CONE", idtmed[7], conpar, 5);
770 gMC->Gspos("Q03T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
771 //printf(" Q03T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
775 // TCDD ZONE - 4th volume
779 gMC->Gsvolu("Q04T", "TUBE", idtmed[7], tubpar, 3);
780 gMC->Gspos("Q04T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
782 //printf(" Q04T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
786 // TCDD ZONE - 5th volume
789 tubpar[2] = 100.12/2.;
790 gMC->Gsvolu("Q05T", "TUBE", idtmed[7], tubpar, 3);
791 gMC->Gspos("Q05T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
793 //printf(" Q05T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
797 // TCDD ZONE - 6th volume
801 gMC->Gsvolu("Q06T", "TUBE", idtmed[7], tubpar, 3);
802 gMC->Gspos("Q06T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
804 //printf(" Q06T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
808 // TCDD ZONE - 7th volume
809 conpar[0] = 11.34/2.;
814 gMC->Gsvolu("Q07T", "CONE", idtmed[7], conpar, 5);
815 gMC->Gspos("Q07T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
816 //printf(" Q07T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
820 // Upper section : one single phi segment of a tube
821 // 5 parameters for tubs: inner radius = 0.,
822 // outer radius = 7.5 cm, half length = 50 cm
823 // phi1 = 0., phi2 = 180.
825 tubspar[1] = 15.0/2.;
826 tubspar[2] = 100.0/2.;
829 gMC->Gsvolu("Q08T", "TUBS", idtmed[7], tubspar, 5);
831 //printf(" upper part : one single phi segment of a tube (Q08T)\n");
833 // rectangular beam pipe inside TCDD upper section (Vacuum)
837 gMC->Gsvolu("Q09T", "BOX ", idtmed[10], boxpar, 3);
838 // positioning vacuum box in the upper section of TCDD
839 gMC->Gspos("Q09T", 1, "Q08T", 0., 1.25, 0., 0, "ONLY");
841 // lower section : one single phi segment of a tube
843 tubspar[1] = 15.0/2.;
844 tubspar[2] = 100.0/2.;
847 gMC->Gsvolu("Q10T", "TUBS", idtmed[7], tubspar, 5);
848 // rectangular beam pipe inside TCDD lower section (Vacuum)
852 gMC->Gsvolu("Q11T", "BOX ", idtmed[10], boxpar, 3);
853 // positioning vacuum box in the lower section of TCDD
854 gMC->Gspos("Q11T", 1, "Q10T", 0., -1.25, 0., 0, "ONLY");
856 // positioning TCDD elements in ZDC2, (inside TCDD volume)
857 gMC->Gspos("Q08T", 1, "ZDCA", 0., 2.5, -100+zd2, 0, "ONLY");
858 gMC->Gspos("Q10T", 1, "ZDCA", 0., -2.5, -100+zd2, 0, "ONLY");
864 gMC->Gsvolu("Q12T", "BOX ", idtmed[7], boxpar, 3);
865 // positioning RF screen at both sides of TCDD
866 gMC->Gspos("Q12T", 1, "ZDCA", tubspar[1]+boxpar[0], 0., -100+zd2, 0, "ONLY");
867 gMC->Gspos("Q12T", 2, "ZDCA", -tubspar[1]-boxpar[0], 0., -100+zd2, 0, "ONLY");
868 //---------------------------- TCDD end ---------------------------------------
870 // Bellow (ID=80 mm) - length = 0.3 m - VMAAB
874 gMC->Gsvolu("QA08", "TUBE", idtmed[7], tubpar, 3);
875 gMC->Gspos("QA08", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
877 //printf(" QA08 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
881 // Flange (ID=80 mm) Cu (first section of VCTCE)
885 gMC->Gsvolu("QA09", "TUBE", idtmed[7], tubpar, 3);
886 gMC->Gspos("QA09", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
888 //printf(" QA09 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
892 // transition cone from ID=80 to ID=212 (second section of VCTCE)
898 gMC->Gsvolu("QA10", "CONE", idtmed[7], conpar, 5);
899 gMC->Gspos("QA10", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
900 //printf(" QA10 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
904 // tube (ID=212 mm) Cu (third section of VCTCE)
907 tubpar[2] = 403.54/2.;
908 gMC->Gsvolu("QA11", "TUBE", idtmed[7], tubpar, 3);
909 gMC->Gspos("QA11", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
911 //printf(" QA11 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
915 // bellow (ID=212 mm) (VMBGA)
919 gMC->Gsvolu("QA12", "TUBE", idtmed[7], tubpar, 3);
920 gMC->Gspos("QA12", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
922 //printf(" QA12 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
926 // TDI valve assembly (ID=212 mm)
930 gMC->Gsvolu("QA13", "TUBE", idtmed[7], tubpar, 3);
931 gMC->Gspos("QA13", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
933 //printf(" QA13 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
937 // bellow (ID=212 mm) (VMBGA)
941 gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
942 gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
944 //printf(" QA14 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
948 // skewed transition piece (ID=212 mm) (before TDI)
951 tubpar[2] = (20.0-2.41)/2.;
952 gMC->Gsvolu("QA15", "TUBE", idtmed[7], tubpar, 3);
953 gMC->Gspos("QA15", 1, "ZDCA", 1.10446, 0., tubpar[2]+2.41/2.+zd2, irotpipe2, "ONLY");
955 //printf(" QA15 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+2.41+zd2);
957 zd2 += 2.*tubpar[2]+2.41;
959 // Vacuum chamber containing TDI
962 tubpar[2] = 540.0/2.;
963 gMC->Gsvolu("Q13TM", "TUBE", idtmed[10], tubpar, 3);
964 gMC->Gspos("Q13TM", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
967 tubpar[2] = 540.0/2.;
968 gMC->Gsvolu("Q13T", "TUBE", idtmed[7], tubpar, 3);
969 gMC->Gspos("Q13T", 1, "Q13TM", 0., 0., 0., 0, "ONLY");
971 //printf(" Q13T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
975 //---------------- INSERT TDI INSIDE Q13T -----------------------------------
978 boxpar[2] = 540.0/2.;
979 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
980 gMC->Gspos("QTD1", 1, "Q13TM", -3.8, 10.5, 0., 0, "ONLY");
983 boxpar[2] = 540.0/2.;
984 gMC->Gsvolu("QTD2", "BOX ", idtmed[7], boxpar, 3);
985 gMC->Gspos("QTD2", 1, "Q13TM", -3.8, -10.5, 0., 0, "ONLY");
988 boxpar[2] = 540.0/2.;
989 gMC->Gsvolu("QTD3", "BOX ", idtmed[7], boxpar, 3);
990 gMC->Gspos("QTD3", 1, "Q13TM", -3.8+5.5+boxpar[0], 6.1, 0., 0, "ONLY");
991 gMC->Gspos("QTD3", 2, "Q13TM", -3.8+5.5+boxpar[0], -6.1, 0., 0, "ONLY");
992 gMC->Gspos("QTD3", 3, "Q13TM", -3.8-5.5-boxpar[0], 6.1, 0., 0, "ONLY");
993 gMC->Gspos("QTD3", 4, "Q13TM", -3.8-5.5-boxpar[0], -6.1, 0., 0, "ONLY");
995 tubspar[0] = 12.0/2.;
996 tubspar[1] = 12.4/2.;
997 tubspar[2] = 540.0/2.;
1000 gMC->Gsvolu("QTD4", "TUBS", idtmed[7], tubspar, 5);
1001 gMC->Gspos("QTD4", 1, "Q13TM", -3.8-10.6, 0., 0., 0, "ONLY");
1002 tubspar[0] = 12.0/2.;
1003 tubspar[1] = 12.4/2.;
1004 tubspar[2] = 540.0/2.;
1007 gMC->Gsvolu("QTD5", "TUBS", idtmed[7], tubspar, 5);
1008 gMC->Gspos("QTD5", 1, "Q13TM", -3.8+10.6, 0., 0., 0, "ONLY");
1009 //---------------- END DEFINING TDI INSIDE Q13T -------------------------------
1011 // skewed transition piece (ID=212 mm) (after TDI)
1012 tubpar[0] = 21.2/2.;
1013 tubpar[1] = 21.8/2.;
1014 tubpar[2] = (20.0-2.41)/2.;
1015 gMC->Gsvolu("QA16", "TUBE", idtmed[7], tubpar, 3);
1016 gMC->Gspos("QA16", 1, "ZDCA", 1.10446+2.2, 0., tubpar[2]+2.41/2.+zd2, irotpipe2, "ONLY");
1018 //printf(" QA16 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+2.41+zd2);
1020 zd2 += 2.*tubpar[2]+2.41;
1022 // bellow (ID=212 mm) (VMBGA)
1023 tubpar[0] = 21.2/2.;
1024 tubpar[1] = 21.8/2.;
1025 tubpar[2] = 40.0/2.;
1026 gMC->Gsvolu("QA17", "TUBE", idtmed[7], tubpar, 3);
1027 gMC->Gspos("QA17", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
1029 //printf(" QA17 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1031 zd2 += 2.*tubpar[2];
1033 // TDI valve assembly (ID=212 mm)
1034 tubpar[0] = 21.2/2.;
1035 tubpar[1] = 21.8/2.;
1036 tubpar[2] = 30.0/2.;
1037 gMC->Gsvolu("QA18", "TUBE", idtmed[7], tubpar, 3);
1038 gMC->Gspos("QA18", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
1040 //printf(" QA18 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1042 zd2 += 2.*tubpar[2];
1044 // bellow (ID=212 mm) (VMBGA)
1045 tubpar[0] = 21.2/2.;
1046 tubpar[1] = 21.8/2.;
1047 tubpar[2] = 40.0/2.;
1048 gMC->Gsvolu("QA19", "TUBE", idtmed[7], tubpar, 3);
1049 gMC->Gspos("QA19", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
1051 //printf(" QA19 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1053 zd2 += 2.*tubpar[2];
1055 // vacuum chamber (ID=212 mm) (BTVST)
1056 tubpar[0] = 21.2/2.;
1057 tubpar[1] = 21.8/2.;
1058 tubpar[2] = 50.0/2.;
1059 gMC->Gsvolu("QA20", "TUBE", idtmed[7], tubpar, 3);
1060 gMC->Gspos("QA20", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
1062 //printf(" QA20 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1064 zd2 += 2.*tubpar[2];
1066 // bellow (ID=212 mm) (VMBGA) repeated 3 times
1067 tubpar[0] = 21.2/2.;
1068 tubpar[1] = 21.8/2.;
1069 tubpar[2] = 120.0/2.;
1070 gMC->Gsvolu("QA21", "TUBE", idtmed[7], tubpar, 3);
1071 gMC->Gspos("QA21", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
1073 //printf(" QA21 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1075 zd2 += 2.*tubpar[2];
1077 // skewed transition cone from ID=212 mm to ID=797 mm SS for the moment
1078 conpar[0] = (110.0-0.44-1.63)/2.;
1079 conpar[1] = 21.2/2.;
1080 conpar[2] = 21.8/2.;
1081 conpar[3] = 79.7/2.;
1082 conpar[4] = 81.3/2.;
1083 gMC->Gsvolu("QA22", "CONE", idtmed[7], conpar, 5);
1084 gMC->Gspos("QA22", 1, "ZDCA", 4.4-2.201, 0., conpar[0]+0.44+zd2, irotpipe1, "ONLY");
1085 //printf(" QA22 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+0.44+1.63+zd2);
1087 zd2 += 2.*conpar[0]+0.44+1.63;
1089 // beam pipe (ID=797 mm) SS
1090 tubpar[0] = 79.7/2.;
1091 tubpar[1] = 81.3/2.;
1092 tubpar[2] = 2393.05/2.;
1093 gMC->Gsvolu("QA23", "TUBE", idtmed[7], tubpar, 3);
1094 gMC->Gspos("QA23", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1096 //printf(" QA23 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1098 zd2 += 2.*tubpar[2];
1100 // Transition from ID=797 mm to ID=196 mm SS for the moment:
1102 // in order to simulate the thin window opened in the transition cone
1103 // we divide the transition cone in three cones:
1104 // the first 8 mm thick
1105 // the second 3 mm thick
1106 // the third 8 mm thick
1109 conpar[0] = (9.09 - dxNoOverlap)/2.; // 15 degree
1110 conpar[1] = 79.7/2.;
1111 conpar[2] = 81.3/2.; // thickness 8 mm
1112 conpar[3] = 74.82868/2.;
1113 conpar[4] = 76.42868/2.; // thickness 8 mm
1114 gMC->Gsvolu("Q24A", "CONE", idtmed[7], conpar, 5);
1115 gMC->Gspos("Q24A", 1, "ZDCA", 0., 0., conpar[0]+zd2+dxNoOverlap/2., 0, "ONLY");
1116 //printf(" Q24A CONE from z = %f to z= %f\n",zd2+dxNoOverlap/2.,2*conpar[0]+zd2+dxNoOverlap/2.);
1118 zd2 += 2.*conpar[0];
1121 conpar[0] = 96.2/2.; // 15 degree
1122 conpar[1] = 74.82868/2.;
1123 conpar[2] = 75.42868/2.; // thickness 3 mm
1124 conpar[3] = 23.19588/2.;
1125 conpar[4] = 23.79588/2.; // thickness 3 mm
1126 gMC->Gsvolu("QA25", "CONE", idtmed[7], conpar, 5);
1127 gMC->Gspos("QA25", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1128 //printf(" QA25 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
1130 zd2 += 2.*conpar[0];
1133 conpar[0] = 6.71/2.; // 15 degree
1134 conpar[1] = 23.19588/2.;
1135 conpar[2] = 24.79588/2.;// thickness 8 mm
1136 conpar[3] = 19.6/2.;
1137 conpar[4] = 21.2/2.;// thickness 8 mm
1138 gMC->Gsvolu("QA26", "CONE", idtmed[7], conpar, 5);
1139 gMC->Gspos("QA26", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1140 //printf(" QA26 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
1142 zd2 += 2.*conpar[0];
1144 // beam pipe (ID=196 mm)
1145 tubpar[0] = 19.6/2.;
1146 tubpar[1] = 21.2/2.;
1147 tubpar[2] = 9.55/2.;
1148 gMC->Gsvolu("QA27", "TUBE", idtmed[7], tubpar, 3);
1149 gMC->Gspos("QA27", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1151 //printf(" QA27 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1153 zd2 += 2.*tubpar[2];
1155 // Flange (ID=196 mm)
1156 tubpar[0] = 19.6/2.;
1157 tubpar[1] = 25.3/2.;
1159 gMC->Gsvolu("QF01", "TUBE", idtmed[7], tubpar, 3);
1160 gMC->Gspos("QF01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1162 //printf(" QF01 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1164 zd2 += 2.*tubpar[2];
1166 // Special Warm Module (made by 5 volumes)
1167 tubpar[0] = 20.2/2.;
1168 tubpar[1] = 20.6/2.;
1169 tubpar[2] = 2.15/2.;
1170 gMC->Gsvolu("QA28", "TUBE", idtmed[7], tubpar, 3);
1171 gMC->Gspos("QA28", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1173 //printf(" QA28 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1175 zd2 += 2.*tubpar[2];
1178 conpar[1] = 20.2/2.;
1179 conpar[2] = 20.6/2.;
1180 conpar[3] = 23.9/2.;
1181 conpar[4] = 24.3/2.;
1182 gMC->Gsvolu("QA29", "CONE", idtmed[7], conpar, 5);
1183 gMC->Gspos("QA29", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1185 //printf(" QA29 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
1187 zd2 += 2.*conpar[0];
1189 tubpar[0] = 23.9/2.;
1190 tubpar[1] = 25.5/2.;
1191 tubpar[2] = 17.0/2.;
1192 gMC->Gsvolu("QA30", "TUBE", idtmed[7], tubpar, 3);
1193 gMC->Gspos("QA30", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1195 //printf(" QA30 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1197 zd2 += 2.*tubpar[2];
1200 conpar[1] = 23.9/2.;
1201 conpar[2] = 24.3/2.;
1202 conpar[3] = 20.2/2.;
1203 conpar[4] = 20.6/2.;
1204 gMC->Gsvolu("QA31", "CONE", idtmed[7], conpar, 5);
1205 gMC->Gspos("QA31", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1207 //printf(" QA31 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
1209 zd2 += 2.*conpar[0];
1211 tubpar[0] = 20.2/2.;
1212 tubpar[1] = 20.6/2.;
1213 tubpar[2] = 2.15/2.;
1214 gMC->Gsvolu("QA32", "TUBE", idtmed[7], tubpar, 3);
1215 gMC->Gspos("QA32", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1217 //printf(" QA32 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1219 zd2 += 2.*tubpar[2];
1221 // Flange (ID=196 mm)
1222 tubpar[0] = 19.6/2.;
1223 tubpar[1] = 25.3/2.;
1225 gMC->Gsvolu("QF02", "TUBE", idtmed[7], tubpar, 3);
1226 gMC->Gspos("QF02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1228 //printf(" QF02 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1230 zd2 += 2.*tubpar[2];
1232 // simulation of the trousers (VCTYB)
1233 // (last design -mail 3/6/05)
1234 // pipe: a tube (ID = 196. OD = 200.)
1235 tubpar[0] = 19.6/2.;
1236 tubpar[1] = 20.0/2.;
1238 gMC->Gsvolu("QA33", "TUBE", idtmed[7], tubpar, 3);
1239 gMC->Gspos("QA33", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1241 //printf(" QA33 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1243 zd2 += 2.*tubpar[2];
1245 // transition cone from ID=196. to ID=216.6
1246 conpar[0] = 32.55/2.;
1247 conpar[1] = 19.6/2.;
1248 conpar[2] = 20.0/2.;
1249 conpar[3] = 21.66/2.;
1250 conpar[4] = 22.06/2.;
1251 gMC->Gsvolu("QA34", "CONE", idtmed[7], conpar, 5);
1252 gMC->Gspos("QA34", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1254 //printf(" QA34 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
1256 zd2 += 2.*conpar[0];
1259 tubpar[0] = 21.66/2.;
1260 tubpar[1] = 22.06/2.;
1261 tubpar[2] = 28.6/2.;
1262 gMC->Gsvolu("QA35", "TUBE", idtmed[7], tubpar, 3);
1263 gMC->Gspos("QA35", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1265 //printf(" QA35 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1267 zd2 += 2.*tubpar[2];
1269 // --------------------------------------------------------
1270 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
1271 // author: Chiara (June 2008)
1272 // --------------------------------------------------------
1273 // TRANSFORMATION MATRICES
1274 // Combi transformation:
1279 thx = 84.989100; phx = 0.000000;
1280 thy = 90.000000; phy = 90.000000;
1281 thz = 5.010900; phz = 180.000000;
1282 TGeoRotation *rotMatrix1 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1283 // Combi transformation:
1287 TGeoCombiTrans *rotMatrix2 = new TGeoCombiTrans("ZDC_c1", dx,dy,dz,rotMatrix1);
1288 rotMatrix2->RegisterYourself();
1289 // Combi transformation:
1294 thx = 95.010900; phx = 0.000000;
1295 thy = 90.000000; phy = 90.000000;
1296 thz = 5.010900; phz = 0.000000;
1297 TGeoRotation *rotMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1298 TGeoCombiTrans *rotMatrix4 = new TGeoCombiTrans("ZDC_c2", dx,dy,dz,rotMatrix3);
1299 rotMatrix4->RegisterYourself();
1302 // VOLUMES DEFINITION
1304 TGeoVolume *pZDCA = gGeoManager->GetVolume("ZDCA");
1306 conpar[0] = (90.1-0.95-0.26)/2.;
1308 conpar[2] = 21.6/2.;
1311 new TGeoCone("QALext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1313 conpar[0] = (90.1-0.95-0.26)/2.;
1315 conpar[2] = 21.2/2.;
1318 new TGeoCone("QALint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1321 TGeoCompositeShape *pOutTrousers = new TGeoCompositeShape("outTrousers", "QALext:ZDC_c1+QALext:ZDC_c2");
1324 //TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
1325 TGeoVolume *pQALext = new TGeoVolume("QALext",pOutTrousers, medZDCFe);
1326 pQALext->SetLineColor(kBlue);
1327 pQALext->SetVisLeaves(kTRUE);
1329 TGeoTranslation *tr1 = new TGeoTranslation(0., 0., (Double_t) conpar[0]+0.95+zd2);
1330 pZDCA->AddNode(pQALext, 1, tr1);
1332 TGeoCompositeShape *pIntTrousers = new TGeoCompositeShape("intTrousers", "QALint:ZDC_c1+QALint:ZDC_c2");
1334 //TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
1335 TGeoVolume *pQALint = new TGeoVolume("QALint",pIntTrousers, medZDCvoid);
1336 pQALint->SetLineColor(kAzure);
1337 pQALint->SetVisLeaves(kTRUE);
1338 pQALext->AddNode(pQALint, 1);
1342 // second section : 2 tubes (ID = 54. OD = 58.)
1345 tubpar[2] = 40.0/2.;
1346 gMC->Gsvolu("QA36", "TUBE", idtmed[7], tubpar, 3);
1347 gMC->Gspos("QA36", 1, "ZDCA", -15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1348 gMC->Gspos("QA36", 2, "ZDCA", 15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1350 //printf(" QA36 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1352 zd2 += 2.*tubpar[2];
1354 // transition x2zdc to recombination chamber : skewed cone
1355 conpar[0] = (10.-0.2)/2.;
1360 gMC->Gsvolu("QA37", "CONE", idtmed[7], conpar, 5);
1361 gMC->Gspos("QA37", 1, "ZDCA", -7.9-0.175, 0., conpar[0]+0.1+zd2, irotpipe7, "ONLY");
1362 gMC->Gspos("QA37", 2, "ZDCA", 7.9+0.175, 0., conpar[0]+0.1+zd2, irotpipe8, "ONLY");
1363 //printf(" QA37 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+0.2+zd2);
1365 zd2 += 2.*conpar[0]+0.2;
1367 // 2 tubes (ID = 63 mm OD=70 mm)
1370 tubpar[2] = 512.9/2.;
1371 gMC->Gsvolu("QA38", "TUBE", idtmed[7], tubpar, 3);
1372 gMC->Gspos("QA38", 1, "ZDCA", -16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1373 gMC->Gspos("QA38", 2, "ZDCA", 16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1374 //printf(" QA38 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
1376 zd2 += 2.*tubpar[2];
1377 //printf("\n END OF SIDE A BEAM PIPE DEFINITION @ z= %f\n",zd2);
1379 // -- Luminometer (Cu box) in front of ZN - side A
1383 //boxpar[2] = (15.+15.+7.5)/2.;
1384 gMC->Gsvolu("QLUA", "BOX ", idtmed[7], boxpar, 3);
1385 gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
1386 //printf("\n QLUC LUMINOMETER from z = %f to z= %f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
1389 // ----------------------------------------------------------------
1390 // -- MAGNET DEFINITION -> LHC OPTICS 6.5
1391 // ----------------------------------------------------------------
1392 // ***************************************************************
1393 // SIDE C - RB26 (dimuon side)
1394 // ***************************************************************
1395 // -- COMPENSATOR DIPOLE (MBXW)
1398 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1401 tubpar[2] = 153./2.;
1402 gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
1407 tubpar[2] = 153./2.;
1408 gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
1410 gMC->Gspos("MBXW", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
1411 gMC->Gspos("YMBX", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
1417 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
1419 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1422 tubpar[2] = 637./2.;
1423 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
1428 tubpar[2] = 637./2.;
1429 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
1431 gMC->Gspos("MQXL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
1432 gMC->Gspos("YMQL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
1434 gMC->Gspos("MQXL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2400., 0, "ONLY");
1435 gMC->Gspos("YMQL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2400., 0, "ONLY");
1438 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1441 tubpar[2] = 550./2.;
1442 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
1447 tubpar[2] = 550./2.;
1448 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
1450 gMC->Gspos("MQX ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
1451 gMC->Gspos("YMQ ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
1453 gMC->Gspos("MQX ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
1454 gMC->Gspos("YMQ ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
1456 // -- SEPARATOR DIPOLE D1
1459 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1462 tubpar[2] = 945./2.;
1463 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
1465 // -- Insert horizontal Cu plates inside D1
1466 // -- (to simulate the vacuum chamber)
1467 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2)) - 0.05;
1469 boxpar[2] = 945./2.;
1470 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
1471 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
1472 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
1476 tubpar[1] = 110./2.;
1477 tubpar[2] = 945./2.;
1478 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
1480 gMC->Gspos("YD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
1481 gMC->Gspos("MD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
1483 //printf(" MD1 from z = %f to z = %f cm\n",-zd1, -zd1-2*tubpar[2]);
1486 // --- LHC optics v6.4
1489 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1492 tubpar[2] = 945./2.;
1493 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
1498 tubpar[2] = 945./2.;
1499 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
1501 gMC->Gspos("YD2 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd2, 0, "ONLY");
1503 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
1504 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
1506 // ***************************************************************
1508 // ***************************************************************
1510 // COMPENSATOR DIPOLE (MCBWA) (2nd compensator)
1511 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1514 tubpar[2] = 153./2.;
1515 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
1516 gMC->Gspos("MCBW", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
1521 tubpar[2] = 153./2.;
1522 gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
1523 gMC->Gspos("YMCB", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
1528 // -- DEFINE MQX1 AND MQX2 QUADRUPOLE ELEMENT
1530 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1533 tubpar[2] = 637./2.;
1534 gMC->Gsvolu("MQX1", "TUBE", idtmed[11], tubpar, 3);
1535 gMC->Gsvolu("MQX4", "TUBE", idtmed[11], tubpar, 3);
1540 tubpar[2] = 637./2.;
1541 gMC->Gsvolu("YMQ1", "TUBE", idtmed[7], tubpar, 3);
1544 gMC->Gspos("MQX1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
1545 gMC->Gspos("YMQ1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
1547 // -- BEAM SCREEN FOR Q1
1548 tubpar[0] = 4.78/2.;
1549 tubpar[1] = 5.18/2.;
1550 tubpar[2] = 637./2.;
1551 gMC->Gsvolu("QBS1", "TUBE", idtmed[6], tubpar, 3);
1552 gMC->Gspos("QBS1", 1, "MQX1", 0., 0., 0., 0, "ONLY");
1553 // INSERT VERTICAL PLATE INSIDE Q1
1554 boxpar[0] = 0.2/2.0;
1555 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(1.9+0.2)*(1.9+0.2));
1557 gMC->Gsvolu("QBS2", "BOX ", idtmed[6], boxpar, 3);
1558 gMC->Gspos("QBS2", 1, "MQX1", 1.9+boxpar[0], 0., 0., 0, "ONLY");
1559 gMC->Gspos("QBS2", 2, "MQX1", -1.9-boxpar[0], 0., 0., 0, "ONLY");
1562 gMC->Gspos("MQX4", 1, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
1563 gMC->Gspos("YMQ1", 2, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
1565 // -- BEAM SCREEN FOR Q3
1566 tubpar[0] = 5.79/2.;
1567 tubpar[1] = 6.14/2.;
1568 tubpar[2] = 637./2.;
1569 gMC->Gsvolu("QBS3", "TUBE", idtmed[6], tubpar, 3);
1570 gMC->Gspos("QBS3", 1, "MQX4", 0., 0., 0., 0, "ONLY");
1571 // INSERT VERTICAL PLATE INSIDE Q3
1572 boxpar[0] = 0.2/2.0;
1573 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1575 gMC->Gsvolu("QBS4", "BOX ", idtmed[6], boxpar, 3);
1576 gMC->Gspos("QBS4", 1, "MQX4", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1577 gMC->Gspos("QBS4", 2, "MQX4", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1582 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1585 tubpar[2] = 550./2.;
1586 gMC->Gsvolu("MQX2", "TUBE", idtmed[11], tubpar, 3);
1587 gMC->Gsvolu("MQX3", "TUBE", idtmed[11], tubpar, 3);
1592 tubpar[2] = 550./2.;
1593 gMC->Gsvolu("YMQ2", "TUBE", idtmed[7], tubpar, 3);
1595 // -- BEAM SCREEN FOR Q2
1596 tubpar[0] = 5.79/2.;
1597 tubpar[1] = 6.14/2.;
1598 tubpar[2] = 550./2.;
1599 gMC->Gsvolu("QBS5", "TUBE", idtmed[6], tubpar, 3);
1600 // VERTICAL PLATE INSIDE Q2
1601 boxpar[0] = 0.2/2.0;
1602 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1604 gMC->Gsvolu("QBS6", "BOX ", idtmed[6], boxpar, 3);
1607 gMC->Gspos("MQX2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
1608 gMC->Gspos("QBS5", 1, "MQX2", 0., 0., 0., 0, "ONLY");
1609 gMC->Gspos("QBS6", 1, "MQX2", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1610 gMC->Gspos("QBS6", 2, "MQX2", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1611 gMC->Gspos("YMQ2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
1615 gMC->Gspos("MQX3", 1, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
1616 gMC->Gspos("QBS5", 2, "MQX3", 0., 0., 0., 0, "ONLY");
1617 gMC->Gspos("QBS6", 3, "MQX3", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1618 gMC->Gspos("QBS6", 4, "MQX3", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1619 gMC->Gspos("YMQ2", 2, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
1621 // -- SEPARATOR DIPOLE D1
1624 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1626 tubpar[1] = 6.75/2.;//3.375
1627 tubpar[2] = 945./2.;
1628 gMC->Gsvolu("MD1L", "TUBE", idtmed[11], tubpar, 3);
1630 // -- The beam screen tube is provided by the beam pipe in D1 (QA03 volume)
1631 // -- Insert the beam screen horizontal Cu plates inside D1
1632 // -- (to simulate the vacuum chamber)
1633 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.885+0.2)*(2.885+0.2));
1636 gMC->Gsvolu("QBS7", "BOX ", idtmed[6], boxpar, 3);
1637 gMC->Gspos("QBS7", 1, "MD1L", 0., 2.885+boxpar[1],0., 0, "ONLY");
1638 gMC->Gspos("QBS7", 2, "MD1L", 0., -2.885-boxpar[1],0., 0, "ONLY");
1643 tubpar[2] = 945./2.;
1644 gMC->Gsvolu("YD1L", "TUBE", idtmed[7], tubpar, 3);
1646 gMC->Gspos("YD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1647 gMC->Gspos("MD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1650 // --- LHC optics v6.5
1653 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1655 tubpar[1] = 7.5/2.; // this has to be checked
1656 tubpar[2] = 945./2.;
1657 gMC->Gsvolu("MD2L", "TUBE", idtmed[11], tubpar, 3);
1662 tubpar[2] = 945./2.;
1663 gMC->Gsvolu("YD2L", "TUBE", idtmed[7], tubpar, 3);
1665 gMC->Gspos("YD2L", 1, "ZDCA", 0., 0., tubpar[2]+zd2l, 0, "ONLY");
1667 gMC->Gspos("MD2L", 1, "YD2L", -9.4, 0., 0., 0, "ONLY");
1668 gMC->Gspos("MD2L", 2, "YD2L", 9.4, 0., 0., 0, "ONLY");
1670 // -- END OF MAGNET DEFINITION
1673 //_____________________________________________________________________________
1674 void AliZDCv3::CreateZDC()
1677 // Create the various ZDCs (ZN + ZP)
1680 Float_t dimPb[6], dimVoid[6];
1682 Int_t *idtmed = fIdtmed->GetArray();
1684 // Parameters for hadronic calorimeters geometry
1685 // NB -> parameters used ONLY in CreateZDC()
1686 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
1687 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
1688 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
1689 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
1690 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
1691 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
1693 // Parameters for EM calorimeter geometry
1694 // NB -> parameters used ONLY in CreateZDC()
1695 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
1696 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
1697 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
1698 Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
1699 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
1700 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
1703 //-- Create calorimeters geometry
1705 // -------------------------------------------------------------------------------
1706 //--> Neutron calorimeter (ZN)
1708 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
1709 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
1710 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
1711 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
1712 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
1713 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
1714 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
1715 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
1716 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
1718 // Divide ZNEU in towers (for hits purposes)
1720 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
1721 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
1723 //-- Divide ZN1 in minitowers
1724 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
1725 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
1726 // (4 fibres per minitower)
1728 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
1729 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
1731 // --- Position the empty grooves in the sticks (4 grooves per stick)
1732 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
1733 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
1735 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1736 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1737 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1738 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1740 // --- Position the fibers in the grooves
1741 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
1742 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
1743 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
1744 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
1746 // --- Position the neutron calorimeter in ZDC
1747 // -- Rotation of ZDCs
1749 gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
1751 gMC->Gspos("ZNEU", 1, "ZDCC", fPosZNC[0], fPosZNC[1], fPosZNC[2]-fDimZN[2], irotzdc, "ONLY");
1753 //printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
1755 // --- Position the neutron calorimeter in ZDC2 (left line)
1756 // -- No Rotation of ZDCs
1757 gMC->Gspos("ZNEU", 2, "ZDCA", fPosZNA[0], fPosZNA[1], fPosZNA[2]+fDimZN[2], 0, "ONLY");
1759 //printf("\n ZN left -> %f < z < %f cm\n",fPosZNl[2],fPosZNl[2]+2*fDimZN[2]);
1762 // -------------------------------------------------------------------------------
1763 //--> Proton calorimeter (ZP)
1765 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
1766 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
1767 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
1768 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
1769 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
1770 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
1771 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
1772 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
1773 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
1775 //-- Divide ZPRO in towers(for hits purposes)
1777 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
1778 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
1781 //-- Divide ZP1 in minitowers
1782 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
1783 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
1784 // (4 fiber per minitower)
1786 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
1787 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
1789 // --- Position the empty grooves in the sticks (4 grooves per stick)
1790 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
1791 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
1793 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1794 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1795 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1796 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1798 // --- Position the fibers in the grooves
1799 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
1800 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
1801 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
1802 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
1805 // --- Position the proton calorimeter in ZDCC
1806 gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
1808 //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
1810 // --- Position the proton calorimeter in ZDCA
1812 gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
1814 //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);
1817 // -------------------------------------------------------------------------------
1818 // -> EM calorimeter (ZEM)
1820 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
1823 gMC->Matrix(irot1,0.,0.,90.,90.,-90.,0.); // Rotation matrix 1
1824 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]);// Rotation matrix 2
1825 //printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
1827 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
1829 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
1831 dimPb[0] = kDimZEMPb; // Lead slices
1832 dimPb[1] = fDimZEM[2];
1833 dimPb[2] = fDimZEM[1];
1834 //dimPb[3] = fDimZEM[3]; //controllare
1835 dimPb[3] = 90.-fDimZEM[3]; //originale
1838 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
1839 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
1840 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
1842 // --- Position the lead slices in the tranche
1843 Float_t zTran = fDimZEM[0]/fDivZEM[2];
1844 Float_t zTrPb = -zTran+kDimZEMPb;
1845 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
1846 gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
1848 // --- Vacuum zone (to be filled with fibres)
1849 dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
1850 dimVoid[1] = fDimZEM[2];
1851 dimVoid[2] = fDimZEM[1];
1852 dimVoid[3] = 90.-fDimZEM[3];
1855 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
1856 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
1858 // --- Divide the vacuum slice into sticks along x axis
1859 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
1860 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
1862 // --- Positioning the fibers into the sticks
1863 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
1864 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
1866 // --- Positioning the vacuum slice into the tranche
1867 //Float_t displFib = fDimZEM[1]/fDivZEM[0];
1868 gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
1869 gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., 0., 0, "ONLY");
1871 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
1872 // NB -> ZEM is positioned in ALIC (instead of in ZDC) volume
1873 gMC->Gspos("ZEM ", 1,"ALIC", -fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1875 // Second EM ZDC (same side w.r.t. IP, just on the other side w.r.t. beam pipe)
1876 gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1878 // --- Adding last slice at the end of the EM calorimeter
1879 Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
1880 gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
1882 //printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
1883 //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
1887 //_____________________________________________________________________________
1888 void AliZDCv3::DrawModule() const
1891 // Draw a shaded view of the Zero Degree Calorimeter version 1
1894 // Set everything unseen
1895 gMC->Gsatt("*", "seen", -1);
1897 // Set ALIC mother transparent
1898 gMC->Gsatt("ALIC","SEEN",0);
1900 // Set the volumes visible
1901 gMC->Gsatt("ZDCC","SEEN",0);
1902 gMC->Gsatt("QT01","SEEN",1);
1903 gMC->Gsatt("QT02","SEEN",1);
1904 gMC->Gsatt("QT03","SEEN",1);
1905 gMC->Gsatt("QT04","SEEN",1);
1906 gMC->Gsatt("QT05","SEEN",1);
1907 gMC->Gsatt("QT06","SEEN",1);
1908 gMC->Gsatt("QT07","SEEN",1);
1909 gMC->Gsatt("QT08","SEEN",1);
1910 gMC->Gsatt("QT09","SEEN",1);
1911 gMC->Gsatt("QT10","SEEN",1);
1912 gMC->Gsatt("QT11","SEEN",1);
1913 gMC->Gsatt("QT12","SEEN",1);
1914 gMC->Gsatt("QT13","SEEN",1);
1915 gMC->Gsatt("QT14","SEEN",1);
1916 gMC->Gsatt("QT15","SEEN",1);
1917 gMC->Gsatt("QT16","SEEN",1);
1918 gMC->Gsatt("QT17","SEEN",1);
1919 gMC->Gsatt("QT18","SEEN",1);
1920 gMC->Gsatt("QC01","SEEN",1);
1921 gMC->Gsatt("QC02","SEEN",1);
1922 gMC->Gsatt("QC03","SEEN",1);
1923 gMC->Gsatt("QC04","SEEN",1);
1924 gMC->Gsatt("QC05","SEEN",1);
1925 gMC->Gsatt("QTD1","SEEN",1);
1926 gMC->Gsatt("QTD2","SEEN",1);
1927 gMC->Gsatt("QTD3","SEEN",1);
1928 gMC->Gsatt("MQXL","SEEN",1);
1929 gMC->Gsatt("YMQL","SEEN",1);
1930 gMC->Gsatt("MQX ","SEEN",1);
1931 gMC->Gsatt("YMQ ","SEEN",1);
1932 gMC->Gsatt("ZQYX","SEEN",1);
1933 gMC->Gsatt("MD1 ","SEEN",1);
1934 gMC->Gsatt("MD1V","SEEN",1);
1935 gMC->Gsatt("YD1 ","SEEN",1);
1936 gMC->Gsatt("MD2 ","SEEN",1);
1937 gMC->Gsatt("YD2 ","SEEN",1);
1938 gMC->Gsatt("ZNEU","SEEN",0);
1939 gMC->Gsatt("ZNF1","SEEN",0);
1940 gMC->Gsatt("ZNF2","SEEN",0);
1941 gMC->Gsatt("ZNF3","SEEN",0);
1942 gMC->Gsatt("ZNF4","SEEN",0);
1943 gMC->Gsatt("ZNG1","SEEN",0);
1944 gMC->Gsatt("ZNG2","SEEN",0);
1945 gMC->Gsatt("ZNG3","SEEN",0);
1946 gMC->Gsatt("ZNG4","SEEN",0);
1947 gMC->Gsatt("ZNTX","SEEN",0);
1948 gMC->Gsatt("ZN1 ","COLO",4);
1949 gMC->Gsatt("ZN1 ","SEEN",1);
1950 gMC->Gsatt("ZNSL","SEEN",0);
1951 gMC->Gsatt("ZNST","SEEN",0);
1952 gMC->Gsatt("ZPRO","SEEN",0);
1953 gMC->Gsatt("ZPF1","SEEN",0);
1954 gMC->Gsatt("ZPF2","SEEN",0);
1955 gMC->Gsatt("ZPF3","SEEN",0);
1956 gMC->Gsatt("ZPF4","SEEN",0);
1957 gMC->Gsatt("ZPG1","SEEN",0);
1958 gMC->Gsatt("ZPG2","SEEN",0);
1959 gMC->Gsatt("ZPG3","SEEN",0);
1960 gMC->Gsatt("ZPG4","SEEN",0);
1961 gMC->Gsatt("ZPTX","SEEN",0);
1962 gMC->Gsatt("ZP1 ","COLO",6);
1963 gMC->Gsatt("ZP1 ","SEEN",1);
1964 gMC->Gsatt("ZPSL","SEEN",0);
1965 gMC->Gsatt("ZPST","SEEN",0);
1966 gMC->Gsatt("ZEM ","COLO",7);
1967 gMC->Gsatt("ZEM ","SEEN",1);
1968 gMC->Gsatt("ZEMF","SEEN",0);
1969 gMC->Gsatt("ZETR","SEEN",0);
1970 gMC->Gsatt("ZEL0","SEEN",0);
1971 gMC->Gsatt("ZEL1","SEEN",0);
1972 gMC->Gsatt("ZEL2","SEEN",0);
1973 gMC->Gsatt("ZEV0","SEEN",0);
1974 gMC->Gsatt("ZEV1","SEEN",0);
1975 gMC->Gsatt("ZES0","SEEN",0);
1976 gMC->Gsatt("ZES1","SEEN",0);
1979 gMC->Gdopt("hide", "on");
1980 gMC->Gdopt("shad", "on");
1981 gMC->Gsatt("*", "fill", 7);
1982 gMC->SetClipBox(".");
1983 gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
1984 gMC->DefaultRange();
1985 gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
1986 gMC->Gdhead(1111, "Zero Degree Calorimeter Version 3");
1987 gMC->Gdman(18, 4, "MAN");
1990 //_____________________________________________________________________________
1991 void AliZDCv3::CreateMaterials()
1994 // Create Materials for the Zero Degree Calorimeter
1996 Float_t dens, ubuf[1], wmat[3], a[3], z[3];
1998 // --- W alloy -> ZN passive material
2009 AliMixture(1, "WALL", a, z, dens, 3, wmat);
2011 // --- Brass (CuZn) -> ZP passive material
2019 AliMixture(2, "BRASS", a, z, dens, 2, wmat);
2029 AliMixture(3, "SIO2", a, z, dens, -2, wmat);
2033 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
2035 // --- Copper (energy loss taken into account)
2037 AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
2039 // --- Iron (energy loss taken into account)
2041 AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
2043 // --- Iron (no energy loss)
2045 AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
2047 // ---------------------------------------------------------
2048 Float_t aResGas[3]={1.008,12.0107,15.9994};
2049 Float_t zResGas[3]={1.,6.,8.};
2050 Float_t wResGas[3]={0.28,0.28,0.44};
2051 Float_t dResGas = 3.2E-14;
2053 // --- Vacuum (no magnetic field)
2054 AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
2056 // --- Vacuum (with magnetic field)
2057 AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
2059 // --- Air (no magnetic field)
2060 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
2061 Float_t zAir[4]={6.,7.,8.,18.};
2062 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
2063 Float_t dAir = 1.20479E-3;
2065 AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
2067 // --- Definition of tracking media:
2069 // --- Tantalum = 1 ;
2071 // --- Fibers (SiO2) = 3 ;
2072 // --- Fibers (SiO2) = 4 ;
2074 // --- Copper (with energy loss)= 6 ;
2075 // --- Copper (with energy loss)= 13 ;
2076 // --- Iron (with energy loss) = 7 ;
2077 // --- Iron (without energy loss) = 8 ;
2078 // --- Vacuum (no field) = 10
2079 // --- Vacuum (with field) = 11
2080 // --- Air (no field) = 12
2082 // ****************************************************
2083 // Tracking media parameters
2085 Float_t epsil = 0.01; // Tracking precision,
2086 Float_t stmin = 0.01; // Min. value 4 max. step (cm)
2087 Float_t stemax = 1.; // Max. step permitted (cm)
2088 Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
2089 Float_t deemax = -1.; // Maximum fractional energy loss
2090 Float_t nofieldm = 0.; // Max. field value (no field)
2091 Float_t fieldm = 45.; // Max. field value (with field)
2092 Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
2093 Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
2094 Int_t inofld = 0; // IFIELD=0 -> no magnetic field
2095 Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
2096 // *****************************************************
2098 AliMedium(1, "ZTANT", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2099 AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2100 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2101 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2102 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2103 AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2104 AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2105 AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2106 AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2107 AliMedium(12,"ZAIR", 12, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2109 AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
2114 //_____________________________________________________________________________
2115 void AliZDCv3::AddAlignableVolumes() const
2118 // Create entries for alignable volumes associating the symbolic volume
2119 // name with the corresponding volume path. Needs to be syncronized with
2120 // eventual changes in the geometry.
2122 TString volpath1 = "ALIC_1/ZDCC_1/ZNEU_1";
2123 TString volpath2 = "ALIC_1/ZDCC_1/ZPRO_1";
2124 TString volpath3 = "ALIC_1/ZDCA_1/ZNEU_2";
2125 TString volpath4 = "ALIC_1/ZDCA_1/ZPRO_2";
2127 TString symname1="ZDC/NeutronZDC_C";
2128 TString symname2="ZDC/ProtonZDC_C";
2129 TString symname3="ZDC/NeutronZDC_A";
2130 TString symname4="ZDC/ProtonZDC_A";
2132 if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
2133 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2135 if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
2136 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2138 if(!gGeoManager->SetAlignableEntry(symname3.Data(),volpath3.Data()))
2139 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2141 if(!gGeoManager->SetAlignableEntry(symname4.Data(),volpath4.Data()))
2142 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2147 //_____________________________________________________________________________
2148 void AliZDCv3::Init()
2151 Int_t *idtmed = fIdtmed->GetArray();
2153 // Thresholds for showering in the ZDCs
2155 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2156 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2157 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2158 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2160 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2161 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2162 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2163 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2165 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2166 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2167 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2168 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2170 // Avoid too detailed showering in TDI
2172 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2173 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2174 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2175 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2177 // Avoid too detailed showering along the beam line
2178 i = 7; //iron with energy loss (ZIRON)
2179 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2180 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2181 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2182 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2184 // Avoid too detailed showering along the beam line
2185 i = 8; //iron with energy loss (ZIRONN)
2186 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2187 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2188 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2189 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2191 // Avoid interaction in fibers (only energy loss allowed)
2192 i = 3; //fibers (ZSI02)
2193 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2194 gMC->Gstpar(idtmed[i], "MULS", 0.);
2195 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2196 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2197 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2198 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2199 gMC->Gstpar(idtmed[i], "COMP", 0.);
2200 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2201 gMC->Gstpar(idtmed[i], "BREM", 0.);
2202 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2203 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2204 gMC->Gstpar(idtmed[i], "HADR", 0.);
2205 i = 4; //fibers (ZQUAR)
2206 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2207 gMC->Gstpar(idtmed[i], "MULS", 0.);
2208 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2209 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2210 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2211 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2212 gMC->Gstpar(idtmed[i], "COMP", 0.);
2213 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2214 gMC->Gstpar(idtmed[i], "BREM", 0.);
2215 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2216 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2217 gMC->Gstpar(idtmed[i], "HADR", 0.);
2219 // Avoid interaction in void
2220 i = 11; //void with field
2221 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2222 gMC->Gstpar(idtmed[i], "MULS", 0.);
2223 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2224 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2225 gMC->Gstpar(idtmed[i], "LOSS", 0.);
2226 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2227 gMC->Gstpar(idtmed[i], "COMP", 0.);
2228 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2229 gMC->Gstpar(idtmed[i], "BREM", 0.);
2230 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2231 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2232 gMC->Gstpar(idtmed[i], "HADR", 0.);
2235 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
2236 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
2237 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
2238 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
2239 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
2240 fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
2241 fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
2242 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
2245 //_____________________________________________________________________________
2246 void AliZDCv3::InitTables()
2249 // Read light tables for Cerenkov light production parameterization
2254 char *lightfName1,*lightfName2,*lightfName3,*lightfName4,
2255 *lightfName5,*lightfName6,*lightfName7,*lightfName8;
2256 FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
2258 // --- Reading light tables for ZN
2259 lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
2260 if((fp1 = fopen(lightfName1,"r")) == NULL){
2261 printf("Cannot open file fp1 \n");
2264 lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
2265 if((fp2 = fopen(lightfName2,"r")) == NULL){
2266 printf("Cannot open file fp2 \n");
2269 lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
2270 if((fp3 = fopen(lightfName3,"r")) == NULL){
2271 printf("Cannot open file fp3 \n");
2274 lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
2275 if((fp4 = fopen(lightfName4,"r")) == NULL){
2276 printf("Cannot open file fp4 \n");
2280 for(k=0; k<fNalfan; k++){
2281 for(j=0; j<fNben; j++){
2282 fscanf(fp1,"%f",&fTablen[0][k][j]);
2283 fscanf(fp2,"%f",&fTablen[1][k][j]);
2284 fscanf(fp3,"%f",&fTablen[2][k][j]);
2285 fscanf(fp4,"%f",&fTablen[3][k][j]);
2293 // --- Reading light tables for ZP and ZEM
2294 lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
2295 if((fp5 = fopen(lightfName5,"r")) == NULL){
2296 printf("Cannot open file fp5 \n");
2299 lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
2300 if((fp6 = fopen(lightfName6,"r")) == NULL){
2301 printf("Cannot open file fp6 \n");
2304 lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
2305 if((fp7 = fopen(lightfName7,"r")) == NULL){
2306 printf("Cannot open file fp7 \n");
2309 lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
2310 if((fp8 = fopen(lightfName8,"r")) == NULL){
2311 printf("Cannot open file fp8 \n");
2315 for(k=0; k<fNalfap; k++){
2316 for(j=0; j<fNbep; j++){
2317 fscanf(fp5,"%f",&fTablep[0][k][j]);
2318 fscanf(fp6,"%f",&fTablep[1][k][j]);
2319 fscanf(fp7,"%f",&fTablep[2][k][j]);
2320 fscanf(fp8,"%f",&fTablep[3][k][j]);
2328 //_____________________________________________________________________________
2329 void AliZDCv3::StepManager()
2332 // Routine called at every step in the Zero Degree Calorimeters
2334 Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
2335 Float_t hits[11], x[3], xdet[3], um[3], ud[3];
2336 Float_t m=0., ekin=0., destep=0., be=0., out=0.;
2337 // Parametrization for light guide uniformity
2338 // NEW!!! Light guide tilted @ 51 degrees
2339 Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
2340 Double_t s[3], p[3];
2343 for(j=0;j<11;j++) hits[j]=-999.;
2345 // --- This part is for no shower developement in beam pipe and TDI
2346 // If particle interacts with beam pipe or TDI -> return
2347 if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){
2348 // If option NoShower is set -> StopTrack
2351 gMC->TrackPosition(s[0],s[1],s[2]);
2352 if(gMC->CurrentMedium() == fMedSensPI){
2353 knamed = gMC->CurrentVolName();
2354 if(!strncmp(knamed,"YMQ",3)){
2355 if(s[2]<0) fpLostITC += 1;
2356 else fpLostITA += 1;
2359 else if(!strncmp(knamed,"YD1",3)){
2360 if(s[2]<0) fpLostD1C += 1;
2361 else fpLostD1A += 1;
2364 else if(!strncmp(knamed,"QAL",3)) fnTrou++;
2366 else if(gMC->CurrentMedium() == fMedSensTDI){
2367 knamed = gMC->CurrentVolName();
2368 if(!strncmp(knamed,"MD1",3)){
2369 if(s[2]<0) fpLostD1C += 1;
2370 else fpLostD1A += 1;
2373 else if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
2374 else if(!strncmp(knamed,"QLU",3)){
2375 if(s[2]<0) fnLumiC ++;
2381 //gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
2382 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2383 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2386 printf("\n\t **********************************\n");
2387 printf("\t ********** Side C **********\n");
2388 printf("\t # of spectators in IT = %d\n",fpLostITC);
2389 printf("\t # of spectators in D1 = %d\n",fpLostD1C);
2390 printf("\t # of spectators in luminometer = %d\n",fnLumiC);
2391 printf("\t ********** Side A **********\n");
2392 printf("\t # of spectators in IT = %d\n",fpLostITA);
2393 printf("\t # of spectators in D1 = %d\n",fpLostD1A);
2394 printf("\t # of spectators in TDI = %d\n",fpLostTDI);
2395 printf("\t # of spectators in luminometer = %d\n",fnLumiA);
2396 printf("\t # of spectators in trousers = %d\n",fnTrou);
2397 printf("\t **********************************\n");
2405 if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
2406 (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
2407 (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
2410 //Particle coordinates
2411 gMC->TrackPosition(s[0],s[1],s[2]);
2412 for(j=0; j<=2; j++) x[j] = s[j];
2417 // Determine in which ZDC the particle is
2418 knamed = gMC->CurrentVolName();
2419 if(!strncmp(knamed,"ZN",2)){
2420 if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
2421 else if(x[2]>0.) vol[0]=4; //ZNA
2423 else if(!strncmp(knamed,"ZP",2)){
2424 if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
2425 else if(x[2]>0.) vol[0]=5; //ZPA
2427 else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
2429 // Determine in which quadrant the particle is
2430 if(vol[0]==1){ //Quadrant in ZNC
2431 // Calculating particle coordinates inside ZNC
2432 xdet[0] = x[0]-fPosZNC[0];
2433 xdet[1] = x[1]-fPosZNC[1];
2434 // Calculating quadrant in ZN
2436 if(xdet[1]<=0.) vol[1]=1;
2439 else if(xdet[0]>0.){
2440 if(xdet[1]<=0.) vol[1]=2;
2443 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2444 printf("\n ZDC StepManager->ERROR in ZN!!! vol[1] = %d, xdet[0] = %f,"
2445 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2448 else if(vol[0]==2){ //Quadrant in ZPC
2449 // Calculating particle coordinates inside ZPC
2450 xdet[0] = x[0]-fPosZPC[0];
2451 xdet[1] = x[1]-fPosZPC[1];
2452 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2453 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2454 // Calculating tower in ZP
2455 Float_t xqZP = xdet[0]/(fDimZP[0]/2.);
2456 for(int i=1; i<=4; i++){
2457 if(xqZP>=(i-3) && xqZP<(i-2)){
2462 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2463 printf(" ZDC StepManager->ERROR in ZP!!! vol[1] = %d, xdet[0] = %f,"
2464 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2467 // Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
2468 // vol[1] = 2 -> particle in 2nd ZEM (placed at x = -8.5 cm)
2469 else if(vol[0] == 3){
2472 // Particle x-coordinate inside ZEM1
2473 xdet[0] = x[0]-fPosZEM[0];
2477 // Particle x-coordinate inside ZEM2
2478 xdet[0] = x[0]+fPosZEM[0];
2480 xdet[1] = x[1]-fPosZEM[1];
2483 else if(vol[0]==4){ //Quadrant in ZNA
2484 // Calculating particle coordinates inside ZNA
2485 xdet[0] = x[0]-fPosZNA[0];
2486 xdet[1] = x[1]-fPosZNA[1];
2487 // Calculating quadrant in ZNA
2489 if(xdet[1]<=0.) vol[1]=1;
2492 else if(xdet[0]<0.){
2493 if(xdet[1]<=0.) vol[1]=2;
2496 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2497 printf("\n ZDC StepManager->ERROR in ZNA!!! vol[1] = %d, xdet[0] = %f,"
2498 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2501 else if(vol[0]==5){ //Quadrant in ZPA
2502 // Calculating particle coordinates inside ZPA
2503 xdet[0] = x[0]-fPosZPA[0];
2504 xdet[1] = x[1]-fPosZPA[1];
2505 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2506 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2507 // Calculating tower in ZP
2508 Float_t xqZP = -xdet[0]/(fDimZP[0]/2.);
2509 for(int i=1; i<=4; i++){
2510 if(xqZP>=(i-3) && xqZP<(i-2)){
2515 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2516 printf(" ZDC StepManager->ERROR in ZPA!!! vol[1] = %d, xdet[0] = %f,"
2517 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2521 // Store impact point and kinetic energy of the ENTERING particle
2523 if(gMC->IsTrackEntering()){
2525 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2527 // Impact point on ZDC
2535 Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
2536 TParticle *part = (gAlice->GetMCApp())->Particle(curTrackN);
2537 hits[10] = part->GetPdgCode();
2538 //printf("\t PDGCode = %d\n", part->GetPdgCode());
2540 AddHit(curTrackN, vol, hits);
2543 //printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n",
2544 //knamed, vol[0], vol[1], x[0], x[1], x[2]);
2547 printf("\n # of particles in ZNC = %d\n\n",fnDetectedC);
2551 printf("\n # of particles in ZPC = %d\n\n",fpDetectedC);
2555 printf("\n # of particles in ZNA = %d\n\n",fnDetectedA);
2559 printf("\n # of particles in ZPA = %d\n\n",fpDetectedA);
2562 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2563 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2570 // Charged particles -> Energy loss
2571 if((destep=gMC->Edep())){
2572 if(gMC->IsTrackStop()){
2573 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2574 m = gMC->TrackMass();
2579 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2585 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2591 // *** Light production in fibres
2592 if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
2594 //Select charged particles
2595 if((destep=gMC->Edep())){
2597 // Particle velocity
2599 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
2600 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2601 if(p[3] > 0.00001) beta = ptot/p[3];
2603 if(beta<0.67)return;
2604 else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
2605 else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
2606 else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
2607 else if(beta>0.95) ibeta = 3;
2609 // Angle between particle trajectory and fibre axis
2610 // 1 -> Momentum directions
2614 gMC->Gmtod(um,ud,2);
2615 // 2 -> Angle < limit angle
2616 Double_t alfar = TMath::ACos(ud[2]);
2617 Double_t alfa = alfar*kRaddeg;
2618 if(alfa>=110.) return;
2620 ialfa = Int_t(1.+alfa/2.);
2622 // Distance between particle trajectory and fibre axis
2623 gMC->TrackPosition(s[0],s[1],s[2]);
2624 for(j=0; j<=2; j++){
2627 gMC->Gmtod(x,xdet,1);
2628 if(TMath::Abs(ud[0])>0.00001){
2629 Float_t dcoeff = ud[1]/ud[0];
2630 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
2633 be = TMath::Abs(ud[0]);
2636 ibe = Int_t(be*1000.+1);
2637 //if((vol[0]==1)) radius = fFibZN[1];
2638 //else if((vol[0]==2)) radius = fFibZP[1];
2640 //Looking into the light tables
2641 Float_t charge = gMC->TrackCharge();
2643 if(vol[0]==1 || vol[0]==4) { // (1) ZN fibres
2644 if(ibe>fNben) ibe=fNben;
2645 out = charge*charge*fTablen[ibeta][ialfa][ibe];
2646 nphe = gRandom->Poisson(out);
2648 //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
2649 //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
2650 if(gMC->CurrentMedium() == fMedSensF1){
2651 hits[7] = nphe; //fLightPMQ
2654 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2658 hits[8] = nphe; //fLightPMC
2660 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2663 else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
2664 if(ibe>fNbep) ibe=fNbep;
2665 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2666 nphe = gRandom->Poisson(out);
2667 if(gMC->CurrentMedium() == fMedSensF1){
2668 hits[7] = nphe; //fLightPMQ
2671 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2675 hits[8] = nphe; //fLightPMC
2677 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2680 else if((vol[0]==3)) { // (3) ZEM fibres
2681 if(ibe>fNbep) ibe=fNbep;
2682 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2683 gMC->TrackPosition(s[0],s[1],s[2]);
2688 // z-coordinate from ZEM front face
2689 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
2690 Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
2691 //z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
2692 //printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
2693 Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
2695 nphe = gRandom->Poisson(out);
2696 //printf(" out*guiEff = %f nphe = %d", out, nphe);
2699 hits[8] = nphe; //fLightPMC (ZEM1)
2701 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2704 hits[7] = nphe; //fLightPMQ (ZEM2)
2707 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);