Re: redirecting histogram statistics to file

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Dec 15 1999 - 09:06:47 MET


Hi Ben,
What you do below should work if you have divided pads or not.
What is the problem ? 
Reply to me not the list.

Rene Brun

Ben Kilminster wrote:
> 
> hi,
> 
> I am interested in dumping the contents of the statistics box of a
> histogram to a file.
> 
> The application is for when one has a large number of root files and is
> interested in only a summary of histogram information for each one.
> 
> I tried several things at the question mark, but was unsuccessful.
> The problem has something to do with the fact that the pad is divided.
> 
> ---------------------------
> 
> void format_getStat()
> {
> gROOT->Reset();
> TFile f("data.root");
> f->cd();
> 
> // plot histogram in pad
> myc = new TCanvas("myc","All purpose canvas");
> pad1 = new TPad("pad1","This is pad1",0.02,0.02,0.98,0.9,33);
> pad1->Divide(2,3);
> pad1->cd(1);
> myntuple->Draw("mass_jets", "numJets==3");
> 
> // print out statistics for histogram
> TPaveText *stats = (TPaveText*)gPad->GetPrimitive("stats");
> // where to go from here ?
> // stats->Print(); >> test1 // works for divided canvas or undivided pad,
>                             // but not for divided pad
> 
> ?
> 
> ...
> 
> }
> 
> --------------------------
> 
> Thanks,
> Ben



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET