Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JEditEnergyCorrection.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <iomanip>
4 
6 
7 #include "Jeep/JParser.hh"
8 #include "Jeep/JMessage.hh"
9 
10 
11 /**
12  * \file
13  *
14  * Example program to edit energy correction.
15  * \author mdejong
16  */
17 int main(int argc, char **argv)
18 {
19  using namespace std;
20  using namespace JPP;
21 
22  string outputFile;
23  JEnergyCorrection fcn;
24  int debug;
25 
26  try {
27 
28  JParser<> zap("Example program to edit energy correction.");
29 
30  zap['E'] = make_field(fcn) = JEnergyCorrection();
31  zap['o'] = make_field(outputFile) = "";
32  zap['d'] = make_field(debug) = 2;
33 
34  zap(argc, argv);
35  }
36  catch(const exception& error) {
37  FATAL(error.what() << endl);
38  }
39 
40 
41  DEBUG("Formula " << fcn << endl);
42 
43  if (outputFile != "") {
44  fcn.store(outputFile.c_str());
45  }
46 }
Utility class to parse command line options.
Definition: JParser.hh:1493
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
int main(int argc, char *argv[])
Definition: Main.cpp:15