From 26ff15609d6215c9f8d2425f8f01beb77a2b18fe Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Sat, 1 Mar 2008 01:08:26 +0000 Subject: [PATCH] implement LAT PSF get dummy --- include/GLATResponse.hpp | 1 + src/rsp/GLATResponse.cpp | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/include/GLATResponse.hpp b/include/GLATResponse.hpp index 19b08d4..dd4ef56 100644 --- a/include/GLATResponse.hpp +++ b/include/GLATResponse.hpp @@ -78,6 +78,7 @@ private: // Private PSF methods void psf_init(void); + double psf_get(const double& delta, const double& logE, const double& ctheta); double psf_scale(const double& energy); double psf_base_value(const double& u, const double& gamma); GVector psf_base_vector(const GVector& u, const double& gamma); diff --git a/src/rsp/GLATResponse.cpp b/src/rsp/GLATResponse.cpp index 63d0404..ce7a9af 100644 --- a/src/rsp/GLATResponse.cpp +++ b/src/rsp/GLATResponse.cpp @@ -424,6 +424,40 @@ void GLATResponse::psf_init(void) /*************************************************************************** + * Get PSF value * + * ----------------------------------------------------------------------- * + ***************************************************************************/ +/// Returns the GLAST LAT PSF value +/// @param delta angular separation between true and observed photon direction +/// @param logE logarithm of the true photon energy +/// @param ctheta cosine of the zenith angle with respect to the pointing axis +double GLATResponse::psf_get(const double& delta, const double& logE, const double& ctheta) +{ + // Interpolate sigma and norm tables + double sigma = 1.0; // Perform bi-linear interpolation in logE and ctheta + double norm = 1.0; // Perform bi-linear interpolation in logE and ctheta + + // Evaluate scale + double energy = pow(10.0,logE); // DUMMY: t=(0.01*(10.0^logE))^-0.8 + double scale = psf_scale(energy); + + // Get stretch factor + double stretch = sigma * scale; + + // Get PSF value from table + double r = delta * deg2rad / stretch; // in radians + int inx = (r - m_psf_angle_min) / m_psf_angle_bin; // Perform linear interpolation + double psf = 1.0; + + // Normalize PSF + psf *= norm; + + // Return PSF value + return psf; +} + + +/*************************************************************************** * Returns PSF scale * * ----------------------------------------------------------------------- * ***************************************************************************/ -- libgit2 0.21.4