Skip to content

Commit

Permalink
StPicoDstMaker: Issue warning when reading dubious tree entries
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Nov 20, 2017
1 parent 24f73ff commit 7598618
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion StPicoDstMaker/StPicoDstMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,23 @@ Int_t StPicoDstMaker::MakeRead()
LOG_WARN << " No input files ... ! EXIT" << endm;
return kStWarn;
}

int bytes = mChain->GetEntry(mEventCounter++);

while ( bytes <= 0 ){
// Detect end of tree chain and return the appropriate code
while ( bytes <= 0 )
{
if ( mEventCounter >= mChain->GetEntriesFast() )
return kStEOF;

LOG_WARN << "Encountered invalid entry or I/O error while reading event "
<< mEventCounter << " from \"" << mChain->GetName() << "\" input tree\n";

bytes = mChain->GetEntry(mEventCounter++);
}

fillEventHeader();

return kStOK;
}
//_____________________________________________________________________________
Expand Down

0 comments on commit 7598618

Please sign in to comment.