Back to home page

EIC code displayed by LXR

 
 

    


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

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