Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::RandomEngineRoot Class Reference

ROOT random number generator. More...

#include <RandomEngineRoot.hh>

+ Inheritance diagram for Garfield::RandomEngineRoot:

Public Member Functions

 RandomEngineRoot ()
 Constructor.
 
 ~RandomEngineRoot ()
 Destructor.
 
double Draw () override
 Call the random number generator.
 
void Seed (const unsigned int s) override
 Initialise the random number generator.
 
void Print () override
 Print information about the generator used and the seed.
 
- Public Member Functions inherited from Garfield::RandomEngine
 RandomEngine ()=default
 Constructor.
 
virtual ~RandomEngine ()
 Destructor.
 

Detailed Description

ROOT random number generator.

Definition at line 12 of file RandomEngineRoot.hh.

Constructor & Destructor Documentation

◆ RandomEngineRoot()

Garfield::RandomEngineRoot::RandomEngineRoot ( )

Constructor.

Definition at line 8 of file RandomEngineRoot.cc.

8: RandomEngine(), m_rng(0) {}
RandomEngine()=default
Constructor.

◆ ~RandomEngineRoot()

Garfield::RandomEngineRoot::~RandomEngineRoot ( )

Destructor.

Definition at line 10 of file RandomEngineRoot.cc.

10{}

Member Function Documentation

◆ Draw()

double Garfield::RandomEngineRoot::Draw ( )
inlineoverridevirtual

Call the random number generator.

Implements Garfield::RandomEngine.

Definition at line 19 of file RandomEngineRoot.hh.

19{ return m_rng.Rndm(); }

◆ Print()

void Garfield::RandomEngineRoot::Print ( )
overridevirtual

Print information about the generator used and the seed.

Implements Garfield::RandomEngine.

Definition at line 17 of file RandomEngineRoot.cc.

17 {
18 std::cout << "RandomEngineRoot::Print:\n"
19 << " Generator type: TRandom3\n"
20 << " Seed: " << m_rng.TRandom::GetSeed() << "\n";
21}

◆ Seed()

void Garfield::RandomEngineRoot::Seed ( const unsigned int s)
overridevirtual

Initialise the random number generator.

Implements Garfield::RandomEngine.

Definition at line 12 of file RandomEngineRoot.cc.

12 {
13 m_rng.SetSeed(s);
14 std::cout << "RandomEngineRoot::Seed: " << m_rng.GetSeed() << "\n";
15}

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