Changeset 18541 for trunk/Mars/msim


Ignore:
Timestamp:
08/24/16 18:04:29 (8 years ago)
Author:
tbretz
Message:
Added code to read the EventIo compacted bunches
Location:
trunk/Mars/msim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/msim/MPhotonEvent.cc

    r18447 r18541  
    554554        operator[](i).SimWavelength(wmin, wmax);
    555555}
     556
     557Int_t MPhotonEvent::ReadEventIoEvtCompact(MCorsikaFormat *fInFormat)
     558{
     559   Int_t bunchHeader[3];
     560   fInFormat->Read(bunchHeader, 3 * sizeof(Int_t));
     561
     562   Int_t n = 0;
     563
     564   for (int bunch = 0; bunch < bunchHeader[2]; bunch++)
     565   {
     566       Short_t buffer[8];
     567       fInFormat->Read(buffer, 8 * sizeof(Short_t));
     568
     569       if (Add(n).FillEventIO(buffer))
     570           n++;
     571   }
     572
     573   Resize(n);
     574   fData.UnSort();
     575
     576   SetReadyToSave();
     577
     578   //*fLog << all << "Number of photon bunches: " << fData.GetEntriesFast() << endl;
     579   return kTRUE;
     580
     581}
     582
    556583Int_t MPhotonEvent::ReadEventIoEvt(MCorsikaFormat *fInFormat)
    557584{
  • trunk/Mars/msim/MPhotonEvent.h

    r18447 r18541  
    6363    // I/O
    6464    Int_t ReadEventIoEvt(MCorsikaFormat *fInFormat);
     65    Int_t ReadEventIoEvtCompact(MCorsikaFormat *fInFormat);
    6566    Int_t ReadCorsikaEvt(Float_t * data, Int_t numEvents, Int_t arrayIdx);
    6667
Note: See TracChangeset for help on using the changeset viewer.