Jpp  19.0.0
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 <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

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 }
Utility class to parse command line options.
Definition: JParser.hh:1711
Q(UTCMax_s-UTCMin_s)-livetime_s
Auxiliary data structure for running average, standard deviation and quantiles.
Definition: JQuantile.hh:43
Auxiliary class for multiplexing object iterators.
Type list.
Definition: JTypeList.hh:22
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
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:2158
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:84
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:486
int debug
debug level