Difficulty with TH3::Project3D("y")

Hi all,

I am struggling to get the expected behaviour from the TH3::Project3D(“y”) method using Version 5.04/00 20 September 2005.

root [0] file = TFile(“output.root”);
root [1] file->ls();
TFile** output.root
TFile* output.root
KEY: TH3F sim_fit;1 Fit results
KEY: TH3F pi_fit;1 Fit results
root [2] sim_fit->GetXaxis()->SetRange(3,3);
root [3] sim_fit->GetZaxis()->SetRange(3,3);
root [4] TH1F sim_temp = (TH1F)sim_fit->Project3D(“ye”)
root [5] sim_temp->GetMaximum()
(const Double_t)1.57262277603149414e+00
root [6] sim_fit->GetMaximum()
(const Double_t)1.01000000000000001e+00

The projection shouldn’t have greater values if I only project one row and column. This seems to only happen with the “y” projection.


Hi what happens if you remove the “e” option?

Without the “e” option, the bin contents are the same but the errors are not computed.

Root Version 4.04/02 10 November 2005 seems to suffer from the same problem, but it also doesn’t calculate the the errors correctly with the “e” option.

-First: version 4.04 is not from 10 November 2005
-Second: save us time by sending a short script and the Root file
explaining your problem


Hi Rene,

I’ve included a small file which reproduces the problem. Hopefully this helps to find the bug. I’m now using version 5.08.00b and the output of the program on my PC is,

max of projx = 1 max of projy = 2 max of projz = 1

test.cpp (1.17 KB)