Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
JQuality.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4
5#include "JTools/JWeight.hh"
9
10#include "Jeep/JParser.hh"
11#include "Jeep/JMessage.hh"
12
13
14/**
15 * \file
16 *
17 * Auxiliary program to sum fit quality.
18 */
19int main(int argc, char **argv)
20{
21 using namespace std;
22 using namespace JPP;
23
25 JLimit_t& numberOfEvents = inputFile.getLimit();
26 bool normalise;
27 int debug;
28
29 try {
30
31 JParser<> zap("Auxiliary program to sum fit quality.");
32
33 zap['f'] = make_field(inputFile);
34 zap['n'] = make_field(numberOfEvents) = JLimit::max();
35 zap['N'] = make_field(normalise);
36 zap['d'] = make_field(debug) = 2;
37
38 zap(argc, argv);
39 }
40 catch(const exception& error) {
41 FATAL(error.what() << endl);
42 }
43
44 JWeight W("Quality");
45
46 while (inputFile.hasNext()) {
47
48 STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
49
50 const JEvt* evt = inputFile.next();
51
52 if (!evt->empty()) {
53 if (evt->begin()->getQ() >= 0.0) {
54 W.put(evt->begin()->getQ());
55 }
56 }
57 }
58 STATUS(endl);
59
60 if (normalise)
61 cout << "Average quality " << FIXED(12,6) << W.getTotal()/W.getCount() << ' ' << FIXED(12,6) << W.getError()/W.getCount() << endl;
62 else
63 cout << "Total quality " << FIXED(12,1) << W.getTotal() << ' ' << FIXED(12,1) << W.getError() << endl;
64}
General purpose messaging.
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define STATUS(A)
Definition JMessage.hh:63
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Definition JQuality.cc:19
ROOT TTree parameter settings of various packages.
Template definition of a multi-dimensional oscillation probability interpolation table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Acoustic event fit.
Auxiliary data structure to unify weights of acoustics data according to the number of pings per emit...
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