GetNtrack() or GetEntries()?

Hi,
See $(ROOTSYS)/test/Event.cxx,h

Event *event = 0;
tree->SetBranchAddress(“event”,&event);
TClonesArray *tracks = event->GetTracks();

after tree->GetEntry(x);

event->GetNtrack() and tracks->GetEntries() is ALWAYS to same ?

Can someone recomend a better way (if I need information ONLY from Track object) ? more clear, more faster …

Thanks, Jan

Hi,

In the case of Event, the most efficient way of retriving the number of track is to use event.fNtrack. There is very little difference from calling event->GetNtrack() and tracks->GetEntries(). Technically tracks->GetEntries() is probably more efficient in some case because you could get away with just loading the track branch.

Cheers,
Philippe.