Changeset 9949 for trunk/Mars/msim
- Timestamp:
- 09/29/10 21:30:21 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msim/MPhotonEvent.cc
r9942 r9949 398 398 Int_t MPhotonEvent::GetNumExternal() const 399 399 { 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++) 403 404 if ((*this)[i].GetPrimary()!=MMcEvtBasic::kNightSky) 404 n++;405 406 return n;405 rc++; 406 407 return rc; 407 408 } 408 409 … … 816 817 } 817 818 */ 819 818 820 // -------------------------------------------------------------------------- 819 821 // … … 822 824 void MPhotonEvent::Print(Option_t *) const 823 825 { 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(); 825 831 } 826 832
Note:
See TracChangeset
for help on using the changeset viewer.