ex-3: revert testing change left by someone

This commit is contained in:
Michele Guerini Rocco 2020-05-27 22:48:52 +02:00
parent f2679b8204
commit a82bbfaec0

View File

@ -85,16 +85,12 @@ int main(int argc, char **argv) {
fputs("# event sampling\n\n", stderr);
fprintf(stderr, "generating %ld events...", opts.num_events);
struct event *e;
// for (size_t i = 0; i < s.size; i++){
// e = &s.events[i];
// do {
// e->th = acos(1 - 2*gsl_rng_uniform(r));
// e->ph = 2 * M_PI * gsl_rng_uniform(r);
// } while(0.2 * gsl_rng_uniform(r) > distr(def_par, e));
for (size_t i = 0; i < s.size; i++){
e = &s.events[i];
e->th = acos(1 - 2*gsl_rng_uniform(r));
e->ph = 2 * M_PI * gsl_rng_uniform(r);
do {
e->th = acos(1 - 2*gsl_rng_uniform(r));
e->ph = 2 * M_PI * gsl_rng_uniform(r);
} while(0.2 * gsl_rng_uniform(r) > distr(def_par, e));
// update the histogram
gsl_histogram2d_increment(hist, e->th, e->ph);