//-----------------------------------------------------------------------------
// Class: AliHijingRndm
-// Random Number Interface to Fortran (FINCTION RLU_HIJING from HIJING)
-// Since AliGenHijing belongs to another module (THijing) one cannot
-// pass the ponter to the generator via static variable
-// Author:
+// Responsibilities: Interface to Root random number generator
+// from Fortran (re-implements FINCTION RLU_HIJING
+// from HIJING)
+// Note: Since AliGenHijing belongs to another module (THijing) one cannot
+// pass the ponter to the generator via static variable
+// Collaborators: AliGenHijing class
+// Example:
+//
+// root> AliGenHijing *gener = new AliGenHijing(-1);
+// root> AliHijingRndm::SetHijingRandom(new TRandom3());
+// root> AliHijingRndm::GetHijingRandom()->SetSeed(0);
+// root> cout<<"Seed "<< AliHijingRndm::GetHijingRandom()->GetSeed() <<endl;
//-----------------------------------------------------------------------------
-#include <TError.h>
+#include <TRandom.h>
#include "AliHijingRndm.h"
ClassImp(AliHijingRndm)
-//_______________________________________________________________________
-AliHijingRndm::AliHijingRndm()
-{
- //
- // Default ctor
- //
-}
-
-//_______________________________________________________________________
-AliHijingRndm::AliHijingRndm(const AliHijingRndm& rn)
-{
- //
- // Copy constructor
- //
- rn.Copy(*this);
-}
-
-//_______________________________________________________________________
-AliHijingRndm::~AliHijingRndm() {
- //
- // Destructor
- //
- fgHijingRandom=0;
-}
-
-//_______________________________________________________________________
-void AliHijingRndm::Copy(AliHijingRndm&) const
-{
- //
- // No copy is allowed
- //
- ::Fatal("Copy","Not implemented\n");
-}
-
//_______________________________________________________________________
void AliHijingRndm::SetHijingRandom(TRandom *ran) {
//
/* $Id$ */
-#include "TRandom.h"
+#include <Rtypes.h>
+#include <TError.h>
+
+class TRandom;
class AliHijingRndm {
public:
- AliHijingRndm();
- AliHijingRndm(const AliHijingRndm &rnd);
- virtual ~AliHijingRndm();
- AliHijingRndm & operator=(const AliHijingRndm& rn)
- {rn.Copy(*this); return (*this);}
+ AliHijingRndm() {
+ // Default constructor. The static data member is initialized
+ // in the implementation file
+ }
+ AliHijingRndm(const AliHijingRndm &/*rn*/) {
+ // Copy constructor: no copy allowed for the object
+ ::Fatal("Copy constructor","Not allowed\n");
+ }
+ virtual ~AliHijingRndm() {
+ // Destructor
+ fgHijingRandom=0;
+ }
+ AliHijingRndm & operator=(const AliHijingRndm& /*rn*/) {
+ // Assignment operator: no assignment allowed
+ ::Fatal("Assignment operator","Not allowed\n");
+ return (*this);
+ }
static void SetHijingRandom(TRandom *ran=0);
static TRandom * GetHijingRandom();
private:
- void Copy(AliHijingRndm &rn) const;
static TRandom * fgHijingRandom; //! pointer to the random number generator