hello to everybody, I have to compute the distance between two bins in a 2D histogram.
I have seen the TGeoShape class but I don’t know it is the case to use it or if there is some other method. Does anybody know how can I do?
thank you
scented
I am not sure to understand your question. Anyhow using TGeoShape looks a funny idea to do this job. If your question is simply to compute teh distance between the center of two bins with respective bin numbers (ix1,iy1, ix2,iy2), do
double x1 = h.GetXaxis()->GetBinCenter(ix1);
double y1 = h.GetYaxis()->GetBinCenter(iy1);
double x2 = h.GetXaxis()->GetBinCenter(ix2);
double y2 = h.GetYaxis()->GetBinCenter(iy2);
double dx = x1-x2;
double dy = y1-y2;
double distance = TMath::Sqrt(dx*dx+dy*dy);
Rene