I am fitting some plots and saving them to a root file with
fitDet = new TFile (“FitRate93.root”,“RECREATE”);
But I also have a legend that shows the chi squared etc. In the macro that makes this root file, I declare this TLegend as
TLegend *leg71 = new TLegend(0.1,0.85,0.9,0.9);
So I want to save this TLegend also in the root file. For this I do :
Looks like they both, the fitted histo and the legend, wrote to the root file FitRate93.root, but now how do I get the legend to draw?
If I open file FitRate93.root and double click graph with “ap” options it draws, now if I double click TPave with “same” option it doesn’t draw. Why is this?
Also it would be nice to give my legend a name. How do I give a TLegend a name so it would not appear as TPave in the root file and instead have a name?