Hello.
I have many canvases stored in my HD as .root files.
Now I want pickup these canvases and manipulated that.
To give the idea, that’s what I do for single-pad canvases:
//[1] define and book some stuff
TH1F* MyHisto.. etc etc..
TGraph* MyGraph... etcetc..
....
// ...assume this stuff is well defined
//[2] pick up existing file
TFile* MyFile new TFile("filename.root","READ");
MyFile->cd();
//[3] pick up canvas in file
TCanvas* MyCanvas= (TCanvas*)file->Get("MyCanvasName")
MyCanvas->cd();
//[4] draw the canvas
MyCanvas->Draw();
//[5] draw my "stuff" superimposed to the previous plots of the canvas
MyHisto->Draw("same");
MyGraph->Draw("l");
..etc...
In this case it works.
Now, assume MyCanvas is “multi-padded”, (i.e. when I generated it, I made sub-divisions my means of TPad objects).
So, before drawing my new stuff over the existing plots, I need to accede to those pads.
I need to do something between step [4] and step[5]; something like:
// [4.5] accede to the pad
TPad* MyPad= (TPad*)MyCanvas->GetPad("PadName");
MyPad->cd();
but this syntax is incorrect; GetPad takes an integer as argument (the subpad number).
In my understanding, the user-defined TPads are not numbered…
So… how to do?