ATLAS Offline Software
|
Thread-local TRandom generator. More...
#include <TRandomTLS.h>
Public Member Functions | |
TRandomTLS (UInt_t seed=4357) | |
Constructor. More... | |
~TRandomTLS ()=default | |
Destructor. More... | |
T * | get () const |
Get thread-specific TRandom. More... | |
T * | operator-> () const |
T & | operator* () const |
Private Attributes | |
boost::thread_specific_ptr< T > | m_rand_tls |
Thread-local TRandom. More... | |
std::atomic< UInt_t > | m_seed |
TRandom seed (incremented for each new instance/thread) More... | |
Thread-local TRandom generator.
This class provides a thread-local TRandom instance of type T. For each new instance/thread the seed is incremented to ensure independent random numbers.
Definition at line 29 of file TRandomTLS.h.
|
inline |
Constructor.
seed | The seed of the first TRandom instance. Additional instances are created with the seed incremented by one. If the seed is 0, it will not be incremented as ROOT then uses a time-based seed. |
Definition at line 38 of file TRandomTLS.h.
|
default |
Destructor.
|
inline |
|
inline |
Definition at line 46 of file TRandomTLS.h.
|
inline |
Definition at line 45 of file TRandomTLS.h.
|
mutableprivate |
Thread-local TRandom.
Definition at line 50 of file TRandomTLS.h.
|
mutableprivate |
TRandom seed (incremented for each new instance/thread)
Definition at line 53 of file TRandomTLS.h.