]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDv1.cxx
Geometry transformed into new coordinate system (test version).
[u/mrichter/AliRoot.git] / PMD / AliPMDv1.cxx
index 2fad56b894b557b1b05d845d7a4f9aa85fdce19e..abc20aca21025a331238ef13439f831f0bf01316 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-/*
-$Log$
-Revision 1.12  2001/05/14 14:01:04  morsch
-AliPMDv0 coarse geometry and AliPMDv1 detailed simulation, completely revised versions by Tapan Nayak.
 
-*/
+/* $Id$ */
+
 //
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -32,12 +29,14 @@ AliPMDv0 coarse geometry and AliPMDv1 detailed simulation, completely revised ve
 ///////////////////////////////////////////////////////////////////////////////
 ////
 
-#include "AliPMDv1.h"
-#include "AliRun.h"
-#include "AliMC.h" 
+#include "Riostream.h"
+
+#include <TVirtualMC.h>
+
 #include "AliConst.h" 
 #include "AliMagF.h" 
-#include "iostream.h"
+#include "AliPMDv1.h"
+#include "AliRun.h"
  
 static Int_t   kdet, ncell_sm, ncell_hole;
 static Float_t zdist, zdist1;
@@ -205,7 +204,7 @@ void AliPMDv1::CreateSupermodule()
 
   // --- place  inner hex inside outer hex 
 
-  gMC->Gsposp("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY", hexd2, 10);
+  gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
 
 // Rhombus shaped supermodules (defined by PARA) 
 
@@ -259,7 +258,7 @@ void AliPMDv1::CreateSupermodule()
     }
     for (i = 1; i <= ncell_sm; ++i) {
       number = i+(j-1)*ncell_sm;
-      gMC->Gsposp("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
+      gMC->Gspos("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY");
       xb += (hexd1[6]*2.);
     }
     xrow = xrow+1;
@@ -336,7 +335,7 @@ void AliPMDv1::CreateSupermodule()
     }
     for (i = 1; i <= ncell_sm; ++i) {
       number = i+(j-1)*ncell_sm;
-         gMC->Gsposp("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
+         gMC->Gspos("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY");
       xb += (hexd1[6]*2.);
     }
     xrow = xrow+1;
@@ -413,7 +412,7 @@ void AliPMDv1::CreateSupermodule()
     }
     for (i = 1; i <= (ncell_sm - ncell_hole); ++i) {
       number = i+(j-1)*(ncell_sm - ncell_hole);
-         gMC->Gsposp("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY", hexd1,10);
+      gMC->Gspos("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY");
       xb += (hexd1[6]*2.);
     }
     xrow = xrow+1;
@@ -705,29 +704,31 @@ void AliPMDv1::CreatePMD()
   num_mod=0;
   for (j=0; j<3; ++j)
     {
-      gMC->Gsposp("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY", Al_rod, 3);
+      gMC->Gspos("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY");
       x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
       y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
 
-      gMC->Gsposp("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY", dpara_emm2, 6);
+      gMC->Gspos("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY");
 
       x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
       y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
 
-      gMC->Gsposp("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY", dpara_emm3, 6);
+      gMC->Gspos("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY");
 
       for (i=1; i<9; ++i)
        {
          xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) - ysup[i]*TMath::Sin(theta[j]);
          ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) + ysup[i]*TMath::Cos(theta[j]);
 
-         printf("%f %f \n", xpos[i], ypos[i]);
+         if(fDebug) 
+             printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]);
 
          num_mod = num_mod+1;
 
-         printf("\nNum_mod %d\n",num_mod);
+         if(fDebug) 
+             printf("\n%s: Num_mod %d\n",ClassName(),num_mod);
 
-         gMC->Gsposp("EMM1", num_mod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY", dpara_emm1, 6);
+         gMC->Gspos("EMM1", num_mod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY");
 
        }
     }
@@ -840,7 +841,7 @@ void AliPMDv1::CreateMaterials()
  
   //   define gas-mixtures 
   
-  char namate[21];
+  char namate[21]="";
   gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
   ag[1] = a;
   zg[1] = z;
@@ -923,17 +924,20 @@ void AliPMDv1::Init()
   Int_t i;
   kdet=1;
   //
-  printf("\n");
-  for(i=0;i<35;i++) printf("*");
-  printf(" PMD_INIT ");
-  for(i=0;i<35;i++) printf("*");
-  printf("\n");
-  printf("                 PMD simulation package (v1) initialised\n");
-  printf(" parameters of pmd\n");
-  printf("%10.2f %10.2f %10.2f %10.2f\n", cell_radius,cell_wall,cell_depth,zdist1 );
-  
-  for(i=0;i<80;i++) printf("*");
-  printf("\n");
+  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 (v1) initialised\n");
+      printf("%s: parameters of pmd\n",ClassName());
+      printf("%s: %10.2f %10.2f %10.2f \
+      %10.2f\n",ClassName(),cell_radius,cell_wall,cell_depth,zdist1 );
+      printf("%s: ",ClassName());
+      for(i=0;i<80;i++) printf("*");
+      printf("\n");
+  }
   
   Int_t *idtmed = fIdtmed->GetArray()-599;
   fMedSens=idtmed[605-1];
@@ -990,7 +994,7 @@ void AliPMDv1::StepManager()
 
     gMC->Gdtom(center,hits,1);
     hits[3] = destep*1e9; //Number in eV
-    AddHit(gAlice->CurrentTrack(), vol, hits);
+    AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
   }
 }
 
@@ -1036,3 +1040,4 @@ void AliPMDv1::GetParameters()
 
 
 
+