25 int main(
int argc,
char **argv)
31 typedef JAbstractHistogram<Double_t> JHistogram_t;
42 JParser<> zap(
"Program to create TH1D and fill according given formula.");
48 zap[
'x'] =
make_field(X) = JHistogram_t(100, -1.0, +1.0);
53 catch(
const exception &error) {
54 FATAL(error.what() << endl);
58 TF1 f1(
"f1", formula.c_str());
68 X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit());
72 if (numberOfEvents > 0) {
74 h0.FillRandom(f1.GetName(), numberOfEvents);
78 for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
79 h0.SetBinContent(ix, f1.Eval(h0.GetXaxis()->GetBinCenter(ix)));