]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/Sim/AliTPCv2.cxx
Changes to compile with Root6 on macosx64
[u/mrichter/AliRoot.git] / TPC / Sim / AliTPCv2.cxx
index 18337b67319adbb4519e0044aa5b02b73c74b23d..d8f4f4e02621d3002e8d0e45464167acdf4f78ec 100644 (file)
@@ -2106,26 +2106,26 @@ void AliTPCv2::Init()
   AliTPC::Init();
 
  
-  fIdSens=gMC->VolId("TPC_Strip");  // one strip is always selected...
+  fIdSens=TVirtualMC::GetMC()->VolId("TPC_Strip");  // one strip is always selected...
 
-  fIDrift=gMC->VolId("TPC_Drift");
+  fIDrift=TVirtualMC::GetMC()->VolId("TPC_Drift");
   fSecOld=-100; // fake number 
 
-  gMC->SetMaxNStep(-120000); // max. number of steps increased
+  TVirtualMC::GetMC()->SetMaxNStep(-120000); // max. number of steps increased
 
   if (fPrimaryIonisation) {
     // for FLUKA
-      gMC->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
+      TVirtualMC::GetMC()->Gstpar(idtmed[2],"PRIMIO_E", 20.77); // 1st ionisation potential
  
-      gMC->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
-      gMC->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
-      gMC->Gstpar(idtmed[2],"STRA",4);
+      TVirtualMC::GetMC()->Gstpar(idtmed[2],"PRIMIO_N", 14.35);
+      TVirtualMC::GetMC()->Gstpar(idtmed[2],"LOSS", 14); // specific energy loss
+      TVirtualMC::GetMC()->Gstpar(idtmed[2],"STRA",4);
   } 
   // specific energy loss for geant3 is now defined in galice.cuts
 
 
   AliDebug(1,"*** TPC version 2 initialized ***");
-  AliDebug(1,Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
+  AliDebug(1,Form("Maximum number of steps = %d",TVirtualMC::GetMC()->GetMaxNStep()));
 
   //
   
@@ -2160,29 +2160,29 @@ void AliTPCv2::StepManager()
   
   vol[1]=0; // preset row number to 0
   //
-  if (!fPrimaryIonisation) gMC->SetMaxStep(kbig);
+  if (!fPrimaryIonisation) TVirtualMC::GetMC()->SetMaxStep(kbig);
   
-  if(!gMC->IsTrackAlive()) return; // particle has disappeared
+  if(!TVirtualMC::GetMC()->IsTrackAlive()) return; // particle has disappeared
   
-  Float_t charge = gMC->TrackCharge();
+  Float_t charge = TVirtualMC::GetMC()->TrackCharge();
   
   if(TMath::Abs(charge)<=0.) return; // take only charged particles
   
   // check the sensitive volume
 
-  id = gMC->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
+  id = TVirtualMC::GetMC()->CurrentVolID(copy); // vol ID and copy number (starts from 1!)
   if(id != fIDrift && id != fIdSens) return; // not in the sensitive folume 
 
   if ( fPrimaryIonisation && id == fIDrift ) {
-    Double_t rnd = gMC->GetRandom()->Rndm();
-    gMC->SetMaxStep(0.2+(2.*rnd-1.)*0.05);  // 2 mm +- rndm*0.5mm step
+    Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();
+    TVirtualMC::GetMC()->SetMaxStep(0.2+(2.*rnd-1.)*0.05);  // 2 mm +- rndm*0.5mm step
   }   
 
-  //if ( fPrimaryIonisation && id == fIDrift && gMC->IsTrackEntering()) {
-  //  gMC->SetMaxStep(0.2);  // 2 mm 
+  //if ( fPrimaryIonisation && id == fIDrift && TVirtualMC::GetMC()->IsTrackEntering()) {
+  //  TVirtualMC::GetMC()->SetMaxStep(0.2);  // 2 mm 
   //}   
   
-  gMC->TrackPosition(p);
+  TVirtualMC::GetMC()->TrackPosition(p);
   Double_t r = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
   //
   
@@ -2230,7 +2230,7 @@ void AliTPCv2::StepManager()
   // track is in the sensitive strip
   if(id == fIdSens){
     // track is entering the strip
-    if (gMC->IsTrackEntering()){
+    if (TVirtualMC::GetMC()->IsTrackEntering()){
       Int_t totrows = fTPCParam->GetNRowLow()+fTPCParam->GetNRowUp();
       vol[1] = (copy<=totrows) ? copy-1 : copy-1-totrows;
       // row numbers are autonomous for lower and upper sectors
@@ -2242,25 +2242,25 @@ void AliTPCv2::StepManager()
   
         // lower sector, row 0, because Jouri wants to have this
 
-        gMC->TrackMomentum(p);
+        TVirtualMC::GetMC()->TrackMomentum(p);
         hits[0]=p[0];
         hits[1]=p[1];
         hits[2]=p[2];
         hits[3]=0.; // this hit has no energy loss
         // Get also the track time for pileup simulation
-        hits[4]=gMC->TrackTime();
+        hits[4]=TVirtualMC::GetMC()->TrackTime();
 
         AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);  
       }
     //
 
-       gMC->TrackPosition(p);
+       TVirtualMC::GetMC()->TrackPosition(p);
        hits[0]=p[0];
        hits[1]=p[1];
        hits[2]=p[2];
        hits[3]=0.; // this hit has no energy loss
        // Get also the track time for pileup simulation
-       hits[4]=gMC->TrackTime();
+       hits[4]=TVirtualMC::GetMC()->TrackTime();
 
        AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);  
     
@@ -2270,31 +2270,31 @@ void AliTPCv2::StepManager()
   //-----------------------------------------------------------------
   //  charged particle is in the sensitive drift volume
   //-----------------------------------------------------------------
-  if(gMC->TrackStep() > 0) {
+  if(TVirtualMC::GetMC()->TrackStep() > 0) {
     Int_t nel=0;
     if (!fPrimaryIonisation) {
-      nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1;
+      nel = (Int_t)(((TVirtualMC::GetMC()->Edep())-poti)/wIon) + 1;
     }
     else {
       
       /*
       static Double_t deForNextStep = 0.;
       // Geant4 (the meaning of Edep as in Geant3) - wrong
-      //nel = (Int_t)(((gMC->Edep())-poti)/wIon) + 1;
+      //nel = (Int_t)(((TVirtualMC::GetMC()->Edep())-poti)/wIon) + 1;
 
       // Geant4 (the meaning of Edep as in Geant3) - NEW
-      Double_t eAvailable = gMC->Edep() + deForNextStep;
+      Double_t eAvailable = TVirtualMC::GetMC()->Edep() + deForNextStep;
       nel = (Int_t)(eAvailable/wIon);
       deForNextStep = eAvailable - nel*wIon;
       */
 
       //new Geant4-approach
-      Double_t meanIon = gMC->Edep()/(wIon*kScalewIonG4);
+      Double_t meanIon = TVirtualMC::GetMC()->Edep()/(wIon*kScalewIonG4);
       nel = (Int_t) ( kFanoFactorG4*AliMathBase::Gamma(meanIon/kFanoFactorG4)); // smear nel using gamma distr w mean = meanIon and variance = meanIon/kFanoFactorG4
     }
     nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
     //
-    gMC->TrackPosition(p);
+    TVirtualMC::GetMC()->TrackPosition(p);
     hits[0]=p[0];
     hits[1]=p[1];
     hits[2]=p[2];
@@ -2304,14 +2304,14 @@ void AliTPCv2::StepManager()
 
     //    if (fHitType&&2){
     if(fHitType){
-      gMC->TrackMomentum(p);
+      TVirtualMC::GetMC()->TrackMomentum(p);
       Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
       Float_t precision =   (momentum>0.1) ? 0.002 :0.01;
       fTrackHits->SetHitPrecision(precision);
     }
 
     // Get also the track time for pileup simulation
-    hits[4]=gMC->TrackTime();
+    hits[4]=TVirtualMC::GetMC()->TrackTime();
  
     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
     if (fDebugStreamer){   
@@ -2319,9 +2319,9 @@ void AliTPCv2::StepManager()
       // function  CreateDebugStremer() to be called in the Config.C  macro
       // if you want to enable it
       // By default debug streaemer is OFF
-      Float_t edep = gMC->Edep();
-      Float_t tstep = gMC->TrackStep();
-      Int_t pid=gMC->TrackPid();
+      Float_t edep = TVirtualMC::GetMC()->Edep();
+      Float_t tstep = TVirtualMC::GetMC()->TrackStep();
+      Int_t pid=TVirtualMC::GetMC()->TrackPid();
       (*fDebugStreamer)<<"hit"<<      
        "x="<<hits[0]<<  // hit position
        "y="<<hits[1]<<
@@ -2343,11 +2343,11 @@ void AliTPCv2::StepManager()
   TLorentzVector mom;
   // below is valid only for Geant3 (fPromaryIonisation not set)
   if(!fPrimaryIonisation){
-    gMC->TrackMomentum(mom);
+    TVirtualMC::GetMC()->TrackMomentum(mom);
     Float_t ptot=mom.Rho();
-    Float_t betaGamma = ptot/gMC->TrackMass();
+    Float_t betaGamma = ptot/TVirtualMC::GetMC()->TrackMass();
 
-    //Int_t pid=gMC->TrackPid();
+    //Int_t pid=TVirtualMC::GetMC()->TrackPid();
     // if((pid==kElectron || pid==kPositron) && ptot > 0.002)
     //       { 
     //         pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
@@ -2360,9 +2360,9 @@ void AliTPCv2::StepManager()
     pp=prim*AliMathBase::BetheBlochAleph(betaGamma,(*bbpar)(0),(*bbpar)(1),(*bbpar)(2),(*bbpar)(3),(*bbpar)(4));         
     //     }
   
-    Double_t rnd = gMC->GetRandom()->Rndm();
+    Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();
   
-    gMC->SetMaxStep(-TMath::Log(rnd)/pp);
+    TVirtualMC::GetMC()->SetMaxStep(-TMath::Log(rnd)/pp);
   }
   
 }