]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRndm.cxx
Changes in QA to be able to process separately different triggers (Ruben)
[u/mrichter/AliRoot.git] / STEER / AliRndm.cxx
index 7dccd41ed2bbf6fba71261112e22ef80d9b6f5ea..f089e66bea707ddda01884f2df580f152741641e 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Header$ */
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//                                                                           //
+// Random number class for AliRoot
+// This class allows to have different 
+// random number generator for different
+// elements of AliRoot                                                                          //
+// It also allows saving and retrieving of the random number seeds
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "TFile.h"
-#include "TError.h"
-#include "TRandom3.h"
-#include "TSystem.h"
+#include <TClass.h>
+#include <TFile.h>
+#include <TError.h>
+#include <TRandom3.h>
+#include <TSystem.h>
 
 #include "AliRndm.h"
+#include "AliLog.h"
 
 ClassImp(AliRndm)
 
 //_______________________________________________________________________
 AliRndm::AliRndm():
-  fRandom(0)
+  fRandom(gRandom)
 {
   // 
   // Default ctor
   //
-  SetRandom();
 }
 
 //_______________________________________________________________________
 AliRndm::AliRndm(const AliRndm& rn):
-  fRandom(0)
+  fRandom(gRandom)
 {
   //
   // Copy constructor
@@ -52,12 +56,12 @@ AliRndm::AliRndm(const AliRndm& rn):
 //_______________________________________________________________________
 void AliRndm::Copy(AliRndm&) const
 {
-  ::Fatal("Copy","Not implemented\n");
+  AliFatalClass("Not implemented");
 }
 
 
 //_____________________________________________________________________________
-void AliRndm::Rndm(Float_t* array, const Int_t size) const
+void AliRndm::Rndm(Float_t* array, Int_t size) const
 {
   //
   // Return an array of n random numbers uniformly distributed 
@@ -81,7 +85,7 @@ void AliRndm::ReadRandom(const char *filename)
   TFile *file = new TFile(fntmp,"r");
   delete [] fntmp;
   if(!file) {
-    printf("AliRndm:: Could not open file %s\n",filename);
+    AliErrorClass(Form("Could not open file %s",filename));
   } else {
     if(!fRandom) fRandom = new TRandom();
     fRandom->Read("Random");
@@ -100,7 +104,7 @@ void AliRndm::WriteRandom(const char *filename) const
   TFile *file = new TFile(fntmp,"new");
   delete [] fntmp;
   if(!file) {
-    printf("AliRndm:: Could not open file %s\n",filename);
+    AliErrorClass(Form("Could not open file %s",filename));
   } else {
     fRandom->Write();
     file->Close();