In the below code, I read a histogram from a file and attach it to the variable c1. I used the exact same format as section 5.11 of this article. Then I attempt to fit and draw the histogram.
The code works fine if I remove the Fit() part of the code, and it draws the histogram just fine. However, with the Fit() line added, the root session crashes without leaving an error message when I try to run it.
When I try to compile and run it, I get the error message “‘c1’ is not recognized as an internal or external command”.
I had no problem fitting it to a histogram made in the same macro either. It’s only when I try to load the histogram from a root file that the problem occurs. Attached is the root file and a picture showing root quitting by itself when I try to run the macro. Note that the first function in my macro was used to generate the histogram, and I saved the histogram manually.