I have questions about ~.root files handlings. I want to merge two or more ~.root files to one ~.root file. I attached two root data file macro in this message for example. I want to add these data and or take averages. But the number of the data is not same. So, if the data of the bin # in one file does not have the data of same bin # in other file, take one data. If the two files have the data of same bin #, take average. What can I do to write root macros?
In addtion, I want to read ~.root files and analyze (fit the data) to use root macros. What kind of header files I need and how to write the macros? Would you tell me how to do that to use the macro example?
Hi,
Thank you for the message. I read user’s guide, tutorials, and HOWTO’s, however, I cannot find the examples or I don’t understand them since my conditions are different from these examples. It is not simple file merges of histograms. Would you show me the examples to use my data file macros that I attached with previous message?
Thank you,
And I wrote the code:
…
TFile* fFileA;
TFile* fFileB;
…
fFileA = new TFile(“90A_MRS_pions…root”, “READ”);
fFileB = new TFile(“90B_MRS_pions…root”, “READ”);
fFileA->ls();
fFileB->ls();
…
These work.
The ~.root files contain KEY: TH1F 90A_MRS_pions_…
but there are error messages,
for instance,
…
fFileA->Draw("");
…
does not work…
So, I would like to know how to handle ~.root files (binary code data files), read and analyze the data?
Would you tell me how to do it?
I attached the sample ~.root data file with this message.
90A_NewAveSpec_MRS_pions_-0.10_0.10_0_10_3_13.root