TTree::Draw'ing number of objects in vector that pass cut

Hi ROOT guru’s,

If I have a tree with an std::vector branch, would it be possible to use TTree::Draw to create a histogram of the number of T objects per event that have a particular flag set?

I think that the code currently in cvs would allow me to do something like

but I was kind of hoping for a trick to accomplish the same in ROOT v4.02/00.

Thanks for your help.


The actual syntax for the latest ROOT would be:tree->Draw("Sum$(branch.hasFlag())")
In ROOT 4.00/02, the best I can think of (short of loading your library and directly using the vector) is to use

This will draw an histogram with the number of ‘flagged T’ on the Y axis and the event ‘number’ on the X axis.