I have many TCanvases in my hard disk. They are stored as rootfiles.
Each canvas contains various objects, as histograms, functions, etc…
Now, I need a procedure to extract these objects from a given canvas and use them.
The way I usually do that (from CINT) is outlined in these 3 steps:
open the rootfile:
root TFile* file= new TFile(“Canvas.root”)
See the list of the pointers
A list like the following is provided:
OBJ: TH1F histo1 : 0x8879330
OBJ: TH2F histo2 : 0x8335023
- Get each single object by means of its pointer, e.g.:
root TH1F* aaa1 = (TH1F*)0x8879330
root TH2F* aaa2 = (TH2F*)0x8335023
This is not a very smart procedure. For instance, I would like to use a more automatic way for getting these objects (e.g. using their names instead of their pointers).
Note that command file->Get(“histo1”) does not work in this case, as “file” does not see “histo1”…