Jpp  debug
the software that should make you happy
Functions
JPrintChi2.cc File Reference

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

#include <iostream>
#include <iomanip>
#include <limits>
#include "TROOT.h"
#include "TFile.h"
#include "JSupport/JMultipleFileScanner.hh"
#include "JAcoustics/JEvt.hh"
#include "JAcoustics/JSuperEvt.hh"
#include "JAcoustics/JSupport.hh"
#include "JLang/JObjectMultiplexer.hh"
#include "JLang/JManip.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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 30 of file JPrintChi2.cc.

31 {
32  using namespace std;
33  using namespace JPP;
34 
35  typedef JTYPELIST<JEvt, JSuperEvt>::typelist typelist;
36 
38  JLimit_t& numberOfEvents = inputFile.getLimit();
39  int width;
40  int precision;
41  int debug;
42 
43  try {
44 
45  JParser<> zap("Auxiliary program to print chi2/NDF of acoustic events.");
46 
47  zap['f'] = make_field(inputFile);
48  zap['n'] = make_field(numberOfEvents) = JLimit_t::max();
49  zap['w'] = make_field(width) = 1;
50  zap['p'] = make_field(precision) = 15;
51  zap['d'] = make_field(debug) = 1;
52 
53  zap(argc, argv);
54  }
55  catch(const exception &error) {
56  FATAL(error.what() << endl);
57  }
58 
59 
60  JQuantile Q;
61 
62  for (JObjectMultiplexer<typelist> in(inputFile); in.hasNext(); ) {
63 
64  const JEvt* evt = in.next();
65 
66  Q.put(evt->chi2 / evt->ndf);
67  }
68 
69  cout << SCIENTIFIC(width,precision) << Q.getMean(numeric_limits<float>::max()) << endl;
70 }
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2158
Auxiliary class for multiplexing object iterators.
virtual bool hasNext() override
Check availability of next element.
Utility class to parse command line options.
Definition: JParser.hh:1714
General purpose class for object reading from a list of file names.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Acoustic event fit.
double ndf
weighed number of degrees of freedom
Type list.
Definition: JTypeList.hh:23
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:45
Auxiliary data structure for running average, standard deviation and quantiles.
Definition: JQuantile.hh:46
void put(const double x, const double w=1.0)
Put value.
Definition: JQuantile.hh:133
double getMean() const
Get mean value.
Definition: JQuantile.hh:252
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:488