ATLAS Offline Software
Loading...
Searching...
No Matches
Resplot::BasicRandom Class Reference

#include <BasicRandom.h>

Collaboration diagram for Resplot::BasicRandom:

Public Member Functions

 BasicRandom (int shared=true, int seed=4357)
 do we ever use a different seed ?? We probably should
 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

Static Private Attributes

static TRandom3 s_random = {4357}

Detailed Description

Definition at line 34 of file BasicRandom.h.

Constructor & Destructor Documentation

◆ BasicRandom() [1/2]

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

do we ever use a different seed ?? We probably should

these are all shared now - we use a static thread_local so they are shared within each thread

Definition at line 38 of file BasicRandom.h.

39 : m_shared(shared), m_random(0) {
40 if ( shared ) {
43 // static TRandom3 r(seed);
45 if ( seed!=4357) m_random->SetSeed(seed);
46 }
47 else {
48 // m_random = new TRandom3(seed);
50 if ( seed ) m_random->SetSeed(seed);
51 }
52 }
static TRandom3 s_random
Definition BasicRandom.h:67

◆ BasicRandom() [2/2]

Resplot::BasicRandom::BasicRandom ( const BasicRandom & )
delete

◆ ~BasicRandom()

virtual Resplot::BasicRandom::~BasicRandom ( )
inlinevirtual

Definition at line 57 of file BasicRandom.h.

57{ if ( !m_shared ) delete m_random; }

Member Function Documentation

◆ exp()

double Resplot::BasicRandom::exp ( )
inline

Definition at line 59 of file BasicRandom.h.

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

◆ gauss()

double Resplot::BasicRandom::gauss ( )
inline

Definition at line 60 of file BasicRandom.h.

60{ return m_random->Gaus(); }

◆ operator=()

BasicRandom Resplot::BasicRandom::operator= ( const BasicRandom & )
delete

◆ uniform()

double Resplot::BasicRandom::uniform ( )
inline

Definition at line 61 of file BasicRandom.h.

61{ return m_random->Uniform(); }

Member Data Documentation

◆ m_random

TRandom3* Resplot::BasicRandom::m_random
private

Definition at line 68 of file BasicRandom.h.

◆ m_shared

bool Resplot::BasicRandom::m_shared
private

Definition at line 66 of file BasicRandom.h.

◆ s_random

TRandom3 Resplot::BasicRandom::s_random = {4357}
inlinethread_localstaticprivate

Definition at line 67 of file BasicRandom.h.

67{4357};

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