1 #ifndef __JTESTKOLMOGOROV_2D__
2 #define __JTESTKOLMOGOROV_2D__
30 std::istream&
read(std::istream&
in) {
31 return in >> threshold >> slice;
40 std::ostream&
write(std::ostream& out) {
42 out << scientific << setprecision(2) << (
r->passed ?
GREEN :
RED) <<
r->message << endl;
55 if (!(dynamic_cast<TH2*>(o1) == NULL) && !(dynamic_cast<TH2*>(o2) == NULL)) {
57 TH2D*
h1 =
dynamic_cast<TH2D*
>(o1);
58 TH2D* h2 =
dynamic_cast<TH2D*
>(o2);
60 if(slice ==
'x' || slice ==
'X'){
62 int nSlices1 = h1->GetNbinsX();
63 int nSlices2 = h2->GetNbinsX();
65 if(nSlices1 != nSlices2)
66 ERROR(
"Histograms with different binning. The objects: " << o1->GetName() <<
" can not be compared." << endl);
68 for (
int i=1 ; i<=nSlices1 ; ++i){
72 TH1D* s1 = h1->ProjectionY (name.c_str(),i,i);
73 TH1D* s2 = h2->ProjectionY (name.c_str(),i,i);
78 }
else if (slice ==
'y' || slice ==
'Y'){
80 int nSlices1 = h1->GetNbinsY();
81 int nSlices2 = h2->GetNbinsY();
83 if(nSlices1 != nSlices2)
84 ERROR(
"Histograms with different binning. The objects: " << o1->GetName() <<
" can not be compared." << endl);
86 for (
int i=1 ; i<=nSlices1 ; ++i){
90 TH1D* s1 = h1->ProjectionX (name.c_str(),i,i);
91 TH1D* s2 = h2->ProjectionX (name.c_str(),i,i);
96 }
else if (slice ==
'n' || slice ==
'N'){
101 }
else if (!(dynamic_cast<TH1*>(o1) == NULL) && !(dynamic_cast<TH1*>(o2) == NULL)) {
102 ERROR(
"For 1D histograms call JTestKolmogorov_1D: " << o1->GetName() << endl);
115 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
double threshold
threshold p-value to decide if test is passed.
virtual void save(TFile *f, string path)
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
then for HISTOGRAM in h0 h1
#define MAKE_STRING(A)
Make string.
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
void test(TObject *o1, TObject *o2)
std::ostream & write(std::ostream &out)
std::string to_string(const T &value)
Convert value to string.
std::istream & read(std::istream &in)