1 #ifndef __JTESTKOLMOGOROV_2D__
2 #define __JTESTKOLMOGOROV_2D__
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);
82 }
else if (!(dynamic_cast<TH1*>(o1) == NULL) && !(dynamic_cast<TH1*>(o2) == NULL)) {
83 ERROR(
"For 1D histograms call JTestKolmogorov_1D: " << o1->GetName() << endl);
93 virtual void save(TFile*
f , std::string
path,
bool onlyFailures =
false)
override{
101 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
106 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
138 const std::string
name =
"KS_2D";
Implementation of the different Kolmogorov-related tests.
std::ostream & write(std::ostream &out, std::string delimiter=" ", bool onlyFailures=false) const override
Write test result to output.
double threshold
threshold p-value to decide if test is passed.
std::vector< JTestResult > results
void clear() override
Clear results.
do set_array DAQHEADER JPrintDAQHeader f
then for HISTOGRAM in h0 h1
virtual void save(TFile *f, std::string path, bool onlyFailures=false) override
Writes the test result to root file.
Structure containing the result of the test.
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
std::istream & read(std::istream &in) override
Read test parameters from input.
Implementation of the Kolmogorov test for 2D histograms.
void test(TObject *o1, TObject *o2) override
Applies Kolmogorov test for two ROOT TH2 histograms.
const std::string parameter
parameter name.
const std::string name
test name.
JTestResult JKolmogorovTest2D(TH2 *h1, TH2 *h2, double threshold, std::string testName, std::string parameterName)
Kolmogorov test for 2D histograms.
Interface to read input and write output for TObject tests.
std::string getName() override
Get test name.
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 typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
JTestKolmogorov_2D()
Default constructor.
std::string getParameter() override
Get parameter name.