projecting 2d ntuples into hists

Wolfgang Korsch (wkorsch@server1.pa.uky.edu)
Mon, 24 Mar 1997 08:03:22 -0700


Hello,
I encountered another problem. I tried to project a 2d ntuple into
a histogram and a "profile" plot into a histogram, but without
success. I get a "segmentation violation" error.

I used the following procedure:

Root> hist2d = new TH2F("hist2d", "test", 200,0,200,100,0,1);
Root> ntuple->Draw("y:x>>hist2d");
Root> hist2d->Draw();

-----> segmentation violation

This seems to work fine for 1d histograms.


A second, probably related, problem I have is:
I don't seem to be able to generate profile histograms without
using the "prof" command. I would like to create a profile plot
where I determine the number of x-bins ("prof" sets this
automatically).
I tried the following:

Root> hprof = new TProfile("hprof", "test",100,0,100,0,1);
Root> ntuple->Draw("y:x>>hprof");
Root> hprof->Draw();

-----> segmentation violation

Thanks very much for your help.

Wolfgang