GetEntry() returns negative value other than -1

Dear ROOT experts,

When I fill a large number of objects into one event of TTree, I started to
get high negative value (e.g. -1731363080) when reading contents of
TTree by tree->GetEntry(0).

According to the document, TTree::GetEntry() returns negative value of -1
only when an I/O error occurs, otherwise the number of bytes of the input buffer.
So I suspect that this high negative value indicates that the number of bytes of
the input buffer exceeds the number which can be handled by Int_t (signed
4 bytes integer), 2147483647, which corresponds to 2 GB.

If it is the case, is it possible to replace the data type of returned value of GetEntry()
with such as Long64_t ?

Hi @yamanaka ,
welcome to the ROOT forum and sorry for the high latency!

Thank you for the report, your analysis might be correct. @Axel , @pcanal , what can we do here?

Cheers,
Enrico

Currently there is a limit of 1Gb per ‘TBuffer’ operation. Namely GetEntry for a single branch with no sub-branches can not return more than 1GB. However indeed, in aggregate a set of branches might be that large. We are currently in process of lifting this limitation and would increase the sizeof the return type GetEntry as part of this upgrade.

Now, it is very unusual for one entry to be that large. Are you sure the data was properly stored? (A common mis-step when storing a collection is to ‘forget’ to clear it between call to TTree::Fill and thus each entry contains its won data and the data of all the previous entries).

Dear @pcanal

In my case, several trees stored in different files are added as friends.
One entry of one tree does not exceed 1GB but when adding all of them,
it might exceed 2GB.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.