I have a macro that fits hundreds of histograms. I would like to take the mean of each fit and use it in a separate macro. The most straightforward way that I can think of is to:
- Create an array: Double_t meaner;
- Populated the array every time a fit is done: meaner[i] = fitFunction->GetParameter(x);
- Write the array to a root file that I can use in a different macro.
I am stuck on step 3. Is it possible to store an array into a root file and then retrieve the array in a different macro to access its elements? If not, what are my alternatives? I have thought about writing the mean results to a text file and using the text file as an input in the other separate macro.
Thank you very much for your help in advance!