MINT2
Public Types | Public Member Functions | Private Attributes | List of all members
MINT::EvtTRandom Class Reference

#include <EvtTRandom.h>

Inheritance diagram for MINT::EvtTRandom:

Public Types

enum  { kBigNumber =1234567890 }
 

Public Member Functions

 EvtTRandom (MINT::IEvtRandom *rnd=NULL)
 
virtual ~EvtTRandom ()
 Destructor. More...
 
virtual UInt_t GetSeed () const
 
virtual Double_t Rndm (Int_t i=0)
 
virtual void RndmArray (Int_t n, Float_t *array)
 
virtual void RndmArray (Int_t n, Double_t *array)
 
virtual void SetSeed (UInt_t seed=0)
 
 EvtTRandom (MINT::IEvtRandom *rand)
 
virtual ~EvtTRandom ()
 
virtual Double_t Rndm (Int_t i=0)
 

Private Attributes

MINT::IEvtRandomm_rnd
 
MINT::IEvtRandomm_rand
 

Detailed Description

Definition at line 25 of file EvtTRandom.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kBigNumber 

Definition at line 34 of file EvtTRandom.h.

34  {
35  kBigNumber=1234567890
36  };

Constructor & Destructor Documentation

◆ EvtTRandom() [1/2]

EvtTRandom::EvtTRandom ( MINT::IEvtRandom rnd = NULL)

Definition at line 15 of file EvtTRandom.cpp.

15  : m_rnd(rnd)
16 {
17  SetName("EvtRandom");
18  SetTitle("Random number generator: EvtRandom");
19 }
MINT::IEvtRandom * m_rnd
Definition: EvtTRandom.h:38

◆ ~EvtTRandom() [1/2]

EvtTRandom::~EvtTRandom ( )
virtual

Destructor.

Definition at line 69 of file EvtTRandom.cpp.

70 {
71  if (m_rnd!=NULL) {
72  delete m_rnd;
73  m_rnd=NULL;
74  }
75 }
MINT::IEvtRandom * m_rnd
Definition: EvtTRandom.h:38

◆ EvtTRandom() [2/2]

MINT::EvtTRandom::EvtTRandom ( MINT::IEvtRandom rand)
inline

Definition at line 24 of file IEvtRandom.h.

25  : m_rand(rand)
26  {
27  SetName("EvtTRandom");
28  SetTitle("Random number generator: EvtTRandom");
29  }
MINT::IEvtRandom * m_rand
Definition: IEvtRandom.h:41

◆ ~EvtTRandom() [2/2]

virtual MINT::EvtTRandom::~EvtTRandom ( )
inlinevirtual

Definition at line 31 of file IEvtRandom.h.

32  { delete m_rand; }
MINT::IEvtRandom * m_rand
Definition: IEvtRandom.h:41

Member Function Documentation

◆ GetSeed()

UInt_t EvtTRandom::GetSeed ( ) const
virtual

Definition at line 56 of file EvtTRandom.cpp.

57 {
58  if (m_rnd==NULL) {
59  Error("MINT::EvtTRandom::GetSeed",
60  "EvtRandom engine not set. Returning zero.");
61  return 0;
62  }
63  return m_rnd->GetSeed();
64 }
virtual UInt_t GetSeed() const =0
MINT::IEvtRandom * m_rnd
Definition: EvtTRandom.h:38

◆ Rndm() [1/2]

Double_t EvtTRandom::Rndm ( Int_t  i = 0)
virtual

Definition at line 22 of file EvtTRandom.cpp.

23 {
24  if (m_rnd==NULL) {
25  Error("MINT::EvtTRandom::Rndm",
26  "EvtRandom engine not set. Returning 'kBigNumber'.");
27  return kBigNumber;
28  }
29  return m_rnd->Rndm(i);
30 }
virtual double Rndm(Int_t i)=0
MINT::IEvtRandom * m_rnd
Definition: EvtTRandom.h:38

◆ Rndm() [2/2]

virtual Double_t MINT::EvtTRandom::Rndm ( Int_t  i = 0)
inlinevirtual

Definition at line 34 of file IEvtRandom.h.

35  {
36  return m_rand->Rndm();
37  (void)i;
38  }
virtual double Rndm(Int_t i)=0
MINT::IEvtRandom * m_rand
Definition: IEvtRandom.h:41

◆ RndmArray() [1/2]

void EvtTRandom::RndmArray ( Int_t  n,
Float_t *  array 
)
virtual

Definition at line 32 of file EvtTRandom.cpp.

33 {
34  // Return an array of n random numbers uniformly distributed in ]0,1]
35 
36  for(Int_t i=0; i<n; i++) array[i]=(Float_t)this->Rndm();
37 }
virtual Double_t Rndm(Int_t i=0)
Definition: EvtTRandom.cpp:22

◆ RndmArray() [2/2]

void EvtTRandom::RndmArray ( Int_t  n,
Double_t *  array 
)
virtual

Definition at line 39 of file EvtTRandom.cpp.

40 {
41  // Return an array of n random numbers uniformly distributed in ]0,1]
42 
43  for(Int_t i=0; i<n; i++) array[i]=this->Rndm();
44 }
virtual Double_t Rndm(Int_t i=0)
Definition: EvtTRandom.cpp:22

◆ SetSeed()

void EvtTRandom::SetSeed ( UInt_t  seed = 0)
virtual

Definition at line 46 of file EvtTRandom.cpp.

47 {
48  if (m_rnd==NULL) {
49  Error("MINT::EvtTRandom::SetSeed",
50  "EvtRandom engine not set.");
51  return;
52  }
53  m_rnd->SetSeed(seed);
54 }
MINT::IEvtRandom * m_rnd
Definition: EvtTRandom.h:38
virtual void SetSeed(UInt_t seed)=0

Member Data Documentation

◆ m_rand

MINT::IEvtRandom* MINT::EvtTRandom::m_rand
private

Definition at line 41 of file IEvtRandom.h.

◆ m_rnd

MINT::IEvtRandom* MINT::EvtTRandom::m_rnd
private

Definition at line 38 of file EvtTRandom.h.


The documentation for this class was generated from the following files: