23 int main(
int argc,
char **argv)
28 JRootObjectID inputFileA;
29 JRootObjectID inputFileB;
36 JParser<> zap(
"Auxiliary program for chi2 test of 1D histograms.");
38 zap[
'a'] =
make_field(inputFileA,
"measurement histogram, e.g: <file name>:<object name>");
39 zap[
'b'] =
make_field(inputFileA,
"reference histogram, e.g: <file name>:<object name>");
42 "UUUF",
"UWUF",
"WWUF",
43 "UUOF",
"UWOF",
"WWOF",
44 "UUUFOF",
"UWUFOF",
"WWUFOF";
45 zap[
'P'] =
make_field(P,
"minimal p-value") = 0.0;
50 catch(
const exception &error) {
51 FATAL(error.what() << endl);
58 if (ha == NULL) {
FATAL(
"No object at " << inputFileA << endl); };
59 if (hb == NULL) {
FATAL(
"No object at " << inputFileB << endl); };
64 if (h1a == NULL && dynamic_cast<TProfile*>(ha) != NULL) { h1a = dynamic_cast<TProfile*>(ha)->ProjectionX(); }
65 if (h1b == NULL && dynamic_cast<TProfile*>(hb) != NULL) { h1b = dynamic_cast<TProfile*>(hb)->ProjectionX(); }
67 if (h1a == NULL && dynamic_cast<TH1*>(ha) != NULL) { h1a = dynamic_cast<TH1*>(ha); }
68 if (h1b == NULL && dynamic_cast<TH1*>(hb) != NULL) { h1b = dynamic_cast<TH1*>(hb); }
70 if (h1a == NULL) {
FATAL(
"Object at " << inputFileA <<
" is not TH1." << endl); };
71 if (h1b == NULL) {
FATAL(
"Object at " << inputFileB <<
" is not TH1." << endl); };
73 const Double_t
result = h1a->Chi2Test(h1b, option.c_str());