29{
32
35
37 JRange_t X;
38 JRange_t Y;
39 JRange_t Z;
40 JRange_t C;
45 int numberOfOutliers;
46 map_type zmap;
48
49 try {
50
51 JParser<> zap(
"Auxiliary program to test contents of 3D histograms.");
52
53 zap[
'f'] =
make_field(inputFile,
"measurement histogram, e.g: <file name>:<object name>");
54 zap[
'x'] =
make_field(X,
"accepted x-range values") = JRange_t();
55 zap[
'y'] =
make_field(Y,
"accepted y-range values") = JRange_t();
56 zap[
'z'] =
make_field(Z,
"accepted z-range values") = JRange_t();
57 zap[
'c'] =
make_field(C,
"accepted codomain values") = JRange_t();
65
67 }
68 catch(const exception &error) {
70 }
71
73
75
77
79
81 FATAL(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
82 }
83
85
87
89
90 const TString tag(
key->GetName());
91
93
94
95
97
99
101
102 for (map_type::const_iterator i = zmap.begin(); i != zmap.end(); ++i) {
103
104 const double value =
getResult(i->first, p);
105 const JRange_t& range = i->second;
106
107 DEBUG(
"Global test " << i->first <<
' ' << (range(value) ?
"passed" :
"failed") <<
endl);
108
110 }
111
112
114 int number_of_outliers = 0;
115
117
121
126
130
132
134
135 DEBUG(
"Test outlier " <<
h3->GetName() <<
" bin (" <<
ix <<
"," <<
iy <<
',' <<
iz <<
") (" <<
h3->GetXaxis()->GetBinLabel(
ix) <<
"," <<
h3->GetYaxis()->GetBinLabel(
iy) <<
"," <<
h3->GetZaxis()->GetBinLabel(
iz) <<
") " << c <<
' ' << (
ok ?
"passed" :
"failed") <<
endl);
136
138 ++number_of_outliers;
139 }
140 }
141 }
142 }
143 }
144
145 } else {
146
147 FATAL(
"Object at " << *input <<
" is not TH3" <<
endl);
148 }
149
150
151 cout << (number_of_outliers > numberOfOutliers ? RED : GREEN);
154
155 if (number_of_outliers > numberOfOutliers) {
157 }
158 }
159 }
160 }
161
163
164 return 0;
165}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
TDirectory * getDirectory(const JRootObjectID &id)
Get TDirectory pointer.
bool isTObject(const TKey *key)
Check if given key corresponds to a TObject.
Double_t getResult(const TString &text, TObject *object=NULL)
Get result of given textual formula.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...