This should work, unless you are changing directory between the creation
of your histogram and the invokation of ntuple->Draw.
This works:
TH1F *myhist = new TH1F("myhist","title",100,-5,5);
ntuple->Draw("some_quantity>>myhist");
This will not work
TH1F *myhist = new TH1F("myhist","title",100,-5,5);
TFile f("myfile.root");
ntuple->Draw("some_quantity>>myhist");
> Also the command
>
> my_ntuple->Project("my_histo", "some_quantity", "some_selection")
>
> does not work in that way, albeit there is some indication from the
> (at this point vague) documentation that it should.
>
Same symptom as above.
> And another question: Should Project() work like ntuple/project in
> Paw, e.g. the projection is only _added_ to the histogram contents (no
> reset)?
>
> I've tried with 1.03/01 for AIX 4.1 and 1.02/00 for Solaris 2.4.
TTree::Project is only a shortcut to TTree::Draw.
By default, Project replaces the contents of the specified histogram.
In both TTree::Draw and TTree::Project, you can use the following
undocumented feature in version 1.02 to use the "+" character in front
of the histogram name.
For example
ntuple_>Draw("px>>myhist","py<0");
ntuple->Draw("px>>+myhist","py>0"); //add to existing bin contents
Rene Brun