Help on use of 'Length$' in selection of TTree::Draw

Hi everyone,

I’ve got a tree with a branch called ‘Muon’ which is a TClonesArray. If I do

t->Draw(“Length$(Muon)”)

it nicely plots the number of muons in each event. But, if I try to use this ‘Length$(Muon)’ in the selection, nothing seems to happen.

t->Draw(“Length$(Muon)”,“Length$(Muon)>200”)

does exactly the same as the above (as in: no selection). The strange thing is that

t->Draw(“Length$(Muon)”,“Entry$%2==0”)

does work.

Am I missing something here or is this a problem?

Thanks,
Jeroen

Hi,

There is indeed a problem with Length$(Muon) when used in expression (like Length$(Muon)>29). This will be fixed short in the CVS repository.
In ROOT 4.03/04 and above you can use (assuming Muon in a TClonesArray)

In older version of ROOT, you can use

Cheers,
Philippe.

by the way:

are to same methods ? or exist any difference ?

They are the same (except that GetEntries is supported only for TClonesArray).

Cheers,
Philippe.