Changeset 9949 for trunk/Mars/mcorsika
- Timestamp:
- 09/29/10 21:30:21 (14 years ago)
- Location:
- trunk/Mars/mcorsika
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcorsika/MCorsikaEvtHeader.cc
r9941 r9949 129 129 Int_t MCorsikaEvtHeader::ReadEvt(MCorsikaFormat *fInFormat) 130 130 { 131 if (!fInFormat->SeekNextBlock("EVTH", 1202)) 132 return kFALSE; 131 const Int_t rc=fInFormat->SeekNextBlock("EVTH", 1202); 132 if (rc!=kTRUE) 133 return rc; 133 134 134 135 Float_t f[273]; 135 136 if (!fInFormat->ReadData(272, f)) 136 return k FALSE;137 return kERROR; 137 138 138 139 fEvtNumber = TMath::Nint(f[0]); … … 169 170 fWeightedNumPhotons = 0; 170 171 171 return !fInFormat->Eof();172 return fInFormat->Eof() ? kERROR : kTRUE; 172 173 } 173 174 … … 177 178 Int_t MCorsikaEvtHeader::ReadEvtEnd(MCorsikaFormat * fInFormat) 178 179 { 179 if ( !fInFormat->SeekNextBlock("EVTE", 1209))180 return k FALSE;180 if (fInFormat->SeekNextBlock("EVTE", 1209)!=kTRUE) 181 return kERROR; 181 182 182 183 //fin.seekg(-1088,ios::cur); 183 184 184 185 Float_t f[2]; 185 186 186 if (!fInFormat->ReadData(2, f)) 187 return k FALSE;187 return kERROR; 188 188 189 189 const UInt_t evtnum = TMath::Nint(f[0]); … … 199 199 fWeightedNumPhotons = f[1]; 200 200 201 return !fInFormat->Eof();202 } 201 return fInFormat->Eof() ? kERROR : kTRUE; 202 } -
trunk/Mars/mcorsika/MCorsikaFormat.cc
r9946 r9949 151 151 // of the id. 152 152 // 153 Bool_t MCorsikaFormatRaw::SeekNextBlock(const char * id, unsigned short type) const153 Int_t MCorsikaFormatRaw::SeekNextBlock(const char * id, unsigned short type) const 154 154 { 155 155 char blockHeader[5]="\0\0\0\0"; … … 162 162 // but find the end of a run. This is expected, therefor no error 163 163 // message. 164 if (strcmp( id, "EVTH")==0 && strcmp(blockHeader, "RUNE")==0)165 return k TRUE;164 if (strcmp(blockHeader, "RUNE")==0) 165 return kFALSE; 166 166 167 167 gLog << err << "ERROR - Wrong identifier: " << id << " expected."; 168 168 gLog << " But read " << blockHeader << " from file." << endl; 169 169 170 return k FALSE;170 return kERROR; 171 171 } 172 172 … … 182 182 Bool_t MCorsikaFormatRaw::SeekEvtEnd() 183 183 { 184 185 184 // Search subblockwise backward (Block: 5733*4 = 21*273*4) 186 185 for (int i=1; i<22; i++) … … 250 249 // of the id. 251 250 // 252 Bool_t MCorsikaFormatEventIO::SeekNextBlock(const char * id, unsigned short type) const251 Int_t MCorsikaFormatEventIO::SeekNextBlock(const char * id, unsigned short type) const 253 252 { 254 253 cout << "Seek " << type << endl; … … 267 266 { 268 267 gLog << err << "MCorsikaFormatEventIO::SeekNextBlock: ERROR - Unexpected end-of-file seeking " << id << " (" << type << ")." << endl; 269 return k FALSE;268 return kERROR; 270 269 } 271 270 … … 343 342 // we have to search in the file 344 343 fIn->seekg(currentPos, ios::beg); 345 if ( !SeekNextBlock("RUNE", 1210))344 if (SeekNextBlock("RUNE", 1210)!=kTRUE) 346 345 return kFALSE; 347 346 -
trunk/Mars/mcorsika/MCorsikaFormat.h
r9943 r9949 27 27 virtual ~MCorsikaFormat(); 28 28 29 virtual Bool_tSeekNextBlock(const char * id, unsigned short type) const = 0;29 virtual Int_t SeekNextBlock(const char * id, unsigned short type) const = 0; 30 30 virtual void UnreadLastHeader() const = 0; 31 31 … … 60 60 : MCorsikaFormat(in) {} 61 61 62 Bool_tSeekNextBlock(const char * id, unsigned short type) const;62 Int_t SeekNextBlock(const char * id, unsigned short type) const; 63 63 void UnreadLastHeader() const; 64 64 … … 79 79 : MCorsikaFormat(in) {fRunePos = std::streampos(0);} 80 80 81 Bool_tSeekNextBlock(const char *id, unsigned short type) const;81 Int_t SeekNextBlock(const char *id, unsigned short type) const; 82 82 void UnreadLastHeader() const; 83 83 -
trunk/Mars/mcorsika/MCorsikaRunHeader.cc
r9937 r9949 85 85 Bool_t MCorsikaRunHeader::ReadEvt(MCorsikaFormat * fInFormat) 86 86 { 87 if ( !fInFormat->SeekNextBlock("RUNH", 1200))87 if (fInFormat->SeekNextBlock("RUNH", 1200)!=kTRUE) 88 88 return kFALSE; 89 89 … … 158 158 // f[145] Muon multiple scattering flag 159 159 160 if ( !fInFormat->SeekNextBlock("EVTH", 1202))160 if (fInFormat->SeekNextBlock("EVTH", 1202)!=kTRUE) 161 161 return kFALSE; 162 162 … … 221 221 Bool_t MCorsikaRunHeader::ReadEvtEnd(MCorsikaFormat * fInFormat) 222 222 { 223 224 if (!fInFormat->SeekNextBlock("RUNE", 1210)) 223 if (fInFormat->SeekNextBlock("RUNE", 1210)!=kTRUE) 225 224 return kFALSE; 226 225
Note:
See TracChangeset
for help on using the changeset viewer.