Commit 26ff15609d6215c9f8d2425f8f01beb77a2b18fe
1 parent
83baaaa0
implement LAT PSF get dummy
Showing
2 changed files
with
35 additions
and
0 deletions
include/GLATResponse.hpp
| @@ -78,6 +78,7 @@ private: | @@ -78,6 +78,7 @@ private: | ||
| 78 | 78 | ||
| 79 | // Private PSF methods | 79 | // Private PSF methods |
| 80 | void psf_init(void); | 80 | void psf_init(void); |
| 81 | + double psf_get(const double& delta, const double& logE, const double& ctheta); | ||
| 81 | double psf_scale(const double& energy); | 82 | double psf_scale(const double& energy); |
| 82 | double psf_base_value(const double& u, const double& gamma); | 83 | double psf_base_value(const double& u, const double& gamma); |
| 83 | GVector psf_base_vector(const GVector& u, const double& gamma); | 84 | GVector psf_base_vector(const GVector& u, const double& gamma); |
src/rsp/GLATResponse.cpp
| @@ -424,6 +424,40 @@ void GLATResponse::psf_init(void) | @@ -424,6 +424,40 @@ void GLATResponse::psf_init(void) | ||
| 424 | 424 | ||
| 425 | 425 | ||
| 426 | /*************************************************************************** | 426 | /*************************************************************************** |
| 427 | + * Get PSF value * | ||
| 428 | + * ----------------------------------------------------------------------- * | ||
| 429 | + ***************************************************************************/ | ||
| 430 | +/// Returns the GLAST LAT PSF value | ||
| 431 | +/// @param delta angular separation between true and observed photon direction | ||
| 432 | +/// @param logE logarithm of the true photon energy | ||
| 433 | +/// @param ctheta cosine of the zenith angle with respect to the pointing axis | ||
| 434 | +double GLATResponse::psf_get(const double& delta, const double& logE, const double& ctheta) | ||
| 435 | +{ | ||
| 436 | + // Interpolate sigma and norm tables | ||
| 437 | + double sigma = 1.0; // Perform bi-linear interpolation in logE and ctheta | ||
| 438 | + double norm = 1.0; // Perform bi-linear interpolation in logE and ctheta | ||
| 439 | + | ||
| 440 | + // Evaluate scale | ||
| 441 | + double energy = pow(10.0,logE); // DUMMY: t=(0.01*(10.0^logE))^-0.8 | ||
| 442 | + double scale = psf_scale(energy); | ||
| 443 | + | ||
| 444 | + // Get stretch factor | ||
| 445 | + double stretch = sigma * scale; | ||
| 446 | + | ||
| 447 | + // Get PSF value from table | ||
| 448 | + double r = delta * deg2rad / stretch; // in radians | ||
| 449 | + int inx = (r - m_psf_angle_min) / m_psf_angle_bin; // Perform linear interpolation | ||
| 450 | + double psf = 1.0; | ||
| 451 | + | ||
| 452 | + // Normalize PSF | ||
| 453 | + psf *= norm; | ||
| 454 | + | ||
| 455 | + // Return PSF value | ||
| 456 | + return psf; | ||
| 457 | +} | ||
| 458 | + | ||
| 459 | + | ||
| 460 | +/*************************************************************************** | ||
| 427 | * Returns PSF scale * | 461 | * Returns PSF scale * |
| 428 | * ----------------------------------------------------------------------- * | 462 | * ----------------------------------------------------------------------- * |
| 429 | ***************************************************************************/ | 463 | ***************************************************************************/ |