Setting the Fit Range automatically for TH1

Hi,

I am trying to fit the histograms with a landau function. While setting the range for the fit I use this

h->Fit(landau_fit,“WL”,“N”,x1-2.85,59.); // where x1 is the bincenter

So here I fit the histogram between x1-2.85 and 59. The number 2.85 that I subtract from x1 is sometimes 3.0 for some histograms and sometimes 2.0 for the others. So I just selected a random number 2.85 just to fit most of the histograms. Is there a way where to make the program set the fit range “automatically”? Else I might not know what is the exact number I should subtract from x1 to set the fit range.

Please help.
Thanks,
Christine