I’ve produced a histogram which I’ve fitted with slightly different functions. Each version has been saved as a separate .root file, that is the canvas was saved via File menu and “Save As”. So each canvas originally had the same name (as it was created with the same macro), and the histogram fitted had the same name.
I now want to display each of the fits in different pads on a single canvas. I’ve written the following macro based on an example found in Locate like command and amended the essai2.C code.
TCanvas *can = new TCanvas("DataAccess", "DataAccess");
This results in the f2 histogram, h2, being drawn in the “singlefit” canvas and a blank canvas, DataAccess. Presumably h1 has been drawn and then overwritten by h2. How can I extract the respective histograms, h1 and h2, from their .root file and redraw them in separate pads. Note, I intend to expand this out to read in a histogram from 12 files.