LoadTree() with large / negative return value

Hello everyone!

My event loops while reading from a TChain are cancelled due to the return value of the LoadTree() function.

for(Long64_t jentry 0; jentry < nevents; jentry++) {
  cout << "Event #" << jentry << endl;  
  Long64_t ientry = LoadTree(jentry);
  if(ientry < 0) {
    cout << " FATAL :: Failed to load jentry #" << jentry << ". LoadTree() returned " << ientry << "! Breaking event loop..." << endl;
      break;
  } else {
    cout << " LoadTree() return " << ientry << endl;
  }
}

As output I get

Event #0
 >> New file has been opened (Notify() function has been called)
 LoadTree() returned 812070666748467856
Event #1
 LoadTree() return 42949672960001
Event #2
 LoadTree() return 2
Event #3
[...]
 LoadTree() return 34
Event #35
 LoadTree() return 35
Event #36
 FATAL :: Failed to load jentry #36. LoadTree() returned -7289951955479166940! Breaking event loop...

As far as I understand, the LoadTree() function should return the event number if it works correctly (see http://root.cern.ch/root/html/TChain.html#TChain:LoadTree, which it is doing for event #2 to #35. The loop fails fails at event #36 with a very large negative return value. But also event #0 and #1 are not returning the event number, but large numbers.

Can anyone clarify for me where such strange return values might come from or what they might indicate?

Cheers
Tobias

Hi Tobias,

This is odd and should not happen. Can you send us a small complete and running example showing the problem?

Thanks,
Philippe.