ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
BasicRandom Class Reference

#include <BasicRandom.h>

Collaboration diagram for BasicRandom:

Public Member Functions

 BasicRandom (int shared=true, int seed=4357)
 
 BasicRandom (const BasicRandom &)=delete
 
BasicRandom operator= (const BasicRandom &)=delete
 
virtual ~BasicRandom ()
 
double exp ()
 
double gauss ()
 
double uniform ()
 

Private Attributes

bool m_shared
 
TRandom3 * m_random
 

Detailed Description

Definition at line 32 of file BasicRandom.h.

Constructor & Destructor Documentation

◆ BasicRandom() [1/2]

BasicRandom::BasicRandom ( int  shared = true,
int  seed = 4357 
)
inline

Definition at line 36 of file BasicRandom.h.

37  : m_shared(shared), m_random(0) {
38  if ( shared ) {
39  static TRandom3 _r(seed);
40  m_random = &_r;
41  }
42  else {
43  m_random = new TRandom3(seed);
44  }
45  }

◆ BasicRandom() [2/2]

BasicRandom::BasicRandom ( const BasicRandom )
delete

◆ ~BasicRandom()

virtual BasicRandom::~BasicRandom ( )
inlinevirtual

Definition at line 50 of file BasicRandom.h.

50 { if ( !m_shared ) delete m_random; }

Member Function Documentation

◆ exp()

double BasicRandom::exp ( )
inline

Definition at line 52 of file BasicRandom.h.

52 { return m_random->Exp(1); }

◆ gauss()

double BasicRandom::gauss ( )
inline

Definition at line 53 of file BasicRandom.h.

53 { return m_random->Gaus(); }

◆ operator=()

BasicRandom BasicRandom::operator= ( const BasicRandom )
delete

◆ uniform()

double BasicRandom::uniform ( )
inline

Definition at line 54 of file BasicRandom.h.

54 { return m_random->Uniform(); }

Member Data Documentation

◆ m_random

TRandom3* BasicRandom::m_random
private

Definition at line 60 of file BasicRandom.h.

◆ m_shared

bool BasicRandom::m_shared
private

Definition at line 59 of file BasicRandom.h.


The documentation for this class was generated from the following file:
BasicRandom::m_shared
bool m_shared
Definition: BasicRandom.h:59
BasicRandom::m_random
TRandom3 * m_random
Definition: BasicRandom.h:60