Changeset 19340 for trunk/Mars
- Timestamp:
- 10/30/18 17:54:59 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcorsika/MCorsikaRead.cc
r19000 r19340 280 280 { 281 281 if (blockType == 1200) 282 status = fRunHeader->ReadEvt(fInFormat );282 status = fRunHeader->ReadEvt(fInFormat, blockLength / sizeof(Float_t)); 283 283 284 284 else if(blockType == 1201) … … 287 287 else if (blockType == 1202) 288 288 { 289 Float_t buffer[272];290 status = fInFormat->Read(buffer , 272 * sizeof(Float_t));291 status = fRunHeader->ReadEventHeader(buffer );289 vector<Float_t> buffer(blockLength / sizeof(Float_t)); 290 status = fInFormat->Read(buffer.data(), blockLength); 291 status = fRunHeader->ReadEventHeader(buffer.data()); 292 292 break; 293 293 } … … 495 495 { 496 496 case 1200: // the run header 497 status = fRunHeader->ReadEvt(fInFormat );497 status = fRunHeader->ReadEvt(fInFormat, fBlockLength / sizeof(Float_t)); 498 498 fReadState = 1; // RUNH is read 499 499 break; … … 504 504 505 505 case 1202: // the event header 506 Float_t buffer[272];507 if (!fInFormat->Read(buffer , 272 * sizeof(Float_t)))506 vector<Float_t> buffer(fBlockLength / sizeof(Float_t)); 507 if (!fInFormat->Read(buffer.data(), fBlockLength)) 508 508 return kFALSE; 509 509 510 510 if (fReadState == 1) // first event after RUN header 511 511 { 512 fRunHeader->ReadEventHeader(buffer );512 fRunHeader->ReadEventHeader(buffer.data()); 513 513 fRunHeader->Print(); 514 514 } 515 515 516 status = fEvtHeader->ReadEvt(buffer );516 status = fEvtHeader->ReadEvt(buffer.data()); 517 517 if (fArrayIdx >= (Int_t)fEvtHeader->GetTotReuse()) 518 518 { … … 597 597 598 598 case 1209: // the event end 599 status = fEvtHeader->ReadEvtEnd(fInFormat );599 status = fEvtHeader->ReadEvtEnd(fInFormat, fBlockLength / sizeof(Float_t)); 600 600 601 601 if (fReadState == 10 || fReadState == 2) … … 640 640 case 1109: // save corsika events 641 641 fEvtHeader->InitXY(); 642 status = fEvent->ReadCorsikaEvt( &fRawEvemtBuffer[0],643 f RawEvemtBuffer.size() / 7,642 status = fEvent->ReadCorsikaEvt(fRawEvemtBuffer, 643 fBlockLength == MCorsikaFormat::kBlockLengthRaw/21 - 4 ? 7 : 8, 644 644 fEvtHeader->GetNumReuse()+1); 645 646 // Simulate wavelength for all bunches with a wavelength == 0 647 fEvent->SimWavelength(fRunHeader->GetWavelengthMin(), 648 fRunHeader->GetWavelengthMax()); 649 645 650 fEvtHeader->IncNumReuse(); 646 651
Note:
See TracChangeset
for help on using the changeset viewer.