Go to the documentation of this file.
21 #include "CLHEP/Random/defs.h"
22 #include "CLHEP/Random/JamesRandom.h"
23 #include "CLHEP/Random/Random.h"
24 #include "CLHEP/Random/StaticRandomStates.h"
25 #include "CLHEP/Utility/memory.h"
31 #include "CLHEP/Random/SeedTable.h"
39 defaults( HepRandom & g, HepJamesRandom & e )
44 void resetEngine( HepRandomEngine * newEngine ) {
48 void resetEngine( HepRandomEngine & newEngine ) {
49 theEngine.reset( &newEngine, do_nothing_deleter() );
52 bool ensureInitialized() {
65 defaults & theDefaults() {
66 static HepRandom theDefaultGenerator;
67 static HepJamesRandom theDefaultEngine;
68 static defaults theDefaults(theDefaultGenerator, theDefaultEngine);
99 return theDefaults().theEngine->flat();
104 theDefaults().theEngine->flatArray(
size,vect);
113 std::cerr <<
"HepRandom::engine() called -- there is no assigned engine!\n";
114 return *theDefaults().theEngine.
get();
134 theDefaults().theEngine->setSeed(seed,lux);
139 return theDefaults().theEngine->getSeed();
144 theDefaults().theEngine->setSeeds(
seeds,aux);
149 return theDefaults().theEngine->getSeeds();
154 if ((index >= 0) && (index < 215)) {
163 return theDefaults().theGenerator.
get();
168 return theDefaults().theEngine.
get();
178 theDefaults().theEngine->saveStatus( filename );
183 theDefaults().theEngine->restoreStatus( filename );
206 theDefaults().theEngine->showStatus();
211 return static_cast<int>( theDefaults().ensureInitialized() );
static const long seedTable[215][2]
static std::ostream & saveFullState(std::ostream &os)
shared_ptr< HepRandom > theGenerator
static int createInstance()
shared_ptr< HepRandomEngine > theEngine
static std::istream & restoreStaticRandomStates(std::istream &is)
static void getTheTableSeeds(long *seeds, int index)
HepRotation and so forth isNear() norm2() rectify() static Rotation row1 row4(To avoid bloat in the code pulled in for programs which don 't use all these features, we split the implementation .cc files. Only isNear() goes into the original Rotation.cc) --------------------------------------- HepAxisAngle and HepEulerAngles classes --------------------------------------- These classes are very useful and simple structures for holding the result of a nice intuituve decomposition of a rotation there is no longer much content in the distinct ZOOM PhysicsVectors library The only content left in the library is the object files representing the various Exception objects When we build the CLHEP classes for the ZOOM we will set up so as to use ZOOM SpaceVector is(but we can disable namespace usage and most of our users do so at this point). What I do is leave Hep3Vector in the global namespace
static std::istream & restoreFullState(std::istream &is)
static void setTheEngine(HepRandomEngine *theNewEngine)
static std::istream & restore(std::istream &is)
static void restoreEngineStatus(const char filename[]="Config.conf")
static const long * getTheSeeds()
virtual std::istream & get(std::istream &is)
user code seldom needs to call this function directly ZMerrno whether or not they are still recorded ZMerrno size() Return the(integer) number of ZMthrow 'n exceptions currently recorded. 5) ZMerrno.clear() Set an internal counter to zero. This counter is available(see next function) to user code to track ZMthrow 'n exceptions that have occurred during any arbitrary time interval. 6) ZMerrno.countSinceCleared() Return the(integer) number of ZMthrow 'n exceptions that have been recorded via ZMerrno.write()
virtual double operator()()
static HepRandom * getTheGenerator()
virtual HepRandomEngine & engine()
virtual std::string name() const
virtual std::istream & get(std::istream &is)
I could not create a faster method completely accurate that does not require overly large tables and takes a major step up when we cross for several values of but we have applied this with much higher N We validated the main trials It showed no sign of approaching the rejectable p values or errors in mean and sigma the method matches the original algorithm
static void setTheSeeds(const long *seeds, int aux=-1)
static std::ostream & save(std::ostream &os)
std::istream & operator>>(std::istream &is, HepAxisAngle &aa)
Technical Maintenance Note for CLHEP Random Consequences of seeding JamesRandom with positive seed values greater than In the source code JamesRandom The usual way of seeding a generator is via the default which makes use of the table of seeds(with some trickery to ensure that the values won 't repeat after the table rows are exhausted). The trickery preserves the fact that sees are never negative(because the table values are never negative
static std::ostream & saveStaticRandomStates(std::ostream &os)
void flatArray(const int size, double *vect)
static void saveEngineStatus(const char filename[]="Config.conf")
static void showEngineStatus()
static void setTheSeed(long seed, int lux=3)
std::ostream & operator<<(std::ostream &os, const HepAxisAngle &aa)
static HepRandomEngine * getTheEngine()
virtual std::ostream & put(std::ostream &os) const