Runs test for sliced 2D histograms.
125 if(slice ==
'x' || slice ==
'X'){
127 int nSlices1 =
h1->GetNbinsX();
128 int nSlices2 = h2->GetNbinsX();
130 TH1* h3 =
h1->ProjectionX(
h1->GetName()==h2->GetName() ?
134 if(nSlices1 != nSlices2)
135 ERROR(
"Histograms with different binning. The objects: " <<
h1->GetName() <<
" and " << h2->GetName() <<
" can not be compared." << endl);
137 for (
int i=1 ; i<=nSlices1 ; ++i){
141 TH1D* s1 =
h1->ProjectionY (sliceName.c_str(),i,i);
142 TH1D* s2 = h2->ProjectionY (sliceName.c_str(),i,i);
144 double R = s1->Integral();
145 double T = s2->Integral();
151 bool a = ((T/
R)*s1->GetBinContent(1) - s2->GetBinContent(1)) < 0;
155 for (
int i = 2 ; i<s1->GetNbinsX() ; ++i){
157 bool b = ((T/
R)*s1->GetBinContent(i) - s2->GetBinContent(i)) < 0;
167 double N = 1 + 2*p*q/(p+q) ;
168 double s = sqrt( 2*p*q*(2*p*q-p-q)/(p+q)/(p+q)/(p+q-1) );
173 (fabs(d) > threshold ? passed =
false : passed =
true);
175 if (!passed) nFailures++;
177 h3->SetBinContent(i,fabs(d));
183 (nFailures/nSlices1 > failuresThreshold ? passed =
false : passed =
true);
185 JResultTitle title(testName, parameterName, passed , nFailures);
187 h3->SetTitle(title.getTitle().c_str());
189 r = JTestResult(testName,
190 JRootObjectID(
MAKE_STRING(
h1->GetDirectory()->GetPath() <<
h1->GetName())),
191 JRootObjectID(
MAKE_STRING(h2->GetDirectory()->GetPath() <<
h1->GetName())),
192 parameterName, nFailures, failuresThreshold, h3, passed);
194 }
else if (slice ==
'y' || slice ==
'Y'){
196 int nSlices1 =
h1->GetNbinsX();
197 int nSlices2 = h2->GetNbinsX();
199 TH1* h3 =
h1->ProjectionY(
h1->GetName()==h2->GetName() ?
203 if(nSlices1 != nSlices2)
204 ERROR(
"Histograms with different binning. The objects: " <<
h1->GetName() <<
" and " << h2->GetName() <<
" can not be compared." << endl);
206 for (
int i=1 ; i<=nSlices1 ; ++i){
210 TH1D* s1 =
h1->ProjectionX (sliceName.c_str(),i,i);
211 TH1D* s2 = h2->ProjectionX (sliceName.c_str(),i,i);
213 double R = s1->Integral();
214 double T = s2->Integral();
220 bool a = ((T/
R)*s1->GetBinContent(1) - s2->GetBinContent(1)) < 0;
224 for (
int i = 2 ; i<s1->GetNbinsX() ; ++i){
226 bool b = ((T/
R)*s1->GetBinContent(i) - s2->GetBinContent(i)) < 0;
236 double N = 1 + 2*p*q/(p+q) ;
237 double s = sqrt( 2*p*q*(2*p*q-p-q)/(p+q)/(p+q)/(p+q-1) );
242 (fabs(d) > threshold ? passed =
false : passed =
true);
244 if (!passed) nFailures++;
246 h3->SetBinContent(i,fabs(d));
252 (nFailures/nSlices1 > failuresThreshold ? passed =
false : passed =
true);
254 JResultTitle title(testName, parameterName, passed , nFailures);
256 h3->SetTitle(title.getTitle().c_str());
258 r = JTestResult (testName,
259 JRootObjectID(
MAKE_STRING(
h1->GetDirectory()->GetPath() <<
h1->GetName())),
260 JRootObjectID(
MAKE_STRING(h2->GetDirectory()->GetPath() <<
h1->GetName())),
261 parameterName, nFailures, failuresThreshold, h3, passed);
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
#define MAKE_CSTRING(A)
Make C-string.
then for HISTOGRAM in h0 h1
#define MAKE_STRING(A)
Make string.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then usage $script[distance] fi case set_variable R
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
std::string to_string(const T &value)
Convert value to string.