1 #ifndef __JCOMPAREHISTOGRAMS__JTESTCHI2_1D__
2 #define __JCOMPAREHISTOGRAMS__JTESTCHI2_1D__
13 namespace JCOMPAREHISTOGRAMS {
31 JTest_t(
"Chi2_1D",
"p-Value(chi2)"),
41 std::istream&
read(std::istream&
in)
override{
55 if (!(dynamic_cast<TH2*>(o1) == NULL) || !(dynamic_cast<TH2*>(o2) == NULL)) {
57 ERROR(
"For 2D histograms call JTestChi2_2D: " << o1->GetName() << endl);
59 }
else if (!(dynamic_cast<TH1*>(o1) == NULL) && !(
dynamic_cast<TH1*
>(o2) == NULL)) {
61 TH1D*
h1 =
dynamic_cast<TH1D*
>(o1);
62 TH1D* h2 =
dynamic_cast<TH1D*
>(o2);
64 if (h1 -> GetNbinsX() != h2 -> GetNbinsX()) {
65 ERROR(
"Histograms with different bining. The objects: " << h1 -> GetName() <<
" can not be compared." << endl);
Interface to read input and write output for TObject tests.
JTestResult JChi2Test(TH1 *h1, TH1 *h2, double threshold, std::string testName, std::string parameterName, std::string options)
Chi2 test for 1D histograms.
void test(TObject *o1, TObject *o2) override
Applies Chi2 test for two ROOT TH1 histograms.
then for HISTOGRAM in h0 h1
JTestChi2_1D()
Default constructor.
std::vector< JTestResult > results
Buffer to store results of multiple tests.*/.
std::istream & read(std::istream &in) override
Read test parameters from input.
const std::string resultType
result type
const std::string testName
test name
Implementation of the Chi2 test for 1D histograms.
Structure containing the result of the test.
double threshold
threshold p-value to decide if test is passed.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
std::string options
options for the ROOT chi2 test.
Implementation of the different Chi2-related tests.