46 JParser<> zap(
"Program to create TH2D and fill according given formula.");
61 catch(
const exception &error) {
62 FATAL(error.what() << endl);
66 if ((formula !=
"" && inputFile !=
"") ||
67 (formula ==
"" && inputFile ==
"")) {
68 FATAL(
"Specify input file or formula." << endl);
74 const string::size_type pos = title.rfind(
'/');
76 if (pos != string::npos) {
78 const string dir = title.substr(0, pos);
80 out.mkdir(dir.c_str());
83 title = title.substr(pos + 1);
86 TH2D h0(title.c_str(), NULL,
92 TF2 f2(
"f2", formula.c_str());
98 if (numberOfEvents > 0) {
101 h0.FillRandom(f2.GetName(), numberOfEvents);
105 for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
106 for (Int_t iy = 1; iy <= h0.GetYaxis()->GetNbins(); ++iy) {
107 h0.SetBinContent(ix, iy, f2.Eval(h0.GetXaxis()->GetBinCenter(ix),
108 h0.GetYaxis()->GetBinCenter(iy)));
112 }
else if (inputFile !=
"") {
118 ifstream in(inputFile.c_str());
120 for (
double x,
y; in >>
x >>
y; ) {
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Wrapper class around string.
Utility class to parse command line options.
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
int getParameter(const std::string &text)
Get parameter number from text string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...