]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCv3.cxx
- implemented function that allows selection of HLT triggered events (Hege)
[u/mrichter/AliRoot.git] / ZDC / AliZDCv3.cxx
index c39b7f5cefc2ebccca0bd406075e27438fd8b347..e58ff641611efa0f3a5c32a6c5b24634b3693f5a 100644 (file)
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
 #include <TGeoMatrix.h>
+#include <TGeoTube.h>
 #include <TGeoCone.h>
 #include <TGeoShape.h>
+#include <TGeoScaledShape.h>
 #include <TGeoCompositeShape.h>
 #include <TParticle.h>
 
@@ -81,8 +83,10 @@ AliZDCv3::AliZDCv3() :
   fpcVCollA(0),
   fpDetectedA(0),
   fnDetectedA(0),
-  fVCollAperture(7./2.),
-  fVCollCentreY(0.),
+  fVCollSideCAperture(7./2.),
+  fVCollSideCCentreY(0.),
+  fVCollSideAAperture(7./2.),
+  fVCollSideACentreY(0.),
   fLumiLength(15.)
 {
   //
@@ -120,8 +124,10 @@ AliZDCv3::AliZDCv3(const char *name, const char *title) :
   fpcVCollA(0),
   fpDetectedA(0),
   fnDetectedA(0),
-  fVCollAperture(7./2.),
-  fVCollCentreY(0.),
+  fVCollSideCAperture(7./2.),
+  fVCollSideCCentreY(0.),
+  fVCollSideAAperture(7./2.),
+  fVCollSideACentreY(0.),
   fLumiLength(15.)  
 {
   //
@@ -307,28 +313,39 @@ void AliZDCv3::CreateBeamLine()
   tubpar[0] = 18.6/2.;
   tubpar[1] = 7.6/2.;
   tubpar[2] = totLength1/2.;
-  gMC->Gsvolu("QE01", "ELTU", idtmed[7], tubpar, 3);  
+//  gMC->Gsvolu("QE01", "ELTU", idtmed[7], tubpar, 3);  
+  // temporary replace with a scaled tube (AG)
+  TGeoTube *tubeQE01 = new TGeoTube(0.,tubpar[0],tubpar[2]);
+  TGeoScale *scaleQE01 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
+  TGeoScaledShape *sshapeQE01 = new TGeoScaledShape(tubeQE01, scaleQE01);
+  new TGeoVolume("QE01", sshapeQE01, gGeoManager->GetMedium(idtmed[7]));
 
   tubpar[0] = 18.0/2.;
   tubpar[1] = 7.0/2.;
   tubpar[2] = totLength1/2.;
-  gMC->Gsvolu("QE02", "ELTU", idtmed[10], tubpar, 3);  
+//  gMC->Gsvolu("QE02", "ELTU", idtmed[10], tubpar, 3);  
+  // temporary replace with a scaled tube (AG)
+  TGeoTube *tubeQE02 = new TGeoTube(0.,tubpar[0],tubpar[2]);
+  TGeoScale *scaleQE02 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
+  TGeoScaledShape *sshapeQE02 = new TGeoScaledShape(tubeQE02, scaleQE02);
+  new TGeoVolume("QE02", sshapeQE02, gGeoManager->GetMedium(idtmed[10]));
+
   gMC->Gspos("QE01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY"); 
   gMC->Gspos("QE02", 1, "QE01", 0., 0., 0., 0, "ONLY");  
   // Ch.debug
   //printf("   QE01 ELTU from z = %1.2f to z= %1.2f\n",-zd1,-2*tubpar[2]-zd1);
   
   // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
-  if(fVCollAperture<3.5){
+  if(fVCollSideCAperture<3.5){
     boxpar[0] = 5.4/2.;
-    boxpar[1] = (3.5-fVCollAperture-fVCollCentreY-0.7)/2.;
+    boxpar[1] = (3.5-fVCollSideCAperture-fVCollSideCCentreY-0.7)/2.;
     if(boxpar[1]<0.) boxpar[1]=0.;
     boxpar[2] = 124.4/2.;
-    printf("\n  AliZDCv3 -> Setting VCollimator jaw: aperture %1.2f center %1.2f mod.thickness %1.3f\n\n", 
-       2*fVCollAperture,fVCollCentreY,2*boxpar[1]);
+    printf("\n  AliZDCv3 -> Setting SideC VCollimator jaw: aperture %1.2f center %1.2f mod.thickness %1.3f\n\n", 
+       2*fVCollSideCAperture,fVCollSideCCentreY,2*boxpar[1]);
     gMC->Gsvolu("QCVC" , "BOX ", idtmed[13], boxpar, 3); 
-    gMC->Gspos("QCVC", 1, "QE02", -boxpar[0],  fVCollAperture+fVCollCentreY+boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");  
-    gMC->Gspos("QCVC", 2, "QE02", -boxpar[0], -fVCollAperture+fVCollCentreY-boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");  
+    gMC->Gspos("QCVC", 1, "QE02", -boxpar[0],  fVCollSideCAperture+fVCollSideCCentreY+boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");  
+    gMC->Gspos("QCVC", 2, "QE02", -boxpar[0], -fVCollSideCAperture+fVCollSideCCentreY-boxpar[1], -totLength1/2.+160.8+78.+148./2., 0, "ONLY");  
   }
   
   zd1 += tubpar[2] * 2.;
@@ -932,26 +949,36 @@ void AliZDCv3::CreateBeamLine()
   tubpar[0] = 18.4/2.;
   tubpar[1] = 7.4/2.;
   tubpar[2] = 313.3/2.;
-  gMC->Gsvolu("QA06", "ELTU", idtmed[7], tubpar, 3);  
+//  gMC->Gsvolu("QA06", "ELTU", idtmed[7], tubpar, 3);  
+  // temporary replace with a scaled tube (AG)
+  TGeoTube *tubeQA06 = new TGeoTube(0.,tubpar[0],tubpar[2]);
+  TGeoScale *scaleQA06 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
+  TGeoScaledShape *sshapeQA06 = new TGeoScaledShape(tubeQA06, scaleQA06);
+  new TGeoVolume("QA06", sshapeQA06, gGeoManager->GetMedium(idtmed[7]));
   //printf("   QA06 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
 
   tubpar[0] = 18.0/2.;
   tubpar[1] = 7.0/2.;
   tubpar[2] = 313.3/2.;
-  gMC->Gsvolu("QA07", "ELTU", idtmed[10], tubpar, 3);  
+//  gMC->Gsvolu("QA07", "ELTU", idtmed[10], tubpar, 3);  
+  // temporary replace with a scaled tube (AG)
+  TGeoTube *tubeQA07 = new TGeoTube(0.,tubpar[0],tubpar[2]);
+  TGeoScale *scaleQA07 = new TGeoScale(1., tubpar[1]/tubpar[0], 1.);
+  TGeoScaledShape *sshapeQA07 = new TGeoScaledShape(tubeQA07, scaleQA07);
+  new TGeoVolume("QA07", sshapeQA07, gGeoManager->GetMedium(idtmed[10]));
   //printf("   QA07 TUBE from z = %1.2f to z= %1.2f\n",zd2,2*tubpar[2]+zd2);
   gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY"); 
   gMC->Gspos("QA07", 1, "QA06", 0., 0., 0., 0, "ONLY");  
   
   // Vertical collimator jaws (defined ONLY if fVCollAperture<3.5!)
-  if(fVCollAperture<3.5){
+  if(fVCollSideAAperture<3.5){
     boxpar[0] = 5.4/2.;
-    boxpar[1] = (3.5-fVCollAperture-fVCollCentreY-0.7)/2.;
+    boxpar[1] = (3.5-fVCollSideAAperture-fVCollSideACentreY-0.7)/2.;
     if(boxpar[1]<0.) boxpar[1]=0.;
     boxpar[2] = 124.4/2.;
     gMC->Gsvolu("QCVA" , "BOX ", idtmed[13], boxpar, 3); 
-    gMC->Gspos("QCVA", 1, "QA07", -boxpar[0], fVCollAperture+fVCollCentreY+boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");  
-    gMC->Gspos("QCVA", 2, "QA07", -boxpar[0], -fVCollAperture+fVCollCentreY-boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");  
+    gMC->Gspos("QCVA", 1, "QA07", -boxpar[0], fVCollSideAAperture+fVCollSideACentreY+boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");  
+    gMC->Gspos("QCVA", 2, "QA07", -boxpar[0], -fVCollSideAAperture+fVCollSideACentreY-boxpar[1], -313.3/2.+78.+148./2., 0, "ONLY");  
   }
   
   zd2 += 2.*tubpar[2];
@@ -2082,6 +2109,7 @@ void AliZDCv3::CreateMaterials()
   Float_t stmin  = 0.01;   // Min. value 4 max. step (cm)
   Float_t stemax = 1.;     // Max. step permitted (cm) 
   Float_t tmaxfd = 0.;     // Maximum angle due to field (degrees) 
+  Float_t tmaxfdv = 0.1;   // Maximum angle due to field (degrees) 
   Float_t deemax = -1.;    // Maximum fractional energy loss
   Float_t nofieldm = 0.;   // Max. field value (no field)
   Float_t fieldm = 45.;    // Max. field value (with field)
@@ -2101,7 +2129,7 @@ void AliZDCv3::CreateMaterials()
   AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   AliMedium(9, "ZCOPL", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfdv, stemax, deemax, epsil, stmin);
   AliMedium(12,"ZAIR", 12, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   AliMedium(13,"ZTANT",13, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   AliMedium(14, "ZIRONT", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);