in ROMEEventLoop::ReadEvent(), if gROME->isOffline() and gROME->isMidas(),
ROME checks if bank size is greater than 0.
But It can happen that the bank size is 0 in normal file.
(Actually in my midas file bank size of "environment data" is 0 at this moment)
---------------------------------------------
else if (gROME->isOffline()&&gROME->isMidas()) {
// read event header
EVENT_HEADER *pevent = (EVENT_HEADER*)gROME->GetMidasEvent();
bool readError = false;
.
.
.
if (pevent->data_size <= 0) readError = true;
else {
n = read(fMidasFileHandle, pevent+1, pevent->data_size);
if (n != (int) pevent->data_size) readError = true;
if ((int) ((BANK_HEADER*)(pevent+1))->data_size < 0) readError = true; <-- I changed here
}
}
// check input
if (readError) {
if (n > 0) cout << "Unexpected end of file\n";
this->SetEndOfRun();
return true; |