Use TLorentzVector for position and momentum
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jun 1999 20:32:27 +0000 (20:32 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jun 1999 20:32:27 +0000 (20:32 +0000)
31 files changed:
FMD/AliFMD.cxx
ITS/AliITSv0.cxx
ITS/AliITSv1.cxx
ITS/AliITSv3.cxx
ITS/AliITSv4.cxx
ITS/AliITSv5.cxx
MUON/AliMUONv0.cxx
PHOS/AliPHOSv0.cxx
PHOS/AliPHOSv1.cxx
PHOS/AliPHOSv2.cxx
PHOS/AliPHOSv3.cxx
PMD/AliPMDv0.cxx
PMD/AliPMDv1.cxx
PMD/AliPMDv2.cxx
STEER/AliConst.h
STEER/AliLego.cxx
STEER/AliMC.h
STEER/AliRun.cxx
TGeant3/TGeant3.cxx
TGeant3/TGeant3.h
TGeant3/TGeant3Dummy.cxx
TGeant3/gucode.cxx
TOF/AliTOFv0.cxx
TOF/AliTOFv1.cxx
TOF/AliTOFv2.cxx
TOF/AliTOFv3.cxx
TPC/AliTPCv1.cxx
TPC/AliTPCv2.cxx
TRD/AliTRDv0.cxx
TRD/AliTRDv1.cxx
TRD/AliTRDv2.cxx

index 4cb0555..4795e3d 100644 (file)
@@ -136,12 +136,14 @@ void AliFMD::StepManager()
   //
   
   Float_t       hits[3];
-  Int_t         copy,vol[1];
+  Int_t         i,copy,vol[1];
   TClonesArray &lhits = *fHits;
+  TLorentzVector p;
   
-  gMC->CurrentVol(0, copy);
+  gMC->CurrentVolID(copy);
   vol[0] = copy;
-  gMC->TrackPosition(hits);
+  gMC->TrackPosition(p);
+  for(i=0;i<3;++i) hits[i]=p[i];
   new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 }
 
index f48691e..cd1305a 100644 (file)
@@ -495,44 +495,44 @@ void AliITSv0::StepManager()
   Int_t         copy, id;
   Float_t       hits[7];
   Int_t         vol[3];
-  Float_t       position[3];
-  Float_t       momentum[4];
+  TLorentzVector position;
+  TLorentzVector momentum;
   TClonesArray &lhits = *fHits;
   //
   if(gMC->TrackCharge() && gMC->Edep()) {
     //
     // Only entering charged tracks
-    if((id=gMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVolID(copy))==fIdSens1) {  
       vol[0]=1;
-      id=gMC->CurrentVolOff(1,0,copy);      
+      id=gMC->CurrentVolOffID(1,copy);      
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                       
     } else if(id==fIdSens2) {
       vol[0]=2;
-      id=gMC->CurrentVolOff(1,0,copy);       
+      id=gMC->CurrentVolOffID(1,copy);       
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                    
     } else if(id==fIdSens3) {
       vol[0]=3;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;             
     } else if(id==fIdSens4) {
       vol[0]=4;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                  
     } else if(id==fIdSens5) {
       vol[0]=5;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;               
     } else if(id==fIdSens6) {
       vol[0]=6;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                      
     } else return;
     gMC->TrackPosition(position);
@@ -540,9 +540,9 @@ void AliITSv0::StepManager()
     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[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];          
     hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }    
index dd90bef..219f76d 100644 (file)
@@ -521,44 +521,43 @@ void AliITSv1::StepManager()
   Int_t         copy, id;
   Float_t       hits[7];
   Int_t         vol[3];
-  Float_t       position[3];
-  Float_t       momentum[4];
+  TLorentzVector position, momentum;
   TClonesArray &lhits = *fHits;
   //
   if(gMC->TrackCharge() && gMC->Edep()) {
     //
     // Only entering charged tracks
-    if((id=gMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVolID(copy))==fIdSens1) {  
       vol[0]=1;
-      id=gMC->CurrentVolOff(1,0,copy);      
+      id=gMC->CurrentVolOffID(1,copy);      
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                       
     } else if(id==fIdSens2) {
       vol[0]=2;
-      id=gMC->CurrentVolOff(1,0,copy);       
+      id=gMC->CurrentVolOffID(1,copy);       
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                    
     } else if(id==fIdSens3) {
       vol[0]=3;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;             
     } else if(id==fIdSens4) {
       vol[0]=4;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                  
     } else if(id==fIdSens5) {
       vol[0]=5;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;               
     } else if(id==fIdSens6) {
       vol[0]=6;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                      
     } else return;
     gMC->TrackPosition(position);
@@ -566,9 +565,9 @@ void AliITSv1::StepManager()
     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[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];        
     hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }      
index 8235833..e8f3b7d 100644 (file)
@@ -4529,44 +4529,43 @@ void AliITSv3::StepManager()
   Int_t         copy, id;
   Float_t       hits[7];
   Int_t         vol[3];
-  Float_t       position[3];
-  Float_t       momentum[4];
+  TLorentzVector position, momentum;
   TClonesArray &lhits = *fHits;
   //
   if(gMC->TrackCharge() && gMC->Edep()) {
     //
     // Only entering charged tracks
-    if((id=gMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVolID(copy))==fIdSens1) {  
       vol[0]=1;
-      id=gMC->CurrentVolOff(1,0,copy);      
+      id=gMC->CurrentVolOffID(1,copy);      
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                       
     } else if(id==fIdSens2) {
       vol[0]=2;
-      id=gMC->CurrentVolOff(1,0,copy);       
+      id=gMC->CurrentVolOffID(1,copy);       
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                    
     } else if(id==fIdSens3) {
       vol[0]=3;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;             
     } else if(id==fIdSens4) {
       vol[0]=4;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                  
     } else if(id==fIdSens5) {
       vol[0]=5;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;               
     } else if(id==fIdSens6) {
       vol[0]=6;
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                      
     } else return;
     gMC->TrackPosition(position);
@@ -4574,9 +4573,9 @@ void AliITSv3::StepManager()
     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[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];        
     hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }      
index e14c1cb..1826d07 100644 (file)
@@ -4559,9 +4559,9 @@ void AliITSv4::StepManager()
     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[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];        
     hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }      
index be60a64..fb25fd8 100644 (file)
@@ -25,7 +25,6 @@
 #include "AliRun.h"
 #include "stdlib.h"
 #include "TSystem.h"
-#include "TGeant3.h"
 
 ClassImp(AliITSv5)
  
@@ -117,50 +116,49 @@ void AliITSv5::StepManager()
   Int_t         copy1,copy2;
   Float_t       hits[7];
   Int_t         vol[3];
-  Float_t       position[3];
-  Float_t       momentum[4];
+  TLorentzVector position, momentum;
   TClonesArray &lhits = *fHits;
   //
   if(gMC->TrackCharge() && gMC->Edep()) {
     //
     // Only entering charged tracks
-    if((id=gMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVolID(copy))==fIdSens1) {  
       vol[0]=1;
-      id=gMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS1)
+      id=gMC->CurrentVolOffID(0,copy);        //detector copy in the ladder = 1<->4  (ITS1)
       vol[1]=copy;
-      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)
+      gMC->CurrentVolOffID(1,copy1);      //ladder copy in the module   = 1<->2  (I186)
+      gMC->CurrentVolOffID(2,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=gMC->CurrentVolOff(0,0,copy);        //detector copy in the ladder = 1<->4  (ITS2)        
+      id=gMC->CurrentVolOffID(0,copy);        //detector copy in the ladder = 1<->4  (ITS2)        
       vol[1]=copy;
-      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)
+      gMC->CurrentVolOffID(1,copy1);      //ladder copy in the module   = 1<->4  (I131)
+      gMC->CurrentVolOffID(2,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=gMC->CurrentVolOff(1,0,copy);        //detector copy in the ladder = 1<->5  (ITS3 is inside I314)
+      id=gMC->CurrentVolOffID(1,copy);        //detector copy in the ladder = 1<->5  (ITS3 is inside I314)
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->12 (I316)
+      id=gMC->CurrentVolOffID(2,copy);        //ladder copy in the layer    = 1<->12 (I316)
       vol[2]=copy;             
     } else if(id==fIdSens4) {
       vol[0]=4;
-      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->8  (ITS4 is inside I414)
+      id=gMC->CurrentVolOffID(1,copy);       //detector copy in the ladder = 1<->8  (ITS4 is inside I414)
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->22 (I417)
+      id=gMC->CurrentVolOffID(2,copy);        //ladder copy in the layer    = 1<->22 (I417)
       vol[2]=copy;               
     } else if(id==fIdSens5) {
       vol[0]=5;
-      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->23  (ITS5 is inside I562)       
+      id=gMC->CurrentVolOffID(1,copy);       //detector copy in the ladder = 1<->23  (ITS5 is inside I562)       
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->34 (I565)
+      id=gMC->CurrentVolOffID(2,copy);        //ladder copy in the layer    = 1<->34 (I565)
       vol[2]=copy;               
     } else if(id==fIdSens6) {
       vol[0]=6;
-      id=gMC->CurrentVolOff(1,0,copy);       //detector copy in the ladder = 1<->26  (ITS6 is inside I566)       
+      id=gMC->CurrentVolOffID(1,copy);       //detector copy in the ladder = 1<->26  (ITS6 is inside I566)       
       vol[1]=copy;
-      id=gMC->CurrentVolOff(2,0,copy);        //ladder copy in the layer    = 1<->38 (I569)
+      id=gMC->CurrentVolOffID(2,copy);        //ladder copy in the layer    = 1<->38 (I569)
       vol[2]=copy;                      
     } else return;
     gMC->TrackPosition(position);
@@ -168,9 +166,9 @@ void AliITSv5::StepManager()
     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[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];        
     hits[6]=gMC->Edep();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }      
index 0af3b4a..94b51e6 100644 (file)
@@ -1298,12 +1298,10 @@ void AliMUONv0::StepManager()
   static Int_t   vol[2];
   Int_t          ipart;
   static Float_t hits[10];
-  Float_t        pos[3];
-  Float_t        mom[4];
-  Float_t        theta,phi;
   Float_t        destep, step;
   static Float_t eloss, xhit, yhit, tlength;
   const  Float_t big=1.e10;
+  TLorentzVector pos, mom;
   
   TClonesArray &lhits = *fHits;
 
@@ -1317,7 +1315,7 @@ void AliMUONv0::StepManager()
   // Only gas gap inside chamber
   // Tag chambers and record hits when track enters 
   idvol=-1;
-  id=gMC->CurrentVol(0,copy);
+  id=gMC->CurrentVolID(copy);
   
     for (Int_t i=1; i<=NCH; i++) {
       if(id==((AliMUONchamber*)(*fChambers)[i-1])->GetGid()){ 
@@ -1339,18 +1337,18 @@ void AliMUONv0::StepManager()
   
   //
   // record hits when track enters ...
-  if( gMC->TrackEntering()) {
+  if( gMC->IsTrackEntering()) {
       gMC->SetMaxStep(fMaxStepGas);
-      Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
-      Double_t rt = TMath::Sqrt(tc);
-      theta   = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
-      phi     = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
+      //      Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
+      //Double_t rt = TMath::Sqrt(tc);
+      //theta   = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
+      //phi     = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
       hits[0] = Float_t(ipart);         // Geant3 particle type
       hits[1] = pos[0];                 // X-position for hit
       hits[2] = pos[1];                 // Y-position for hit
       hits[3] = pos[2];                 // Z-position for hit
-      hits[4] = theta;                  // theta angle of incidence
-      hits[5] = phi;                    // phi angle of incidence 
+      hits[4] = mom.Theta()*kRaddeg;    // theta angle of incidence
+      hits[5] = mom.Phi()*kRaddeg;      // phi angle of incidence 
       hits[8] = (Float_t) fNclusters;   // first padhit
       hits[9] = -1;                     // last pad hit
       // phi angle of incidence
@@ -1374,7 +1372,7 @@ void AliMUONv0::StepManager()
   // Calculate the charge induced on a pad (disintegration) in case 
   //
   // Mip left chamber ...
-  if( gMC->TrackExiting() || gMC->TrackStop() || gMC->TrackDisappear()){
+  if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
       gMC->SetMaxStep(big);
       eloss   += destep;
       tlength += step;
index d00ecd0..2954981 100644 (file)
@@ -241,19 +241,21 @@ void AliPHOSv0::StepManager()
 {
 
   TClonesArray &lhits = *fHits;
+  TLorentzVector p;
   Int_t copy, i;
   Int_t vol[5];
   Float_t hits[4];
-  if(gMC->CurrentVol(0,copy) == fIdSens) {
+  if(gMC->CurrentVolID(copy) == fIdSens) {
     //
     //We are in the sensitive volume
     for(i=0;i<4;i++) {
-      gMC->CurrentVolOff(i+1,0,copy);
+      gMC->CurrentVolOffID(i+1,copy);
       vol[4-i]=copy;
     }
-    gMC->CurrentVolOff(7,0,copy);
+    gMC->CurrentVolOffID(7,copy);
     vol[0]=copy;
-    gMC->TrackPosition(hits);
+    gMC->TrackPosition(p);
+    for(i=0;i<3;++i) hits[i]=p[i];
     hits[3]=gMC->Edep();
     new(lhits[fNhits++]) AliPHOShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
index 1ed839e..a20885a 100644 (file)
@@ -207,17 +207,17 @@ void AliPHOSv1::StepManager()
 
   int cradle_number, cell_Z, cell_Phi;  // Variables that describe cell position.
 
-  if( gMC->GetMedium() == GetPHOS_IDTMED_PIN() && (gMC->TrackInside() || gMC->TrackExiting()==2) && inwold && gMC->TrackCharge()!=0 )
+  if( gMC->GetMedium() == GetPHOS_IDTMED_PIN() && (gMC->IsTrackInside() || gMC->IsTrackExiting()==2) && inwold && gMC->TrackCharge()!=0 )
   {
     // GEANT particle just have entered into PIN diode.
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(4,0,copy);
+    gMC->CurrentVolOffID(4,copy);
     cradle_number  = copy-1;
-    gMC->CurrentVolOff(1,0,copy);
+    gMC->CurrentVolOffID(1,copy);
     cell_Z         = copy-1;
-    gMC->CurrentVolOff(2,0,copy);
+    gMC->CurrentVolOffID(2,copy);
     cell_Phi       = copy-1;
 /*
         cradle_number  = cvolu->number[cvolu->nlevel-5]-1;
@@ -237,11 +237,11 @@ void AliPHOSv1::StepManager()
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(5,0,copy);
+    gMC->CurrentVolOffID(5,copy);
     cradle_number  = copy-1;
-    gMC->CurrentVolOff(2,0,copy);
+    gMC->CurrentVolOffID(2,copy);
     cell_Z         = copy-1;
-    gMC->CurrentVolOff(3,0,copy);
+    gMC->CurrentVolOffID(3,copy);
     cell_Phi       = copy-1;
 /*
         cradle_number  = cvolu->number[cvolu->nlevel-6]-1;
@@ -254,13 +254,13 @@ void AliPHOSv1::StepManager()
 
   //////////////////////////////////////////////////////////////////////////////
 
-  if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && (gMC->TrackInside() || gMC->TrackExiting()) && inwold )
+  if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && (gMC->IsTrackInside() || gMC->IsTrackExiting()) && inwold )
   {
     // GEANT particle just have entered into CPV detector.
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(1,0,cradle_number);
+    gMC->CurrentVolOffID(1,cradle_number);
     cradle_number--;
 //        cradle_number  = cvolu->number[cvolu->nlevel-2]-1;
 
@@ -268,23 +268,23 @@ void AliPHOSv1::StepManager()
 
     AliPHOSCradle  &cradle = PHOS.GetCradle(cradle_number);
 
-    Float_t   xyz[3];
+    TLorentzVector xyz;
+    TVector3 v;
     gMC->TrackPosition(xyz);
-    TVector3          p(xyz[0],xyz[1],xyz[2]),v;
 
     float x,y,l;
     float R = cradle.GetRadius() - cradle.GetCPV_PHOS_Distance() - cradle.GetCPV_Thikness();
-    cradle.GetXY(p,v,R,x,y,l);
+    cradle.GetXY(xyz.Vect(),v,R,x,y,l);
     if( PHOS.fDebugLevel>0 )
       if( l<0 )
         printf("PHOS_STEP:  warning: negative distance to CPV!! %f\n", l);
 
     // Store current particle in the list of Cradle particles.
-    Float_t  pmom[4];
+    TLorentzVector  pmom;
     gMC->TrackMomentum(pmom);
-    float     Px      =       pmom[0] * pmom[3],
-              Py      =       pmom[1] * pmom[3],
-              Pz      =       pmom[2] * pmom[3];
+    float     Px      =       pmom[0],
+              Py      =       pmom[1],
+              Pz      =       pmom[2];
     Int_t     Ipart   =       gMC->TrackPid();
 
 //     TClonesArray &P=cradle.GetParticles();
@@ -295,6 +295,6 @@ void AliPHOSv1::StepManager()
       cradle.AddCPVHit(x,y);
   }
 
-  inwold=gMC->TrackEntering();         // Save current status of GEANT variable.
+  inwold=gMC->IsTrackEntering();         // Save current status of GEANT variable.
 }
 
index 8a9352e..4dc3a0d 100644 (file)
@@ -602,10 +602,10 @@ void AliPHOSv2::StepManager(void)
     gMC->TrackPosition(xyze);
     xyze[3]=gMC->Edep();
     
-    gMC->CurrentVolOff(3, (Text_t*)NULL, blrc[0]);
+    gMC->CurrentVolOffID(3, blrc[0]);
     blrc[1]=1; // CPV corresponds to layer 1
-    gMC->CurrentVolOff(2, (Text_t*)NULL, blrc[2]);
-    gMC->CurrentVolOff(1, (Text_t*)NULL, blrc[3]);
+    gMC->CurrentVolOffID(2, blrc[2]);
+    gMC->CurrentVolOffID(1, blrc[3]);
     
     AddHit(gAlice->CurrentTrack(), blrc, xyze);
 
@@ -616,10 +616,10 @@ void AliPHOSv2::StepManager(void)
     gMC->TrackPosition(xyze);
     xyze[3]=gMC->Edep();
 
-    gMC->CurrentVolOff(9, (Text_t*)NULL, blrc[0]);
+    gMC->CurrentVolOffID(9, blrc[0]);
     blrc[1]=2; // PWO crystals correspond to layer 2
-    gMC->CurrentVolOff(4, (Text_t*)NULL, blrc[2]);
-    gMC->CurrentVolOff(3, (Text_t*)NULL, blrc[3]);
+    gMC->CurrentVolOffID(4, blrc[2]);
+    gMC->CurrentVolOffID(3, blrc[3]);
 
     AddHit(gAlice->CurrentTrack(), blrc, xyze);
 
index adef6e4..8fabc2c 100644 (file)
@@ -213,17 +213,17 @@ void AliPHOSv3::StepManager()
 
   int cradle_number, cell_Z, cell_Phi;  // Variables that describe cell position.
 
-  if( gMC->GetMedium()==GetPHOS_IDTMED_PIN() && gMC->TrackEntering() && gMC->TrackCharge()!=0 )
+  if( gMC->GetMedium()==GetPHOS_IDTMED_PIN() && gMC->IsTrackEntering() && gMC->TrackCharge()!=0 )
   {
     // GEANT particle just have entered into PIN diode.
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(4,0,copy);
+    gMC->CurrentVolOffID(4,copy);
     cradle_number  = copy-1;
-    gMC->CurrentVolOff(1,0,copy);
+    gMC->CurrentVolOffID(1,copy);
     cell_Z         = copy-1;
-    gMC->CurrentVolOff(2,0,copy);
+    gMC->CurrentVolOffID(2,copy);
     cell_Phi       = copy-1;
 
     TH2S &h = PHOS.GetCradle(cradle_number).fChargedTracksInPIN;
@@ -243,11 +243,11 @@ void AliPHOSv3::StepManager()
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(5,0,copy);
+    gMC->CurrentVolOffID(5,copy);
     cradle_number  = copy-1;
-    gMC->CurrentVolOff(2,0,copy);
+    gMC->CurrentVolOffID(2,copy);
     cell_Z         = copy-1;
-    gMC->CurrentVolOff(3,0,copy);
+    gMC->CurrentVolOffID(3,copy);
     cell_Phi       = copy-1;
 
     TH2F &h = PHOS.GetCradle(cradle_number).fCellEnergy;
@@ -256,37 +256,37 @@ void AliPHOSv3::StepManager()
 
   //////////////////////////////////////////////////////////////////////////////
 
-  if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && gMC->TrackEntering() )
+  if( gMC->GetMedium()==GetPHOS_IDTMED_CPV() && gMC->IsTrackEntering() )
   {
     // GEANT particle just have entered into CPV detector.
 
     AliPHOS &PHOS = *(AliPHOS*)gAlice->GetModule("PHOS");
 
-    gMC->CurrentVolOff(1,0,cradle_number);
+    gMC->CurrentVolOffID(1,cradle_number);
     cradle_number--;
 
     // Save CPV x,y hits position of charged particles.
 
     AliPHOSCradle  &cradle = PHOS.GetCradle(cradle_number);
 
-    Float_t   xyz[3];
-    gMC->TrackPosition(xyz);
-    TVector3          p(xyz[0],xyz[1],xyz[2]),v;
+    TLorentzVector p;
+    gMC->TrackPosition(p);
+    TVector3          v;
 
     float x,y,l;
     float R = cradle.GetRadius() - cradle.GetCPV_PHOS_Distance() - cradle.GetCPV_Thikness();
-    cradle.GetXY(p,v,R,x,y,l);
+    cradle.GetXY(p.Vect(),v,R,x,y,l);
     if( PHOS.fDebugLevel>0 )
       if( l<0 )
         printf("PHOS_STEP:  warning: negative distance to CPV!! %f\n", l);
 
     // Store current particle in the list of Cradle particles.
-    Float_t  pmom[4];
+    TLorentzVector  pmom;
     gMC->TrackMomentum(pmom);
-    Float_t Px    = pmom[0] * pmom[3],
-            Py    = pmom[1] * pmom[3],
-            Pz    = pmom[2] * pmom[3];
-    Float_t Getot = gMC->Etot();
+    Float_t Px    = pmom[0],
+            Py    = pmom[1],
+            Pz    = pmom[2];
+    Float_t Getot = pmom[3];
     Int_t   Ipart = gMC->TrackPid();
 
     cradle.GetParticles().Add(new AliPHOSgamma(x,y,Getot,Px,Py,Pz,Ipart));
@@ -296,5 +296,5 @@ void AliPHOSv3::StepManager()
 
   }
 
-  inwold=gMC->TrackEntering();         // Save current status of GEANT variable.
+  inwold=gMC->IsTrackEntering();         // Save current status of GEANT variable.
 }
index 6b409a6..b4b4fc7 100644 (file)
@@ -618,21 +618,22 @@ void AliPMDv0::StepManager()
   Float_t hits[4], destep;
   Float_t center[3] = {0,0,0};
   Int_t   vol[5];
-  Text_t namep[5];
+  const char* namep;
   
   if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
     
-    gMC->CurrentVol(namep, copy);
+    gMC->CurrentVolID(copy);
     vol[0]=copy;
-    gMC->CurrentVolOff(1,namep,copy);
+    gMC->CurrentVolOffID(1,copy);
     vol[1]=copy;
-    gMC->CurrentVolOff(2,namep,copy);
+    gMC->CurrentVolOffID(2,copy);
+    namep=gMC->CurrentVolOffName(2);
     vol[2]=copy;
     if(strncmp(namep,"DW11",4))vol[2]=1;
     if(strncmp(namep,"DV11",4))vol[2]=2;
-    gMC->CurrentVolOff(3,namep,copy);
+    gMC->CurrentVolOffID(3,copy);
     vol[3]=copy;
-    gMC->CurrentVolOff(4,namep,copy);
+    gMC->CurrentVolOffID(4,copy);
     vol[4]=copy;
     gMC->Gdtom(center,hits,1);
     hits[3] = destep*1e9; //Number in eV
index 606d506..addd6d1 100644 (file)
@@ -550,29 +550,30 @@ void AliPMDv1::StepManager()
   Float_t hits[4], destep;
   Float_t center[3] = {0,0,0};
   Int_t   vol[5];
-  Text_t namep[5];
+  //  char *namep;
   
   if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
     
-//    gMC->CurrentVol(0, copy);
-    gMC->CurrentVol(namep, copy);
-//     printf("Current vol is %s \n",namep);
+    gMC->CurrentVolID(copy);
+//    namep=gMC->CurrentVolName();
+//    printf("Current vol is %s \n",namep);
     vol[0]=copy;
-//    gMC->CurrentVolOff(1,0,copy);
-    gMC->CurrentVolOff(1,namep,copy);
-//     printf("Current vol 11 is %s \n",namep);
+    gMC->CurrentVolOffID(1,copy);
+//    namep=gMC->CurrentVolOffName(1);
+//    printf("Current vol 11 is %s \n",namep);
     vol[1]=copy;
-//    gMC->CurrentVolOff(2,0,copy);
-    gMC->CurrentVolOff(2,namep,copy);
-//     printf("Current vol 22 is %s \n",namep);
+    gMC->CurrentVolOffID(2,copy);
+//    namep=gMC->CurrentVolOffName(2);
+//    printf("Current vol 22 is %s \n",namep);
     vol[2]=copy;
 //     if(strncmp(namep,"DW11",4))vol[2]=1;
-//    gMC->CurrentVolOff(3,0,copy);
-    gMC->CurrentVolOff(3,namep,copy);
-//     printf("Current vol 33 is %s \n",namep);
+    gMC->CurrentVolOffID(3,copy);
+//    namep=gMC->CurrentVolOffName(3);
+//    printf("Current vol 33 is %s \n",namep);
     vol[3]=copy;
-    gMC->CurrentVolOff(4,namep,copy);
-//     printf("Current vol 44 is %s \n",namep);
+    gMC->CurrentVolOffID(4,copy);
+//    namep=gMC->CurrentVolOffName(4);
+//    printf("Current vol 44 is %s \n",namep);
     vol[4]=copy;
 //     printf("volume number %d,%d,%d,%d,%d \n",vol[0],vol[1],vol[2],vol[3],vol[4]);
     gMC->Gdtom(center,hits,1);
index 678b716..7041fa7 100644 (file)
@@ -952,21 +952,22 @@ void AliPMDv2::StepManager()
   Float_t hits[4], destep;
   Float_t center[3] = {0,0,0};
   Int_t   vol[5];
-  Text_t namep[5];
+  const char *namep;
   
   if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
     
-    gMC->CurrentVol(namep, copy);
+    gMC->CurrentVolID(copy);
     vol[0]=copy;
-    gMC->CurrentVolOff(1,namep,copy);
+    gMC->CurrentVolOffID(1,copy);
     vol[1]=copy;
-    gMC->CurrentVolOff(2,namep,copy);
+    gMC->CurrentVolOffID(2,copy);
+    namep=gMC->CurrentVolOffName(2);
     vol[2]=copy;
     if(strncmp(namep,"DW11",4))vol[2]=1;
     if(strncmp(namep,"DV11",4))vol[2]=2;
-    gMC->CurrentVolOff(3,namep,copy);
+    gMC->CurrentVolOffID(3,copy);
     vol[3]=copy;
-    gMC->CurrentVolOff(4,namep,copy);
+    gMC->CurrentVolOffID(4,copy);
     vol[4]=copy;
     gMC->Gdtom(center,hits,1);
     hits[3] = destep*1e9; //Number in eV
index 56d53f7..bed17bf 100644 (file)
@@ -3,7 +3,6 @@
  
 #include <TMath.h> 
   
-static const Double_t kPI     = TMath::Pi();
 static const Double_t k2PI    = 2*kPI;
 static const Double_t kDegrad = kPI/180;
 static const Double_t kRaddeg = 180/kPI;
index cc2c3bb..c30142e 100644 (file)
@@ -221,24 +221,31 @@ void AliLego::StepManager()
   
    Float_t t, tt;
    Float_t a,z,dens,radl,absl;
+   Int_t i;
    
    Float_t step  = gMC->TrackStep();
        
-   Float_t vect[3], pmom[4];
-   gMC->TrackPosition(vect);  
-   gMC->TrackMomentum(pmom);
+   Float_t vect[3], dir[3];
+   TLorentzVector pos, mom;
+
+   gMC->TrackPosition(pos);  
+   gMC->TrackMomentum(mom);
    gMC->CurrentMaterial(a,z,dens,radl,absl);
    
    if (z < 1) return;
    
 // --- See if we have to stop now
-   if (TMath::Abs(vect[2]) > fZMax  || 
-       vect[0]*vect[0] +vect[1]*vect[1] > fRadMax*fRadMax) {
+   if (TMath::Abs(pos[2]) > fZMax  || 
+       pos[0]*pos[0] +pos[1]*pos[1] > fRadMax*fRadMax) {
        gMC->StopEvent();
    } else {
 
 // --- See how long we have to go
-      t  = PropagateCylinder(vect,pmom,fRadMax,fZMax);
+      for(i=0;i<3;++i) {
+       vect[i]=pos[i];
+       dir[i]=mom[i];
+      }
+      t  = PropagateCylinder(vect,dir,fRadMax,fZMax);
       tt = TMath::Min(step,t);
 
       fTotAbso += tt/absl;
index 8d184cc..76a179e 100644 (file)
@@ -9,6 +9,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include <TNamed.h>
+#include <TLorentzVector.h>
 
 class AliMC : public TNamed 
 {
@@ -24,28 +25,30 @@ public:
   static inline AliMC* GetMC() {return fgMC;}
   //
   virtual Int_t   CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const =0;
-  virtual Int_t   CurrentVol(Text_t*, Int_t&) const =0;
-  virtual Int_t   CurrentVolOff(Int_t, Text_t*, Int_t& ) const =0;
+  virtual Int_t   CurrentVolID(Int_t&) const =0;
+  virtual Int_t   CurrentVolOffID(Int_t, Int_t& ) const =0;
+  virtual const char* CurrentVolName() const =0;
+  virtual const char* CurrentVolOffName(Int_t) const =0;
   virtual Int_t   NofVolumes() const =0;
   virtual Int_t   VolId(Text_t*) const =0;
   virtual Int_t   IdFromPDG(Int_t) const =0;
   virtual Int_t   PDGFromId(Int_t) const =0;
   virtual void    DefineParticles() = 0;
-  virtual void    TrackPosition(Float_t*) const =0;
-  virtual void    TrackMomentum(Float_t*) const =0;
+  virtual void    TrackPosition(TLorentzVector&) const =0;
+  virtual void    TrackMomentum(TLorentzVector&) const =0;
   virtual Float_t TrackCharge() const =0;
   virtual Float_t TrackMass() const =0;
   virtual Float_t TrackStep() const =0;
   virtual Int_t   TrackPid() const =0;
-  virtual Bool_t  TrackInside() const =0;
-  virtual Bool_t  TrackEntering() const =0;
-  virtual Bool_t  TrackExiting() const =0;
-  virtual Bool_t  TrackOut() const =0;
-  virtual Bool_t  TrackDisappear() const =0;
-  virtual Bool_t  TrackStop() const =0;
+  virtual Bool_t  IsTrackInside() const =0;
+  virtual Bool_t  IsTrackEntering() const =0;
+  virtual Bool_t  IsTrackExiting() const =0;
+  virtual Bool_t  IsTrackOut() const =0;
+  virtual Bool_t  IsTrackDisappeared() const =0;
+  virtual Bool_t  IsTrackStop() const =0;
   virtual Float_t TrackLength() const =0;
   virtual Float_t TrackTime() const =0;
-  virtual Bool_t  TrackAlive() const=0;
+  virtual Bool_t  IsTrackAlive() const=0;
   virtual Int_t   NSecondaries() const=0;
   virtual Int_t   CurrentEvent() const=0;
   virtual void    ProdProcess(char*) const=0;
index 89f9b44..194e10f 100644 (file)
@@ -1372,7 +1372,7 @@ void AliRun::StepManager(Int_t id) const
     return;
   }
   //Update energy deposition tables
-  sEventEnergy[gMC->CurrentVol(0,copy)]+=gMC->Edep();
+  sEventEnergy[gMC->CurrentVolID(copy)]+=gMC->Edep();
   
   //Call the appropriate stepping routine;
   AliModule *det = (AliModule*)fModules->At(id);
index d16b14a..3f5d11b 100644 (file)
@@ -557,50 +557,88 @@ Int_t TGeant3::NextVolUp(Text_t *name, Int_t &copy)
 }
 
 //_____________________________________________________________________________
-Int_t TGeant3::CurrentVol(Text_t *name, Int_t &copy) const
+Int_t TGeant3::CurrentVolID(Int_t &copy) const
 {
   //
-  // Returns the current volume ID, name and copy number
-  // if name=0 no name is returned
+  // Returns the current volume ID and copy number
   //
   Int_t i, gname;
   if( (i=fGcvolu->nlevel-1) < 0 ) {
-    printf("CurrentVol: stack depth %d\n",fGcvolu->nlevel);
+    Warning("CurrentVolID","Stack depth only %d\n",fGcvolu->nlevel);
   } else {
     gname=fGcvolu->names[i];
-    if(name) {
-      strncpy(name,(char *) &gname, 4);
-      name[4]='\0';
-    }
     copy=fGcvolu->number[i];
     i=fGcvolu->lvolum[i];   
     if(gname == fZiq[fGclink->jvolum+i]) return i;
-    else printf("CurrentVol: Volume %s not found in bank\n",name);
+    else Warning("CurrentVolID","Volume %4s not found\n",(char*)&gname);
   }
   return 0;
 }
 
 //_____________________________________________________________________________
-Int_t TGeant3::CurrentVolOff(Int_t off, Text_t *name, Int_t &copy) const
+Int_t TGeant3::CurrentVolOffID(Int_t off, Int_t &copy) const
 {
   //
   // Return the current volume "off" upward in the geometrical tree 
-  // ID, name and copy number
-  // if name=0 no name is returned
+  // ID and copy number
   //
   Int_t i, gname;
   if( (i=fGcvolu->nlevel-off-1) < 0 ) {
-    printf("CurrentVolOff: Offset requested %d but stack depth %d\n",off,fGcvolu->nlevel);
+    Warning("CurrentVolOffID","Offset requested %d but stack depth %d\n",
+           off,fGcvolu->nlevel);
   } else {
     gname=fGcvolu->names[i];
-    if(name) {
-      strncpy(name,(char *) &gname, 4);
-      name[4]='\0';
-    }
     copy=fGcvolu->number[i];          
     i=fGcvolu->lvolum[i];    
     if(gname == fZiq[fGclink->jvolum+i]) return i;
-    else printf("CurrentVolOff: Volume %s not found in bank\n",name);
+    else Warning("CurrentVolOffID","Volume %4s not found\n",(char*)&gname);
+  }
+  return 0;
+}
+
+//_____________________________________________________________________________
+const char* TGeant3::CurrentVolName() const
+{
+  //
+  // Returns the current volume name
+  //
+  Int_t i, gname;
+  char *name;
+  if( (i=fGcvolu->nlevel-1) < 0 ) {
+    Warning("CurrentVolName","Stack depth %d\n",fGcvolu->nlevel);
+  } else {
+    gname=fGcvolu->names[i];
+    name = new char[5];
+    strncpy(name,(char *) &gname, 4);
+    name[4]='\0';
+    i=fGcvolu->lvolum[i];   
+    if(gname == fZiq[fGclink->jvolum+i]) return name;
+    else Warning("CurrentVolName","Volume %4s not found\n",name);
+  }
+  return 0;
+}
+
+//_____________________________________________________________________________
+const char* TGeant3::CurrentVolOffName(Int_t off) const
+{
+  //
+  // Return the current volume "off" upward in the geometrical tree 
+  // ID, name and copy number
+  // if name=0 no name is returned
+  //
+  Int_t i, gname;
+  char *name;
+  if( (i=fGcvolu->nlevel-off-1) < 0 ) {
+    Warning("CurrentVolOffName",
+           "Offset requested %d but stack depth %d\n",off,fGcvolu->nlevel);
+  } else {
+    gname=fGcvolu->names[i];
+    name = new char[5];
+    strncpy(name,(char *) &gname, 4);
+    name[4]='\0';
+    i=fGcvolu->lvolum[i];    
+    if(gname == fZiq[fGclink->jvolum+i]) return name;
+    else Warning("CurrentVolOffName","Volume %4s not found\n",name);
   }
   return 0;
 }
@@ -920,7 +958,7 @@ const char* TGeant3::VolName(Int_t id) const
 }
 
 //_____________________________________________________________________________
-void TGeant3::TrackPosition(Float_t *xyz) const
+void TGeant3::TrackPosition(TLorentzVector &xyz) const
 {
   //
   // Return the current position in the master reference frame of the
@@ -929,6 +967,7 @@ void TGeant3::TrackPosition(Float_t *xyz) const
   xyz[0]=fGctrak->vect[0];
   xyz[1]=fGctrak->vect[1];
   xyz[2]=fGctrak->vect[2];
+  xyz[3]=fGctrak->tofg;
 }
 
 //_____________________________________________________________________________
@@ -941,16 +980,17 @@ Float_t TGeant3::TrackTime() const
 }
 
 //_____________________________________________________________________________
-void TGeant3::TrackMomentum(Float_t *xyz) const
+void TGeant3::TrackMomentum(TLorentzVector &xyz) const
 {
   //
   // Return the direction and the momentum (GeV/c) of the track
   // currently being transported
   //
-  xyz[0]=fGctrak->vect[3];
-  xyz[1]=fGctrak->vect[4];
-  xyz[2]=fGctrak->vect[5];
-  xyz[3]=fGctrak->vect[6];  
+  Double_t ptot=fGctrak->vect[6];
+  xyz[0]=fGctrak->vect[3]*ptot;
+  xyz[1]=fGctrak->vect[4]*ptot;
+  xyz[2]=fGctrak->vect[5]*ptot;
+  xyz[3]=fGctrak->getot;
 }
 
 //_____________________________________________________________________________
@@ -999,7 +1039,7 @@ Float_t TGeant3::TrackLength() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackInside() const
+Bool_t TGeant3::IsTrackInside() const
 {
   //
   // True if the track is not at the boundary of the current volume
@@ -1008,7 +1048,7 @@ Bool_t TGeant3::TrackInside() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackEntering() const
+Bool_t TGeant3::IsTrackEntering() const
 {
   //
   // True if this is the first step of the track in the current volume
@@ -1017,7 +1057,7 @@ Bool_t TGeant3::TrackEntering() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackExiting() const
+Bool_t TGeant3::IsTrackExiting() const
 {
   //
   // True if this is the last step of the track in the current volume
@@ -1026,7 +1066,7 @@ Bool_t TGeant3::TrackExiting() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackOut() const
+Bool_t TGeant3::IsTrackOut() const
 {
   //
   // True if the track is out of the setup
@@ -1035,7 +1075,7 @@ Bool_t TGeant3::TrackOut() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackStop() const
+Bool_t TGeant3::IsTrackStop() const
 {
   //
   // True if the track energy has fallen below the threshold 
@@ -1121,7 +1161,7 @@ void TGeant3::InitLego()
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackDisappear() const
+Bool_t TGeant3::IsTrackDisappeared() const
 {
   //
   // True if the current particle has disappered
@@ -1132,7 +1172,7 @@ Bool_t TGeant3::TrackDisappear() const
 }
 
 //_____________________________________________________________________________
-Bool_t TGeant3::TrackAlive() const
+Bool_t TGeant3::IsTrackAlive() const
 {
   //
   // True if the current particle is alive and will continue to be
index a463559..1546266 100644 (file)
@@ -445,15 +445,17 @@ public:
   void  GeomIter();
   Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const;
   Int_t NextVolUp(Text_t *name, Int_t &copy);
-  Int_t CurrentVol(Text_t *name, Int_t &copy) const;
-  Int_t CurrentVolOff(Int_t off, Text_t *name, Int_t &copy) const;
+  Int_t CurrentVolID(Int_t &copy) const;
+  Int_t CurrentVolOffID(Int_t off, Int_t &copy) const;
+  const char* CurrentVolName() const;
+  const char *CurrentVolOffName(Int_t off) const;
   Int_t VolId(Text_t *name) const;
   Int_t IdFromPDG(Int_t pdg) const;
   Int_t PDGFromId(Int_t pdg) const;
   void  DefineParticles();
   const char* VolName(Int_t id) const;
-  void  TrackPosition(Float_t *xyz) const;
-  void  TrackMomentum(Float_t *xyz) const;  
+  void  TrackPosition(TLorentzVector &xyz) const;
+  void  TrackMomentum(TLorentzVector &xyz) const;  
   Int_t NofVolumes() const;
   Float_t TrackTime() const;  
   Float_t TrackCharge() const;
@@ -461,13 +463,13 @@ public:
   Float_t TrackStep() const;
   Float_t TrackLength() const;
   Int_t   TrackPid() const;
-  Bool_t TrackInside() const;
-  Bool_t TrackEntering() const;
-  Bool_t TrackExiting() const;
-  Bool_t TrackOut() const;
-  Bool_t TrackDisappear() const;
-  Bool_t TrackStop() const;
-  Bool_t TrackAlive() const;
+  Bool_t IsTrackInside() const;
+  Bool_t IsTrackEntering() const;
+  Bool_t IsTrackExiting() const;
+  Bool_t IsTrackOut() const;
+  Bool_t IsTrackDisappeared() const;
+  Bool_t IsTrackStop() const;
+  Bool_t IsTrackAlive() const;
   Int_t   NSecondaries() const;
   Int_t   CurrentEvent() const;
   void    ProdProcess(char*) const;
index a9d062c..a2fd5c5 100644 (file)
@@ -28,11 +28,13 @@ void    TGeant3::Gfile(const char*, const char*) {}
 void    TGeant3::GeomIter() {}
 Int_t   TGeant3::CurrentMaterial(Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const {return 0;}
 Int_t   TGeant3::NextVolUp(Text_t*, Int_t&) {return 0;}
-Int_t   TGeant3::CurrentVol(Text_t*, Int_t&) const {return 0;}
+Int_t   TGeant3::CurrentVolID(Int_t&) const {return 0;}
+const char*  TGeant3::CurrentVolName() const {return 0;}
 Int_t   TGeant3::NofVolumes() const {return 0;}
-Int_t   TGeant3::CurrentVolOff(Int_t, Text_t*, Int_t&) const {return 0;}
-void    TGeant3::TrackPosition(Float_t*) const {}
-void    TGeant3::TrackMomentum(Float_t*) const {}
+Int_t   TGeant3::CurrentVolOffID(Int_t, Int_t&) const {return 0;}
+const char *TGeant3::CurrentVolOffName(Int_t) const {return 0;}
+void    TGeant3::TrackPosition(TLorentzVector&) const {}
+void    TGeant3::TrackMomentum(TLorentzVector&) const {}
 Int_t   TGeant3::IdFromPDG(Int_t pdg) const {return -1;}
 Int_t   TGeant3::PDGFromId(Int_t pdg) const {return -1;}
 void    TGeant3::DefineParticles() {}
@@ -40,12 +42,12 @@ Int_t   TGeant3::VolId(Text_t*) const {return 0;}
 const char*   TGeant3::VolName(Int_t ) const {return 0;}
 Float_t TGeant3::TrackCharge() const {return 0;}
 Float_t TGeant3::TrackMass() const {return 0;}
-Bool_t  TGeant3::TrackInside() const {return 0;}
-Bool_t  TGeant3::TrackEntering() const {return 0;}
-Bool_t  TGeant3::TrackExiting() const {return 0;}
-Bool_t  TGeant3::TrackOut() const {return 0;}
-Bool_t  TGeant3::TrackDisappear() const {return 0;}
-Bool_t  TGeant3::TrackStop() const {return 0;}
+Bool_t  TGeant3::IsTrackInside() const {return 0;}
+Bool_t  TGeant3::IsTrackEntering() const {return 0;}
+Bool_t  TGeant3::IsTrackExiting() const {return 0;}
+Bool_t  TGeant3::IsTrackOut() const {return 0;}
+Bool_t  TGeant3::IsTrackDisappeared() const {return 0;}
+Bool_t  TGeant3::IsTrackStop() const {return 0;}
 Int_t   TGeant3::NSecondaries() const {return 0;}
 void    TGeant3::ProdProcess(char*) const {}
 void    TGeant3::GetSecondary(Int_t, Int_t&, Float_t*, Float_t*){}
@@ -61,7 +63,7 @@ Float_t TGeant3::TrackStep() const {return 0;}
 Float_t TGeant3::TrackLength() const {return 0;}
 Float_t TGeant3::TrackTime() const {return 0;}
 Int_t   TGeant3::TrackPid() const {return 0;}
-Bool_t  TGeant3::TrackAlive() const {return 0;}
+Bool_t  TGeant3::IsTrackAlive() const {return 0;}
 void    TGeant3::StopTrack() {}
 void    TGeant3::StopEvent() {}
 void    TGeant3::SetMaxNStep(Int_t) {}
index 77fd8d1..2bdaf90 100644 (file)
@@ -463,7 +463,7 @@ void gustep()
 //
 
 
-  Float_t x[3];
+  TLorentzVector x;
   Float_t r;
   Int_t ipp, jk, id, nt;
   Float_t polar[3]={0,0,0};
@@ -493,7 +493,7 @@ void gustep()
   }
 
   // --- Particle leaving the setup ?
-  if (!gMC->TrackOut()) 
+  if (!gMC->IsTrackOut()) 
     if ((id=gAlice->DetFromMate(geant3->Gctmed()->numed)) >= 0) gAlice->StepManager(id);
 }
 
index 224c697..3864c1a 100644 (file)
@@ -181,24 +181,32 @@ void AliTOFv0::StepManager()
   // Procedure called at each step in the Time Of Flight
   Float_t hits[8];
   Int_t vol[3];
-  Int_t copy, id;
+  Int_t copy, id, i;
+  TLorentzVector mom, pos;
   //
   // Get the pointer to the MonteCarlo
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[510-1] && 
-     gMC->TrackEntering() && gMC->TrackCharge()
-     && (id=gMC->CurrentVol(0,copy))==fIdSens) {
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && (id=gMC->CurrentVolID(copy))==fIdSens) {
     TClonesArray &lhits = *fHits;
     //
     // Record only charged tracks at entrance
     vol[2]=copy;
-    vol[1]=gMC->CurrentVolOff(1,0,copy);
+    vol[1]=gMC->CurrentVolOffID(1,copy);
     if(id==fIdFBT2) copy+=2; else 
       if(id==fIdFBT2) copy+=4;
     vol[0]=1;
-    gMC->TrackPosition(hits);
-    gMC->TrackMomentum(&hits[3]);
-    hits[7]=gMC->TrackTime();
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
index 7dbc17f..2838299 100644 (file)
@@ -224,24 +224,33 @@ void AliTOFv1::Init()
 //______________________________________________________________________________
 void AliTOFv1::StepManager()
 {
+  TLorentzVector mom, pos;
   Float_t hits[8];
   Int_t vol[3];
-  Int_t copy, id;
+  Int_t copy, id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[510-1] && 
-     gMC->TrackEntering() && gMC->TrackCharge()
-     && (id=gMC->CurrentVol(0,copy))==fIdSens) {
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && (id=gMC->CurrentVolID(copy))==fIdSens) {
     TClonesArray &lhits = *fHits;
 //
 // Record only charged tracks at entrance
     vol[2]=copy;
-    vol[1]=gMC->CurrentVolOff(1,0,copy);
+    vol[1]=gMC->CurrentVolOffID(1,copy);
     if(id==fIdFBT2) copy+=2; else 
       if(id==fIdFBT2) copy+=4;
     vol[0]=1;
-    gMC->TrackPosition(hits);
-    gMC->TrackMomentum(&hits[3]);
-    hits[7]=gMC->TrackTime();
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    //
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
index 28afe8e..65fb3ed 100644 (file)
@@ -268,36 +268,44 @@ void AliTOFv2::StepManager()
   // Procedure called at each step in the Time Of Flight
   //
   Float_t hits[8];
+  TLorentzVector pos, mom;
   Int_t vol[3];
-  Int_t copy, id;
+  Int_t copy, id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[510-1] && 
-     gMC->TrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVol(0,copy)==fIdSens) {
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && gMC->CurrentVolID(copy)==fIdSens) {
     TClonesArray &lhits = *fHits;
     //
     // Record only charged tracks at entrance
-    gMC->CurrentVolOff(1,0,copy);
+    gMC->CurrentVolOffID(1,copy);
     vol[2]=copy;
-    gMC->CurrentVolOff(3,0,copy);
+    gMC->CurrentVolOffID(3,copy);
     vol[1]=copy;
-    id=gMC->CurrentVolOff(6,0,copy);
+    id=gMC->CurrentVolOffID(6,copy);
     vol[0]=copy;
     if(id==fIdFTO3) {
       vol[0]+=22;
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT3) vol[1]+=6;
     } else if (id==fIdFTO2) {
       vol[0]+=20;
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT2) vol[1]+=8;
     } else {
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT1) vol[1]+=14;
     }
-    gMC->TrackPosition(hits);
-    gMC->TrackMomentum(&hits[3]);
-    hits[7]=gMC->TrackTime();
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
index 2f1c386..0a193b8 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliTOFv3.h"
-#include <TNode.h>
-#include <TTUBE.h>
 #include "AliRun.h"
-#include "AliMC.h"
  
 ClassImp(AliTOFv3)
  
@@ -300,37 +297,45 @@ void AliTOFv3::StepManager()
   //
   // Procedure called at each step in the Time Of Flight
   //
+  TLorentzVector mom, pos;
   Float_t hits[8];
   Int_t vol[3];
-  Int_t copy, id;
+  Int_t copy, id, i;
   Int_t *idtmed = fIdtmed->GetArray()-499;
   if(gMC->GetMedium()==idtmed[510-1] && 
-     gMC->TrackEntering() && gMC->TrackCharge()
-     && gMC->CurrentVol(0,copy)==fIdSens) {
+     gMC->IsTrackEntering() && gMC->TrackCharge()
+     && gMC->CurrentVolID(copy)==fIdSens) {
     TClonesArray &lhits = *fHits;
     //
     // Record only charged tracks at entrance
-    gMC->CurrentVolOff(1,0,copy);
+    gMC->CurrentVolOffID(1,copy);
     vol[2]=copy;
-    gMC->CurrentVolOff(3,0,copy);
+    gMC->CurrentVolOffID(3,copy);
     vol[1]=copy;
-    id=gMC->CurrentVolOff(6,0,copy);
+    id=gMC->CurrentVolOffID(6,copy);
     vol[0]=copy;
     if(id==fIdFTO3) {
       vol[0]+=22;
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT3) vol[1]+=6;
     } else if (id==fIdFTO2) {
       vol[0]+=20;
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT2) vol[1]+=8;
     } else {
-      id=gMC->CurrentVolOff(4,0,copy);
+      id=gMC->CurrentVolOffID(4,copy);
       if(id==fIdFLT1) vol[1]+=14;
     }
-    gMC->TrackPosition(hits);
-    gMC->TrackMomentum(&hits[3]);
-    hits[7]=gMC->TrackTime();
+    gMC->TrackPosition(pos);
+    gMC->TrackMomentum(mom);
+    Double_t ptot=mom.Rho();
+    Double_t norm=1/ptot;
+    for(i=0;i<3;++i) {
+      hits[i]=pos[i];
+      hits[i+3]=mom[i]*norm;
+    }
+    hits[6]=ptot;
+    hits[7]=pos[3];
     new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
 }
index 173685a..28f5045 100644 (file)
@@ -705,25 +705,27 @@ void AliTPCv1::StepManager()
   //
   // Called at every step in the Time Projection Chamber
   //
-  Int_t         copy, id;
+  Int_t         copy, id, i;
   Float_t       hits[4];
   Int_t         vol[2];
+  TLorentzVector p;
   TClonesArray &lhits = *fHits;
 
   //
-  if(gMC->TrackCharge() && gMC->TrackEntering()) {
+  if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
     //
     // Only entering charged tracks
-    if((id=gMC->CurrentVol(0, copy))==fIdSens1) {
+    if((id=gMC->CurrentVolID(copy))==fIdSens1) {
       vol[1]=copy+23;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[0]=copy+24;
     } else if(id==fIdSens2) {
       vol[1]=copy;
-      id=gMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[0]=copy;
     } else return;
-    gMC->TrackPosition(hits);
+    gMC->TrackPosition(p);
+    for(i=0;i<3;++i) hits[i]=p[i];
     hits[3]=0;
     new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
   }
index 2eb3325..324180e 100644 (file)
@@ -768,6 +768,7 @@ void AliTPCv2::StepManager()
   Float_t hits[4];
   Int_t vol[2];  
   TClonesArray &lhits = *fHits;
+  TLorentzVector pos;
   
   vol[1]=0;
 
@@ -775,14 +776,14 @@ void AliTPCv2::StepManager()
 
   gMC->SetMaxStep(big);
   
-  if(!gMC->TrackAlive()) return; // particle has disappeared
+  if(!gMC->IsTrackAlive()) return; // particle has disappeared
   
   Float_t charge = gMC->TrackCharge();
   
   if(TMath::Abs(charge)<=0.) return; // take only charged particles
   
   
-  id=gMC->CurrentVol(0, copy);
+  id=gMC->CurrentVolID(copy);
   
   // Check the sensitive volume
   
@@ -794,23 +795,29 @@ void AliTPCv2::StepManager()
     {
       vol[0] = copy; // S-sector number 
     }
-  else if(id == fIdSens3 && gMC->TrackEntering())
+  else if(id == fIdSens3 && gMC->IsTrackEntering())
     {
       vol[1] = copy;  // row number  
-      id = gMC->CurrentVolOff(1,0,copy);
+      id = gMC->CurrentVolOffID(1,copy);
       vol[0] = copy; // sector number (S-sector)
       
-      gMC->TrackPosition(hits);
+      gMC->TrackPosition(pos);
+      hits[0]=pos[0];
+      hits[1]=pos[1];
+      hits[2]=pos[2];
       hits[3]=0.; // this hit has no energy loss
       new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
     }
-  else if(id == fIdSens4 && gMC->TrackEntering())
+  else if(id == fIdSens4 && gMC->IsTrackEntering())
     {
       vol[1] = copy; // row number 
-      id = gMC->CurrentVolOff(1,0,copy);
+      id = gMC->CurrentVolOffID(1,copy);
       vol[0] = copy+24; // sector number (L-sector)
       
-      gMC->TrackPosition(hits);
+      gMC->TrackPosition(pos);
+      hits[0]=pos[0];
+      hits[1]=pos[1];
+      hits[2]=pos[2];
       hits[3]=0.; // this hit has no energy loss
       new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
     }
@@ -825,7 +832,10 @@ void AliTPCv2::StepManager()
     Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1;
     nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
     
-    gMC->TrackPosition(hits);
+    gMC->TrackPosition(pos);
+    hits[0]=pos[0];
+    hits[1]=pos[1];
+    hits[2]=pos[2];
     hits[3]=(Float_t)nel;
     
     // Add this hit
@@ -837,10 +847,10 @@ void AliTPCv2::StepManager()
   // Stemax calculation for the next step
   
   Float_t pp;
-  Float_t vect[4];
-  gMC->TrackMomentum(vect);
-  Float_t ptot = vect[3];
-  Float_t beta_gamma = ptot/(gMC->TrackMass());
+  TLorentzVector mom;
+  gMC->TrackMomentum(mom);
+  Float_t ptot=mom.Rho();
+  Float_t beta_gamma = ptot/gMC->TrackMass();
   
   if(gMC->TrackPid() <= 3 && ptot > 0.002)
     { 
index 804e5a5..e6a5d4f 100644 (file)
@@ -463,23 +463,24 @@ void AliTRDv0::StepManager()
   //
 
   Int_t         vol[3]; 
-  Int_t         icopy, idSens, icSens; 
+  Int_t         icopy, idSens, icSens, i; 
 
   Float_t       hits[4];
+  TLorentzVector p;
 
   TClonesArray &lhits = *fHits;
 
   // Use only charged tracks and count them only once per volume
-  if (gMC->TrackCharge() && gMC->TrackExiting()) {
+  if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
     
     // Check on sensitive volume
-    idSens = gMC->CurrentVol(0,icSens);
+    idSens = gMC->CurrentVolID(icSens);
     if ((idSens == fIdSens1) || 
         (idSens == fIdSens2) ||
         (idSens == fIdSens3)) { 
       
       // The sector number
-      gMC->CurrentVolOff(5,0,icopy);
+      gMC->CurrentVolOffID(5,icopy);
       vol[0] = icopy;
       
       // The chamber number 
@@ -488,7 +489,7 @@ void AliTRDv0::StepManager()
       //   3: inner
       //   4: neighbouring right
       //   5: outer right
-      gMC->CurrentVolOff(3,0,icopy);
+      gMC->CurrentVolOffID(3,icopy);
       if      (idSens == fIdSens3)
         vol[1] = 4 * icopy - 3; 
       else if (idSens == fIdSens2)
@@ -497,7 +498,7 @@ void AliTRDv0::StepManager()
         vol[1] = 3;
       
       // The plane number
-      gMC->CurrentVolOff(1,0,icopy);
+      gMC->CurrentVolOffID(1,icopy);
       vol[2] = icopy;
 
       if (fSensSelect) {
@@ -506,13 +507,15 @@ void AliTRDv0::StepManager()
         if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
         if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
         if (addthishit) {
-          gMC->TrackPosition(hits);
+          gMC->TrackPosition(p);
+         for(i=0;i<3;++i) hits[i]=p[i];
           hits[3] = 0;
           new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
        }
       }
       else {      
-        gMC->TrackPosition(hits);
+       gMC->TrackPosition(p);
+       for(i=0;i<3;++i) hits[i]=p[i];
         hits[3] = 0;
         new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
       }
index 2f13113..b6a61a8 100644 (file)
@@ -491,26 +491,27 @@ void AliTRDv1::StepManager()
   Int_t         vol[3]; 
   Int_t         icopy1, icopy2;
   Int_t         idSens, icSens; 
+  TLorentzVector pos;
   
   Float_t       hits[4];
   
   TClonesArray &lhits = *fHits;
 
   // Use only charged tracks and count them only once per volume
-  if (gMC->TrackCharge() && gMC->TrackExiting()) {
+  if (gMC->TrackCharge() && gMC->IsTrackExiting()) {
     
     // Check on sensitive volume
-    idSens = gMC->CurrentVol(0,icSens);
+    idSens = gMC->CurrentVolID(icSens);
 
     // Check on sensitive volume
-    idSens = gMC->CurrentVol(0,icSens);
+    idSens = gMC->CurrentVolID(icSens);
     if ((idSens == fIdSens1) || 
         (idSens == fIdSens2) ||
         (idSens == fIdSens3)) { 
       
       // The sector number
-      gMC->CurrentVolOff(5,0,icopy1);
-      gMC->CurrentVolOff(6,0,icopy2);
+      gMC->CurrentVolOffID(5,icopy1);
+      gMC->CurrentVolOffID(6,icopy2);
       if (icopy2 == 1)
         vol[0] =     icopy1;
       else
@@ -522,7 +523,7 @@ void AliTRDv1::StepManager()
       //   3: inner
       //   4: neighbouring right
       //   5: outer right
-      gMC->CurrentVolOff(3,0,icopy1);
+      gMC->CurrentVolOffID(3,icopy1);
       if      (idSens == fIdSens3)
         vol[1] = 4 * icopy1 - 3; 
       else if (idSens == fIdSens2)
@@ -531,7 +532,7 @@ void AliTRDv1::StepManager()
         vol[1] = 3;
       
       // The plane number
-      gMC->CurrentVolOff(1,0,icopy1);
+      gMC->CurrentVolOffID(1,icopy1);
       vol[2] = icopy1;
 
       if (fSensSelect) {
@@ -540,13 +541,19 @@ void AliTRDv1::StepManager()
         if ((fSensChamber) && (vol[1] != fSensChamber)) addthishit = 0;
         if ((fSensSector)  && (vol[0] != fSensSector )) addthishit = 0;
         if (addthishit) {
-          gMC->TrackPosition(hits);
+          gMC->TrackPosition(pos);
+         hits[0] = pos[0];
+         hits[1] = pos[1];
+         hits[2] = pos[2];
           hits[3] = 0;
           new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
        }
       }
       else {      
-        gMC->TrackPosition(hits);
+       gMC->TrackPosition(pos);
+       hits[0] = pos[0];
+       hits[1] = pos[1];
+       hits[2] = pos[2];
         hits[3] = 0;
         new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
       }
index bf6676c..6e03ff1 100644 (file)
@@ -520,11 +520,12 @@ void AliTRDv2::StepManager()
   const Double_t kBig = 1.0E+12;
 
   Float_t        hits[4];
-  Float_t        mom[4];
   Float_t        random[1];
   Float_t        charge;
   Float_t        aMass;
 
+  TLorentzVector pos, mom;
+
   Double_t       pTot;
   Double_t       qTot;
   Double_t       eDelta;
@@ -552,11 +553,11 @@ void AliTRDv2::StepManager()
 
   // Use only charged tracks 
   if (( gMC->TrackCharge()   ) &&
-      (!gMC->TrackStop()     ) && 
-      (!gMC->TrackDisappear())) {
+      (!gMC->IsTrackStop()     ) && 
+      (!gMC->IsTrackDisappeared())) {
 
     // Find the sensitive volume
-    idSens = gMC->CurrentVol(0,icSens);
+    idSens = gMC->CurrentVolID(icSens);
     iPla   = 0;
     iOut   = 0;
     for (Int_t icham = 0; icham < ncham; ++icham) {
@@ -585,7 +586,7 @@ void AliTRDv2::StepManager()
       qTot = (Double_t) ((Int_t) (eDelta / kWion) + 1);
 
       // The sector number
-      id = gMC->CurrentVolOff(4,0,iSec);
+      id = gMC->CurrentVolOffID(4,iSec);
 
       // The chamber number
       //   1: outer left
@@ -593,7 +594,7 @@ void AliTRDv2::StepManager()
       //   3: inner
       //   4: neighbouring right
       //   5: outer right
-      id = gMC->CurrentVolOff(2,0,iCha);
+      id = gMC->CurrentVolOffID(2,iCha);
       if (iCha == 1) 
         iCha = 3 + iOut;
       else
@@ -614,13 +615,16 @@ void AliTRDv2::StepManager()
       if (addthishit) {
 
         // Add this hit
-        gMC->TrackPosition(hits);
+        gMC->TrackPosition(pos);
+       hits[0]=pos[0];
+       hits[1]=pos[1];
+       hits[2]=pos[2];
         hits[3] = qTot;
         new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
 
         // The energy loss according to Bethe Bloch
         gMC->TrackMomentum(mom);
-        pTot = mom[3];
+        pTot = mom.Rho();
         iPid = gMC->TrackPid();
         if ( (iPid >  3) ||
            ((iPid <= 3) && (pTot < kPTotMax))) {