Changeset 9949 for trunk/Mars/msim


Ignore:
Timestamp:
09/29/10 21:30:21 (14 years ago)
Author:
tbretz
Message:
Fixed a problem reading the RUNE section in the raw corsika files and accelerated plain readcorsika.
File:
1 edited

Legend:

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

    r9942 r9949  
    398398Int_t MPhotonEvent::GetNumExternal() const
    399399{
    400     Int_t n=0;
    401 
    402     for (int i=0; i<GetNumPhotons(); i++)
     400    const Int_t n=GetNumPhotons();
     401
     402    Int_t rc = 0;
     403    for (int i=0; i<n; i++)
    403404        if ((*this)[i].GetPrimary()!=MMcEvtBasic::kNightSky)
    404             n++;
    405 
    406     return n;
     405            rc++;
     406
     407    return rc;
    407408}
    408409
     
    816817}
    817818*/
     819
    818820// --------------------------------------------------------------------------
    819821//
     
    822824void MPhotonEvent::Print(Option_t *) const
    823825{
    824     fData.Print();
     826    // This is much faster than looping over all entries and discarding
     827    // the empty ones
     828    const UInt_t n = GetNumPhotons();
     829    for (UInt_t i=0; i<n; i++)
     830        operator[](i).Print();
    825831}
    826832
Note: See TracChangeset for help on using the changeset viewer.