Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:38

0001 // $Id: RandGauss.icc,v 1.3 2010/06/16 17:24:53 garren Exp $
0002 // -*- C++ -*-
0003 // 
0004 // -----------------------------------------------------------------------
0005 //                             HEP Random
0006 //                         --- RandGauss ---
0007 //                 inlined functions implementation file
0008 // -----------------------------------------------------------------------
0009 // This file is part of Geant4 (simulation toolkit for HEP).
0010  
0011 // =======================================================================
0012 // Gabriele Cosmo - Created: 19th August 1998
0013 // =======================================================================
0014 
0015 namespace CLHEP {
0016 
0017 inline RandGauss::RandGauss(HepRandomEngine & anEngine, double mean,
0018                                                         double stdDev )
0019 : HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
0020   localEngine(&anEngine, do_nothing_deleter()), set(false), nextGauss(0.0){}
0021 
0022 inline RandGauss::RandGauss(HepRandomEngine * anEngine, double mean,
0023                                                         double stdDev )
0024 : HepRandom(), defaultMean(mean), defaultStdDev(stdDev),
0025   localEngine(anEngine), set(false), nextGauss(0.0) {}
0026 
0027 inline double RandGauss::shoot(double mean, double stdDev) {
0028   return shoot()*stdDev + mean;
0029 }
0030 
0031 inline double RandGauss::shoot(HepRandomEngine* anEngine,
0032                                   double mean, double stdDev) {
0033   return shoot(anEngine)*stdDev + mean;
0034 }
0035 
0036 inline double RandGauss::fire() {
0037   return normal()*defaultStdDev + defaultMean;
0038 }
0039 
0040 inline double RandGauss::fire(double mean, double stdDev) {
0041   return normal()*stdDev + mean;
0042 }
0043 
0044 }  // namespace CLHEP