Re: [ROOT] bug in selection cuts ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Apr 29 2001 - 15:51:19 MEST


Hi Andre,
The problem has been indentified in TTreeFormula (not connected with
TCut).
The class does not expand correctly an array when more than 16 operators
"||" are defined in the same formula.
Thanks for reporting the problem.

Rene Brun

On Sat, 28 Apr 2001, Andre Holzner wrote:

> Hello,
> 
> I think I came across a bug in root (if this has not been
> fixed yet), I'm using Version   3.00/06 12 March 2001
> from /afs/cern.ch/na49/library.4/ROOT/pro/rootsys/
> on RH6.1/i386.
> 
> Here's test.C
> 
> {
>   nt = new TNtuple("ntuple","ntuple","x:y");
>   nt->Fill(1.0,2.0);
>  
>  
>   TString cut = "(x>0)";
>  
>   while (nt->Draw("y:x",cut,"goff")>0)
>  
>   {
>     cut.Prepend("(x<0)||");
>     cout << cut.Length() << endl;
>     cout << cut << endl;
>  
>   }
>  
> }
> 
> i.e. cut is a string of n times (x<0) || ...
> and the last condition is (x>0) so the event
> in the ntuple should always be selected, the
> program should continue forever.
> 
> However, it stops quite early:
> 
> root [0] .x test.C
> 12
> (x<0)||(x>0)
> 19
> (x<0)||(x<0)||(x>0)
> 26
> (x<0)||(x<0)||(x<0)||(x>0)
> 33
> (x<0)||(x<0)||(x<0)||(x<0)||(x>0)
> 40
> (x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x>0)
> 47
> (x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x>0)
> 54
> (x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x>0)
> 61
> (x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x<0)||(x>0)
> root [1]
> 
> When using a cut like 0||0||0||(x>0), I manage to get to
> longer strings (I stopped the program at about 500).
> 
> Any ideas ?
> 
> 
> best regards & thanks for looking into this & sorry if this
> has been fixed already,
> 
> 
> André
> 
> 
> -- 
> ------------------+----------------------------------
> Andre Holzner     | +41 22 76 76750 
> Bureau 32 2-C13   | Building 32     
> CERN              | Office 2-C13    
> CH-1211 Geneve 23 | http://wwweth.cern.ch/~holzner/
> 



This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:51:23 MEST