Jpp
17.3.0-rc.1
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JAcoustics
JPrintChi2.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <limits>
4
5
#include "TROOT.h"
6
#include "TFile.h"
7
8
#include "
JSupport/JMultipleFileScanner.hh
"
9
10
#include "
JAcoustics/JEvt.hh
"
11
#include "
JAcoustics/JSupport.hh
"
12
13
#include "
JTools/JQuantile.hh
"
14
15
#include "
Jeep/JPrint.hh
"
16
#include "
Jeep/JParser.hh
"
17
#include "
Jeep/JMessage.hh
"
18
19
20
/**
21
* \file
22
*
23
* Auxiliary program to print chi2/NDF of acoustic events.
24
* \author mdejong
25
*/
26
int
main
(
int
argc,
char
**argv)
27
{
28
using namespace
std;
29
using namespace
JPP;
30
31
JMultipleFileScanner<JEvt>
inputFile;
32
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
33
int
width;
34
int
precision;
35
int
debug
;
36
37
try
{
38
39
JParser<>
zap(
"Auxiliary program to print chi2/NDF of acoustic events."
);
40
41
zap[
'f'
] =
make_field
(inputFile);
42
zap[
'n'
] =
make_field
(numberOfEvents) = JLimit_t::max();
43
zap[
'w'
] =
make_field
(width) = 1;
44
zap[
'p'
] =
make_field
(precision) = 15;
45
zap[
'd'
] =
make_field
(
debug
) = 1;
46
47
zap(argc, argv);
48
}
49
catch
(
const
exception &error) {
50
FATAL
(error.what() << endl);
51
}
52
53
54
JQuantile
Q
;
55
56
while
(inputFile.hasNext()) {
57
58
const
JEvt
* evt = inputFile.next();
59
60
Q
.put(evt->
chi2
/ evt->
ndf
);
61
}
62
63
cout << scientific << setw(width) << setprecision(precision) << (
Q
.getCount() > 0 ?
Q
.getMean() : numeric_limits<float>::max()) << endl;
64
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
Q
Q(UTCMax_s-UTCMin_s)-livetime_s
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JTOOLS::JQuantile
Auxiliary data structure for running average, standard deviation and quantiles.
Definition:
JQuantile.hh:43
JSupport.hh
ROOT TTree parameter settings.
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
JPrint.hh
I/O formatting auxiliaries.
JACOUSTICS::JEvt
Acoustic event fit.
Definition:
JAcoustics/JEvt.hh:207
JACOUSTICS::JHead::ndf
double ndf
weighed number of degrees of freedom
Definition:
JAcoustics/JEvt.hh:169
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JMultipleFileScanner.hh
Scanning of objects from multiple files according a format that follows from the extension of each fi...
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition:
JMultipleFileScanner.hh:199
JParser.hh
Utility class to parse command line options.
JQuantile.hh
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:73
JEvt.hh
Acoustic event fit.
JACOUSTICS::JHead::chi2
double chi2
chi2
Definition:
JAcoustics/JEvt.hh:170
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5