Stat boxes for a THStack

From: Suvayu Ali <fatkasuvayu_at_gmail.com>
Date: Thu, 10 Jun 2010 01:47:47 -0700


Hi ROOT users,

I was trying to use stacked histograms to represent contribution from various background processes in my analysis. So far I have been able to manage the stat boxes for the individual histograms in the stack. But how do I display a stat box for the final histogram represented by the entire histogram stack?

I tried things like,

> THStack *METStack = new THStack("METStack", "Stack testing");
> METStack->Add(my_hist1,"hist");
> // ... add some more histograms
> METStack->Draw();
> TPaveStats *statbox_stack = (TPaveStats*) METStack->GetHistogram()->FindObject("stats");

But as I had expected, it returns a null-pointer. I presume it is because the stat box is not created until we actually draw the histogram?

Any ideas how to access it? TIA

-- 
Suvayu

Open source is the future. It sets us free.
Received on Thu Jun 10 2010 - 10:47:56 CEST

This archive was generated by hypermail 2.2.0 : Thu Jun 10 2010 - 11:50:02 CEST