Skip to content

Commit 34f9d42

Browse files
ferdymercuryguitargeek
authored andcommitted
[hist] bin center microoptimization
1 parent 3ffdada commit 34f9d42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hist/hist/src/TAxis.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ Double_t TAxis::GetBinCenter(Int_t bin) const
483483
Double_t binwidth;
484484
if (!fXbins.fN || bin<1 || bin>fNbins) {
485485
binwidth = (fXmax - fXmin) / Double_t(fNbins);
486-
return fXmin + (bin-1) * binwidth + 0.5*binwidth;
486+
return fXmin + (bin - 0.5) * binwidth;
487487
} else {
488488
binwidth = fXbins.fArray[bin] - fXbins.fArray[bin-1];
489489
return fXbins.fArray[bin-1] + 0.5*binwidth;

0 commit comments

Comments
 (0)