GetBinCenter fot TH3

Hi!

Is there to obtain the (x,y,z) coordinates of the center of a bin in a TH3 once I have the binID?

Andrea

For each axis (ix / iy / iz going from 1 to Nx / Ny / Nz, resp.):

h->GetXaxis()->GetBinCenter(ix);
h->GetYaxis()->GetBinCenter(iy);
h->GetZaxis()->GetBinCenter(iz);

thanks! but the binID is a single integer for TH2 and TH3, is there a method I’m missing to get the corresponding binID in the 2(3) directions?

https://root.cern/doc/master/classTH1.html#a55e591270aaad37c3059a62f83566e4e

Int_t ix, iy, iz; h->GetBinXYZ(binID, ix, iy, iz);

Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.