]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliPythiaRndm.cxx
Correct handling of seeds for MC on the fly trains
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythiaRndm.cxx
index 7efc265efa2facea624eec050fabdf2cedbf4ae6..0dcb21c52d8f84efe1007b55b4c27632191603e9 100644 (file)
@@ -30,6 +30,7 @@
 //
 //-----------------------------------------------------------------------------
 
+#include <TMath.h>
 #include <TRandom.h>
 
 #include "AliPythiaRndm.h"
@@ -53,6 +54,7 @@ TRandom * AliPythiaRndm::GetPythiaRandom() {
   //
   // Retrieves the pointer to the random numbers generator
   //
+  if (!fgPythiaRandom) fgPythiaRandom=gRandom;
   return fgPythiaRandom;
 }
 
@@ -65,7 +67,7 @@ TRandom * AliPythiaRndm::GetPythiaRandom() {
 extern "C" {
     Double_t pyr(Int_t*) 
     {
-       // Wrapper to FINCTION PYR from PYTHIA
+       // Wrapper to FUNCTION PYR from PYTHIA
        // Uses static method to retrieve the pointer to the (C++) generator
        Double_t r;
        do r=AliPythiaRndm::GetPythiaRandom()->Rndm();