[ROOT] bug in TTree::Draw ?

From: Helmut Schmuecker (helmut@ep1.ruhr-uni-bochum.de)
Date: Wed Apr 11 2001 - 23:12:40 MEST


Hi rooters,

After changing from version 2.25-03 to version 3.00-06, one of my macros, 
which creates TEventlists by using the TTree::Draw(">>eventlist","some
selection string") method, does not work anymore. With 3.00-06 nothing is
written into the Eventlists if the selection string becomes too long.

I have tried to reproduce the effect with the TTree T in the
$ROOTSYS/test/Event.root file and the following macro. It is not the same 
effect, but what happens is also pretty weird:


void testtree(){
  
  gSystem->Load("libEvent.so");
  TFile f("Event.root","read");
  TTree* tree = (TTree*)f.Get("T");
  
  TCut cut1 = "abs(fTracks.fBx-0.1)<0.2 && fTracks.fPx>1.0 &&
fTracks.fPz-fTracks.fPy>0.0 && !fTracks.fCharge && !fTracks.fValid &&
fTracks.fPz>1.0 && fTracks.fRandom>800";
  TCut cut2 = "fTracks.fNpoint>64";
 
  TCut magic = cut1 && cut2;
  
  cerr << "\n\n\n"
       << cut1 << "\n\n"
       << cut2 << "\n\n"
       << magic << endl;
  
  TCanvas* can = new TCanvas("can","",900,300);
  can->Divide(3,1);
  
  can->cd(1);
  T->Draw("fTracks.fNpoint", cut1);
  can->cd(2);
  T->Draw("fTracks.fNpoint", cut2);
  can->cd(3);
  T->Draw("fTracks.fNpoint", magic);
  
}


It seems that in "T->Draw("fTracks.fNpoint", magic)" the last cut 
(cut2 = "fTracks.fNpoint>64") is simply ignored. In the third histogram 
I see also entries with fNpoint<=64. If one of the cuts in
cut1 is removed, e.g. "fTracks.fRandom>800", everything looks fine again.

With 2.25-03 these problems don't occur.

Any Idea? 

cheers,
    Helmut



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