Garfield++ v2r0
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 ()
 
 ~RandomEngineRoot ()
 
double Draw ()
 Draw a random number.
 
void Seed (unsigned int s)
 Initialise the random number generator.
 
- Public Member Functions inherited from Garfield::RandomEngine
 RandomEngine ()
 Constructor.
 
virtual ~RandomEngine ()
 Destructor.
 
virtual double Draw ()=0
 Draw a random number.
 
virtual void Seed (unsigned int s)=0
 Initialise 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 ( )

Definition at line 8 of file RandomEngineRoot.cc.

8 : rng(0) {
9
10 std::cout << "RandomEngineRoot:\n";
11 std::cout << " Generator type: TRandom3\n";
12 std::cout << " Seed: " << rng.GetSeed() << "\n";
13}

◆ ~RandomEngineRoot()

Garfield::RandomEngineRoot::~RandomEngineRoot ( )

Definition at line 15 of file RandomEngineRoot.cc.

15{}

Member Function Documentation

◆ Draw()

double Garfield::RandomEngineRoot::Draw ( )
inlinevirtual

Draw a random number.

Implements Garfield::RandomEngine.

Definition at line 20 of file RandomEngineRoot.hh.

20{ return rng.Rndm(); }

Referenced by Garfield::RndmUniform().

◆ Seed()

void Garfield::RandomEngineRoot::Seed ( unsigned int  s)
virtual

Initialise the random number generator.

Implements Garfield::RandomEngine.

Definition at line 17 of file RandomEngineRoot.cc.

17 {
18
19 rng.SetSeed(s);
20 std::cout << "RandomEngineRoot::Seed:\n";
21 std::cout << " Seed: " << rng.GetSeed() << "\n";
22}

Referenced by main().


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