Changeset 18526 for branches/Corsika7500Compatibility/msim/MPhotonEvent.cc
- Timestamp:
- 06/28/16 14:29:15 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Corsika7500Compatibility/msim/MPhotonEvent.cc
r18455 r18526 559 559 fInFormat->Read(bunchHeader, 3 * sizeof(Int_t)); 560 560 561 this-> resize( bunchHeader[2] );561 this->Resize( bunchHeader[2] ); 562 562 563 563 Int_t n = 0; … … 582 582 } 583 583 584 Int_t MPhotonEvent::ReadEventIoEvtCompact(MCorsikaFormat *fInFormat) 585 { 586 //Int_t bunchHeader[3]; 587 //fInFormat->Read(bunchHeader, 3*sizeof(Int_t)); 588 short array; 589 short tel; 590 float photon; 591 fInFormat->Read(&array, sizeof(array)); 592 fInFormat->Read(&tel, sizeof(tel)); 593 fInFormat->Read(&photon, sizeof(photon)); 594 595 std::cout << "ReadEventIO Evt Compact (Header) : " << array << " - " << tel << " - " << photon << std::endl; 596 597 this->Resize( (int)photon ); 598 599 int nbunches; 600 fInFormat->Read(&nbunches, sizeof(int)); 601 std::cout << "ReadEventIO Evt Compact (nbunches) : " << nbunches << std::endl; 602 603 Int_t n = 0; 604 605 for(int bunch = 0; bunch < (int)nbunches; bunch++) 606 { 607 short buffer[8]; 608 float floatBuffer[8]; 609 fInFormat->Read(buffer, 8 * sizeof(short)); 610 611 612 std::cout << "\nBunch: " << bunch << " with: "; 613 for(int i=0; i<8; i++) 614 { 615 std::cout << ", " <<buffer[i]; 616 floatBuffer[i] = static_cast<float>(buffer[i]); 617 } 618 619 if(Add(n).FillEventIO(floatBuffer)) 620 n++; 621 } 622 Resize(n); 623 fData.UnSort(); 624 625 SetReadyToSave(); 626 627 return kTRUE; 628 } 629 584 630 Int_t MPhotonEvent::ReadCorsikaEvt(Float_t * data, Int_t numEvents, Int_t arrayIdx) 585 631 { 586 632 Int_t n = 0; 587 633 588 this-> resize(numEvents);634 this->Resize(numEvents); 589 635 590 636 for (Int_t event = 0; event < numEvents; event++)
Note:
See TracChangeset
for help on using the changeset viewer.