23 {
24
25 std::cout << "main()" << std::endl;
26
27 TFile
f(
"out.root",
"recreate");
28
29
30 int Nxbins = 10;
31 double xlimitlo = -10;
32 double xlimithi = 10;
33
34 int Nybins = 300;
35 double ylimitlo = -30;
36 double ylimithi = 30;
37
38
39 Resplot plot1(
"plot1", Nxbins, xlimitlo, xlimithi, Nybins, ylimitlo, ylimithi );
40 Resplot plot2(
"plot2", Nxbins, xlimitlo, xlimithi, Nybins, ylimitlo, ylimithi );
41
42 std::cout << "running" << std::endl;
43
45
46
47
48 for (
int i=0 ;
i<10000 ;
i++ ) {
49
50 if ( (i%1000)==0 ) std::cout <<
"process event " <<
i << std::endl;
51
52 double x0 = 20*
rnd.uniform()-10;
53 double y0 = (2+x0*x0/20)*
rnd.gauss();
54
55 plot1.Fill(x0, y0);
57
58 }
59
60 std::cout << "finalising" << std::endl;
61
63
64 std::cout << __LINE__ << std::endl;
65
67
68 plot1.Write();
70
71
73
74
75 std::cout << "closing f" << std::endl;
77
78
79 std::cout << "operations" << std::endl;
80
81 return 0;
82}
static Random & RandomBuilder()
static TF1 * FitGaussian(TH1D *s, double a=-999, double b=-999)
static TF1 * FitNull95(TH1D *s, double a=0, double b=0)
plot2(classAndKey, valueX="$x", valueY="$x", criteria="True", nEvent=100)