1 #ifndef __JTESTIDENTICAL_T__
2 #define __JTESTIDENTICAL_T__
44 if(h1 -> GetNbinsX() != h2 -> GetNbinsX() || h1 -> GetNbinsY() != h2 -> GetNbinsY() || h1 -> GetNbinsZ() != h2 -> GetNbinsZ())
45 ERROR(
"Histograms with different bining. The objects: " << h1 -> GetName() <<
" can not be compared." << endl);
47 T* h3 = (
T*)h1->Clone(h1->GetName()==h2->GetName() ?
55 double maxDifference = 0.0;
57 for (
int i=0 ; i < h1->GetNbinsX() ; ++i){
58 for (
int j=0 ;
j< h1->GetNbinsY() ; ++
j){
59 for (
int k=0 ;
k< h1->GetNbinsY() ; ++
k){
61 double d = h1->GetBinContent(i+1,
j+1,
k+1) - h2->GetBinContent(i+1,
j+1,
k+1);
63 if (fabs(d) > maxDifference)
64 maxDifference = fabs(d);
65 if (fabs(d) > tolerance)
71 JResultTitle title(testName, parameterName, passed , maxDifference);
73 h3->SetTitle(title.
getTitle().c_str());
76 string (h1->GetDirectory()->GetPath()).append(h1->GetName()),
77 string (h2->GetDirectory()->GetPath()).append(h2->GetName()),
78 h1->GetDirectory()->GetFile()->GetName(),
79 h2->GetDirectory()->GetFile()->GetName(),
80 parameterName, maxDifference, tolerance, h3, passed);
JTestIdentical_t()
Default constructor.
Implementation test that verify if two histograms are the same.
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
Class dedicated to standardize the title of the graphical objects produced by the JTest_t() derived c...
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
Structure containing the result of the test.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::string getTitle()
Returns a standard string to be used as title of a graphical root object.
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
std::string to_string(const T &value)
Convert value to string.
JTestResult JIdenticalTest(T *h1, T *h2, double tolerance, std::string testName, std::string parameterName)
Bin-by-Bin test of two histograms, that verifies whether the histograms are the same.