16 #include "GaudiKernel/ITHistSvc.h"
30 m_checkOverflows(true)
37 const std::string delim(
"/");
38 std::vector<std::string>
words;
39 std::string::size_type sPos, sEnd, sLen;
40 sPos = fullHistoName.find_first_not_of(delim);
41 while ( sPos != std::string::npos ) {
42 sEnd = fullHistoName.find_first_of(delim, sPos);
43 if(sEnd==std::string::npos) sEnd = fullHistoName.length();
45 std::string word = fullHistoName.substr(sPos,sLen);
46 words.push_back(word);
47 sPos = fullHistoName.find_first_not_of(delim, sEnd);
49 std::string
base =
"";
57 auto h = std::make_unique<TH1F>(this->
baseName(histoName).c_str(),histoTitle.c_str(),
bins,minx,maxx);
60 std::cout <<
"Cannot book histo " << histoName <<
" with Title " << histoTitle <<std::endl;
67 auto h = std::make_unique<TH1F>(this->
baseName(histoName).c_str(),histoTitle.c_str(),
bins,edge);
69 std::cout <<
"Cannot book histo " << histoName <<
" with Title " << histoTitle <<std::endl;
74 void HistoHelperRoot::bookHisto(
const std::string& histoName,
const std::string& histoTitle,
unsigned int binsx,
double minx,
double maxx,
unsigned int binsy,
double miny,
double maxy)
76 auto h = std::make_unique<TH2F>(this->
baseName(histoName).c_str(),histoTitle.c_str(),binsx,minx,maxx,binsy,miny,maxy);
78 std::cout <<
"Cannot book histo " << histoName <<
" with Title " << histoTitle <<std::endl;
83 void HistoHelperRoot::bookHisto(
const std::string& histoName,
const std::string& histoTitle,
unsigned int binsx,
double* edgex,
unsigned int binsy,
double* edgey)
85 auto h = std::make_unique<TH2F>(this->
baseName(histoName).c_str(),histoTitle.c_str(),binsx,edgex,binsy,edgey);
87 std::cout <<
"Cannot book histo " << histoName <<
" with Title " << histoTitle <<std::endl;
92 void HistoHelperRoot::bookHisto(
const std::string& histoName,
const std::string& histoTitle,
unsigned int binsx,
double minx,
double maxx,
unsigned int binsy,
double miny,
double maxy,
unsigned int binsz,
double minz,
double maxz)
94 auto h = std::make_unique<TH3F>(this->
baseName(histoName).c_str(),histoTitle.c_str(),binsx,minx,maxx,binsy,miny,maxy,binsz,minz,maxz);
96 std::cout <<
"Cannot book histo " << histoName <<
" with Title " << histoTitle <<std::endl;
114 locked_handle->Fill(
value);
137 if ( valuex <
l.xmin ) valuex =
l.xmin+0.0001;
138 else if ( valuex >
l.xmax ) valuex =
l.xmax-0.0001;
139 if ( valuey <
l.ymin ) valuey =
l.ymin+0.0001;
140 else if ( valuey >
l.ymax ) valuey =
l.ymax-0.0001;
144 locked_handle->Fill(valuex,valuey);
153 if ( valuex <
l.xmin ) valuex =
l.xmin+0.0001;
154 else if ( valuex >
l.xmax ) valuex =
l.xmax-0.0001;
155 if ( valuey <
l.ymin ) valuey =
l.ymin+0.0001;
156 else if ( valuey >
l.ymax ) valuey =
l.ymax-0.0001;
157 if ( valuez <
l.zmin ) valuez =
l.zmin+0.0001;
158 else if ( valuez >
l.zmax ) valuez =
l.zmax-0.0001;
162 locked_handle->Fill(valuex,valuey,valuez);
165 TH1* HistoHelperRoot::getHisto1D(
const std::string& histoName)
169 TH2* HistoHelperRoot::getHisto2D(
const std::string& histoName)
173 TH3* HistoHelperRoot::getHisto3D(
const std::string& histoName)
180 std::cout <<
"The name of the 1D Histo " <<
name << std::endl;
183 std::cout <<
"The name of the 2D Histo " <<
name << std::endl;
186 std::cout <<
"The name of the 3D Histo " <<
name << std::endl;
192 std::cout <<
"Smoothing a two dimensional histogram "<< input2D->GetName()
193 <<
" " <<
m1 <<
" " <<
m2 << std::endl;
194 std::cout <<
"First (1-3, 1-3) 3x3 bins before smoothing: " << std::endl;
195 for(
int i=1;
i<4;
i++) {
196 for(
int j=1;j<4;j++) {
197 std::cout<<
i<<
" "<<j<<
" : "<<input2D->GetBinContent(
i,j)<<
" / " ;
200 std::cout << std::endl;
201 int ioffset = input2D->GetNbinsX() / 2 ;
202 int joffset = input2D->GetNbinsY() / 2 ;
203 std::cout <<
"Middle (" << ioffset+1 <<
"-" << ioffset+4 <<
", ("
204 << joffset+1 <<
"-" << joffset+4 <<
") 3x3 bins before smoothing: " << std::endl;
205 for(
int i=1;
i<4;
i++) {
206 for(
int j=1;j<4;j++) {
207 std::cout<<
i<<
" "<<j<<
" : "<<input2D->GetBinContent(
i+ioffset,j+joffset)<<
" / " ;
210 std::cout << std::endl;
214 if (
m1 > lsup ||
m2 > lsup) {
215 std::cout <<
"HistoHelperRoot::smoothASH2D: m1 or m2 too big !"<<std::endl;
218 int nx = input2D->GetNbinsX()+1;
219 int ny = input2D->GetNbinsY()+1;
221 h =
new float*[nx-1];
222 res =
new float*[nx-1];
223 for (
int i = 0;
i < nx-1;
i++) {
224 h[
i] =
new float[ny-1];
225 res[
i] =
new float[ny-1];
227 for (
int iy = 1;iy<ny;iy++) {
228 for (
int ix = 1;ix<nx;ix++) {
229 h[ix-1][iy-1] = (
float) input2D->GetBinContent(ix,iy);
234 float wk1[41],wk2[41],wgt[100][100];
235 double wk[41][41],wks = 0.;
237 const float am12 = am1*am1, am22 = am2*am2;
238 const float inv_am1_am2 = 1. / (am1 * am2);
239 const float inv_am12 = 1. / am12;
240 const float inv_am22 = 1. / am22;
242 for (
k = 0;
k<nx-1;
k++) {
243 for (
l = 0;
l<ny-1;
l++) {
244 res[
k][
l] = 0.; wgt[
k][
l] = 0.;
248 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
250 wk1[
i] = 15./16.*(1.-ai*inv_am12)*(1.-ai*inv_am12);
253 const double fac1 = am1 / wks;
254 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
255 wk1[
i] = wk1[
i]*fac1;
258 for (
i = lsup+1-
m2;
i<lsup+
m2;
i++) {
260 wk2[
i] = 15./16.*(1.-ai*inv_am22)*(1.-ai*inv_am22);
263 const double fac2 = am2 / wks;
264 for (
i = lsup+1-
m2;
i<lsup+
m2;
i++) {
265 wk2[
i] = wk2[
i]*fac2;
267 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
268 for (j = lsup+1-
m2;j<lsup+
m2;j++) {
269 wk[
i][j] = wk1[
i]*wk2[j];
273 for (
k = 0;
k<nx-1;
k++) {
274 for (
l = 0;
l<ny-1;
l++) {
278 wgt[
i][j] = wgt[
i][j] + wk[lsup+
i-
k][lsup+j-
l];
283 for (
k = 0;
k<nx-1;
k++) {
284 for (
l = 0;
l<ny-1;
l++) {
291 for (
int iy = 1;iy<ny;iy++) {
292 for (
int ix = 1;ix<nx;ix++) {
293 input2D->SetBinContent(ix,iy,
res[ix-1][iy-1]);
296 for (
i = 0;
i < nx-1;
i++){
304 std::cout <<
"First (1-3, 1-3) 3x3 bins after smoothing: " << std::endl;
305 for(
int i=1;
i<4;
i++) {
306 for(
int j=1;j<4;j++) {
307 std::cout<<
i<<
" "<<j<<
" : "<<input2D->GetBinContent(
i,j)<<
" / " ;
310 std::cout << std::endl;
311 int ioffset = input2D->GetNbinsX() / 2 ;
312 int joffset = input2D->GetNbinsY() / 2 ;
313 std::cout <<
"Middle (" << ioffset+1 <<
"-" << ioffset+4 <<
", ("
314 << joffset+1 <<
"-" << joffset+4 <<
") 3x3 bins after smoothing: " << std::endl;
315 for(
int i=1;
i<4;
i++) {
316 for(
int j=1;j<4;j++) {
317 std::cout<<
i<<
" "<<j<<
" : "<<input2D->GetBinContent(
i+ioffset,j+joffset)<<
" / " ;
320 std::cout << std::endl;
326 std::cout <<
"Smoothing a three dimensional histogram "<< input3D->GetName()
327 <<
" " <<
m1 <<
" " <<
m2 <<
" " <<
m3 << std::endl;
328 std::cout <<
"First 2x2x2 bins before smoothing: " << std::endl;
329 for(
int i=1;
i<3;
i++) {
330 for(
int j=1;j<3;j++) {
331 for(
int k=1;
k<3;
k++) {
332 std::cout<<
i<<
" "<<j<<
" "<<
k<<
" : "<<input3D->GetBinContent(
i,j,
k)<<
" / " ;
336 std::cout << std::endl;
337 int ioffset = input3D->GetNbinsX() / 2 ;
338 int joffset = input3D->GetNbinsY() / 2 ;
339 int koffset = input3D->GetNbinsZ() / 2 ;
340 std::cout <<
"Middle (" << ioffset+1 <<
"-" << ioffset+3 <<
", "
341 << joffset+1 <<
"-" << joffset+3 <<
", "
342 << koffset+1 <<
"-" << koffset+3 <<
") 2x2 bins before smoothing: " << std::endl;
343 for(
int i=1;
i<3;
i++) {
344 for(
int j=1;j<3;j++) {
345 for(
int k=1;
k<3;
k++) {
346 std::cout<<
i<<
" "<<j<<
" "<<
k<<
" : "<<input3D->GetBinContent(
i+ioffset,j+joffset,
k+koffset)<<
" / " ;
350 std::cout << std::endl;
354 if (
m1 > lsup ||
m2 > lsup ||
m3 > lsup) {
355 std::cout <<
"HistoHelperRoot::smoothASH3D: m1, m2 or m3 too big !"<<std::endl;
358 int nx = input3D->GetNbinsX()+1;
359 int ny = input3D->GetNbinsY()+1;
360 int nz = input3D->GetNbinsZ()+1;
362 h =
new float**[nx-1];
363 res =
new float**[nx-1];
364 for (
int i = 0;
i < nx-1;
i++) {
365 h[
i] =
new float*[ny-1];
366 res[
i] =
new float*[ny-1];
367 for (
int j = 0; j < ny-1; j++) {
368 h[
i][j] =
new float[nz-1];
369 res[
i][j] =
new float[nz-1];
372 for (
int iz = 1;iz<nz;iz++) {
373 for (
int iy = 1;iy<ny;iy++) {
374 for (
int ix = 1;ix<nx;ix++) {
375 h[ix-1][iy-1][iz-1] = (
float) input3D->GetBinContent(ix,iy,iz);
381 float wk1[41],wk2[41],wk3[41];
383 double wk[41][41][41],wks = 0.;
385 const float am12 = am1*am1, am22 = am2*am2, am32 = am3*am3;
386 const float inv_am1_am2 = 1. / (am1*am2);
387 const float inv_am12 = 1. / am12;
388 const float inv_am22 = 1. / am22;
389 const float inv_am32 = 1. / am32;
392 for (
k = 0;
k<nx-1;
k++) {
393 for (
l = 0;
l<ny-1;
l++) {
394 for (
m = 0;
m<nz-1;
m++) {
404 int dimension = 100;
int x,
y,
z = 0;
405 wgt =
new float**[dimension];
407 std::cout <<
"HistoHelperRoot::smoothASH3D: problem to allocate memory, exiting"<<std::endl;
410 for(
x = 0;
x < dimension;
x++) {
411 wgt[
x] =
new float*[dimension];
413 std::cout <<
"HistoHelperRoot::smoothASH3D: problem to allocate memory, exiting"<<std::endl;
416 for(
y = 0;
y < dimension;
y++) {
417 wgt[
x][
y] =
new float[dimension];
419 std::cout <<
"HistoHelperRoot::smoothASH3D: problem to allocate memory, exiting"<<std::endl;
422 for(
z = 0;
z < dimension;
z++)
427 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
429 wk1[
i] = 15./16.*(1.-ai*inv_am12)*(1.-ai*inv_am12);
432 const double fac1 = am1 / wks;
433 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
434 wk1[
i] = wk1[
i]*fac1;
437 for (
i = lsup+1-
m2;
i<lsup+
m2;
i++) {
439 wk2[
i] = 15./16.*(1.-ai*inv_am22)*(1.-ai*inv_am22);
442 const double fac2 = am2 / wks;
443 for (
i = lsup+1-
m2;
i<lsup+
m2;
i++) {
444 wk2[
i] = wk2[
i]*fac2;
447 for (
i = lsup+1-
m3;
i<lsup+
m3;
i++) {
449 wk3[
i] = 15./16.*(1.-ai*inv_am32)*(1.-ai*inv_am32);
452 const double fac3 = am3 / wks;
453 for (
i = lsup+1-
m3;
i<lsup+
m3;
i++) {
454 wk3[
i] = wk3[
i]*fac3;
457 for (
i = lsup+1-
m1;
i<lsup+
m1;
i++) {
458 for (j = lsup+1-
m2;j<lsup+
m2;j++) {
459 for (
k = lsup+1-
m3;
k<lsup+
m3;
k++) {
460 wk[
i][j][
k] = wk1[
i]*wk2[j]*wk3[
k];
465 for (
k = 0;
k<nx-1;
k++) {
466 for (
l = 0;
l<ny-1;
l++) {
467 for (
m = 0;
m<nz-1;
m++) {
472 wgt[
i][j][
n] = wgt[
i][j][
n] + wk[lsup+
i-
k][lsup+j-
l][lsup+
n-
m];
479 for (
k = 0;
k<nx-1;
k++) {
480 for (
l = 0;
l<ny-1;
l++) {
481 for (
m = 0;
m<nz-1;
m++) {
489 for (
int iz = 1;iz<nz;iz++) {
490 for (
int iy = 1;iy<ny;iy++) {
491 for (
int ix = 1;ix<nx;ix++) {
492 input3D->SetBinContent(ix,iy,iz,
res[ix-1][iy-1][iz-1]);
496 for (
i = 0;
i < nx-1;
i++){
497 for (j = 0; j < ny-1; j++) {
507 for (
i = 0;
i < dimension;
i++){
508 for (j = 0; j < dimension; j++)
515 std::cout <<
"First 2x2x2 bins after smoothing: " << std::endl;
516 for(
int i=1;
i<3;
i++) {
517 for(
int j=1;j<3;j++) {
518 for(
int k=1;
k<3;
k++) {
519 std::cout<<
i<<
" "<<j<<
" "<<
k<<
" : "<<input3D->GetBinContent(
i,j,
k)<<
" / " ;
523 std::cout << std::endl;
524 int ioffset = input3D->GetNbinsX() / 2 ;
525 int joffset = input3D->GetNbinsY() / 2 ;
526 int koffset = input3D->GetNbinsZ() / 2 ;
527 std::cout <<
"Middle (" << ioffset+1 <<
"-" << ioffset+3 <<
", "
528 << joffset+1 <<
"-" << joffset+3 <<
", "
529 << koffset+1 <<
"-" << koffset+3 <<
") 2x2 bins after smoothing: " << std::endl;
530 for(
int i=1;
i<3;
i++) {
531 for(
int j=1;j<3;j++) {
532 for(
int k=1;
k<3;
k++) {
533 std::cout<<
i<<
" "<<j<<
" "<<
k<<
" : "<<input3D->GetBinContent(
i+ioffset,j+joffset,
k+koffset)<<
" / " ;
537 std::cout << std::endl;
547 int bin((
h->GetXaxis())->FindBin(
x));
548 double bincenter(
h->GetBinCenter(
bin));
549 double nextbincenter(bincenter);
550 double nextbincontent(0);
553 nextbincenter =
h->GetBinCenter(
bin+1);
554 nextbincontent =
h->GetBinContent(
bin+1);
556 else if(x<bincenter && bin > 1)
558 nextbincenter =
h->GetBinCenter(
bin-1);
559 nextbincontent =
h->GetBinContent(
bin-1);
561 double tmp(
h->GetBinContent(
bin));
562 if(nextbincenter != bincenter)
tmp = ( nextbincontent*(
x-bincenter) +
tmp*(nextbincenter-
x) ) / (nextbincenter - bincenter);
571 int nx =
h->GetNbinsX(), ny =
h->GetNbinsY();
572 int ibx =
h->GetXaxis()->FindBin(
x), iby =
h->GetYaxis()->FindBin(
y);
574 double z00,z11,z01,z10,xc,yc,xc2,yc2,
u,
t,
r;
575 if (ibx > nx) ibx = nx;
576 if (iby > ny) iby = ny;
577 xc =
h->GetXaxis()->GetBinCenter(ibx);
578 yc =
h->GetYaxis()->GetBinCenter(iby);
579 z11 =
h->GetBinContent(ibx,iby);
580 if ( (ibx > 1 || (ibx == 1 &&
x > xc) ) &&
581 (ibx < nx || (ibx == nx &&
x < xc) ) ) {
582 if (
x > xc) {ibx2 = ibx + 1;}
else {ibx2 = ibx - 1;}
583 xc2 =
h->GetXaxis()->GetBinCenter(ibx2);
584 if ( (iby > 1 || (iby == 1 &&
y > yc) ) &&
585 (iby < ny || (iby == ny &&
y < yc) ) ) {
586 if (
y > yc) {iby2 = iby + 1;}
else {iby2 = iby - 1;}
587 yc2 =
h->GetYaxis()->GetBinCenter(iby2);
588 z00 =
h->GetBinContent(ibx2,iby2);
589 z10 =
h->GetBinContent(ibx,iby2);
590 z01 =
h->GetBinContent(ibx2,iby);
591 t = (
x - xc2)/(xc-xc2);
592 u = (
y - yc2)/(yc-yc2);
593 r = z11*
t*
u+z00*(1.-
t)*(1.-
u)+z01*(1.-
t)*
u+z10*
t*(1.-
u);
595 z01 =
h->GetBinContent(ibx2,iby);
596 t = (
x - xc2)/(xc-xc2);
597 r = z11*
t + z01*(1.-
t);
599 }
else if ((iby > 1 || (iby == 1 &&
y > yc) ) &&
600 (iby < ny || (iby == ny &&
y < yc) ) ) {
601 if (
y > yc) {iby2 = iby + 1;}
else {iby2 = iby - 1;}
602 z10 =
h->GetBinContent(ibx,iby2);
603 yc2 =
h->GetYaxis()->GetBinCenter(iby2);
604 u = (
y - yc2)/(yc-yc2);
605 r = z11*
u + z10*(1.-
u);
617 int nx =
h->GetNbinsX(), ny =
h->GetNbinsY(), nz =
h->GetNbinsZ();
618 int ibx =
h->GetXaxis()->FindBin(
x), iby =
h->GetYaxis()->FindBin(
y), ibz =
h->GetZaxis()->FindBin(
z);
620 double z000,z010,z110,z100,z001,z011,z111,z101,xc,yc,zc,xc2,yc2,zc2,
u,
t,
v,
r;
621 if (ibx > nx) ibx = nx;
622 if (iby > ny) iby = ny;
623 if (ibz > nz) ibz = nz;
624 xc =
h->GetXaxis()->GetBinCenter(ibx);
625 yc =
h->GetYaxis()->GetBinCenter(iby);
626 zc =
h->GetZaxis()->GetBinCenter(ibz);
628 z111 =
h->GetBinContent(ibx,iby,ibz);
629 if ( (ibx > 1 || (ibx == 1 &&
x > xc) ) &&
630 (ibx < nx || (ibx == nx &&
x < xc) ) ) {
631 if (
x > xc) {ibx2 = ibx + 1;}
else {ibx2 = ibx - 1;}
632 xc2 =
h->GetXaxis()->GetBinCenter(ibx2);
633 if ( (iby > 1 || (iby == 1 &&
y > yc) ) &&
634 (iby < ny || (iby == ny &&
y < yc) ) ) {
635 if (
y > yc) {iby2 = iby + 1;}
else {iby2 = iby - 1;}
636 yc2 =
h->GetYaxis()->GetBinCenter(iby2);
637 if ( (ibz > 1 || (ibz == 1 &&
z > zc) ) &&
638 (ibz < nz || (ibz == nz &&
z < zc) ) ) {
639 if (
z > zc) {ibz2 = ibz + 1;}
else {ibz2 = ibz - 1;}
640 zc2 =
h->GetZaxis()->GetBinCenter(ibz2);
642 z000 =
h->GetBinContent(ibx2,iby2,ibz2);
643 z100 =
h->GetBinContent(ibx,iby2,ibz2);
644 z010 =
h->GetBinContent(ibx2,iby,ibz2);
645 z110 =
h->GetBinContent(ibx,iby,ibz2);
646 z001 =
h->GetBinContent(ibx2,iby2,ibz);
647 z101 =
h->GetBinContent(ibx,iby2,ibz);
648 z011 =
h->GetBinContent(ibx2,iby,ibz);
649 t = (
x - xc2)/(xc-xc2);
650 u = (
y - yc2)/(yc-yc2);
651 v = (
z - zc2)/(zc-zc2);
652 r = z111*
t*
u*
v + z001*(1.-
t)*(1.-
u)*
v
653 + z011*(1.-
t)*
u*
v + z101*
t*(1.-
u)*
v
654 + z110*
t*
u*(1.-
v) + z000*(1.-
t)*(1.-
u)*(1.-
v)
655 + z010*(1.-
t)*
u*(1.-
v) + z100*
t*(1.-
u)*(1.-
v);
657 z011 =
h->GetBinContent(ibx2,iby,ibz);
658 z001 =
h->GetBinContent(ibx2,iby2,ibz);
659 z101 =
h->GetBinContent(ibx,iby2,ibz);
660 t = (
x - xc2)/(xc-xc2);
661 u = (
y - yc2)/(yc-yc2);
662 r = z111*
t*
u + z011*(1.-
t)*
u + z101*
t*(1.-
u) + z001*(1.-
t)*(1.-
u) ;
664 }
else if ((ibz > 1 || (ibz == 1 &&
z > zc) ) &&
665 (ibz < nz || (ibz == nz &&
z < zc) ) ) {
666 if (
z > zc) {ibz2 = ibz + 1;}
else {ibz2 = ibz - 1;}
667 z110 =
h->GetBinContent(ibx,iby,ibz2);
668 z010 =
h->GetBinContent(ibx2,iby,ibz2);
669 z011 =
h->GetBinContent(ibx2,iby,ibz);
670 zc2 =
h->GetYaxis()->GetBinCenter(ibz2);
671 t = (
x - xc2)/(xc-xc2);
672 v = (
z - zc2)/(zc-zc2);
673 r = z111*
t*
v + z011*(1.-
t)*
v + z110*
t*(1.-
v) +z010*(1.-
t)*(1.-
v);
675 z011 =
h->GetBinContent(ibx2,iby,ibz);
676 t = (
x - xc2)/(xc-xc2);
677 r = z111*
t + z011*(1.-
t);
680 if ( (iby > 1 || (iby == 1 &&
y > yc) ) &&
681 (iby < ny || (iby == ny &&
y < yc) ) ) {
682 if (
y > yc) {iby2 = iby + 1;}
else {iby2 = iby - 1;}
683 yc2 =
h->GetYaxis()->GetBinCenter(iby2);
684 if ( (ibz > 1 || (ibz == 1 &&
z > zc) ) &&
685 (ibz < nz || (ibz == nz &&
z < zc) ) ) {
686 if (
z > zc) {ibz2 = ibz + 1;}
else {ibz2 = ibz - 1;}
687 zc2 =
h->GetZaxis()->GetBinCenter(ibz2);
689 z100 =
h->GetBinContent(ibx,iby2,ibz2);
690 z110 =
h->GetBinContent(ibx,iby,ibz2);
691 z101 =
h->GetBinContent(ibx,iby2,ibz);
692 u = (
y - yc2)/(yc-yc2);
693 v = (
z - zc2)/(zc-zc2);
694 r = z111*
u*
v + z101*(1.-
u)*
v
695 + z110*
u*(1.-
v) + z100*(1.-
u)*(1.-
v);
697 z101 =
h->GetBinContent(ibx,iby2,ibz);
698 u = (
y - yc2)/(yc-yc2);
699 r = z111*
u + z101*(1.-
u);
701 }
else if ((ibz > 1 || (ibz == 1 &&
z > zc) ) &&
702 (ibz < nz || (ibz == nz &&
z < zc) ) ) {
703 if (
z > zc) {ibz2 = ibz + 1;}
else {ibz2 = ibz - 1;}
704 z110 =
h->GetBinContent(ibx,iby,ibz2);
705 zc2 =
h->GetYaxis()->GetBinCenter(ibz2);
706 v = (
z - zc2)/(zc-zc2);
707 r = z111*
v + z110*(1.-
v);