#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JMath/JBell.hh"
#include "Jeep/JParser.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
| Example program to plot Bell function.
|
|
◆ main()
int main |
( |
int | argc, |
|
|
char ** | argv ) |
Example program to plot Bell function.
- Author
- mdejong
Definition at line 19 of file JBell.cc.
20{
23
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
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).