Garfield++ 4.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.
 
virtual double Draw ()=0
 Draw a random number.
 
virtual void Seed (const unsigned int s)=0
 Initialise the random number generator.
 
virtual void Print ()=0
 Print some information about the random number generator.
 

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(); }

Referenced by Garfield::RndmUniform().

◆ Print()

void Garfield::RandomEngineRoot::Print ( )
overridevirtual

Print information about the generator used and the seed.

Implements Garfield::RandomEngine.

Definition at line 18 of file RandomEngineRoot.cc.

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

◆ 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:\n"
15 << " Seed: " << m_rng.GetSeed() << "\n";
16}

Referenced by main().


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