Undocumented behavior when drawing trees?

I’m using root 5.17/02 and I"m drawing some data from a tree (named ‘data’) and I was surprised by the difference in behavior between the following two:
data.Draw(“photon.E”, “photon.E”)

I expected the second command to be equivalent to
data.Draw(“photon.E”, TCut(“photon.E != 0”))

But this is not the case, see the attachments. The second command appears to weigh every bin with the value of photon.E in that bin. I couldn’t deduce this behavior from the documentation which is why I’m posting in this forum. Is this documented / expected behavior?

I think it is explained here: root.cern.ch/root/html/TTree.html#TTree:Draw


data.Draw("photon.E", "photon.E != 0")
is not the same as

data.Draw("photon.E","photon.E ")
With the first expression the weight of each entry is either 0 or 1 and only non-zero weights
are histogrammed.
With the second expression all entries are histogrammed with a weight equal to photon.E


Oops, I remember making the same mistake before. (!= 0) <=> true is too deeply ingrained in my brain.