]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv5.cxx
Use gMC and not pMC everywhere
[u/mrichter/AliRoot.git] / ITS / AliITSv5.cxx
index 0fba03388b9c9b5a49917be1ef56ecf3cfc5a92f..be60a64331e214e55cbda4f7c75aceb51def8092 100644 (file)
@@ -58,7 +58,7 @@ void AliITSv5::CreateMaterials()
   FILE *file = fopen(fEuclidMaterial.Data(),"r");
   if(file) {
     fclose(file);
-    gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),2);
+    gAlice->ReadEuclidMedia(fEuclidMaterial.Data(),this);
   } else {
     Error("CreateMaterials"," THE MEDIA FILE %s DOES NOT EXIST !",fEuclidMaterial.Data());
     exit(1);
@@ -72,8 +72,6 @@ void AliITSv5::CreateGeometry()
   // Read geometry for the ITS
   //
 
-  AliMC* pMC = AliMC::GetMC();
-  
   char topvol[5];
   char *filtmp;
 //
@@ -82,7 +80,7 @@ void AliITSv5::CreateGeometry()
   delete [] filtmp;
   if(file) {
     fclose(file);
-    gAlice->ReadEuclid(fEuclidGeometry.Data(),2,topvol);
+    gAlice->ReadEuclid(fEuclidGeometry.Data(),this,topvol);
   } else {
     Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !",fEuclidGeometry.Data());
     exit(1);
@@ -91,12 +89,12 @@ void AliITSv5::CreateGeometry()
   // --- Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it
   //     invisible
   //
-  pMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
+  gMC->Gspos("ITSV",1,"ALIC",0,0,0,0,"ONLY");
   //
   // --- Outputs the geometry tree in the EUCLID/CAD format
   
     if (fEuclidOut) {
-      pMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
+      gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
     }
 }
 
@@ -122,59 +120,58 @@ void AliITSv5::StepManager()
   Float_t       position[3];
   Float_t       momentum[4];
   TClonesArray &lhits = *fHits;
-  AliMC* pMC = AliMC::GetMC();
   //
-  if(pMC->TrackCharge() && pMC->Edep()) {
+  if(gMC->TrackCharge() && gMC->Edep()) {
     //
     // Only entering charged tracks
-    if((id=pMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVol(0,copy))==fIdSens1) {  
       vol[0]=1;
-      id=pMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS1)
+      id=gMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS1)
       vol[1]=copy;
-      pMC->CurrentVolOff(1,0,copy1);      //ladder copy in the module   = 1<->2  (I186)
-      pMC->CurrentVolOff(2,0,copy2);      //module copy in the layer    = 1<->10 (I132)
+      gMC->CurrentVolOff(1,0,copy1);      //ladder copy in the module   = 1<->2  (I186)
+      gMC->CurrentVolOff(2,0,copy2);      //module copy in the layer    = 1<->10 (I132)
       vol[2]=copy1+(copy2-1)*2;               //# of ladders in one module  = 2          
     } else if(id==fIdSens2) {
       vol[0]=2;
-      id=pMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS2)        
+      id=gMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS2)        
       vol[1]=copy;
-      pMC->CurrentVolOff(1,0,copy1);      //ladder copy in the module   = 1<->4  (I131)
-      pMC->CurrentVolOff(2,0,copy2);      //module copy in the layer    = 1<->10 (I132)
+      gMC->CurrentVolOff(1,0,copy1);      //ladder copy in the module   = 1<->4  (I131)
+      gMC->CurrentVolOff(2,0,copy2);      //module copy in the layer    = 1<->10 (I132)
       vol[2]=copy1+(copy2-1)*4;                  //# of ladders in one module  = 4   
     } else if(id==fIdSens3) {
       vol[0]=3;
-      id=pMC->CurrentVolOff(1,0,copy);        //detector copy in the ladder = 1<->5  (ITS3 is inside I314)
+      id=gMC->CurrentVolOff(1,0,copy);        //detector copy in the ladder = 1<->5  (ITS3 is inside I314)
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->12 (I316)
+      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->12 (I316)
       vol[2]=copy;             
     } else if(id==fIdSens4) {
       vol[0]=4;
-      id=pMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->8  (ITS4 is inside I414)
+      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->8  (ITS4 is inside I414)
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->22 (I417)
+      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->22 (I417)
       vol[2]=copy;               
     } else if(id==fIdSens5) {
       vol[0]=5;
-      id=pMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->23  (ITS5 is inside I562)       
+      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->23  (ITS5 is inside I562)       
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->34 (I565)
+      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->34 (I565)
       vol[2]=copy;               
     } else if(id==fIdSens6) {
       vol[0]=6;
-      id=pMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->26  (ITS6 is inside I566)       
+      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->26  (ITS6 is inside I566)       
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->38 (I569)
+      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->38 (I569)
       vol[2]=copy;                      
     } else return;
-    pMC->TrackPosition(position);
-    pMC->TrackMomentum(momentum);
+    gMC->TrackPosition(position);
+    gMC->TrackMomentum(momentum);
     hits[0]=position[0];
     hits[1]=position[1];
     hits[2]=position[2];          
     hits[3]=momentum[0]*momentum[3];
     hits[4]=momentum[1]*momentum[3];
     hits[5]=momentum[2]*momentum[3];        
-    hits[6]=pMC->Edep();
+    hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }      
 }