Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
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/JStats.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
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 JStats 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:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Template definition of a multi-dimensional oscillation probability interpolation table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Acoustic event fit.
double ndf
weighed number of degrees of freedom
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary data structure for running average and standard deviation.
Definition JStats.hh:44
void put(const double x, const double w=1.0)
Put value.
Definition JStats.hh:119
double getMean() const
Get mean value.
Definition JStats.hh:234
Auxiliary data structure for floating point format specification.
Definition JManip.hh:488