Go to the documentation of this file. 1 #include "CLHEP/Random/defs.h"
2 #include "CLHEP/Random/DoubConv.hh"
4 #include "CLHEP/Random/RandExpZiggurat.h"
20 if ( deleteEngine )
delete localEngine;
30 return fire( defaultMean );
55 for (
int i=0;
i<
size; ++
i) vect[
i] =
fire( defaultMean );
60 for (
int i=0;
i<
size; ++
i) vect[
i] =
fire( defaultMean );
74 int pr=os.precision(20);
75 std::vector<unsigned long> t(2);
76 os <<
" " <<
name() <<
"\n";
79 os << defaultMean <<
" " << t[0] <<
" " << t[1] <<
"\n";
83 int pr=os.precision(20);
84 os <<
" " <<
name() <<
"\n";
85 os << defaultMean <<
"\n";
94 if (inName !=
name()) {
95 is.clear(std::ios::badbit |
is.rdstate());
96 std::cerr <<
"Mismatch when expecting to read state of a "
97 <<
name() <<
" distribution\n"
98 <<
"Name found was " << inName
99 <<
"\nistream is left in the badbit state\n";
103 std::vector<unsigned long> t(2);
114 unsigned long iz=jz&255;
126 if(jz<
ke[iz])
return (jz*
we[iz]);
132 const double rzm1 = 2147483648.0, rzm2 = 4294967296.;
133 double dn=3.442619855899,tn=dn,vn=9.91256303526217e-3, q;
134 double de=7.697117470131487, te=de, ve=3.949659822581572e-3;
139 kn[0]=(
unsigned long)((dn/q)*rzm1);
146 fn[127]=exp(-.5*dn*dn);
148 for(
i=126;
i>=1;
i--) {
149 dn=sqrt(-2.*log(vn/dn+exp(-.5*dn*dn)));
150 kn[
i+1]=(
unsigned long)((dn/tn)*rzm1);
152 fn[
i]=exp(-.5*dn*dn);
158 ke[0]=(
unsigned long)((de/q)*rzm2);
167 for(
i=254;
i>=1;
i--) {
168 de=-log(ve/de+exp(-de));
169 ke[
i+1]= (
unsigned long)((de/te)*rzm2);
HepRandomEngine & engine()
static unsigned long ziggurat_SHR3(HepRandomEngine *anEngine)
std::ostream & put(std::ostream &os) const
virtual ~RandExpZiggurat()
static bool ziggurat_init()
static unsigned long kn[128]
static void shootArray(const int size, float *vect, float mean=1.0)
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 float ziggurat_efix(unsigned long jz, HepRandomEngine *anEngine)
static double longs2double(const std::vector< unsigned long > &v)
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()
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
static float ziggurat_UNI(HepRandomEngine *anEngine)
static bool ziggurat_is_init
virtual double operator()()
RandExpZiggurat(HepRandomEngine &anEngine, double mean=1.0)
std::istream & get(std::istream &is)
static std::vector< unsigned long > dto2longs(double d)
void fireArray(const int size, float *vect)
any side effects of that construction would occur twice The semantics of throw x
static unsigned long ke[256]