#ifndef _mevt_MEvent_h_ #define _mevt_MEvent_h_ #include #include #include #include namespace evt { class Event; } namespace mevt { /** * \class MEvent MEvent.h "mevt/MEvent.h" * \brief Root of the Muon event hierarchy. * * \author Rodolfo Federico Gamarra * \date 10 Jan 2009 * \ingroup mevt */ class MEvent { typedef evt::ComponentGroup InternalCounterCollection; public: typedef InternalCounterCollection::ComponentConstIterator CounterConstIterator; typedef InternalCounterCollection::ComponentIterator CounterIterator; // Counters. Counter& GetCounter(const int cId) { return fCounters.Get(cId); } const Counter& GetCounter(const int cId) const { return fCounters.Get(cId); } void MakeCounter(const int cId) { fCounters.Make(cId); } bool HasCounter(const int cId) const { return fCounters.Has(cId); } int GetNumberOfCounters() const { return fCounters.GetNumberOf(); } CounterConstIterator CountersBegin() const { return fCounters.Begin(); } CounterConstIterator CountersEnd() const { return fCounters.End(); } CounterIterator CountersBegin() { return fCounters.Begin(); } CounterIterator CountersEnd() { return fCounters.End(); } unsigned int GetNumberOfCandidateCounters() const; // Header. Header& GetHeader() { return *fHeader; } const Header& GetHeader() const { return *fHeader; } // An event is saturated if any of its counters is saturated bool IsSaturated() const; private: MEvent(); ~MEvent(); friend class evt::Event; /** * \brief Friendship to allow construction. */ friend class utl::LameShadowPtr; utl::InitializedLameShadowPtr
fHeader; InternalCounterCollection fCounters; }; } #endif // _mevt_MEvent_h_