Changeset 10213 for trunk


Ignore:
Timestamp:
03/03/11 10:13:12 (14 years ago)
Author:
rohlfs
Message:
accept an EVTH only after an EVTE and after a RUNH
Location:
trunk/Mars/mcorsika
Files:
3 edited

Legend:

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

    r10146 r10213  
    108108// header of the block. As the event block has no header it is located   
    109109// at the beginning of this block, which is as the beginning of the data 
    110 Bool_t MCorsikaFormatRaw::NextBlock(Bool_t  subBlock,
     110Bool_t MCorsikaFormatRaw::NextBlock(Int_t   readState,
    111111                                    Int_t & blockType,
    112112                                    Int_t & blockVersion,
     
    114114                                    Int_t & blockLength) const
    115115{
     116
    116117    int blockHeader;
    117118    fIn->read((char*)&blockHeader, 4);
     
    123124    blockLength     = 272 * 4;
    124125
    125 
    126126    switch(blockHeader)
    127127      {
     
    133133         break;
    134134      case 1213486661 : // EVTH
    135          blockType = 1202;
     135         if (readState != 10)
     136            blockType = 1202;
     137         else
     138            {
     139            blockType = 1105;
     140            fIn->seekg(-4, ios::cur);
     141            blockLength += 4;
     142            }
    136143         break;
    137144      case 1163155013 : // EVTE
     
    169176///////////////////////////////////////////////////////////////////////////////
    170177
    171 Bool_t MCorsikaFormatEventIO::NextBlock(Bool_t  subBlock,
     178Bool_t MCorsikaFormatEventIO::NextBlock(Int_t   readState,
    172179                                        Int_t & blockType,
    173180                                        Int_t & blockVersion,
     
    182189//         - id (first 4 bytes of data field)
    183190
    184    if (subBlock)
     191   if (readState == 4)
     192//   if (subBlock)
    185193      {
     194      // this is a sub-block
    186195      int blockHeader[3];
    187196      fIn->read((char*)blockHeader, 3 * sizeof(int));
  • trunk/Mars/mcorsika/MCorsikaFormat.h

    r10069 r10213  
    2525   virtual ~MCorsikaFormat();
    2626
    27    virtual Bool_t NextBlock(Bool_t  subBlock, Int_t & blockType, Int_t & blockVersion,
     27   virtual Bool_t NextBlock(Int_t   readState, Int_t & blockType, Int_t & blockVersion,
    2828                            Int_t & blockIdentifier, Int_t & blockLength) const = 0;
    2929
     
    5050        : MCorsikaFormat(in) {}
    5151
    52    Bool_t NextBlock(Bool_t  subBlock, Int_t & blockType, Int_t & blockVersion,
     52   Bool_t NextBlock(Int_t   readState, Int_t & blockType, Int_t & blockVersion,
    5353                    Int_t & blockIdentifier, Int_t & blockLength) const;
    5454
     
    6767
    6868
    69     Bool_t NextBlock(Bool_t  subBlock, Int_t & blockType, Int_t & blockVersion,
     69    Bool_t NextBlock(Int_t   readState, Int_t & blockType, Int_t & blockVersion,
    7070                     Int_t & blockIdentifier, Int_t & blockLength) const;
    7171
  • trunk/Mars/mcorsika/MCorsikaRead.cc

    r10165 r10213  
    276276            Int_t blockType, blockVersion, blockIdentifier, blockLength;
    277277            while (status &&
    278                    fInFormat->NextBlock(fReadState == 4, blockType, blockVersion,
     278                   fInFormat->NextBlock(fReadState/* == 4*/, blockType, blockVersion,
    279279                              blockIdentifier, blockLength))
    280280               {
     
    385385Int_t MCorsikaRead::ReadNextBlockHeader()
    386386{
    387    if (fInFormat->NextBlock(fReadState == 4, fBlockType, fBlockVersion,
     387   if (fInFormat->NextBlock(fReadState/* == 4*/, fBlockType, fBlockVersion,
    388388                            fBlockIdentifier, fBlockLength)               == kFALSE)
    389389      // end of file
    390390      return kFALSE;
    391 
    392 //    gLog << "Next fBlock:  type=" << fBlockType << " version=" << fBlockVersion;
    393 //    gLog << " identifier=" << fBlockIdentifier << " length=" << fBlockLength;
    394 //    gLog << " readState= " << fReadState << endl;
    395    
     391/*
     392    gLog << "Next fBlock:  type=" << fBlockType << " version=" << fBlockVersion;
     393    gLog << " identifier=" << fBlockIdentifier << " length=" << fBlockLength;
     394    gLog << " readState= " << fReadState << endl;
     395*/   
    396396   if (fReadState == 3 && fBlockType != 1210)
    397397      // fReadState == 3    means we have read the event end
Note: See TracChangeset for help on using the changeset viewer.