23 int main(
int argc,
char **argv)
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());
General purpose messaging.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Auxiliary class to handle file name, ROOT directory and object name.
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).