RE: [ROOT] logical cut problem

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Aug 19 2003 - 18:01:11 MEST


Hi Chris,

Thanks for reporting this problem in TTree::Draw.  The fix will be uploaded shortly in the CVS repository.

In the meantime you can work around the problem by doing the string comparaison first in the expression.  I.e. the following works:

tree->Draw("c_theta_x_p_mean[0]:c_serial_no>>h1_2_1",
           cut && "c_theta_x_p_mean[0] > -9000","BOX");

Cheers,
Philippe.

On Tue, 19 Aug 2003, Philippe Canal wrote:

> Hi Chris,
>
> This sounds like instead of taking c_site for a sting it takes it as an
> array of number (hence the increased number of entries in the histogram).
>
> Please tell me where to download the root file so that I can reproduce your
> case.
>
> Cheers,
> Philippe
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Chris Hayward
> Sent: Tuesday, August 19, 2003 4:07 AM
> To: ROOT Talk Mailing List
> Subject: [ROOT] logical cut problem
>
>
> Hello,
> I use ROOT 3.05/07 with gcc 2.96 in lxplus. I am trying to define a
> logical cut for a histogram. The variable c_site is an array of chars. I
> tried using the cut "strcmp(c_site,\"RM1\") != 0", but this does not work.
> I get an empty pad instead of a histogram.
>
> I have also tried "c_site == \"RM1\"", but this too does not work. This
> behavior is more puzzling. Without the cut, I have 7 entries. When I add
> the cut, the number of entries jumps to 140, though the histogram looks
> the same and the mean does not change.
>
> Here is my draw command with the cut:
> tree->Draw("c_theta_x_p_mean[0]:c_serial_no>>h1_2_1",
>     "c_theta_x_p_mean[0] > -9000" && cut,"BOX");
>
> where cut = "c_site == \"RM1\"";
>
> and here is the command without:
> tree->Draw("c_theta_x_p_mean[0]:c_serial_no>>h1_2_1",
>     "c_theta_x_p_mean[0] > -9000","BOX");
>
> The ROOT file is too large to attach to the message, but I can send it
> along with my code on request. I have, however, attached the two
> histograms so that it is possible to see this behavior.
>
> Cheers,
> Chris
>
>



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