So I have a code that reads through data files, does some modifications then plots it into a histogram named “h0” and “h1” then I do a fitting on it with a function, I then write the results to a file so I can go back to them later. An example of the ending is written below.
TFitResultPtr F0 = h0 -> Fit("function_0","S"); TFitResultPtr F1 = h1 -> Fit("function_1","S"); TFile f("histo_data_0.root","new"); h0 -> Write(); h1 -> Write(); F0 -> Write(); F1 -> Write();
A file named “histo_data_0.root” is spat out
I can then access the histograms again by doing
TFile f("histo_data_0.root") Tbrowser browser
I then see a browser that contains my written histograms and the Fit results.
I can easily open the Histograms by double clicking them.
But I’m not sure how to actually get the Fit result values themselves
I’m trying to get something that would spit out this kind of information again, similar to when the code is initially ran.
FCN=9057.64 FROM MIGRAD STATUS=CONVERGED 41 CALLS 42 TOTAL EDM=2.66151e-08 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p0 9.21807e+03 4.36240e+00 2.17487e-05 4.45622e-01 2 p1 1.29468e+07 4.33733e+03 3.62802e-06 2.79289e+00
ROOT Version: 6.22
Platform: Not Provided
Compiler: Not Provided