Suggested improvement: TTree::GetEntry

Hi,

I would like to suggest a small improvement in the documentation of TTree that could save some debugging time to users. Due to a bug in my program, I started to find only events with length 0. After a lot of cross-checks I discovered that all the branches were disabled ( SetBranchStatus( “name”, 0 ) ). Even if the behaviour of ROOT is perfectly consistent, I suggest to add in the documentation a caveat for a situation like this. In fact, in such a case TTree::GetEntry throws no error, but IMO this is still a symptom of something weird going on with branch statuses.

Regards,
Riccardo

Hi Riccardo,

The function GetEntry returns the number of bytes read. To detect your case and in any other error cases you ought to check the return value of GetEntry:[quote] // The function returns the number of bytes read from the input buffer.
// If entry does not exist the function returns 0.
// If an I/O error occurs, the function returns -1.[/quote.

Cheers,
Philippe.