#ifndef _fdet_FDetector_h_ #define _fdet_FDetector_h_ #include #include #include #include #include #include namespace det { class Detector; } namespace fevt { class Channel; class Pixel; class Eye; class Telescope; } namespace fdet { class Eye; class Channel; class Pixel; class Telescope; /** \class FDetector FDetector.h "fdet/FDetector.h" \brief Detector description interface for FDetector-related data \author S. Argiro \author T. Paul \date 4 March 2003 \version $Id: FDetector.h 22995 2013-03-14 16:20:31Z porcelli $ \ingroup fdet */ class FDetector { private: // FDetector offers only const list interface to const Eyes typedef std::list InternalEyeIdCollection; typedef std::list InternalEyeCollection; typedef InternalEyeCollection::const_iterator InternalEyeIterator; /// An iterator over eyes for read only typedef boost::indirect_iterator AllEyeIterator; AllEyeIterator AllEyesBegin() const { return AllEyeIterator(fCommissionedEyeList.begin()); } AllEyeIterator AllEyesEnd() const { return AllEyeIterator(fCommissionedEyeList.end()); } public: /// Get Id of first eye unsigned int GetFirstEyeId() const; /// Get Id of last eye unsigned int GetLastEyeId() const; /// An iterator over eyes /// selective Eye iterators typedef boost::filter_iterator EyeIterator; /// iterator pointing to first eye of given type (ePhysical, eVirtual, eAll) EyeIterator EyesBegin(const FDetComponentSelector::Type type = FDetComponentSelector::ePhysical) const { return EyeIterator(FDetComponentSelector(type), AllEyesBegin(), AllEyesEnd()); } /// iterator pointing to end of available eyes of given type (ePhysical, eVirtual, eAll) EyeIterator EyesEnd(const FDetComponentSelector::Type type = FDetComponentSelector::ePhysical) const { return EyeIterator(FDetComponentSelector(type), AllEyesEnd(), AllEyesEnd()); } /// Find eye by numerical Id const Eye& GetEye(const unsigned int eyeId) const; /// Find eye by name const Eye& GetEye(const std::string& eyeName) const; ///Get fdet::Eye from fevt::Eye const Eye& GetEye(const fevt::Eye& eventEye) const; ///Get fdet::Telescope from fevt::Telescope const Telescope& GetTelescope(const fevt::Telescope& eventTel) const; ///Get fdet::Channel from fevt::Channel const Channel& GetChannel(const fevt::Channel& eventChannel) const; const Channel& GetChannel(const fdet::Pixel& p) const; const Channel& GetChannel(const fevt::Pixel& p) const; ///Get fdet::Pixel from fevt::Channel const Pixel& GetPixel(const fevt::Pixel& eventPixel) const; const Pixel& GetPixel(const fevt::Channel& c) const; const Pixel& GetPixel(const fdet::Channel& c) const; // dynamic up time data double GetCDASUpTimeFraction() const; //double GetCDASVetoFraction() const; bool IsCDASInAquisition() const; int GetCDASDAQStatus() const; bool HasFdUpTime() const; double GetModelMinWavelength() const; double GetModelMaxWavelength() const; // reference wavelength to be used for all calculations double GetReferenceLambda() const; private: template inline const T& GetFDetectorData(T*& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg) const; template inline void GetFDetectorData(T& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg) const; private: FDetector() : fFullEyeList(0), fReferenceLambda(0) { } ~FDetector(); FDetector(const FDetector&); FDetector& operator=(const FDetector&); void Update(); void UpdateFdUpTime() const; const InternalEyeIdCollection& GetFullEyeList() const; // Container for all commissioned Eyes (note that, currently, all eyes found // in the external file (XML file or possibly database) are // considered to be "commissioned." Individual telescopes within eyes, however, will // have real commission and decommission times associated with them,however.) // mutable InternalEyeCollection fCommissionedEyeList; // List of all eyes available in the external sources // (external sources are, for example, the XML file containing // the telescope/eye list or perhaps at some point a MySQL database mutable InternalEyeIdCollection* fFullEyeList; // up time info mutable det::ValidityStamp fUpTimeValidityStamp; mutable double fUpTimeFraction; mutable double fVetoFraction; mutable int fStatus; mutable int fHasFdUpTime; mutable double * fReferenceLambda; friend class det::Detector; }; } // namespace fdet #endif // _fdet_FDetector_h_ // Configure (x)emacs for this file ... // Local Variables: // mode:c++ // compile-command: "make -C .. -k" // End: