48 for(
double* v = vect; v != vect+size; ++v )
53 const int size,
double* vect,
56 for(
double* v = vect; v != vect+size; ++v )
57 *v =
shoot(anEngine,a);
61 for(
double* v = vect; v != vect+size; ++v )
67 for(
double* v = vect; v != vect+size; ++v )
95 if( a < 1 )
return (-1.0);
101 u = anEngine->
flat();
102 v = anEngine->
flat() * 0.857763884960707;
107 if (z < 0.0) r = r + zz * z / (3.0 * z);
108 if (u < r * 0.3894003915)
return(z*z);
109 if (zz > (1.036961043 / u + 1.4))
continue;
110 if (2 * std::log(u) < (- zz * 0.5 ))
return(z*z);
117 b = std::sqrt(a - 1.0);
118 vm = - 0.6065306597 * (1.0 - 0.25 / (b * b + 1.0));
119 vm = (-b > vm)? -b : vm;
120 vp = 0.6065306597 * (0.7071067812 + b) / (0.5 + b);
126 u = anEngine->
flat();
127 v = anEngine->
flat() * vd + vm;
129 if (z < -b)
continue;
132 if (z < 0.0) r = r + zz * z / (3.0 * (z + b));
133 if (u < r * 0.3894003915)
return((z + b)*(z + b));
134 if (zz > (1.036961043 / u + 1.4))
continue;
135 if (2 * std::log(u) < (std::log(1.0 + z / b) * b * b - zz * 0.5 - z * b))
return((z + b)*(z + b));
141 int pr=os.precision(20);
142 std::vector<unsigned long> t(2);
143 os <<
" " <<
name() <<
"\n";
144 os <<
"Uvec" <<
"\n";
146 os <<
defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
154 if (inName !=
name()) {
155 is.clear(std::ios::badbit | is.rdstate());
156 std::cerr <<
"Mismatch when expecting to read state of a "
157 <<
name() <<
" distribution\n"
158 <<
"Name found was " << inName
159 <<
"\nistream is left in the badbit state\n";
163 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()
void fireArray(const int size, double *vect)
std::istream & get(std::istream &is)
HepRandomEngine & engine()
std::shared_ptr< HepRandomEngine > localEngine
static void shootArray(const int size, double *vect, double a=1.0)
std::ostream & put(std::ostream &os) const
static double genChiSquare(HepRandomEngine *anEngine, double a)
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
#define CLHEP_THREAD_LOCAL