How to pass values from a tree variable to histogram?

My last question has already been answered here: Fit an histogram without drawing it

So, h[i] -> Fit(Form("fit[%d]", i), "0RQ"); solved my problem.

Thank you.