CLHEP
2.4.7.1
C++ Class Library for High Energy Physics
CLHEP
Random
RandExponential.icc
Go to the documentation of this file.
1
// $Id: RandExponential.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
2
// -*- C++ -*-
3
//
4
// -----------------------------------------------------------------------
5
// HEP Random
6
// --- RandExponential ---
7
// inlined functions implementation file
8
// -----------------------------------------------------------------------
9
// This file is part of Geant4 (simulation toolkit for HEP).
10
11
// =======================================================================
12
// Gabriele Cosmo - Created: 19th August 1998
13
// =======================================================================
14
15
#include <cmath>
// for log()
16
17
namespace
CLHEP
{
18
19
inline
RandExponential::RandExponential
(
HepRandomEngine
& anEngine,
20
double
mean )
21
:
HepRandom
(), localEngine(&anEngine,
do_nothing_deleter
()), defaultMean(mean) {}
22
23
inline
RandExponential::RandExponential
(
HepRandomEngine
* anEngine,
24
double
mean )
25
:
HepRandom
(), localEngine(anEngine), defaultMean(mean) {}
26
27
//-------------
28
29
inline
double
RandExponential::shoot
(
HepRandomEngine
* anEngine) {
30
return
-std::log(anEngine->
flat
());
31
}
32
33
inline
double
RandExponential::shoot
(
HepRandomEngine
* anEngine,
34
double
mean) {
35
return
-std::log(anEngine->
flat
())*mean;
36
}
37
38
//-------------
39
40
inline
double
RandExponential::fire
() {
41
return
-std::log(localEngine->flat())*defaultMean;
42
}
43
44
inline
double
RandExponential::fire
(
double
mean) {
45
return
-std::log(localEngine->flat())*mean;
46
}
47
48
}
// namespace CLHEP
CLHEP::HepRandomEngine
Definition
RandomEngine.h:55
CLHEP::HepRandomEngine::flat
virtual double flat()=0
CLHEP::HepRandom::HepRandom
HepRandom()
CLHEP::RandExponential::RandExponential
RandExponential(HepRandomEngine &anEngine, double mean=1.0)
Definition
RandExponential.icc:19
CLHEP::RandExponential::fire
double fire()
Definition
RandExponential.icc:40
CLHEP::RandExponential::shoot
static double shoot()
CLHEP
Definition
ClhepVersion.h:13
CLHEP::do_nothing_deleter
Definition
memory.h:25
Generated by
1.14.0