How to fit a histogram to another histogram

Hello!

So I have a histogram from a prediction, say TH1F *pred. Now I have a histogram of data, say TH1F *data. Is there a cool way to fit the data histogram to the pred histogram, using TFit? Or should I just scale pred by the ratio of integrals between data and pred?

In other words is there a way to define a function using a histogram, in this case TH1F *pred? The pred histo is sort of like a step function - is there a predefined function for step-like functions?

Thanks!

  • Sujeewa

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

Rene