17 const int nbins = 300;
18 const double ymax = 1.1;
19 const double xmin = 0;
20 const double xmax = 10;
21 const double dx = xmax-
xmin;
25 TF1 *
func =
new TF1 (
"func",
"1/(x+1)",0,10);
26 TH1D * hgen =
new TH1D (
"hgen",
"generated",nbins,xmin,xmax);
28 for(
int i=0;
i<N;
i++) {
29 cout <<
"..................." <<
i <<
endl;
32 double xg = xmin + rg.Uniform() *
dx;
33 double yg = ymax * rg.Uniform();
34 double yc = func->Eval(xg);
43 double IF = func->Integral(xmin,xmax);
44 double IH = hgen->Integral(
"width");
std::map< std::string, double > xmax
double func(double x, double y)
void test_mc_rejection_method_lin()