Re: ROOT crashes during scatter plot

Rene Brun (Rene.Brun@cern.ch)
Wed, 13 May 1998 10:03:01 +0200


Wolfgang Korsch wrote:
>
> Hi Rooters,
> I have a large sample of data (>1.5e6 evts) and I want to generate
> scatter plots. Using the command
>
> root> ntuple.Draw("y:x");
>
> works fine, but displays only the first (20,000 ?) events. That's
> ok, then I do
>
> root> ntuple.SetEstimate(1500000);
> root> ntuple.Draw("y:x");
>
> and I get either this error
>
> ----------------
> Error in <RootX11IOError>: fatal X11 error (connection to server lost?!)

When using the syntax ntuple.Draw("y:x"), Root keeps in memory
the arrays X and Y and displays the arrays via a TPolyMaker object.
This keeps the original precision of the data points.
However in case of a large number of points, this may endup in
a memory problem. From the X and Y arrays, Root creates new
arrays of points converted to pixel coordinates and pass this arrays
to the X11 system. Your X11 server must have enough memory
to display these arrays. This is a typical problem with X terminals.
In your case, to circumvent this memory limitation, you should
create a 2-D histogram, project the ntuple in this histogram.
example:
TH2F h2("h2","test",40,0,1,40,-6,6);
ntuple.Draw("y:x>>h2");
In this case, h2 is drawn by generating a number of dots per cell
proportional to the cell content. Once you have h2 filled,
you can also draw it with different drawing options.
This second technique requires less memory than the first one
in case of a large number of entries in a ntuple.

Rene Brun