Auxiliary program for chi2 test of 1D histograms.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TProfile.h"
#include "JGizmo/JRootObjectID.hh"
#include "JGizmo/JGizmoToolkit.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program for chi2 test of 1D histograms.
- Author
- mdejong
Definition in file JTestChi2.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 23 of file JTestChi2.cc.
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";
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());
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get TObject.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object