Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
CLHEP::HepRandomEngine Class Referenceabstract

#include <RandomEngine.h>

+ Inheritance diagram for CLHEP::HepRandomEngine:

Public Member Functions

 HepRandomEngine ()
 
virtual ~HepRandomEngine ()
 
bool operator== (const HepRandomEngine &engine)
 
bool operator!= (const HepRandomEngine &engine)
 
virtual double flat ()=0
 
virtual void flatArray (const int size, double *vect)=0
 
virtual void setSeed (long seed, int)=0
 
virtual void setSeeds (const long *seeds, int)=0
 
virtual void saveStatus (const char filename[]="Config.conf") const =0
 
virtual void restoreStatus (const char filename[]="Config.conf")=0
 
virtual void showStatus () const =0
 
virtual std::string name () const =0
 
virtual std::ostream & put (std::ostream &os) const
 
virtual std::istream & get (std::istream &is)
 
virtual std::istream & getState (std::istream &is)
 
virtual std::vector< unsigned long > put () const
 
virtual bool get (const std::vector< unsigned long > &v)
 
virtual bool getState (const std::vector< unsigned long > &v)
 
long getSeed () const
 
const long * getSeeds () const
 
virtual operator double ()
 
virtual operator float ()
 
virtual operator unsigned int ()
 

Static Public Member Functions

static std::string beginTag ()
 
static HepRandomEnginenewEngine (std::istream &is)
 
static HepRandomEnginenewEngine (const std::vector< unsigned long > &v)
 

Static Protected Member Functions

static double exponent_bit_32 ()
 
static double mantissa_bit_12 ()
 
static double mantissa_bit_24 ()
 
static double mantissa_bit_32 ()
 
static double twoToMinus_32 ()
 
static double twoToMinus_48 ()
 
static double twoToMinus_49 ()
 
static double twoToMinus_53 ()
 
static double nearlyTwoToMinus_54 ()
 
static bool checkFile (std::istream &file, const std::string &filename, const std::string &classname, const std::string &methodname)
 

Protected Attributes

long theSeed
 
const long * theSeeds
 

Detailed Description

Constructor & Destructor Documentation

◆ HepRandomEngine()

CLHEP::HepRandomEngine::HepRandomEngine ( )

Definition at line 27 of file RandomEngine.cc.

28: theSeed (19780503L)
30{ }

◆ ~HepRandomEngine()

CLHEP::HepRandomEngine::~HepRandomEngine ( )
virtual

Definition at line 32 of file RandomEngine.cc.

32{}

Member Function Documentation

◆ beginTag()

std::string CLHEP::HepRandomEngine::beginTag ( )
static

Definition at line 68 of file RandomEngine.cc.

68 {
69 return "HepRandomEngine-begin";
70}

◆ checkFile()

bool CLHEP::HepRandomEngine::checkFile ( std::istream &  file,
const std::string &  filename,
const std::string &  classname,
const std::string &  methodname 
)
staticprotected

Definition at line 47 of file RandomEngine.cc.

50 {
51 if (!file) {
52 std::cerr << "Failure to find or open file " << filename <<
53 " in " << classname << "::" << methodname << "()\n";
54 return false;
55 }
56 return true;
57}

Referenced by CLHEP::DualRand::restoreStatus(), CLHEP::HepJamesRandom::restoreStatus(), CLHEP::MTwistEngine::restoreStatus(), CLHEP::RanecuEngine::restoreStatus(), CLHEP::RanluxEngine::restoreStatus(), CLHEP::Ranlux64Engine::restoreStatus(), and CLHEP::RanshiEngine::restoreStatus().

◆ exponent_bit_32()

static double CLHEP::HepRandomEngine::exponent_bit_32 ( )
inlinestaticprotected

◆ flat()

virtual double CLHEP::HepRandomEngine::flat ( )
pure virtual

Implemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Referenced by G4FPYSamplingOps::G4SampleUniform(), G4VEmissionProbability::SampleEnergy(), G4SBBremTable::SampleEnergyTransfer(), G4IonFluctuations::SampleFluctuations(), G4PreCompoundFragment::SampleKineticEnergy(), G4EvaporationProbability::SampleKineticEnergy(), G4UrbanAdjointMscModel::SampleScattering(), G4UrbanMscModel::SampleScattering(), G4WentzelVIModel::SampleScattering(), G4eBremParametrizedModel::SampleSecondaries(), G4eBremsstrahlungRelModel::SampleSecondaries(), G4BoldyshevTripletModel::SampleSecondaries(), G4AtimaEnergyLossModel::SampleSecondaries(), G4BetheBlochModel::SampleSecondaries(), G4BetheHeitlerModel::SampleSecondaries(), G4BraggIonModel::SampleSecondaries(), G4BraggModel::SampleSecondaries(), G4eDPWACoulombScatteringModel::SampleSecondaries(), G4eeToTwoGammaModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4LindhardSorensenIonModel::SampleSecondaries(), G4MollerBhabhaModel::SampleSecondaries(), G4PairProductionRelModel::SampleSecondaries(), G4eplusTo2GammaOKVIModel::SampleSecondaries(), G4eplusTo3GammaOKVIModel::SampleSecondaries(), G4BetheHeitler5DModel::SampleSecondaries(), G4WentzelOKandVIxSection::SampleSingleScattering(), CLHEP::RandFlat::shoot(), CLHEP::RandGauss::shoot(), CLHEP::RandStudentT::shoot(), CLHEP::RandBreitWigner::shoot(), CLHEP::RandPoisson::shoot(), CLHEP::RandExpZiggurat::ziggurat_UNI(), and CLHEP::RandGaussZiggurat::ziggurat_UNI().

◆ flatArray()

◆ get() [1/2]

bool CLHEP::HepRandomEngine::get ( const std::vector< unsigned long > &  v)
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 82 of file RandomEngine.cc.

82 {
83 std::cerr << "HepRandomEngine::get(v) called -- no effect!\n";
84 return false;
85}

◆ get() [2/2]

std::istream & CLHEP::HepRandomEngine::get ( std::istream &  is)
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 63 of file RandomEngine.cc.

63 {
64 std::cerr << "HepRandomEngine::get called -- no effect!\n";
65 return is;
66}

Referenced by CLHEP::HepRandom::engine(), CLHEP::HepRandom::getTheEngine(), and CLHEP::operator>>().

◆ getSeed()

long CLHEP::HepRandomEngine::getSeed ( ) const
inline

Definition at line 112 of file RandomEngine.h.

112{ return theSeed; }

◆ getSeeds()

const long * CLHEP::HepRandomEngine::getSeeds ( ) const
inline

Definition at line 115 of file RandomEngine.h.

115{ return theSeeds; }

◆ getState() [1/2]

bool CLHEP::HepRandomEngine::getState ( const std::vector< unsigned long > &  v)
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 86 of file RandomEngine.cc.

86 {
87 std::cerr << "HepRandomEngine::getState(v) called -- no effect!\n";
88 return false;
89}

◆ getState() [2/2]

std::istream & CLHEP::HepRandomEngine::getState ( std::istream &  is)
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 72 of file RandomEngine.cc.

72 {
73 std::cerr << "HepRandomEngine::getState called -- no effect!\n";
74 return is;
75}

◆ mantissa_bit_12()

static double CLHEP::HepRandomEngine::mantissa_bit_12 ( )
inlinestaticprotected

◆ mantissa_bit_24()

◆ mantissa_bit_32()

static double CLHEP::HepRandomEngine::mantissa_bit_32 ( )
inlinestaticprotected

◆ name()

◆ nearlyTwoToMinus_54()

static double CLHEP::HepRandomEngine::nearlyTwoToMinus_54 ( )
inlinestaticprotected

◆ newEngine() [1/2]

HepRandomEngine * CLHEP::HepRandomEngine::newEngine ( const std::vector< unsigned long > &  v)
static

Definition at line 96 of file RandomEngine.cc.

96 {
98}
static HepRandomEngine * newEngine(std::istream &is)

◆ newEngine() [2/2]

HepRandomEngine * CLHEP::HepRandomEngine::newEngine ( std::istream &  is)
static

Definition at line 91 of file RandomEngine.cc.

91 {
92 return EngineFactory::newEngine(is);
93}

Referenced by CLHEP::StaticRandomStates::restore().

◆ operator double()

CLHEP::HepRandomEngine::operator double ( )
virtual

◆ operator float()

CLHEP::HepRandomEngine::operator float ( )
virtual

◆ operator unsigned int()

CLHEP::HepRandomEngine::operator unsigned int ( )
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::RanecuEngine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 42 of file RandomEngine.cc.

42 {
43 return (unsigned int)( flat() * exponent_bit_32() );
44}
static double exponent_bit_32()

◆ operator!=()

bool CLHEP::HepRandomEngine::operator!= ( const HepRandomEngine engine)
inline

◆ operator==()

bool CLHEP::HepRandomEngine::operator== ( const HepRandomEngine engine)
inline

◆ put() [1/2]

std::vector< unsigned long > CLHEP::HepRandomEngine::put ( ) const
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 77 of file RandomEngine.cc.

77 {
78 std::cerr << "v=HepRandomEngine::put() called -- no data!\n";
79 std::vector<unsigned long> v;
80 return v;
81}

◆ put() [2/2]

std::ostream & CLHEP::HepRandomEngine::put ( std::ostream &  os) const
virtual

Reimplemented in CLHEP::DualRand, CLHEP::HepJamesRandom, CLHEP::MixMaxRng, CLHEP::MTwistEngine, CLHEP::NonRandomEngine, CLHEP::RanecuEngine, CLHEP::Ranlux64Engine, CLHEP::RanluxEngine, and CLHEP::RanshiEngine.

Definition at line 59 of file RandomEngine.cc.

59 {
60 std::cerr << "HepRandomEngine::put called -- no effect!\n";
61 return os;
62}

Referenced by CLHEP::operator<<().

◆ restoreStatus()

virtual void CLHEP::HepRandomEngine::restoreStatus ( const char  filename[] = "Config.conf")
pure virtual

◆ saveStatus()

virtual void CLHEP::HepRandomEngine::saveStatus ( const char  filename[] = "Config.conf") const
pure virtual

◆ setSeed()

virtual void CLHEP::HepRandomEngine::setSeed ( long  seed,
int   
)
pure virtual

◆ setSeeds()

virtual void CLHEP::HepRandomEngine::setSeeds ( const long *  seeds,
int   
)
pure virtual

◆ showStatus()

virtual void CLHEP::HepRandomEngine::showStatus ( ) const
pure virtual

◆ twoToMinus_32()

static double CLHEP::HepRandomEngine::twoToMinus_32 ( )
inlinestaticprotected

◆ twoToMinus_48()

static double CLHEP::HepRandomEngine::twoToMinus_48 ( )
inlinestaticprotected

◆ twoToMinus_49()

static double CLHEP::HepRandomEngine::twoToMinus_49 ( )
inlinestaticprotected

◆ twoToMinus_53()

static double CLHEP::HepRandomEngine::twoToMinus_53 ( )
inlinestaticprotected

Member Data Documentation

◆ theSeed

long CLHEP::HepRandomEngine::theSeed
protected

Definition at line 142 of file RandomEngine.h.

Referenced by CLHEP::DualRand::DualRand(), getSeed(), CLHEP::DualRand::getState(), CLHEP::HepJamesRandom::getState(), CLHEP::MixMaxRng::getState(), CLHEP::MTwistEngine::getState(), CLHEP::RanecuEngine::getState(), CLHEP::Ranlux64Engine::getState(), CLHEP::RanluxEngine::getState(), CLHEP::RanshiEngine::getState(), CLHEP::HepJamesRandom::HepJamesRandom(), CLHEP::MixMaxRng::MixMaxRng(), CLHEP::RanecuEngine::put(), CLHEP::MixMaxRng::put(), CLHEP::MTwistEngine::put(), CLHEP::RanecuEngine::RanecuEngine(), CLHEP::RanluxEngine::RanluxEngine(), CLHEP::RanshiEngine::RanshiEngine(), CLHEP::DualRand::restoreStatus(), CLHEP::HepJamesRandom::restoreStatus(), CLHEP::MTwistEngine::restoreStatus(), CLHEP::RanecuEngine::restoreStatus(), CLHEP::RanluxEngine::restoreStatus(), CLHEP::Ranlux64Engine::restoreStatus(), CLHEP::RanshiEngine::restoreStatus(), CLHEP::MTwistEngine::saveStatus(), CLHEP::RanecuEngine::setIndex(), CLHEP::RanecuEngine::setSeed(), CLHEP::HepJamesRandom::setSeed(), CLHEP::MixMaxRng::setSeed(), CLHEP::Ranlux64Engine::setSeed(), CLHEP::RanluxEngine::setSeed(), CLHEP::DualRand::setSeed(), CLHEP::MTwistEngine::setSeed(), CLHEP::RanecuEngine::setSeeds(), CLHEP::Ranlux64Engine::setSeeds(), CLHEP::RanluxEngine::setSeeds(), CLHEP::MixMaxRng::setSeeds(), CLHEP::RanshiEngine::setSeeds(), CLHEP::DualRand::showStatus(), CLHEP::HepJamesRandom::showStatus(), CLHEP::MTwistEngine::showStatus(), CLHEP::RanecuEngine::showStatus(), CLHEP::Ranlux64Engine::showStatus(), CLHEP::RanluxEngine::showStatus(), and CLHEP::RanshiEngine::showStatus().

◆ theSeeds


The documentation for this class was generated from the following files: