- Timestamp:
- 03/03/11 10:13:12 (14 years ago)
- Location:
- trunk/Mars/mcorsika
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcorsika/MCorsikaFormat.cc
r10146 r10213 108 108 // header of the block. As the event block has no header it is located 109 109 // at the beginning of this block, which is as the beginning of the data 110 Bool_t MCorsikaFormatRaw::NextBlock( Bool_t subBlock,110 Bool_t MCorsikaFormatRaw::NextBlock(Int_t readState, 111 111 Int_t & blockType, 112 112 Int_t & blockVersion, … … 114 114 Int_t & blockLength) const 115 115 { 116 116 117 int blockHeader; 117 118 fIn->read((char*)&blockHeader, 4); … … 123 124 blockLength = 272 * 4; 124 125 125 126 126 switch(blockHeader) 127 127 { … … 133 133 break; 134 134 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 } 136 143 break; 137 144 case 1163155013 : // EVTE … … 169 176 /////////////////////////////////////////////////////////////////////////////// 170 177 171 Bool_t MCorsikaFormatEventIO::NextBlock( Bool_t subBlock,178 Bool_t MCorsikaFormatEventIO::NextBlock(Int_t readState, 172 179 Int_t & blockType, 173 180 Int_t & blockVersion, … … 182 189 // - id (first 4 bytes of data field) 183 190 184 if (subBlock) 191 if (readState == 4) 192 // if (subBlock) 185 193 { 194 // this is a sub-block 186 195 int blockHeader[3]; 187 196 fIn->read((char*)blockHeader, 3 * sizeof(int)); -
trunk/Mars/mcorsika/MCorsikaFormat.h
r10069 r10213 25 25 virtual ~MCorsikaFormat(); 26 26 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, 28 28 Int_t & blockIdentifier, Int_t & blockLength) const = 0; 29 29 … … 50 50 : MCorsikaFormat(in) {} 51 51 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, 53 53 Int_t & blockIdentifier, Int_t & blockLength) const; 54 54 … … 67 67 68 68 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, 70 70 Int_t & blockIdentifier, Int_t & blockLength) const; 71 71 -
trunk/Mars/mcorsika/MCorsikaRead.cc
r10165 r10213 276 276 Int_t blockType, blockVersion, blockIdentifier, blockLength; 277 277 while (status && 278 fInFormat->NextBlock(fReadState == 4, blockType, blockVersion,278 fInFormat->NextBlock(fReadState/* == 4*/, blockType, blockVersion, 279 279 blockIdentifier, blockLength)) 280 280 { … … 385 385 Int_t MCorsikaRead::ReadNextBlockHeader() 386 386 { 387 if (fInFormat->NextBlock(fReadState == 4, fBlockType, fBlockVersion,387 if (fInFormat->NextBlock(fReadState/* == 4*/, fBlockType, fBlockVersion, 388 388 fBlockIdentifier, fBlockLength) == kFALSE) 389 389 // end of file 390 390 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 */ 396 396 if (fReadState == 3 && fBlockType != 1210) 397 397 // fReadState == 3 means we have read the event end
Note:
See TracChangeset
for help on using the changeset viewer.