Problem with errors when using TTree::Draw with prof and gof

Hi,

I encountered the following problem:

I’ve got some TTree with some tracking information and I can plot the following which works:

tracks->Draw("(pTR-pTMC)/(pTMC*pTMC):pTMC","pTMC>10","prof")

… but within a macro I don’t want to draw the histogram immediately, hence I turn of the graphics with the ‘goff’-option. Afterwards I fetch the histogram and draw it. But then the error-bars are by about a factor of 10000 too high.

tracks->Draw("(pTR-pTMC)/(pTMC*pTMC):pTMC","pTMC>10","profgoff")
TH1F* hist = tracks->GetHistogram()
hist->Draw()

I attached the root-file where I found the problem.

thanks,
Peter
muminus.root (838 KB)

“profg” is a valid option for profiles, see TProfile::SetErrorOption at
root.cern.ch/root/html/TProfile. … rrorOption

so, simply specify “prof goff” or “prof,goff”

Rene

Hi Rene,

Thanks for the quick reply. That solved my problem.

  • Peter