Project ntuple to TH1F prob

Hi - I realize this question has been addressed before, but I’m still having difficulties…

When running interactively I can easily fill a predefined histogram doing something like

TH1F * hist = new TH1F(“hist”,“title”, 120, 0, 60 );
ntuple->Draw(“energy>>hist”,weight);
hist->Draw();
c1->Print(“Flux.ps”);

but this seems to only work when I do it interactively. Inside a macro, “hist” is empty.

I tried
ntuple->Draw(“energy>>+hist”,weight);
and
ntuple->Draw(“energy>>hist”,weight, “goff”);

and various other things and it’s still not working for me.
I’m using root 5.14/00a. On another computer, where the root version is 4.04, I seem to have a macro that does something similar, and I know that it works. So I can just copy everything to the other computer, but I’d like to know what I’m doing wrong.

Thanks…

I just tried with the root latest version (5.17/05) the following little example:

{
   TH1F * hist = new TH1F("hist","title", 120, 0, 60 );
   ntuple->Draw("px>>hist","");
   hist->Draw();
   c1->Print("c1.ps"); 
}

This macro works fine for me. It uses the ntuple produced by $ROOTSYS/tutorials/hsimple.C. Can you try it ?