Re: a problem of using of ntuple's selection

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Mar 04 2000 - 12:10:35 MET


The selection expression in TTree::Draw returns the weight to be
used when filling the histogram.
If you have a selection expression sel= a && b, the result
will always be 0 or 1. In your case, you should do:
ntuple.Draw("ntracks","(1/w)*(px == 2.)")
or simply
ntuple.Draw("ntracks","(px == 2.)/w")

Rene Brun

On Fri, 3 Mar 2000, Zhou Zhang wrote:

> Hi rooter talkers,
> 
>   I have a ntuple which holds a lot of tracks with a weight w. 
> Each tuple of the  track  has px,py,pz which are the three momentum
> components of the track. 
> 
>   when I use ntuple.Draw("ntracks","1/w && px == 2. "), the plot looks
> that the normalization cut "1/w" is not applied. Have anyone met such
> problem before? Who could give me some advices to solve it?
> 
>                              Thanks
> 
>                                     Zhou 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET