Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // $Id: RandGaussT.icc,v 1.4 2010/06/16 17:24:53 garren Exp $
0002 // -*- C++ -*-
0003 //
0004 // -----------------------------------------------------------------------
0005 //                             HEP Random
0006 //                         --- RandGaussT ---
0007 //                 inlined functions implementation file
0008 // -----------------------------------------------------------------------
0009 // This file is part of Geant4 (simulation toolkit for HEP).
0010  
0011 // =======================================================================
0012 // M. Fischler    - Created: 04 Feb, 2000
0013 //
0014 // M. Fischler    - Modified fire() to use local engine, not getTheEngine()
0015 //          12/13/04
0016 // =======================================================================
0017 
0018 // Constructors
0019 // ------------
0020 
0021 namespace CLHEP {
0022 
0023 RandGaussT::RandGaussT(HepRandomEngine & anEngine, double mean,
0024                                                         double stdDev )
0025 : RandGauss(anEngine, mean, stdDev) {}
0026 
0027 RandGaussT::RandGaussT(HepRandomEngine * anEngine, double mean,
0028                                                         double stdDev )
0029 : RandGauss(anEngine, mean, stdDev) {}
0030 
0031 // Getting a Gaussian deviate - static methods
0032 // -------------------------------------------
0033 
0034 double RandGaussT::shoot()
0035 {
0036   HepRandomEngine* anEngine = HepRandom::getTheEngine();
0037   return HepStat::flatToGaussian (anEngine->flat());
0038 }
0039 
0040 double RandGaussT::shoot( HepRandomEngine* anotherEngine )
0041 { 
0042   return HepStat::flatToGaussian  (anotherEngine->flat());
0043 }
0044 
0045 double RandGaussT::shoot(double mean, double stdDev) {
0046   return shoot()*stdDev + mean;
0047 }
0048 
0049 double RandGaussT::shoot(HepRandomEngine* anotherEngine,
0050                                   double mean, double stdDev) {
0051   return shoot(anotherEngine)*stdDev + mean;
0052 }
0053 
0054 // Getting a Gaussian deviate - instance methods
0055 // ---------------------------------------------
0056 
0057 double RandGaussT::fire() {
0058   return HepStat::flatToGaussian(localEngine->flat()) * defaultStdDev 
0059                                 + defaultMean;
0060 }
0061 
0062 double RandGaussT::fire(double mean, double stdDev) {
0063   return HepStat::flatToGaussian(localEngine->flat()) * stdDev + mean;
0064 }
0065 
0066 
0067 }  // namespace CLHEP