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

Auxiliary program to print chi2/NDF of acoustic events. More...

#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "JSupport/JMultipleFileScanner.hh"
#include "JAcoustics/JEvt.hh"
#include "JAcoustics/JSupport.hh"
#include "JTools/JQuantile.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 print chi2/NDF of acoustic events.

Author
mdejong

Definition in file JPrintChi2.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 25 of file JPrintChi2.cc.

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
Auxiliary data structure for running average, standard deviation and quantiles.
Definition: JQuantile.hh:43
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
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
#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:73