]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDv0.cxx
Modified file access mode
[u/mrichter/AliRoot.git] / PMD / AliPMDv0.cxx
index 31370aabad573608055fe9995556da96a0c2c5b1..5ee8ce8d1cb7432e1be134f98c80adc25689bfbc 100644 (file)
@@ -36,6 +36,7 @@
 #include "AliPMDv0.h"
 #include "AliRun.h"
 #include "AliMC.h"
+#include "AliLog.h"
 
 const Int_t   AliPMDv0::fgkNcellHole  = 24;       // Hole dimension
 const Float_t AliPMDv0::fgkCellRadius = 0.25;     // Radius of a hexagonal cell
@@ -55,22 +56,28 @@ const Float_t AliPMDv0::fgkPi         = 3.14159;  // pi
 ClassImp(AliPMDv0)
  
 //_____________________________________________________________________________
-  AliPMDv0::AliPMDv0()
+AliPMDv0::AliPMDv0():
+  fSMthick(0.),
+  fSMLength(0.),
+  fMedSens(0),
+  fNcellSM(0)
 {
   //
   // Default constructor 
   //
-  fMedSens=0;
 }
  
 //_____________________________________________________________________________
-AliPMDv0::AliPMDv0(const char *name, const char *title)
-  : AliPMD(name,title)
+AliPMDv0::AliPMDv0(const char *name, const char *title):
+  AliPMD(name,title),
+  fSMthick(0.),
+  fSMLength(0.),
+  fMedSens(0),
+  fNcellSM(0)
 {
   //
   // Standard constructor
   //
-  fMedSens=0;
 }
 
 //_____________________________________________________________________________
@@ -698,13 +705,12 @@ void AliPMDv0::CreatePMD()
         ysup[i]*TMath::Sin(theta[j]);
        ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) +
         ysup[i]*TMath::Cos(theta[j]);
-       if(fDebug) 
-        printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]);
+        
+       AliDebugClass(1,Form("xpos: %f, ypos: %f", xpos[i], ypos[i]));
        
        nummod = nummod+1;
        
-       if(fDebug) 
-        printf("\n%s: nummod %d\n",ClassName(),nummod);
+       AliDebugClass(1,Form("nummod %d",nummod));
        
        gMC->Gspos("EMM1", nummod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY");
        
@@ -770,7 +776,6 @@ void AliPMDv0::CreateMaterials()
   
   //  cout << " Inside create materials " << endl;
 
-  Int_t *idtmed = fIdtmed->GetArray()-599;
   Int_t isxfld = gAlice->Field()->Integ();
   Float_t sxmgmx = gAlice->Field()->Max();
   
@@ -808,7 +813,8 @@ void AliPMDv0::CreateMaterials()
   
   Float_t aG10[4]={1.,12.011,15.9994,28.086};
   Float_t zG10[4]={1.,6.,8.,14.};
-  Float_t wG10[4]={0.148648649,0.104054054,0.483499056,0.241666667};
+  //PH  Float_t wG10[4]={0.148648649,0.104054054,0.483499056,0.241666667};
+  Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
   AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
   
   AliMaterial(15, "Cu   $", 63.54, 29., 8.96, 1.43, 15.);
@@ -841,7 +847,33 @@ void AliPMDv0::CreateMaterials()
   AliMedium(98, "Vacuum  $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
   AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
 
-  
+}
+
+//_____________________________________________________________________________
+void AliPMDv0::Init()
+{
+  //
+  // Initialises PMD detector after it has been built
+  //
+  Int_t i;
+  //  kdet=1;
+  //
+  if(AliLog::GetGlobalDebugLevel()>0) {
+      printf("\n%s: ",ClassName());
+      for(i=0;i<35;i++) printf("*");
+      printf(" PMD_INIT ");
+      for(i=0;i<35;i++) printf("*");
+      printf("\n%s: ",ClassName());
+      printf("                 PMD simulation package (v0) initialised\n");
+      printf("%s: parameters of pmd\n", ClassName());
+      printf("%s: %10.2f %10.2f %10.2f \
+      %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
+      printf("%s: ",ClassName());
+      for(i=0;i<80;i++) printf("*");
+      printf("\n");
+  }
+  Int_t *idtmed = fIdtmed->GetArray()-599;
+  fMedSens=idtmed[605-1];
   // --- Generate explicitly delta rays in the iron, aluminium and lead --- 
   gMC->Gstpar(idtmed[600], "LOSS", 3.);
   gMC->Gstpar(idtmed[600], "DRAY", 1.);
@@ -879,10 +911,10 @@ void AliPMDv0::CreateMaterials()
   gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
   gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
   gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
-  gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
-  gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
-  gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
-  gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
+//   gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
+//   gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
+//   gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
+//   gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
   
   // --- Prevent particles stopping in the gas due to energy cut-off --- 
   gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
@@ -892,33 +924,6 @@ void AliPMDv0::CreateMaterials()
   gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
 }
 
-//_____________________________________________________________________________
-void AliPMDv0::Init()
-{
-  //
-  // Initialises PMD detector after it has been built
-  //
-  Int_t i;
-  //  kdet=1;
-  //
-  if(fDebug) {
-      printf("\n%s: ",ClassName());
-      for(i=0;i<35;i++) printf("*");
-      printf(" PMD_INIT ");
-      for(i=0;i<35;i++) printf("*");
-      printf("\n%s: ",ClassName());
-      printf("                 PMD simulation package (v0) initialised\n");
-      printf("%s: parameters of pmd\n", ClassName());
-      printf("%s: %10.2f %10.2f %10.2f \
-      %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
-      printf("%s: ",ClassName());
-      for(i=0;i<80;i++) printf("*");
-      printf("\n");
-  }
-  Int_t *idtmed = fIdtmed->GetArray()-599;
-  fMedSens=idtmed[605-1];
-}
-
 //_____________________________________________________________________________
 void AliPMDv0::StepManager()
 {
@@ -931,7 +936,7 @@ void AliPMDv0::StepManager()
   Int_t   vol[5];
   //char *namep;
   
-  if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
+  if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
   
     gMC->CurrentVolID(copy);