Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPrintAcousticsEvent.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 
4 #include "TROOT.h"
5 #include "TFile.h"
6 
8 
9 #include "JAcoustics/JEvent.hh"
10 #include "JAcoustics/JSupport.hh"
11 
12 #include "Jeep/JPrint.hh"
13 #include "Jeep/JParser.hh"
14 #include "Jeep/JMessage.hh"
15 
16 
17 /**
18  * \file
19  *
20  * Auxiliary program to print acoustic events.
21  * \author mdejong
22  */
23 int main(int argc, char **argv)
24 {
25  using namespace std;
26  using namespace JPP;
27 
29  JLimit_t& numberOfEvents = inputFile.getLimit();
30  int debug;
31 
32  try {
33 
34  JParser<> zap("Auxiliary program to print acoustic events.");
35 
36  zap['f'] = make_field(inputFile);
37  zap['n'] = make_field(numberOfEvents) = 1;
38  zap['d'] = make_field(debug) = 1;
39 
40  zap(argc, argv);
41  }
42  catch(const exception &error) {
43  FATAL(error.what() << endl);
44  }
45 
46 
47  while (inputFile.hasNext()) {
48 
49  const JEvent* evt = inputFile.next();
50 
51  cout << *evt << endl;
52  }
53 }
Utility class to parse command line options.
Definition: JParser.hh:1493
ROOT TTree parameter settings.
Acoustic event.
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
I/O formatting auxiliaries.
#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
Scanning of objects from multiple files according a format that follows from the extension of each fi...
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
Acoustic event.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
int main(int argc, char *argv[])
Definition: Main.cpp:15