Combine canvas from two root files


I created c1.root file using graphical cut. Now I have to combine histograms from c4.root file with x-axis data from canvas in c1.root file (to create graph using these data), but I do not know how to combine two different .root files. Please help me…
Thank you

You should have saved your histograms as “histograms” in the a .root file not as TCanvas. It makes the data much easier to access later on. You should saved the TCanvas in a root file for graphics purpose only. If you what to work on histogram later on better do something like:

TFile outputFile ("outputFile.root","RECREATE");
TH1F h ("myHisto","Histogram Title",100, -2, 2);

But it will be still in another .root file. How could I combine them?
c1.root (17.8 KB)

a simple way will be to use the command line tools rootmv or rootcp to move or copy objects from one file to an other.

Thank you.