Jpp  19.1.0
the software that should make you happy
Functions
JQuality.cc File Reference

Auxiliary program to sum fit quality. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JTools/JWeight.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "JReconstruction/JEvt.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 sum fit quality.

Definition in file JQuality.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 19 of file JQuality.cc.

20 {
21  using namespace std;
22  using namespace JPP;
23 
25  JLimit_t& numberOfEvents = inputFile.getLimit();
26  int debug;
27 
28  try {
29 
30  JParser<> zap("Auxiliary program to sum fit quality.");
31 
32  zap['f'] = make_field(inputFile);
33  zap['n'] = make_field(numberOfEvents) = JLimit::max();
34  zap['d'] = make_field(debug) = 2;
35 
36  zap(argc, argv);
37  }
38  catch(const exception& error) {
39  FATAL(error.what() << endl);
40  }
41 
42  JWeight W("Quality");
43 
44  while (inputFile.hasNext()) {
45 
46  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
47 
48  const JEvt* evt = inputFile.next();
49 
50  if (!evt->empty()) {
51  if (evt->begin()->getQ() >= 0.0) {
52  W.put(evt->begin()->getQ());
53  }
54  }
55  }
56  STATUS(endl);
57 
58  cout << "Total quality " << FIXED(12,1) << W.getTotal() << ' ' << FIXED(12,1) << W.getError()<< endl;
59 }
#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:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
Utility class to parse command line options.
Definition: JParser.hh:1698
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
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