Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPrintChi2.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/JEvt.hh"
10 #include "JAcoustics/JSupport.hh"
11 
12 #include "JTools/JQuantile.hh"
13 
14 #include "Jeep/JPrint.hh"
15 #include "Jeep/JParser.hh"
16 #include "Jeep/JMessage.hh"
17 
18 
19 /**
20  * \file
21  *
22  * Auxiliary program to print chi2/NDF of acoustic events.
23  * \author mdejong
24  */
25 int main(int argc, char **argv)
26 {
27  using namespace std;
28  using namespace JPP;
29 
31  JLimit_t& numberOfEvents = inputFile.getLimit();
32  int width;
33  int precision;
34  int debug;
35 
36  try {
37 
38  JParser<> zap("Auxiliary program to print chi2/NDF of acoustic events.");
39 
40  zap['f'] = make_field(inputFile);
41  zap['n'] = make_field(numberOfEvents) = JLimit_t::max();
42  zap['w'] = make_field(width) = 1;
43  zap['p'] = make_field(precision) = 15;
44  zap['d'] = make_field(debug) = 1;
45 
46  zap(argc, argv);
47  }
48  catch(const exception &error) {
49  FATAL(error.what() << endl);
50  }
51 
52 
53  JQuantile Q;
54 
55  while (inputFile.hasNext()) {
56 
57  const JEvt* evt = inputFile.next();
58 
59  Q.put(evt->chi2 / evt->ndf);
60  }
61 
62  cout << scientific << setw(width) << setprecision(precision) << Q.getMean();
63 }
Utility class to parse command line options.
Definition: JParser.hh:1500
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
Definition: Main.cc:15
Auxiliary data structure for running average, standard deviation and quantiles.
Definition: JQuantile.hh:43
ROOT TTree parameter settings.
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
I/O formatting auxiliaries.
Acoustic event fit.
double ndf
weighed number of degrees of freedom
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:66
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.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
Acoustic event fit.