Jpp  16.0.3
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 debug;
33 
34  try {
35 
36  JParser<> zap("Auxiliary program to print chi2/NDF of acoustic events.");
37 
38  zap['f'] = make_field(inputFile);
39  zap['n'] = make_field(numberOfEvents) = JLimit_t::max();
40  zap['d'] = make_field(debug) = 1;
41 
42  zap(argc, argv);
43  }
44  catch(const exception &error) {
45  FATAL(error.what() << endl);
46  }
47 
48 
49  JQuantile Q;
50 
51  while (inputFile.hasNext()) {
52 
53  const JEvt* evt = inputFile.next();
54 
55  Q.put(evt->chi2 / evt->weight);
56  }
57 
58  cout << Q.getMean();
59 }
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.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
double weight
total weight of hits
int debug
debug level
Definition: JSirene.cc:63
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.