Geant4  10.00.p01
RandGauss.icc
Go to the documentation of this file.
1 // $Id:$
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandGauss ---
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 namespace CLHEP {
16 
17 inline RandGauss::RandGauss(HepRandomEngine & anEngine, double mean,
18  double stdDev )
19 : HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
20  localEngine(&anEngine, do_nothing_deleter()), set(false), nextGauss(0.0){}
21 
22 inline RandGauss::RandGauss(HepRandomEngine * anEngine, double mean,
23  double stdDev )
24 : HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
25  localEngine(anEngine), set(false), nextGauss(0.0) {}
26 
27 inline double RandGauss::shoot(double mean, double stdDev) {
28  return shoot()*stdDev + mean;
29 }
30 
31 inline double RandGauss::shoot(HepRandomEngine* anEngine,
32  double mean, double stdDev) {
33  return shoot(anEngine)*stdDev + mean;
34 }
35 
36 inline double RandGauss::fire() {
37  return normal()*defaultStdDev + defaultMean;
38 }
39 
40 inline double RandGauss::fire(double mean, double stdDev) {
41  return normal()*stdDev + mean;
42 }
43 
44 } // namespace CLHEP