Ignore:
Timestamp:
09/29/10 21:30:21 (14 years ago)
Author:
tbretz
Message:
Fixed a problem reading the RUNE section in the raw corsika files and accelerated plain readcorsika.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcorsika/MCorsikaFormat.cc

    r9946 r9949  
    151151// of the id.
    152152//
    153 Bool_t MCorsikaFormatRaw::SeekNextBlock(const char * id, unsigned short type) const
     153Int_t MCorsikaFormatRaw::SeekNextBlock(const char * id, unsigned short type) const
    154154{
    155155    char blockHeader[5]="\0\0\0\0";
     
    162162    // but find the end of a run. This is expected, therefor no error
    163163    // message.
    164     if (strcmp(id, "EVTH")==0 && strcmp(blockHeader, "RUNE")==0)
    165         return kTRUE;
     164    if (strcmp(blockHeader, "RUNE")==0)
     165        return kFALSE;
    166166
    167167    gLog << err << "ERROR - Wrong identifier: " << id << " expected.";
    168168    gLog << " But read " << blockHeader << " from file." << endl;
    169169
    170     return kFALSE;
     170    return kERROR;
    171171}
    172172
     
    182182Bool_t MCorsikaFormatRaw::SeekEvtEnd()
    183183{
    184 
    185184    // Search subblockwise backward (Block: 5733*4 = 21*273*4)
    186185    for (int i=1; i<22; i++)
     
    250249// of the id.
    251250//
    252 Bool_t MCorsikaFormatEventIO::SeekNextBlock(const char * id, unsigned short type) const
     251Int_t MCorsikaFormatEventIO::SeekNextBlock(const char * id, unsigned short type) const
    253252{
    254253    cout << "Seek " << type << endl;
     
    267266        {
    268267            gLog << err << "MCorsikaFormatEventIO::SeekNextBlock: ERROR - Unexpected end-of-file seeking " << id << " (" << type << ")." << endl;
    269             return kFALSE;
     268            return kERROR;
    270269        }
    271270
     
    343342    // we have to search in the file
    344343    fIn->seekg(currentPos, ios::beg);
    345     if (!SeekNextBlock("RUNE", 1210))
     344    if (SeekNextBlock("RUNE", 1210)!=kTRUE)
    346345        return kFALSE;
    347346
Note: See TracChangeset for help on using the changeset viewer.