|
Jpp
16.0.0
the software that should make you happy
|
Implementation of a bin-by-bin compatibility test for 2D histograms with low bin contents. More...
#include <JTestZero.hh>
Public Member Functions | |
| JTestZero () | |
| Default constructor. More... | |
| std::istream & | read (std::istream &in) override |
| Read test parameters from input. More... | |
| void | test (TObject *o1, TObject *o2) override |
| Bin-by-bin comparison for ROOT TH2 histograms, of compatibility with a Poisson pdf of parameter 1. 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 | JTestZero_2D (TH2 *h1, TH2 *h2, double outliersThreshold, double threshold, std::string testName, std::string parameterName) |
| Bin-by-Bin test for 2D histograms where a very low number of entries is expected. 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 | outliersThreshold |
| Fraction of bins allowed to fail. More... | |
| double | threshold |
| threshold p-value to decide if test is passed. More... | |
Implementation of a bin-by-bin compatibility test for 2D histograms with low bin contents.
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 test is run by the method JTestZero_2D().
Definition at line 29 of file JTestZero.hh.
|
inline |
Default constructor.
Definition at line 38 of file JTestZero.hh.
|
inlineoverridevirtual |
Read test parameters from input.
| in | input stream |
Implements JCOMPAREHISTOGRAMS::JTest_t.
Definition at line 49 of file JTestZero.hh.
Bin-by-bin comparison for ROOT TH2 histograms, of compatibility with a Poisson pdf of parameter 1.
| o1 | First histogram |
| o2 | Second histogram |
Implements JCOMPAREHISTOGRAMS::JTest_t.
Definition at line 59 of file JTestZero.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 |
Bin-by-Bin test for 2D histograms where a very low number of entries is expected.
The test loops over all the bins of both histograms and performs the following operations.
-Calculates the probability that the observed bin content for histogram A is obtained from a Poisson of parameter 1.
-Compares the previous result with the threshold value given as an input parameter. The result is true if the probability is higher than the threshold.
-Calculates the probability that the observed bin content for histogram B is obtained from a Poisson of parameter 1.
-Compares the previous result with the threshold value given as an input parameter. The result is true if the probability is higher than the threshold.
-Compares the results from both bins: If both are true, or both are false, the test is passed. If one is true and the other is false, the test is failed.
At the end of the loop, a failure fraction is computed and compared to the outliersThreshold parameter. If the failure fraction is above the threshold, the test is failed.
| h1 | First object |
| h2 | Second object |
| outliersThreshold | Fraction of incompatible bins allowed. |
| threshold | Poisson 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 54 of file JTestZero_t.hh.
|
private |
Fraction of bins allowed to fail.
Definition at line 71 of file JTestZero.hh.
|
private |
threshold p-value to decide if test is passed.
Definition at line 75 of file JTestZero.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.
1.8.5