Putting Overflow/underflow statistics in File

Hi everyone,

I have a question about writing histograms to file. Right now I have normal things like

TFile myFile ("saving.root", "RECREATE"); deltaPhiGoodHist->Write(); myFile.Close();

When the histogram is drawn, the stat box has the overflow/underflow stats in it. However, when it is written to a root file, the overflow/underflow seem to not be in there. I’m wondering how you could force ROOT to write those stats into the histograms and save them? Thanks!!

Hi,

the over/underflow bins are saved. You probably mean that the stat box does not show them anymore? The stat box is not part of the histogram; if you want to retain it you’ll have to store the canvas that contains the drawn histogram.

Cheers, Axel.

[quote=“Axel”]Hi,

the over/underflow bins are saved. You probably mean that the stat box does not show them anymore? The stat box is not part of the histogram; if you want to retain it you’ll have to store the canvas that contains the drawn histogram.

Cheers, Axel.[/quote]

Hi Axel,

yes that’s what I mean. Is there a way to write those into the code and not individually save them by drawing them first?

Thanks!

nevermind I figured it out. Thanks anyways!