I want to perform a reduced chi-square test for 4 degrees of freedom system for two histograms compared to graph result. I have no idea regarding this even tried to look roofit and other posted questions. The minimal code would work for me.

As much i studied from a research article an author named it reduced chi square test in which the author compared multiple simulated results with the experimental results using root. Iām trying the same, deviations of two simulated results(histogram h16) compared to the experimental (z.root) results. I guess it would help you to understand.
Thanks

Thanks, but as I mentioned my both root files contain 20 histograms out of which I want to compare the 16th histogram. So, how should I mention the 16th histogram?
For example for drawing 16th histogram from the root files on the same canvas I used