]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDCv3.cxx
Hits, SDigits, Digits updated to AliZDCv3 (2nd ZDC set included)
[u/mrichter/AliRoot.git] / ZDC / AliZDCv3.cxx
index 6499570be137e35b35c8b2ea2ac2197993c20b2c..d3f527d7d0c0155775cc4bca6dc40f232f2bfb02 100644 (file)
@@ -34,7 +34,6 @@
 #include <TVirtualMC.h>
 #include <TGeoManager.h>
 
-
 // --- AliRoot classes
 #include "AliConst.h"
 #include "AliMagF.h"
@@ -1689,13 +1688,13 @@ void AliZDCv3::CreateZDC()
   
 
   // --- Position the proton calorimeter in ZDCC
-  gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPA[0], fPosZPA[1], fPosZPA[2]-fDimZP[2], irotzdc, "ONLY");
+  gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
   //Ch debug
   //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
   
   // --- Position the proton calorimeter in ZDCA
   // --- No rotation 
-  gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPC[0], fPosZPC[1], fPosZPC[2]+fDimZP[2], 0, "ONLY");
+  gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
   //Ch debug
   //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);  
     
@@ -2223,8 +2222,11 @@ void AliZDCv3::StepManager()
   Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, out;
   //Float_t radius;
   Float_t xalic[3], z, guiEff;
-  // Parametrization for light guide uniformity -> OBSOLETE!!!!
-  Float_t guiPar[4]={0.31,-0.0004,0.0197,0.7958};
+  // Parametrization for light guide uniformity
+  // -> OBSOLETE!!!! For guide tilted @ 46 degrees
+  //Float_t guiPar[4]={0.31,-0.0004,0.0197,0.7958};
+  // NEW!!! Light guide tilted @ 51 degrees
+  Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
   Double_t s[3], p[3];
   const char *knamed;
   //
@@ -2283,18 +2285,18 @@ void AliZDCv3::StepManager()
   // Determine in which ZDC the particle is
     knamed = gMC->CurrentVolName();
     if(!strncmp(knamed,"ZN",2)){
-          if(x[2]<0.) vol[0]=1;
-         else if(x[2]>=0.) vol[0]=4;
+          if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
+         else if(x[2]>0.) vol[0]=4; //ZNA
     }
     else if(!strncmp(knamed,"ZP",2)){ 
-          if(x[2]<0.) vol[0]=2;
-         else if(x[2]>=0.) vol[0]=5;   
+          if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
+         else if(x[2]>0.) vol[0]=5; //ZPA  
     }
-    else if(!strncmp(knamed,"ZE",2)) vol[0]=3;
+    else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
   
   // Determine in which quadrant the particle is
     if(vol[0]==1){     //Quadrant in ZNC
-      // Calculating particle coordinates inside ZN
+      // Calculating particle coordinates inside ZNC
       xdet[0] = x[0]-fPosZNC[0];
       xdet[1] = x[1]-fPosZNC[1];
       // Calculating quadrant in ZN
@@ -2312,7 +2314,7 @@ void AliZDCv3::StepManager()
     }
     
     else if(vol[0]==2){        //Quadrant in ZPC
-      // Calculating particle coordinates inside ZP
+      // Calculating particle coordinates inside ZPC
       xdet[0] = x[0]-fPosZPA[0];
       xdet[1] = x[1]-fPosZPA[1];
       if(xdet[0]>=fDimZP[0])  xdet[0]=fDimZP[0]-0.01;
@@ -2401,15 +2403,25 @@ void AliZDCv3::StepManager()
        AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
        
        if(fNoShower==1){
-         if(vol[0]==1) fnDetectedC += 1;
-         else if(vol[0]==2) fpDetectedC += 1;
-         else if(vol[0]==4) fnDetectedA += 1;
-         else if(vol[0]==5) fpDetectedA += 1;
+         //printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n", 
+           //knamed, vol[0], vol[1], x[0], x[1], x[2]);
+         if(vol[0]==1){
+           fnDetectedC += 1;
+           printf("\n    # of detected neutrons in ZNC = %d\n\n",fnDetectedC);
+         }
+         else if(vol[0]==2){
+           fpDetectedC += 1;
+           printf("\n    # of detected protons in ZPC = %d\n\n",fpDetectedC);
+         }
+         else if(vol[0]==4){
+           fnDetectedA += 1;
+           printf("\n    # of detected neutrons in ZNA = %d\n\n",fnDetectedA);     
+         }
+         else if(vol[0]==5){
+           fpDetectedA += 1;
+           printf("\n    # of detected protons in ZPA = %d\n\n",fpDetectedA);      
+         }
          gMC->StopTrack();
-         if(vol[0]==1) printf("\n      # of detected neutrons in ZNC = %d\n\n",fpDetectedC);
-         if(vol[0]==2) printf("\n      # of detected protons in ZNPC = %d\n\n",fnDetectedC);
-         if(vol[0]==4) printf("\n      # of detected neutrons in ZNA = %d\n\n",fpDetectedA);     
-         if(vol[0]==5) printf("\n      # of detected protons in ZPA = %d\n\n",fnDetectedA);      
          return;
        }
       }
@@ -2487,7 +2499,7 @@ void AliZDCv3::StepManager()
        //Looking into the light tables 
        Float_t charge = gMC->TrackCharge();
        
-       if((vol[0]==1)) {       // (1)  ZN fibres
+       if(vol[0]==1 || vol[0]==4) {    // (1)  ZN fibres
          if(ibe>fNben) ibe=fNben;
          out =  charge*charge*fTablen[ibeta][ialfa][ibe];
         nphe = gRandom->Poisson(out);
@@ -2507,7 +2519,7 @@ void AliZDCv3::StepManager()
           AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
         }
        } 
-       else if((vol[0]==2)) {  // (2) ZP fibres
+       else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
          if(ibe>fNbep) ibe=fNbep;
          out =  charge*charge*fTablep[ibeta][ialfa][ibe];
         nphe = gRandom->Poisson(out);