1 #ifndef __JTESTRUNS_2D__
2 #define __JTESTRUNS_2D__
27 std::istream&
read(std::istream&
in) {
28 return in >> threshold >> logX >> logY >> slice;
37 std::ostream&
write(std::ostream& out) {
39 out << scientific << setprecision(2) << (
r->passed ?
GREEN :
RED) <<
r->message << endl;
52 if (!(dynamic_cast<TH2*>(o1) == NULL) && !(dynamic_cast<TH2*>(o2) == NULL)) {
54 TH2D*
h1 =
dynamic_cast<TH2D*
>(o1);
55 TH2D* h2 =
dynamic_cast<TH2D*
>(o2);
57 if(slice ==
'x' || slice ==
'X'){
59 int nSlices1 = h1->GetNbinsX();
60 int nSlices2 = h2->GetNbinsX();
62 if(nSlices1 != nSlices2)
63 ERROR(
"Histograms with different binning. The objects: " << o1->GetName() <<
" can not be compared." << endl);
65 for (
int i=1 ; i<=nSlices1 ; ++i){
69 TH1D* s1 = h1->ProjectionY (name.c_str(),i,i);
70 TH1D* s2 = h2->ProjectionY (name.c_str(),i,i);
72 JTestResult r = JRunsTest(s1, s2, threshold, logX, logY);
76 }
else if (slice ==
'y' || slice ==
'Y'){
78 int nSlices1 = h1->GetNbinsY();
79 int nSlices2 = h2->GetNbinsY();
81 if(nSlices1 != nSlices2)
82 ERROR(
"Histograms with different binning. The objects: " << o1->GetName() <<
" can not be compared." << endl);
84 for (
int i=1 ; i<=nSlices1 ; ++i){
88 TH1D* s1 = h1->ProjectionX (name.c_str(),i,i);
89 TH1D* s2 = h2->ProjectionX (name.c_str(),i,i);
91 JTestResult r = JRunsTest(s1, s2, threshold, logX, logY);
96 }
else if (!(dynamic_cast<TH1*>(o1) == NULL) && !(dynamic_cast<TH1*>(o2) == NULL)) {
97 ERROR(
"For 1D histograms call JChi2_1D: " << o1->GetName() << endl);
110 if (f -> GetDirectory(path.c_str())==0) f->mkdir(path.c_str());
std::istream & read(std::istream &in)
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
then for HISTOGRAM in h0 h1
#define MAKE_STRING(A)
Make string.
virtual void save(TFile *f, string path)
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
std::string to_string(const T &value)
Convert value to string.
void test(TObject *o1, TObject *o2)
std::ostream & write(std::ostream &out)