How to use a histogram as an input to a fitting function?

Hi All,
I am trying to fit a function to my data points. The function has a
histogram as one of its variable. Can anybody point me to a direction
how can I pass the histogram as an input to a function?
Actually, I want to extract each bin content of the histogram in the function.

Thanks a lot !

see example in $ROOTSYS/tutorials/fit/fithist.C


Thanks a lot. This is what exactly I was looking for.

Best Regards,