Jpp
15.0.0
the software that should make you happy
|
Implementation of the Chi2 test for 2D histograms. More...
#include <JTestChi2_2D.hh>
Public Member Functions | |
JTestChi2_2D () | |
Default constructor. More... | |
std::istream & | read (std::istream &in) override |
Read test parameters from input. More... | |
void | test (TObject *o1, TObject *o2) override |
Applies Chi2 test for two ROOT TH2 histograms. More... | |
std::ostream & | write (std::ostream &out, const char delimiter= ' ', const bool onlyFailures=false) const |
Write test result to output. More... | |
virtual void | save (TFile *f, const std::string &path, const bool onlyFailures=false) |
Writes the test result to root file. More... | |
virtual void | clear () |
Clear results. More... | |
const std::string & | getTestName () |
Get test name. More... | |
const std::string & | getResultType () |
Get result type. More... | |
JTestResult | JChi2Test (TH1 *h1, TH1 *h2, double threshold, std::string testName, std::string parameterName, std::string options) |
Chi2 test for 1D histograms. More... | |
JTestResult | JChi2TestSlice (TH2 *h1, TH2 *h2, double threshold, double failuresThreshold, std::string testName, std::string parameterName, std::string options, char slice) |
Chi2 test for sliced 2D histograms. More... | |
JTestResult | JChi2TestBin_2D (TH2 *h1, TH2 *h2, double outliersThreshold, double chi2Threshold, std::string testName, std::string parameterName) |
Bin-by-Bin Chi2 comparison of 2D histograms. More... | |
Public Attributes | |
std::vector< JTestResult > | results |
Buffer to store results of multiple tests.*/. More... | |
Protected Attributes | |
const std::string | testName |
test name More... | |
const std::string | resultType |
result type More... | |
Private Attributes | |
double | threshold |
threshold p-value to decide if test is passed. More... | |
double | failuresThreshold |
threshold p-value to decide if test is passed. More... | |
char | slice |
axis to slice. More... | |
std::string | options |
options for the ROOT chi2 test. More... | |
Implementation of the Chi2 test for 2D histograms.
This class is derived from the abstract class JTest_t(). For a general description of the implementation of this and other tests derived from JTest_t(), see its documentation.
The parameter slice() can have the values x, X, y or Y. The histograms are sliced along the corresponding axis, and the JChi2Test() test is applied to each slice.
The input parameter threshold(), is used to evaluate whether the test is passed or failed for each slice.
The evaluation is done by comparing the threshold() value with the result produced by JChi2Test(). The output of JChi2Test() is a p-value.
The parameter threshold() should therefore be a real value between 0 and 1.
Definition at line 23 of file JTestChi2_2D.hh.
|
inline |
Default constructor.
Definition at line 32 of file JTestChi2_2D.hh.
|
inlineoverridevirtual |
Read test parameters from input.
in | input stream |
Implements JCOMPAREHISTOGRAMS::JTest_t.
Definition at line 43 of file JTestChi2_2D.hh.
Applies Chi2 test for two ROOT TH2 histograms.
o1 | First histogram |
o2 | Second histogram |
Implements JCOMPAREHISTOGRAMS::JTest_t.
Definition at line 53 of file JTestChi2_2D.hh.
|
inlineinherited |
Write test result to output.
out | output stream |
delimiter | field delimiter |
onlyFailures | if true, write only failures. |
Definition at line 81 of file JTest_t.hh.
|
inlinevirtualinherited |
Writes the test result to root file.
f | A ROOT file |
path | Path in root file. |
onlyFailures | If true, write only failures. |
Definition at line 113 of file JTest_t.hh.
|
inlinevirtualinherited |
Clear results.
Definition at line 137 of file JTest_t.hh.
|
inlineinherited |
|
inlineinherited |
Get result type.
Definition at line 157 of file JTest_t.hh.
|
inlineinherited |
Chi2 test for 1D histograms.
The input parameter threshold, is used to evaluate whether the test is passed or failed.
The evaluation is done by comparing the threshold value with the result of the Chi2 test. The output of a Chi2 test is a p-value.
The parameter threshold should therefore be a real value between 0 and 1.
h1 | First histogram |
h2 | Second histogram |
threshold | Threshold value for the test result |
parameterName | Name of the parameter used to test the histograms |
testName | Name of the test used to compare the histograms |
options | ROOT options for the test. |
Definition at line 45 of file JTestChi2_t.hh.
|
inlineinherited |
Chi2 test for sliced 2D histograms.
The histograms are sliced along the axis specified by the slice parameter. A slice per bin is made.
For each of the slices, the input parameter threshold, is used to evaluate whether the test is passed or failed.
The evaluation is done by comparing the threshold value with the result of the Chi2 test. The output of a Chi2 test is a p-value.
The parameter threshold should therefore be a real value between 0 and 1.
The fraction of failed tests is compared to the input parameter failuresThreshold. If this fraction is larger than failuresThreshold, the test fails.
h1 | First histogram |
h2 | Second histogram |
threshold | Threshold value for the test result |
failuresThreshold | Threshold value for the fraction of failed tests. |
parameterName | Name of the parameter used to test the histograms |
testName | Name of the test used to compare the histograms |
options | ROOT options for the test. |
slice | The axis along which the histogram is sliced. |
Definition at line 115 of file JTestChi2_t.hh.
|
inlineinherited |
Bin-by-Bin Chi2 comparison of 2D histograms.
The Chi distance between h1 and h2 is calculated for each bin, and compared to the chi2Threshold() parameter.
If the calculated Chi distance is above this threshold, the test is passed for that bin.
If the fraction of failures is above the input parameter outliersThreshold(), the test is failed.
h1 | First object |
h2 | Second object |
outliersThreshold | fraction of bins allowed to fail the test |
chi2Threshold | p-value |
parameterName | Name of the parameter used to test the histograms |
testName | Name of the test used to compare the histograms |
Definition at line 240 of file JTestChi2_t.hh.
|
private |
threshold p-value to decide if test is passed.
Definition at line 76 of file JTestChi2_2D.hh.
|
private |
threshold p-value to decide if test is passed.
Definition at line 80 of file JTestChi2_2D.hh.
|
private |
axis to slice.
Definition at line 81 of file JTestChi2_2D.hh.
|
private |
options for the ROOT chi2 test.
Definition at line 82 of file JTestChi2_2D.hh.
|
inherited |
Buffer to store results of multiple tests.*/.
Definition at line 162 of file JTest_t.hh.
|
protectedinherited |
test name
Definition at line 166 of file JTest_t.hh.
|
protectedinherited |
result type
Definition at line 167 of file JTest_t.hh.