29int main(
int argc,
char **argv)
50 JParser<> zap(
"Auxiliary program to test contents of 2D histograms.");
52 zap[
'f'] =
make_field(inputFile,
"measurement histogram, e.g: <file name>:<object name>");
53 zap[
'x'] =
make_field(X,
"accepted x-range values") = JRange_t();
54 zap[
'y'] =
make_field(Y,
"accepted y-range values") = JRange_t();
55 zap[
'z'] =
make_field(Z,
"accepted z-range values") = JRange_t();
65 catch(
const exception &error) {
78 FATAL(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
87 const TString tag(key->GetName());
93 if (tag.Contains(
regexp) && isTObject(key)) {
98 const TGraph2D* g2 = (
dynamic_cast<TGraph2D*
>(p) !=
NULL ?
dynamic_cast<TGraph2D*
>(p) :
NULL);
100 for (map_type::const_iterator i = zmap.begin(); i != zmap.end(); ++i) {
102 const double value = getResult(i->first, p);
103 const JRange_t& range = i->second;
105 DEBUG(
"Global test " << i->first <<
' ' << (range(value) ?
"passed" :
"failed") <<
endl);
112 int number_of_outliers = 0;
119 const Double_t x = h2->GetXaxis()->GetBinCenter(
ix);
120 const Double_t y = h2->GetYaxis()->GetBinCenter(
iy);
130 DEBUG(
"Test outlier " << h2->GetName() <<
" bin (" <<
ix <<
"," <<
iy <<
") (" << h2->GetXaxis()->GetBinLabel(
ix) <<
"," << h2->GetYaxis()->GetBinLabel(
iy) <<
") " << z <<
' ' << (
ok ?
"passed" :
"failed") <<
endl);
133 ++number_of_outliers;
139 }
else if (g2 !=
NULL) {
141 for (
Int_t i = 0; i != g2->GetN(); ++i) {
154 DEBUG(
"Test outlier " << g2->GetName() <<
" bin (" << i <<
") " << z <<
' ' << (
ok ?
"passed" :
"failed") <<
endl);
157 ++number_of_outliers;
164 FATAL(
"Object at " << *input <<
" is not TH2 nor TGraph2D." <<
endl);
168 cout << (number_of_outliers > numberOfOutliers ? RED : GREEN);
172 if (number_of_outliers > numberOfOutliers) {