getEntries with cut

How does one get the number of entries of a branch with a cut applied?

e.g. without a cut

TBranch *myBranch = ntp10->GetBranch(“d0Mass”)
root [96] myBranch->GetEntries()
(const Long64_t)6259

However, I see no way to do this with a cut applied (like d0Mass < 1.6) . TCut seems to only be available for Draw class. Is this correct? I’d like to cut on these branches and return get the number of entries to do a signal/background estimate.

Thank you.

In version 5.13 we introduced a new function

virtual Long64_t GetEntries(const char *selection);

[quote]In version 5.13 we introduced a new function



Can a similar possibility be introduced for GetMinimum() and GetMaximum() ?

Best regards,


Implementing your request would imply to implement the TTree::Draw
interface for many functions. Instead the solution to your problem is quite simple. Simply do, eg

Long64_t N = tree.Draw("myvar","my selection","goff"); TMath::MaxElement(N,tree.GetV1());