25 int main(
int argc, 
char **argv)
 
   47     JParser<> zap(
"Program to create TH2D and fill according given formula.");
 
   63   catch(
const exception &error) {
 
   64     FATAL(error.what() << endl);
 
   68   if ((formula != 
"" && inputFile != 
"") ||
 
   69       (formula == 
"" && inputFile == 
"")) {
 
   70     FATAL(
"Specify input file or formula." << endl);
 
   76   const string::size_type pos = title.rfind(
'/');
 
   78   if (pos != string::npos) {
 
   80     const string dir = title.substr(0, pos);
 
   82     out.mkdir(dir.c_str());
 
   85     title = title.substr(pos + 1);
 
   88   TH3D h0(title.c_str(), NULL,
 
   95     TF3 
f3(
"f3", formula.c_str());
 
  101     if (numberOfEvents > 0) {
 
  104       h0.FillRandom(
f3.GetName(), numberOfEvents);
 
  108       for (Int_t ix = 1; ix <= h0.GetXaxis()->GetNbins(); ++ix) {
 
  109         for (Int_t iy = 1; iy <= h0.GetYaxis()->GetNbins(); ++iy) {
 
  110           for (Int_t iz = 1; iz <= h0.GetZaxis()->GetNbins(); ++iz) {
 
  112             h0.SetBinContent(ix, iy, iz, 
f3.Eval(h0.GetXaxis()->GetBinCenter(ix),
 
  113                                                  h0.GetYaxis()->GetBinCenter(iy),
 
  114                                                  h0.GetZaxis()->GetBinCenter(iz)));
 
  119   } 
else if (inputFile != 
"") {
 
  125     ifstream in(inputFile.c_str());
 
  127     for (
double x, 
y, z; in >> 
x >> 
y >> z; ) {
 
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
 
double f3(const double x, const double y, const double z)
3D function.
 
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)...