Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JFootprint.cc File Reference

Auxiliary program to plot average tilt angles. More...

#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "JSupport/JMultipleFileScanner.hh"
#include "JROOT/JManager.hh"
#include "JAcoustics/JEvt.hh"
#include "JAcoustics/JSupport.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to plot average tilt angles.

Author
mdejong

Definition in file JFootprint.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 27 of file JFootprint.cc.

28 {
29  using namespace std;
30  using namespace JPP;
31 
33  JLimit_t& numberOfEvents = inputFile.getLimit();
34  string outputFile;
35  int debug;
36 
37  try {
38 
39  JParser<> zap("Auxiliary program to plot average tilt angles.");
40 
41  zap['f'] = make_field(inputFile, "input file (output of JKatoomba)");
42  zap['n'] = make_field(numberOfEvents) = JLimit::max();
43  zap['o'] = make_field(outputFile) = "parramatta.root";
44  zap['d'] = make_field(debug) = 2;
45 
46  zap(argc, argv);
47  }
48  catch(const exception &error) {
49  FATAL(error.what() << endl);
50  }
51 
52  JManager<int, TH2D> H2(new TH2D("string[%]", NULL, 500, -50.0, +50.0, 500, -50.0, +50.0));
53 
54  while (inputFile.hasNext()) {
55 
56  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
57 
58  const JEvt* evt = inputFile.next();
59 
60  for (JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
61  H2 ->Fill(i->tx*1.0e3, i->ty*1.0e3); // [mrad]
62  H2[i->id]->Fill(i->tx*1.0e3, i->ty*1.0e3); // [mrad]
63  }
64  }
65  STATUS(endl);
66 
67  TFile out(outputFile.c_str(), "recreate");
68 
69  out << H2
70  << *H2;
71 
72  out.Write();
73  out.Close();
74 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define STATUS(A)
Definition: JMessage.hh:63
string outputFile
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition: JManager.hh:43
Acoustic event fit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:84
int debug
debug level
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62