Hello ROOTers
I have a quick question regarding proper procedue to save the same histogram in two different files. One file contains the data (in a tree object) and the “produced” histograms. A second file will contain only the “produced” histograms. The reason is that I do not want to carry all the data files around since they are quite big.
My first question is, if there is a proper way to transfer ONLY the histograms from one TFile to another.
What I am doing is this:
-Open TFile f1 which contains the TTree obj with data
-Create all histograms which belongs to the current open file
-Fill histograms.
-To each histogram, I make an explicit call to: histo->write("",kOverwrite);
-Now I open a second TFile f2
-To each histogram, I make an explicit call to: histo->write("",kOverwrite);
-close f2
-close f1
It seems to work except for some minor issues regarding memory leak warnings when I overwrite objects. Hence, the reason I am looking for a better or proper alternative to do this.
I appreciate your comments.
Best regards
Cmos