]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCv2.cxx
GetMedium replaced by CurrentMedium as it was in version 1.37
[u/mrichter/AliRoot.git] / ZDC / AliZDCv2.cxx
index 77874eb141e4d27015e7a6a79df5ae0473ae2497..bbbf9085fbc3f724167f45928e26a70927e56901 100644 (file)
 
 // --- AliRoot classes
 #include "AliConst.h"
-#include "AliDetector.h"
 #include "AliMagF.h"
-#include "AliPDG.h"
 #include "AliRun.h"
-#include "AliZDCHit.h"
 #include "AliZDCv2.h"
 #include "AliMC.h"
  
+class  AliZDCHit;
+class  AliPDG;
+class  AliDetector;
  
 ClassImp(AliZDCv2)
 
@@ -455,11 +455,13 @@ void AliZDCv2::CreateBeamLine()
   // -- ROTATE PIPES 
   Float_t angle = 0.143*kDegrad; // Rotation angle
   
-  AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
+  //AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
+  gMC->Matrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
   gMC->Gspos("QT17", 1, "ZDC ", TMath::Sin(angle) * 680.8/ 2. - 9.4, 
              0., -tubpar[2]-zd1, im1, "ONLY"); 
             
-  AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
+  //AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
+  gMC->Matrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
   gMC->Gspos("QT18", 1, "ZDC ", 9.7 - TMath::Sin(angle) * 680.8 / 2., 
              0., -tubpar[2]-zd1, im2, "ONLY"); 
                 
@@ -482,7 +484,7 @@ void AliZDCv2::CreateBeamLine()
   tubpar[0] = 4.5;
   tubpar[1] = 55.;
   tubpar[2] = 170./2.;
-  gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
+  gMC->Gsvolu("YMBX", "TUBE", idtmed[13], tubpar, 3);
 
   gMC->Gspos("MBXW", 1, "ZDC ", 0., 0., -tubpar[2]-zc, 0, "ONLY");
   gMC->Gspos("YMBX", 1, "ZDC ", 0., 0., -tubpar[2]-zc, 0, "ONLY");
@@ -945,6 +947,7 @@ void AliZDCv2::CreateMaterials()
   // --- Iron (no energy loss)
   ubuf[0] = 1.1;
   AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
+  AliMaterial(13, "IRON2", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
   
   // ---------------------------------------------------------  
   Float_t aResGas[3]={1.008,12.0107,15.9994};
@@ -1010,7 +1013,8 @@ void AliZDCv2::CreateMaterials()
   AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   AliMedium(12,"ZAIR", 12, 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, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium(13,"ZIRONE",13, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
   
   // Thresholds for showering in the ZDCs 
   i = 1; //tantalum
@@ -1049,6 +1053,12 @@ void AliZDCv2::CreateMaterials()
   gMC->Gstpar(idtmed[i], "CUTELE", .1);
   gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
   gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
+  // Avoid too detailed showering along the beam line 
+  i = 13; //iron with energy loss (ZIRONN)
+  gMC->Gstpar(idtmed[i], "CUTGAM", 1.);
+  gMC->Gstpar(idtmed[i], "CUTELE", 1.);
+  gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
+  gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
   
   // Avoid interaction in fibers (only energy loss allowed) 
   i = 3; //fibers (ZSI02)
@@ -1211,15 +1221,15 @@ void AliZDCv2::StepManager()
   
   // --- This part is for no shower developement in beam pipe and TDI
   // If particle interacts with beam pipe or TDI -> return
-  if((gMC->GetMedium() == fMedSensPI) || (gMC->GetMedium() == fMedSensTDI)){ 
+  if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){ 
   // If option NoShower is set -> StopTrack
     if(fNoShower==1) {
-      if(gMC->GetMedium() == fMedSensPI) {
+      if(gMC->CurrentMedium() == fMedSensPI) {
         knamed = gMC->CurrentVolName();
        if(!strncmp(knamed,"YMQ",3))  fpLostIT += 1;
         if(!strncmp(knamed,"YD1",3))   fpLostD1 += 1;
       }
-      else if(gMC->GetMedium() == fMedSensTDI){ // NB->Cu = TDI or D1 vacuum chamber
+      else if(gMC->CurrentMedium() == fMedSensTDI){ // NB->Cu = TDI or D1 vacuum chamber
         knamed = gMC->CurrentVolName();
         if(!strncmp(knamed,"MD1",3)) fpLostD1 += 1;
         if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
@@ -1232,9 +1242,9 @@ void AliZDCv2::StepManager()
     return;
   }
 
-  if((gMC->GetMedium() == fMedSensZN) || (gMC->GetMedium() == fMedSensZP) ||
-     (gMC->GetMedium() == fMedSensGR) || (gMC->GetMedium() == fMedSensF1) ||
-     (gMC->GetMedium() == fMedSensF2) || (gMC->GetMedium() == fMedSensZEM)){
+  if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
+     (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
+     (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
 
   
   //Particle coordinates 
@@ -1321,10 +1331,11 @@ void AliZDCv2::StepManager()
        AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
        
        if(fNoShower==1){
-         fpDetected += 1;
+         if(vol[0]==1) fnDetected += 1;
+         else if(vol[0]==2) fpDetected += 1;
+         printf("\n  # of nucleons in ZN = %d",fnDetected);
+         printf("\n  # of nucleons in ZP = %d\n\n",fpDetected);
          gMC->StopTrack();
-         if(vol[0]==1) printf("\n      # of detected neutrons = %d\n\n",fpDetected);
-         if(vol[0]==2) printf("\n      # of detected protons = %d\n\n",fpDetected);
          return;
        }
       }
@@ -1351,7 +1362,7 @@ void AliZDCv2::StepManager()
 
 
   // *** Light production in fibres 
-  if((gMC->GetMedium() == fMedSensF1) || (gMC->GetMedium() == fMedSensF2)){
+  if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
 
      //Select charged particles
      if((destep=gMC->Edep())){
@@ -1409,7 +1420,7 @@ void AliZDCv2::StepManager()
         // Ch. debug
          //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
         //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
-        if(gMC->GetMedium() == fMedSensF1){
+        if(gMC->CurrentMedium() == fMedSensF1){
           hits[7] = nphe;      //fLightPMQ
           hits[8] = 0;
           hits[9] = 0;
@@ -1426,7 +1437,7 @@ void AliZDCv2::StepManager()
          if(ibe>fNbep) ibe=fNbep;
          out =  charge*charge*fTablep[ibeta][ialfa][ibe];
         nphe = gRandom->Poisson(out);
-        if(gMC->GetMedium() == fMedSensF1){
+        if(gMC->CurrentMedium() == fMedSensF1){
           hits[7] = nphe;      //fLightPMQ
           hits[8] = 0;
           hits[9] = 0;