// $Id$ #ifndef __TelescopeGeometry_H #define __TelescopeGeometry_H #include #include #include #include // class to hold FD event class TelescopeGeometry : public TObject { public: typedef std::vector PixelList_t; typedef PixelList_t::iterator PixelIterator; typedef PixelList_t::const_iterator ConstPixelIterator; public: TelescopeGeometry(const std::map& telElevations, const std::map& telAzimuths, const UInt_t nFADC, const Double_t bFADC, const std::map& telPixPhis, const std::map& telPixOmegas); TelescopeGeometry(); bool HasPixel(const UInt_t id) const { return id < fPixelPhi.size(); } /// pixel ID iPix [0:TelescopeGeometry::fgNumberOfPixels[ Double_t GetPixelPhi(const UInt_t iPix, TString pointingId) const; /// pixel ID iPix [0:TelescopeGeometry::fgNumberOfPixels[ Double_t GetPixelOmega(const UInt_t iPix, TString pointingId) const; /// Get the azimuthal PixelList_t for a given pointing id (cf. Detector) const PixelList_t& GetPixelsPhi(TString pointingId) const; /// Get the zenith PixelList_t for a given pointing id (cf. Detector) const PixelList_t& GetPixelsOmega(TString pointingId) const; /// Get a list of solid angles const PixelList_t& GetSolidAngles() const { return fSolidAngles; } /// Get a list of solid angles PixelList_t& GetSolidAngles() { return fSolidAngles; } /// Get the solid angle of a specific pixel double GetSolidAngle(const UInt_t iPix) const; Double_t GetPixelMinPhi(const TString& pointingId) const; Double_t GetPixelMaxPhi(const TString& pointingId) const; Double_t GetPixelMinOmega(const TString& pointingId) const; Double_t GetPixelMaxOmega(const TString& pointingId) const; UInt_t GetFADCSize() const { return fNBinsFADC; } Double_t GetFADCBinning() const { return fBinningFADC; } /// get the number of mirrors of eye "eyeid" UShort_t GetNumberOfPixels() const; Double_t GetElevation(TString pointingId) const; Double_t GetAzimuth(TString pointingId) const; /// get the camera column given pixel ID [1-fgNumberOfPixels] static unsigned int GetRow(const unsigned int id); /// get the camera row given pixel ID [1-fgNumberOfPixels] static unsigned int GetColumn(const unsigned int id); /// Check if a telescope pointing of the given id exists bool HasPointing(const TString& pointingId) const; /// Add a new telescope pointing to the object void AddPointing(const TString& pointingId, const Double_t phi, const Double_t elevation, const TelescopeGeometry::PixelList_t& pixPhis, const TelescopeGeometry::PixelList_t& pixOmegas); /// Returns a vector of telescope pointing ids std::vector GetPointingIds() const; /** Merge the telescope pointings with those of another * TelescopeGeometry and store them in the object. * Returns ture if the object was modified. * The object into which the information is merged takes precedence * on conflicts. */ bool MergeTelescopeFrom(const TelescopeGeometry& source); static UInt_t GetMaxNumberOfPixelsPerCamera() { return fgNumberOfPixels; } private: void CalculateMinMaxFOV(TString pointingId) const; /** Infers the default pointing id from the available ones. * Chooses the lowest pointing by default. */ void GuessDefaultPointing(); private: static const UInt_t fgNumberOfPixels; // from Offlines fdet::Telescope static const unsigned int fgFirstPixel = 1; static const unsigned int fgLastPixel = 440; static const unsigned int fgFirstChannel = 1; static const unsigned int fgLastChannel = 480; static const unsigned int fgFirstRow = 1; static const unsigned int fgFirstColumn = 1; static const unsigned int fgLastRow = 22; static const unsigned int fgLastColumn = 20; private: TString fDefaultFOVId; /// The default id of the telescope pointing PixelList_t fPixelPhi; /// default azimuth [deg] PixelList_t fPixelOmega; /// default elevation angle [deg] PixelList_t fSolidAngles; /// solid angles (obviously independent of pointing) std::map fTelPointingPixelPhi; /// azimuths for various telescope pointings [deg] std::map fTelPointingPixelOmega; /// elevation angles for various telescope pointings [deg] UInt_t fNBinsFADC; Double_t fBinningFADC; Double_t fElevation; Double_t fAzimuth; std::map fTelPointingElevation; std::map fTelPointingAzimuth; // fast access pfusch --------- // The "slash-slash-exclamation-mark" pfusch means that these aren't streamed. mutable TString fCurrentFOVId; //! mutable Double_t fMinPhi; //! mutable Double_t fMinOmega; //! mutable Double_t fMaxPhi; //! mutable Double_t fMaxOmega; //! // ----------------------------- ClassDef(TelescopeGeometry, 7); }; #endif