Example program to plot Bell function.
20{
23
25 double sigma;
26 double alpha;
28
29 try {
30
31 JParser<> zap(
"Example program to plot Bell function.");
32
37
38 zap(argc, argv);
39 }
40 catch(const exception& error) {
41 FATAL(error.what() << endl);
42 }
43
44
45 const JBell bell(0.0, sigma, 1.0, 0.0, alpha);
46
48
49 const double xmin = -7.0 * sigma;
50 const double xmax = +7.0 * sigma;
51 const double dx = 1.0e-4 * sigma;
52 const int nx = (int) ((xmax - xmin) / dx);
53
54 TH1D h0("h0", "", nx, xmin, xmax);
55
56 for (Int_t i = 1; i != h0.GetXaxis()->GetNbins(); ++i) {
57
58 const Double_t
x = h0.GetXaxis()->GetBinCenter(i);
59 const Double_t
y = bell(x);
60
61 h0.SetBinContent(i, y);
62 }
63
64 out.Write();
65 out.Close();
66}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).