[ROOT] problem with drawing TTrees with selection

From: Vladimir Morozov (VBMorozov@lbl.gov)
Date: Sat Jan 11 2003 - 08:02:29 MET


Dear ROOT folks:
I'm working in ROOT Version   3.02/07
I'm stuck with the following situation - I have 2 files each with a TTree
named 'uDst'. For simplicity, suppose each uDst tree has 3 variables in each
event : variable1, variable2 and variable3.
I'd like to open those two files in the same macro, and draw some histos.
When drawing my histos I have some selection that I apply to TTrees. Here's
a generic macro i'm talking about

void mymacro()
{
TFile *f1 = new TFile("f1.root");
TTree *t1 = uDst;
TH1F *hist1 = blah blah blah
t1->Draw("variable3>>hist1","(abs(variable1)+abs(variable2))<5");

TFile *f2 = new TFile("f2.root");
TTree *t2 = uDst;
TH1F *hist2 = blah blah blah
t2->Draw("variable3>>hist2","(abs(variable1)+abs(variable2))<5");
}

When the macro comes to line "t2->Draw .... " ROOT crashes with the message:
 *** Break *** segmentation violation
Root > Function mymacro() busy flag cleared


I've noticed that if I only try to open 1 file (either 1 or 2 ) in a macro,
it all works. Oddly, it also works fine if I change my selection condition
from
(abs(variable1)+abs(variable2))<5
to just variable1<5 or variable2<5
but that's not the selection that I want ...

What am I doing wrong ??

Thank you,
Vladimir



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET