1 #ifndef __JTESTKOLMOGOROV_SLICE__
2 #define __JTESTKOLMOGOROV_SLICE__
39 std::istream&
read(std::istream&
in)
override{
51 std::ostream&
write(std::ostream& out, std::string delimiter =
" ",
bool onlyFailures =
false)
const override{
55 out << std::scientific << std::setprecision(2) << (
r->passed ?
JPP::GREEN :
JPP::RED) <<
r->print(delimiter) << std::endl;
57 out << std::scientific << std::setprecision(2) << (
r->passed ?
JPP::GREEN :
JPP::RED) <<
r->print(delimiter) << std::endl;
74 if (!(dynamic_cast<TH2*>(o1) == NULL) && !(dynamic_cast<TH2*>(o2) == NULL)) {
76 TH2D*
h1 =
dynamic_cast<TH2D*
>(o1);
77 TH2D* h2 =
dynamic_cast<TH2D*
>(o2);
86 ERROR (
"Slice option should be: x, X, y or Y, and not " +
slice);
89 }
else if (!(dynamic_cast<TH1*>(o1) == NULL) && !(dynamic_cast<TH1*>(o2) == NULL)) {
90 ERROR(
"For 1D histograms call JTestKolmogorov_1D: " << o1->GetName() << endl);
100 virtual void save(TFile*
f , std::string
path,
bool onlyFailures =
false)
override{
108 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
113 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
146 const std::string
name =
"KS_Slice";
const std::string parameter
parameter name.
Implementation of the different Kolmogorov-related tests.
char slice
axis to slice. x or X for x-axis, y or Y for y-axis, n or N for None.
const std::string name
test name.
double failuresThreshold
threshold p-value to decide if test is passed.
std::vector< JTestResult > results
virtual void save(TFile *f, std::string path, bool onlyFailures=false) override
Writes the test result to root file.
Implementation of the Kolmogorov test for 2D histograms.
then for HISTOGRAM in h0 h1
JTestResult JKolmogorovTestSlice(TH2 *h1, TH2 *h2, double threshold, double failuresThreshold, std::string testName, std::string parameterName, char slice)
Kolmogorov test for sliced 2D histograms.
Structure containing the result of the test.
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
double threshold
threshold p-value to decide if test is passed.
void clear() override
Clear results.
void test(TObject *o1, TObject *o2) override
Applies Kolmogorov test for two ROOT TH2 histograms.
std::string getParameter() override
Get parameter name.
Interface to read input and write output for TObject tests.
std::ostream & write(std::ostream &out, std::string delimiter=" ", bool onlyFailures=false) const override
Write test result to output.
std::istream & read(std::istream &in) override
Read test parameters from input.
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 getName() override
Get test name.
JTestKolmogorovSlice()
Default constructor.