]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMC.cxx
Distance between creation points CFs
[u/mrichter/AliRoot.git] / STEER / AliMC.cxx
index 0c5804d494717949dd6edc290548db8866b51d06..3ad70446c83d131bf71d8a8107755c08a2175182 100644 (file)
@@ -21,6 +21,7 @@
 // Author: F.Carminati
 //         Federico.Carminati@cern.ch
 
+#include <RVersion.h>
 #include <TBrowser.h>
 #include <TStopwatch.h>
 #include <TSystem.h>
@@ -123,7 +124,7 @@ AliMC::~AliMC()
 }
 
 //_______________________________________________________________________
-void AliMC::Copy(AliMC &) const
+void AliMC::Copy(TObject &) const
 {
   //dummy Copy function
   Fatal("Copy","Not implemented!\n");
@@ -173,7 +174,7 @@ void  AliMC::InitGeometry()
 }
 
 //_______________________________________________________________________
-void  AliMC::GeneratePrimaries()
+void  AliMC::GeneratePrimaries() 
 { 
   //
   // Generate primary particles and fill them in the stack.
@@ -215,8 +216,10 @@ void AliMC::FinishRun()
   fGenerator->FinishRun();
 
   //Output energy summary tables
-  if (GetDebug()) Info("FinishRun"," EnergySummary()");
-  EnergySummary();
+  if (GetDebug()) {
+    Info("FinishRun"," EnergySummary()");
+    EnergySummary();
+  }
 
 }
 
@@ -268,7 +271,7 @@ void AliMC::Stepping()
     //
     // write tracke reference for track which is dissapearing - MI
     if (gMC->IsTrackDisappeared()) {      
-      if (gMC->Etot()>0.05) AddTrackReference(GetCurrentTrackNumber());
+       if (gMC->Etot()>0.05) AddTrackReference(GetCurrentTrackNumber());
     }
   
     //Call the appropriate stepping routine;
@@ -479,6 +482,10 @@ void AliMC::FinishPrimary()
   //  static Int_t count=0;
   //  const Int_t times=10;
   // This primary is finished, purify stack
+#if ROOT_VERSION_CODE > 262152
+  if (!(gMC->SecondariesAreOrdered()))
+       runloader->Stack()->ReorderKine();
+#endif
   runloader->Stack()->PurifyKine();
   
   TIter next(gAlice->Modules());
@@ -583,8 +590,6 @@ void AliMC::Init()
 
    //=================Create Materials and geometry
    gMC->Init();
-   gMC->DefineParticles();  //Create standard MC particles
-
    //Read the cuts for all materials
    ReadTransPar();
    //Build the special IMEDIA table
@@ -902,7 +907,7 @@ TObjArray* AliMC::Particles() const {
 //_______________________________________________________________________
 void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
                       Float_t *vpos, Float_t *polar, Float_t tof,
-                      TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
+                      TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is) const
 { 
 // Delegate to stack
 //
@@ -918,7 +923,7 @@ void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg,
                      Double_t px, Double_t py, Double_t pz, Double_t e,
                      Double_t vx, Double_t vy, Double_t vz, Double_t tof,
                      Double_t polx, Double_t poly, Double_t polz,
-                     TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
+                     TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is) const
 { 
   // Delegate to stack
   //
@@ -930,7 +935,7 @@ void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg,
 }
 
 //_______________________________________________________________________
-void AliMC::SetHighWaterMark(const Int_t nt)
+void AliMC::SetHighWaterMark(Int_t nt) const
 {
     //
     // Set high water mark for last track in event
@@ -941,7 +946,7 @@ void AliMC::SetHighWaterMark(const Int_t nt)
 }
 
 //_______________________________________________________________________
-void AliMC::KeepTrack(const Int_t track)
+void AliMC::KeepTrack(Int_t track) const
 { 
   //
   // Delegate to stack
@@ -953,7 +958,7 @@ void AliMC::KeepTrack(const Int_t track)
 }
  
 //_______________________________________________________________________
-void AliMC::FlagTrack(Int_t track)
+void AliMC::FlagTrack(Int_t track) const
 {
   // Delegate to stack
   //
@@ -964,7 +969,7 @@ void AliMC::FlagTrack(Int_t track)
 }
 
 //_______________________________________________________________________
-void AliMC::SetCurrentTrack(Int_t track)
+void AliMC::SetCurrentTrack(Int_t track) const
 { 
   //
   // Set current track number