25 int main(
int argc,
char **argv)
45 JParser<> zap(
"Program to create TH1D and fill according given formula.");
59 catch(
const exception &error) {
60 FATAL(error.what() << endl);
64 if ((formula !=
"" && inputFile !=
"") ||
65 (formula ==
"" && inputFile ==
"")) {
66 FATAL(
"Specify input file or formula." << endl);
72 const string::size_type pos = title.rfind(
'/');
74 if (pos != string::npos) {
76 const string dir = title.substr(0, pos);
78 out.mkdir(dir.c_str());
81 title = title.substr(pos + 1);
84 TH1D h0(title.c_str(), NULL,
89 TF1
f1(
"f1", formula.c_str());
95 if (numberOfEvents > 0) {
98 h0.FillRandom(
f1.GetName(), numberOfEvents);
102 for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
103 h0.SetBinContent(ix,
f1.Eval(h0.GetXaxis()->GetBinCenter(ix)));
107 }
else if (inputFile !=
"") {
113 ifstream in(inputFile.c_str());
115 for (
double x; in >>
x; ) {
int main(int argc, char **argv)
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Wrapper class around string.
Utility class to parse command line options.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
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)...