Ignore:
Timestamp:
02/14/04 11:48:43 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r2859 r3148  
    5454
    5555ClassImp(MCerPhotEvt);
     56ClassImp(MCerPhotEvtIter);
    5657
    5758using namespace std;
     
    428429    *fLog << warn << "MCerPhotEvt::DrawPixelContent - not available." << endl;
    429430}
     431
     432TObject *MCerPhotEvtIter::Next()
     433{
     434    MCerPhotPix *pix;
     435    while ((pix = (MCerPhotPix*)TObjArrayIter::Next()))
     436        if (pix->IsPixelUsed())
     437            return pix;
     438    return pix;
     439}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r2958 r3148  
    1717class MGeomCam;
    1818class MCerPhotPix;
     19class MCerPhotEvtIter;
    1920
    2021class MCerPhotEvt : public MParContainer, public MCamEvent
    2122{
     23    friend class MCerPhotEvtIter;
    2224private:
    2325    UInt_t        fNumPixels;
     
    7880    void Clear(Option_t *opt=NULL) { Reset(); }
    7981
     82    // class MCamEvent
    8083    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    8184    void DrawPixelContent(Int_t num) const;
     85
     86    operator TIterator*() const;
    8287
    8388    ClassDef(MCerPhotEvt, 2)    // class for an event containing cerenkov photons
    8489};
    8590
     91class MCerPhotEvtIter : public TObjArrayIter
     92{
     93private:
     94    Bool_t fUsedOnly;
     95public:
     96    MCerPhotEvtIter(const MCerPhotEvt *evt, Bool_t usedonly=kTRUE, Bool_t dir=kIterForward) : TObjArrayIter(evt->fPixels, dir), fUsedOnly(usedonly) { }
     97    TObject *Next();
     98    ClassDef(MCerPhotEvtIter, 0)
     99};
     100
     101inline MCerPhotEvt::operator TIterator*() const { return new MCerPhotEvtIter(this); }
     102
    86103#endif
Note: See TracChangeset for help on using the changeset viewer.