[ROOT] TCanvas trouble

From: Matthieu Guillo (guillo@jlab.org)
Date: Tue Aug 28 2001 - 16:48:06 MEST


Hello ROOTERS

I am working on a Linux box, RedHat 6.1, kernel 2.4 (recompiled), ROOT
version 3.01/05.

I have a TCanvas ojbect I want to save into a ROOT file. I first create
it, divide it in many sub pads and draw on every subpad an histogram
obtained applying a TEventList AND a cut on a tree doing something like:

c1->cd(2);  // go to second pad
tree->SetEventList(0); // reset list (not sure I need to do that)
tree->SetEventList(mylistselection);  // use only selected events
tree->Draw("var >> myhisto", cut);    // use subset of selected events

The problem is that sometimes when applying the cut there is no entries.
The histogram is therefore empty and I noticed that the pad where it was
supposed to be drawn is destroyed! Later I save the TCanvas in a ROOT file
and when I try to retrieve it, I receive the following message:

Error in <RootX11ErrorHandler>: BadValue (integer parameter out of range
for operation) (XID: 0) 

Then everything freeze, ROOT, my canvas, and the only way to recover is to
destroy the shell where I started ROOT!
My guess is that occurs because the subpad was destroyed? What can I do to
prevent that? Shoudn't I have an empty histogram drawn into the pad
instead of having the pad destroyed. May be I cannot use both a TEventList
and a cut? 

Thanks for any suggestion 

Matthieu Guillo
University of South Carolina
Thomas Jefferson National Laboratory
Office 71 trailer 16
Phone: 757-269-5551



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:58 MET