ATLAS Offline Software
Loading...
Searching...
No Matches
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 }
TRandom3 * m_random
Definition BasicRandom.h:60
int r
Definition globals.cxx:22

◆ 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: