#ifndef __fevt_Eye_h__ #define __fevt_Eye_h__ #include #include #include #include #include #include namespace fevt { class EyeRecData; class EyeTriggerData; class EyeHeader; class Telescope; /** \class Eye \brief Fluorescence Detector Eye Event \author Stefano Argiro' \version $Id$ \ingroup fevt */ class Eye { private: typedef std::list InternalTelescopeContainer; typedef InternalTelescopeContainer::iterator InternalTelescopeIterator; typedef InternalTelescopeContainer::const_iterator InternalConstTelescopeIterator; /// An iterator over all telescopes for read and write typedef boost::indirect_iterator AllTelescopeIterator; /// An iterator over telescopes for read only typedef boost::indirect_iterator ConstAllTelescopeIterator; AllTelescopeIterator AllTelescopesBegin() { return AllTelescopeIterator(fTelescopes.begin()); } AllTelescopeIterator AllTelescopesEnd() { return AllTelescopeIterator(fTelescopes.end()); } ConstAllTelescopeIterator AllTelescopesBegin() const { return ConstAllTelescopeIterator(fTelescopes.begin()); } ConstAllTelescopeIterator AllTelescopesEnd() const { return ConstAllTelescopeIterator(fTelescopes.end()); } public: Eye(const Eye& eyeData); Eye& operator=(const Eye& eyeData); unsigned int GetId() const { return fId; } /// Number of telescopes that participated in the event unsigned int GetNActiveTelescopes() const { return fTelescopes.size(); } /// Retrieve Telescope by Id, throw exception if not existent Telescope& GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status = ComponentSelector::eHasData); const Telescope& GetTelescope(const unsigned int telescopeId, const ComponentSelector::Status status = ComponentSelector::eHasData) const; /// Make Telescope telescopeId void MakeTelescope(const unsigned int telescopeId, const ComponentSelector::Status status = ComponentSelector::eHasData); /// Check if the telescope is in the event bool HasTelescope(const unsigned int telescopeId, const ComponentSelector::Status status = ComponentSelector::eHasData) const; /// selective Telescope iterators typedef boost::filter_iterator TelescopeIterator; typedef boost::filter_iterator ConstTelescopeIterator; /// iterator pointing to first available tel of given status TelescopeIterator TelescopesBegin(const ComponentSelector::Status status) { return TelescopeIterator(ComponentSelector(status), AllTelescopesBegin(), AllTelescopesEnd()); } /// first available tel of status eHasData (DEPRECATED) TelescopeIterator TelescopesBegin(); /// iterator pointing to end of available tel of given status TelescopeIterator TelescopesEnd(const ComponentSelector::Status status) { return TelescopeIterator(ComponentSelector(status), AllTelescopesEnd(), AllTelescopesEnd()); } /// first available tel of status eHasData (DEPRECATED) TelescopeIterator TelescopesEnd(); /// first available tel of given status ConstTelescopeIterator TelescopesBegin(const ComponentSelector::Status status) const { return ConstTelescopeIterator(ComponentSelector(status), AllTelescopesBegin(), AllTelescopesEnd()); } /// first available tel of status eHasData (DEPRECATED) ConstTelescopeIterator TelescopesBegin() const; /// end of available tel of given status ConstTelescopeIterator TelescopesEnd(const ComponentSelector::Status status) const { return ConstTelescopeIterator(ComponentSelector(status), AllTelescopesEnd(), AllTelescopesEnd()); } /// end of available tel of status eHasData (DEPRECATED) ConstTelescopeIterator TelescopesEnd() const; /// Header for this Eye Event fevt::EyeHeader& GetHeader(); const fevt::EyeHeader& GetHeader() const; void MakeHeader(); bool HasHeader() const { return fHeader; } /// Trigger data for this eye fevt::EyeTriggerData& GetTriggerData(); const fevt::EyeTriggerData& GetTriggerData() const; void MakeTriggerData(); bool HasTriggerData() const { return fTriggerData; } /// Reconstructed data for this eye fevt::EyeRecData& GetRecData(); const fevt::EyeRecData& GetRecData() const; void MakeRecData(); bool HasRecData() const { return fRecData; } ComponentSelector::Status GetStatus() const { return fStatus; } void SetStatus(const ComponentSelector::Status status) { fStatus = status; } private: Eye(const unsigned int eyeId, const ComponentSelector::Status status = ComponentSelector::eHasData); ~Eye(); void Clear(); unsigned int fId; InternalTelescopeContainer fTelescopes; utl::ShadowPtr fRecData; utl::ShadowPtr fTriggerData; utl::ShadowPtr fHeader; ComponentSelector::Status fStatus; friend class FEvent; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. FEvent/Eye.o -k" // End: