#ifndef _fdet_Pixel_h_ #define _fdet_Pixel_h_ /** \file \brief Description of a pixel. \author S. Argiro \author L. Prado Jr \author T. Paul \version $Id: Pixel.h 17917 2010-11-03 15:51:37Z colin $ \date 29 Jun 2003 */ #include #include #include #include #include #include namespace fdet { class Telescope; /** \class Pixel \brief Description of a pixel. \author S. Argiro \author L. Prado Jr \version $Id: Pixel.h 17917 2010-11-03 15:51:37Z colin $ \date 29 Jun 2003 \ingroup fdet */ class Pixel { public: enum Status { eGood = 0, eBadCalibration = 1, eUnknown }; void Update(); unsigned int GetRow(const unsigned int pixelid) const; unsigned int GetColumn(const unsigned int pixelid) const; /// pointing direction of this pixel const utl::Vector& GetDirection() const; const utl::CoordinateSystemPtr& GetPixelCoordinateSystem() const; /// end to end calibration at the reference wavelength double GetEndToEndCalibrationAtReferenceWavelength() const; /// end to end calibration function /** For an example of reading FD calibration constants, see the ReadFDCalibNS::ReadFDCalib example. See also: GetEndToEndCalibrationAtReferenceWavelength()! */ const utl::TabulatedFunction& GetEndToEndCalibration() const; double GetEndToEndCalibration(const double wavelength) const; /// for the simulated end-to-end calibration constant double GetSimulatedEndToEndCalibration(const std::string& configSignature) const; // double GetSimulatedEndToEndCalibration(const std::string& configSignature, const double wl) const; double GetDiaPhoton2ADC(const std::string& configSignature, const double wavelength) const; /// Get the pixel status flag Status GetStatus() const; /// pixel time offset double GetTimeOffset() const; /// By default from 1..440 unsigned int GetId() const { return fPixelId; } unsigned int GetChannelId() const; bool IsMismatched() const { return (GetChannelId() != GetId()); } /// 1..6 for normal FD, 1..3 for HEAT unsigned int GetTelescopeId() const { return fTelescopeId; } /// 1..5 (4x normal FD, 1x HEAT) unsigned int GetEyeId() const { return fEyeId; } unsigned int GetRow() const { return GetRow(fPixelId); } unsigned int GetColumn() const { return GetColumn(fPixelId); } /// The solid angle viewed by this pixel double GetSolidAngle() const; /// Average quantum efficiency as a function of the wavelength const utl::TabulatedFunction& GetQEfficiency() const; double GetDiaPhoton2PEFactor(const double wavelength) const; /// how much of pixel is obscured by clouds float GetCloudFraction() const; bool HasCloudFraction() const; bool IsObscuredByCloud() const { return GetCloudIndex() > 0; } /// Access the telescope this Pixel belongs to const Telescope& GetTelescope() const; private: Pixel(const unsigned int eyeId, const unsigned int telescopeId, const unsigned int pixelId, const std::string& physEyeIdString, const std::string& physTelIdString); ~Pixel(); // prevent copying Pixel(const Pixel&); Pixel& operator=(const Pixel&); mutable utl::Vector fDirection; mutable utl::CoordinateSystemPtr fCoordinateSystem; mutable utl::TabulatedFunction fWavelengthCalib; // filled by Telescope mutable double* fTimeOffset; mutable Status fPixelStatus; mutable double* fSimulatedEndToEnd; unsigned int fEyeId; unsigned int fTelescopeId; unsigned int fPixelId; std::string fPhysicalEyeIdString; std::string fPhysicalTelescopeIdString; std::string fPixelIdString; mutable double* fSolidAngle; mutable utl::TabulatedFunction* fQEfficiency; mutable int fCloudIndex; mutable det::ValidityStamp fCloudValidityStamp; template const T& GetPixelData(T*& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg, const std::string& extraIndex = "") const; template void GetPixelData(T& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg, const std::string& extraIndex = "") const; template const T& GetPixelDataDiaphragm(T*& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg) const; template void GetPixelDataDiaphragm(T& requestedData, const std::string& property, const std::string& component, const std::string& errorMsg) const; /// Cloud index in strange units. To access please use GetCloudFraction() int GetCloudIndex() const; friend class fdet::Telescope; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. FDetector/Pixel.o -k" // End: