Geant4-11
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes
CLHEP::HepRandomEngine Class Referenceabstract

#include <RandomEngine.h>

Inheritance diagram for CLHEP::HepRandomEngine:
CLHEP::DualRand CLHEP::HepJamesRandom CLHEP::MTwistEngine CLHEP::MixMaxRng CLHEP::NonRandomEngine CLHEP::RanecuEngine CLHEP::Ranlux64Engine CLHEP::RanluxEngine CLHEP::RanluxppEngine CLHEP::RanshiEngine

Public Member Functions

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

Static Public Member Functions

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

Static Protected Member Functions

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

Protected Attributes

long theSeed
 
const long * theSeeds
 

Detailed Description

Author
Gabri.nosp@m.ele..nosp@m.Cosmo.nosp@m.@cer.nosp@m.n.ch

Definition at line 53 of file RandomEngine.h.

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}

References geant4_check_module_cycles::file.

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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

Referenced by G4UniversalFluctuation::AddExcitation(), G4FermiPhaseSpaceDecay::BetaKopylov(), G4FPYSamplingOps::G4SampleUniform(), CLHEP::RandBinomial::genBinomial(), CLHEP::RandChiSquare::genChiSquare(), CLHEP::RandGamma::genGamma(), CLHEP::normal(), CLHEP::RandPoissonQ::poissonDeviateSmall(), G4UrbanAdjointMscModel::SampleCosineTheta(), G4UrbanMscModel::SampleCosineTheta(), G4ModifiedTsai::SampleCosTheta(), G4FermiBreakUpVI::SampleDecay(), G4UrbanAdjointMscModel::SampleDisplacement(), G4UrbanAdjointMscModel::SampleDisplacementNew(), G4UrbanMscModel::SampleDisplacementNew(), G4VEmissionProbability::SampleEnergy(), G4SBBremTable::SampleEnergyTransfer(), G4IonFluctuations::SampleFluctuations(), G4UniversalFluctuation::SampleGauss(), 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(), G4UrbanAdjointMscModel::SimpleScattering(), CLHEP::RandExpZiggurat::ziggurat_UNI(), and CLHEP::RandGaussZiggurat::ziggurat_UNI().

◆ flatArray()

virtual void CLHEP::HepRandomEngine::flatArray ( const int  size,
double *  vect 
)
pure virtual

◆ 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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

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::operator>>().

◆ getSeed()

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

Definition at line 112 of file RandomEngine.h.

112{ return theSeed; }

References theSeed.

◆ getSeeds()

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

Definition at line 115 of file RandomEngine.h.

115{ return theSeeds; }

References 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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

Definition at line 72 of file RandomEngine.cc.

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

Referenced by CLHEP::makeAnEngine().

◆ mantissa_bit_12()

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

◆ mantissa_bit_24()

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

◆ mantissa_bit_32()

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

◆ name()

virtual std::string CLHEP::HepRandomEngine::name ( ) const
pure virtual

◆ 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)

References CLHEP::EngineFactory::newEngine().

◆ 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}

References CLHEP::EngineFactory::newEngine().

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

◆ 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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

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, CLHEP::RanshiEngine, and CLHEP::RanluxppEngine.

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

Field 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::RanluxppEngine::RanluxppEngine(), 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::RanluxppEngine::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

const long* CLHEP::HepRandomEngine::theSeeds
protected

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