Geant4  10.02.p02
RandGaussQ.icc
Go to the documentation of this file.
1 // $Id:$
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandGaussQ ---
7 // inlined functions implementation file
8 // -----------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 
11 // =======================================================================
12 // M. Fischler - Created: 24 Janm 2000
13 //
14 // M. Fischler - Modified fire() to use local engine, not getTheEngine()
15 // 12/13/04
16 // =======================================================================
17 
18 // Constructors
19 // ------------
20 
21 namespace CLHEP {
22 
23 RandGaussQ::RandGaussQ(HepRandomEngine & anEngine, double mean,
24  double stdDev )
25 : RandGauss(anEngine, mean, stdDev) {}
26 
27 RandGaussQ::RandGaussQ(HepRandomEngine * anEngine, double mean,
28  double stdDev )
29 : RandGauss(anEngine, mean, stdDev) {}
30 
31 // Getting a Gaussian deviate - static methods
32 // -------------------------------------------
33 
34 double RandGaussQ::shoot()
35 {
36  HepRandomEngine* anEngine = HepRandom::getTheEngine();
37  return transformQuick (anEngine->flat());
38 }
39 
40 double RandGaussQ::shoot( HepRandomEngine* anotherEngine )
41 {
42  return transformQuick (anotherEngine->flat());
43 }
44 
45 double RandGaussQ::shoot(double mean, double stdDev) {
46  return shoot()*stdDev + mean;
47 }
48 
49 double RandGaussQ::shoot(HepRandomEngine* anotherEngine,
50  double mean, double stdDev) {
51  return shoot(anotherEngine)*stdDev + mean;
52 }
53 
54 // Getting a Gaussian deviate - instance methods
55 // ---------------------------------------------
56 
57 double RandGaussQ::fire() {
58  return transformQuick(localEngine->flat()) * defaultStdDev + defaultMean;
59 }
60 
61 double RandGaussQ::fire(double mean, double stdDev) {
62  return transformQuick(localEngine->flat()) * stdDev + mean;
63 }
64 
65 } // namespace CLHEP
66