GammaLib
2.1.0.dev
|
Fermi/LAT point spread function version 1 class. More...
#include <GLATPsfV1.hpp>
Classes | |
class | base_integrand |
Public Member Functions | |
GLATPsfV1 (void) | |
Void constructor. More... | |
GLATPsfV1 (const GLATPsfV1 &psf) | |
Copy constructor. More... | |
virtual | ~GLATPsfV1 (void) |
Destructor. More... | |
GLATPsfV1 & | operator= (const GLATPsfV1 &psf) |
Assignment operator. More... | |
void | clear (void) |
Clear point spread function. More... | |
GLATPsfV1 * | clone (void) const |
Clone point spread function. More... | |
std::string | classname (void) const |
Return class name. More... | |
void | read (const GFitsTable &table) |
Read point spread function from FITS table. More... | |
void | write (GFits &file) const |
Write point spread function into FITS file. More... | |
double | psf (const double &offset, const double &logE, const double &ctheta) |
Return point spread function value. More... | |
int | version (void) const |
Return point spread function version number. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print point spread function. More... | |
Public Member Functions inherited from GLATPsfBase | |
GLATPsfBase (void) | |
Void constructor. More... | |
GLATPsfBase (const GLATPsfBase &psf) | |
Copy constructor. More... | |
virtual | ~GLATPsfBase (void) |
Destructor. More... | |
GLATPsfBase & | operator= (const GLATPsfBase &psf) |
Assignment operator. More... | |
void | read_scale (const GFitsTable &hdu) |
Read PSF scale factors from FITS table. More... | |
void | write_scale (GFits &file) const |
Write PSF scale factors. More... | |
int | size (void) const |
Return number of bins in point spread function. More... | |
int | nenergies (void) const |
Return number of energies in point spread function. More... | |
int | ncostheta (void) const |
Return number of cosine theta bins in point spread function. More... | |
const double & | costhetamin (void) const |
Return cosine theta minimum. More... | |
void | costhetamin (const double &ctheta) |
Set minimum cos(theta) angle for point spread function. More... | |
bool | has_phi (void) const |
Signal that point spread function has Phi dependence. More... | |
const bool & | front (void) const |
Signal that point spread function is for front section. More... | |
void | front (const bool &front) |
Set if point spread function is for front section. More... | |
const double & | scale_par1 (void) const |
Return first scaling parameter. More... | |
const double & | scale_par2 (void) const |
Return second scaling parameter. More... | |
const double & | scale_index (void) const |
Return scaling index. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Private Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GLATPsfV1 &psf) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Static Private Member Functions | |
static double | base_fct (const double &u, const double &gamma) |
Return point spread base function value. More... | |
static double | base_int (const double &u, const double &gamma) |
Return approximation of point spread base function integral. More... | |
Private Attributes | |
std::vector< double > | m_ncore |
PSF ncore parameter. More... | |
std::vector< double > | m_sigma |
PSF sigma parameter. More... | |
std::vector< double > | m_gcore |
PSF gcore parameter. More... | |
std::vector< double > | m_gtail |
PSF gtail parameter. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GLATPsfBase | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GLATPsfBase &psf) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
double | scale_factor (const double &energy) const |
Return scale factor for energy (in MeV) More... | |
Protected Attributes inherited from GLATPsfBase | |
bool | m_front |
PSF is for front section? More... | |
GLATResponseTable | m_rpsf_bins |
PSF energy and cos theta binning. More... | |
double | m_scale_par1 |
PSF scaling parameter 1. More... | |
double | m_scale_par2 |
PSF scaling parameter 2. More... | |
double | m_scale_index |
PSF scaling index. More... | |
double | m_min_ctheta |
Minimum valid cos(theta) More... | |
Fermi/LAT point spread function version 1 class.
This class has been inspired by code from the Fermi/LAT ScienceTools. For comparison check the file irfs/latResponse/src/Psf.h
Definition at line 47 of file GLATPsfV1.hpp.
GLATPsfV1::GLATPsfV1 | ( | void | ) |
Void constructor.
Definition at line 60 of file GLATPsfV1.cpp.
References init_members().
Referenced by clone().
GLATPsfV1::GLATPsfV1 | ( | const GLATPsfV1 & | psf | ) |
Copy constructor.
[in] | psf | Point spread function. |
Definition at line 75 of file GLATPsfV1.cpp.
References copy_members(), and init_members().
|
virtual |
|
staticprivate |
Return point spread base function value.
[in] | u | Function argument. |
[in] | gamma | Index. |
The version 1 PSF base function is given by
\[\left(1 - \frac{1}{\Gamma} \right) \left(1 + \frac{u}{\Gamma} \right)^{-\Gamma}\]
Definition at line 495 of file GLATPsfV1.cpp.
References pow().
Referenced by GLATPsfV1::base_integrand::eval(), and psf().
|
staticprivate |
Return approximation of point spread base function integral.
[in] | u | Function argument. |
[in] | gamma | Index. |
The version 1 PSF base function integral is approximated by
\[1 - \left(1 + \frac{u}{\Gamma} \right)^{1-\Gamma}\]
which is valid for small angles \(u\). For larger angles a numerical integration of the base function has to be performed.
Definition at line 522 of file GLATPsfV1.cpp.
References pow().
Referenced by psf().
|
inlinevirtual |
Return class name.
Implements GLATPsfBase.
Definition at line 115 of file GLATPsfV1.hpp.
|
virtual |
Clear point spread function.
Implements GLATPsfBase.
Definition at line 146 of file GLATPsfV1.cpp.
References free_members(), GLATPsfBase::free_members(), init_members(), and GLATPsfBase::init_members().
|
virtual |
Clone point spread function.
Implements GLATPsfBase.
Definition at line 166 of file GLATPsfV1.cpp.
References GLATPsfV1().
|
private |
Copy class members.
[in] | psf | Point spread function. |
Definition at line 462 of file GLATPsfV1.cpp.
References m_gcore, m_gtail, m_ncore, and m_sigma.
Referenced by GLATPsfV1(), and operator=().
|
private |
Delete class members.
Definition at line 478 of file GLATPsfV1.cpp.
Referenced by clear(), operator=(), and ~GLATPsfV1().
|
private |
Initialise class members.
Definition at line 444 of file GLATPsfV1.cpp.
References m_gcore, m_gtail, m_ncore, and m_sigma.
Referenced by clear(), GLATPsfV1(), and operator=().
Assignment operator.
[in] | psf | Point spread function. |
Definition at line 113 of file GLATPsfV1.cpp.
References copy_members(), free_members(), init_members(), and GLATPsfBase::operator=().
Print point spread function.
[in] | chatter | Chattiness (defaults to NORMAL). |
Implements GLATPsfBase.
Definition at line 417 of file GLATPsfV1.cpp.
References SILENT.
|
virtual |
Return point spread function value.
[in] | offset | Offset angle (deg). |
[in] | logE | Log10 of the true photon energy (MeV). |
[in] | ctheta | Cosine of zenith angle. |
Implements GLATPsfBase.
Definition at line 342 of file GLATPsfV1.cpp.
References base_fct(), base_int(), gammalib::deg2rad, GLATResponseTable::interpolate(), m_gcore, m_gtail, GLATPsfBase::m_min_ctheta, m_ncore, GLATPsfBase::m_rpsf_bins, m_sigma, norm(), gammalib::pihalf, pow(), GIntegral::romberg(), GLATPsfBase::scale_factor(), sum(), and gammalib::twopi.
|
virtual |
Read point spread function from FITS table.
[in] | table | FITS table. |
GException::invalid_argument | Inconsistent response table encountered |
Reads point spread function information from FITS HDU. In addition to the energy and costheta binning information, 4 columns are expected: NCORE, SIGMA, GCORE, and GTAIL.
Implements GLATPsfBase.
Definition at line 184 of file GLATPsfV1.cpp.
References GLATResponseTable::costheta_lo(), G_READ, m_gcore, m_gtail, GLATPsfBase::m_min_ctheta, m_ncore, GLATPsfBase::m_rpsf_bins, m_sigma, GFitsTableCol::number(), GLATResponseTable::read(), GFitsTableCol::real(), GLATPsfBase::size(), GLATResponseTable::size(), and gammalib::str().
|
inlinevirtual |
Return point spread function version number.
Implements GLATPsfBase.
Definition at line 127 of file GLATPsfV1.hpp.
|
virtual |
Write point spread function into FITS file.
[in] | file | FITS file. |
Writes the PSF into the extension "RPSF" of a FITS file. This method does not check if a "RPSF" extension exists so far, it simply adds one each time it is called.
Nothing is done if the PSF size is 0.
Implements GLATPsfBase.
Definition at line 276 of file GLATPsfV1.cpp.
References GFitsTable::append(), GFits::append(), GFitsHDU::card(), GFitsHDU::extname(), GLATPsfBase::front(), m_gcore, m_gtail, m_ncore, GLATPsfBase::m_rpsf_bins, m_sigma, GLATPsfBase::size(), GLATResponseTable::size(), and GLATResponseTable::write().
|
private |
PSF gcore parameter.
Definition at line 104 of file GLATPsfV1.hpp.
Referenced by copy_members(), init_members(), psf(), read(), and write().
|
private |
PSF gtail parameter.
Definition at line 105 of file GLATPsfV1.hpp.
Referenced by copy_members(), init_members(), psf(), read(), and write().
|
private |
PSF ncore parameter.
Definition at line 102 of file GLATPsfV1.hpp.
Referenced by copy_members(), init_members(), psf(), read(), and write().
|
private |
PSF sigma parameter.
Definition at line 103 of file GLATPsfV1.hpp.
Referenced by copy_members(), init_members(), psf(), read(), and write().