Median of TH1F

Hi,
I am trying to calculate the median for a TH1F histogram, any ideas?

Hi,

Double_t TMath::Median(Long64_t n, const Double_t *a, const Double_t *w, Long64_t *work)

where array a are the bin centers and array w is the bin contents .

For inspiration how to put it together have a look at

Double_t TH1::GetSkewness(Int_t axis) const

Eddy