21#include "CLHEP/Random/defs.h"
22#include "CLHEP/Random/RandStudentT.h"
23#include "CLHEP/Random/DoubConv.h"
40 return fire( defaultA );
76 if( a < 0.0)
return (DBL_MAX);
83 while ((w = u * u + v * v) > 1.0);
85 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
91 for(
double* v = vect; v != vect + size; ++v )
96 const int size,
double* vect,
99 for(
double* v = vect; v != vect + size; ++v )
100 *v =
shoot(anEngine,a);
109 u = 2.0 * localEngine->flat() - 1.0;
110 v = 2.0 * localEngine->flat() - 1.0;
112 while ((w = u * u + v * v) > 1.0);
114 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
119 for(
double* v = vect; v != vect + size; ++v )
126 for(
double* v = vect; v != vect + size; ++v )
136 u = 2.0 * anEngine->
flat() - 1.0;
137 v = 2.0 * anEngine->
flat() - 1.0;
139 while ((w = u * u + v * v) > 1.0);
141 return(u * std::sqrt( a * ( std::exp(- 2.0 / a * std::log(w)) - 1.0) / w));
145 long pr=os.precision(20);
146 std::vector<unsigned long> t(2);
147 os <<
" " <<
name() <<
"\n";
148 os <<
"Uvec" <<
"\n";
150 os << defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
154 long pr=os.precision(20);
155 os <<
" " <<
name() <<
"\n";
156 os << defaultA <<
"\n";
165 if (inName !=
name()) {
166 is.clear(std::ios::badbit | is.rdstate());
167 std::cerr <<
"Mismatch when expecting to read state of a "
168 <<
name() <<
" distribution\n"
169 <<
"Name found was " << inName
170 <<
"\nistream is left in the badbit state\n";
174 std::vector<unsigned long> t(2);
static double longs2double(const std::vector< unsigned long > &v)
static std::vector< unsigned long > dto2longs(double d)
static HepRandomEngine * getTheEngine()
static void shootArray(const int size, double *vect, double a=1.0)
void fireArray(const int size, double *vect)
HepRandomEngine & engine()
std::istream & get(std::istream &is)
std::ostream & put(std::ostream &os) const
bool possibleKeywordInput(IS &is, const std::string &key, T &t)