32 return genChiSquare( anEngine, a );
37 return genChiSquare( anEngine, a );
41 return genChiSquare( localEngine.get(),
a );
46 for(
double*
v = vect;
v != vect+size; ++
v )
51 const int size,
double* vect,
54 for(
double*
v = vect;
v != vect+size; ++
v )
59 for(
double*
v = vect;
v != vect+size; ++
v )
65 for(
double*
v = vect;
v != vect+size; ++
v )
93 if( a < 1 )
return (-1.0);
100 v = anEngine->
flat() * 0.857763884960707;
105 if (z < 0.0) r = r + zz * z / (3.0 *
z);
106 if (u < r * 0.3894003915)
return(z*z);
107 if (zz > (1.036961043 / u + 1.4))
continue;
108 if (2 * std::log(u) < (- zz * 0.5 ))
return(z*z);
115 b = std::sqrt(a - 1.0);
116 vm = - 0.6065306597 * (1.0 - 0.25 / (
b *
b + 1.0));
117 vm = (-
b > vm)? -
b : vm;
118 vp = 0.6065306597 * (0.7071067812 +
b) / (0.5 +
b);
124 u = anEngine->
flat();
125 v = anEngine->
flat() * vd + vm;
127 if (z < -
b)
continue;
130 if (z < 0.0) r = r + zz * z / (3.0 * (z +
b));
131 if (u < r * 0.3894003915)
return((z +
b)*(z +
b));
132 if (zz > (1.036961043 / u + 1.4))
continue;
133 if (2 * std::log(u) < (std::log(1.0 + z /
b) *
b *
b - zz * 0.5 - z *
b))
return((z +
b)*(z +
b));
139 int pr=os.precision(20);
140 std::vector<unsigned long> t(2);
141 os <<
" " <<
name() <<
"\n";
142 os <<
"Uvec" <<
"\n";
144 os << defaultA <<
" " << t[0] <<
" " << t[1] <<
"\n";
152 if (inName !=
name()) {
153 is.clear(std::ios::badbit | is.rdstate());
154 std::cerr <<
"Mismatch when expecting to read state of a "
155 <<
name() <<
" distribution\n"
156 <<
"Name found was " << inName
157 <<
"\nistream is left in the badbit state\n";
161 std::vector<unsigned long> t(2);
void fireArray(const int size, double *vect)
std::vector< ExP01TrackerHit * > a
static void shootArray(const int size, double *vect, double a=1.0)
std::ostream & put(std::ostream &os) const
static HepRandomEngine * getTheEngine()
std::istream & get(std::istream &is)
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
#define CLHEP_THREAD_LOCAL
static std::vector< unsigned long > dto2longs(double d)
HepRandomEngine & engine()
static double longs2double(const std::vector< unsigned long > &v)