Using TTDraw::Draw to count events cutting on event arrays

I’ve got an ntuple that contains muon and jet information. I’d like to
know the number of events that pass a muon pt & fit cut and also have at
least two jets. I can write a script, but I was trying to see if I could do it
from the TTree::Draw command line. For example, I can do the following:

CollectionTree->Draw(“Length$(sqrt(jet_Px2+jet_Py2)>15)”) and
that will give me a histogram of the number of jets that pass that cut in
each event.

So I tried something like the following:


but that didn’t seem to give me a sensible answer. Is this possible or do I
have to resort to a small function file? Or is there a totally different
approach I should be using?

Many thanks!

Hi Gordon,

Length$ give you the total number of elements on which the expression must be evaluated!

would be closer.

See also: … GetEntries: