You can use TAxis::FindBin
Example in case of a 2-d histogram (same for 1-d and 3-d)
TAxis *xaxis = h->GetXaxis();
TAxis *yaxis = h->GetYaxis();
Int_t binx = xaxis->FindBin(x);
Int_t biny = yaxis->FindBin(y);
etc..
> Is there any other way to make my own histogram contents with errors? At
> the moment I'm using TH1::Fill(x,value) for the data but there's not the
> like for errors.
>
> Actually, it's not really histograms I want but something which looks the
> same (plot of single equidistant values with errorbars).
>
TH1::Fill increments bin contents and bin errors (if TH1::Sumw2 was called before).
If you just want to set bin content or bin error, use
TH1::SetBinContent(bin,value)
TH1::SetBinError(bin,error);
Note that if TH1::Sumw2 was not called, SetBinError will automatically activate
the storage of errors.
Rene Brun