GammaLib
2.0.0
|
Interface for the Fermi LAT point spread function. More...
#include <GLATPsf.hpp>
Public Member Functions | |
GLATPsf (void) | |
Void constructor. More... | |
GLATPsf (const GFilename &filename, const std::string &evtype) | |
File constructor. More... | |
GLATPsf (const GLATPsf &psf) | |
Copy constructor. More... | |
virtual | ~GLATPsf (void) |
Destructor. More... | |
GLATPsf & | operator= (const GLATPsf &psf) |
Assignment operator. More... | |
double | operator() (const double &offset, const double &logE, const double &ctheta) |
Return point spread function value. More... | |
void | clear (void) |
Clear instance. More... | |
GLATPsf * | clone (void) const |
Clone instance. More... | |
std::string | classname (void) const |
Return class name. More... | |
const std::string & | evtype (void) const |
Return event type. More... | |
void | load (const GFilename &filename, const std::string &evtype) |
Load point spread function from FITS file. More... | |
void | save (const GFilename &filename, const bool &clobber=false) |
Save point spread function into FITS file. More... | |
void | read (const GFits &file, const std::string &evtype) |
Read point spread function from FITS file. More... | |
void | write (GFits &file) const |
Write point spread function into FITS file. More... | |
int | size (void) const |
Returns size of PSF. More... | |
int | nenergies (void) const |
Returns number of energy bins in PSF. More... | |
int | ncostheta (void) const |
Returns number of cos(theta) bins in PSF. More... | |
double | costhetamin (void) const |
Returns minimum cos(theta) angle. More... | |
void | costhetamin (const double &ctheta) |
Set minimum cos(theta) angle for point spread function access. More... | |
bool | has_phi (void) const |
Signals if PSF has phi dependence. More... | |
int | version (void) const |
Returns PSF version. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print point spread function information. 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 GLATPsf &psf) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Private Attributes | |
std::string | m_evtype |
Event type. More... | |
GLATPsfBase * | m_psf |
Pointer to versioned point spread function. More... | |
Interface for the Fermi LAT point spread function.
This class provides the interface to the Fermi LAT point spread function (PSF). An instance of the class holds the PSF for a specific event type. The class handles different PSF versions by holding a pointer to the versioned PSF, which is defined by the abstract base class GLATPsfBase. On loading (or reading) of the PSF information from the FITS file, the appropriate versioned PSF will be allocated.
Definition at line 54 of file GLATPsf.hpp.
GLATPsf::GLATPsf | ( | void | ) |
Void constructor.
Constructs an empty Fermi LAT point spread function.
Definition at line 65 of file GLATPsf.cpp.
References init_members().
Referenced by clone().
GLATPsf::GLATPsf | ( | const GFilename & | filename, |
const std::string & | evtype | ||
) |
File constructor.
[in] | filename | FITS file name. |
[in] | evtype | Event type. |
Constructs a Fermi LAT point spread function by loading the point spread function for a given event type from a FITS response file.
Definition at line 84 of file GLATPsf.cpp.
References init_members(), and load().
GLATPsf::GLATPsf | ( | const GLATPsf & | psf | ) |
Copy constructor.
[in] | psf | Point spread function. |
Constructs point spread function by copying point spread function from another object.
Definition at line 105 of file GLATPsf.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 106 of file GLATPsf.hpp.
|
virtual |
Clear instance.
This method properly resets the object to an initial state.
Implements GBase.
Definition at line 199 of file GLATPsf.cpp.
References free_members(), and init_members().
Referenced by read().
|
virtual |
Clone instance.
Implements GBase.
Definition at line 217 of file GLATPsf.cpp.
References GLATPsf().
|
private |
Copy class members.
[in] | psf | Point spread function. |
Definition at line 563 of file GLATPsf.cpp.
References GLATPsfBase::clone(), m_evtype, and m_psf.
Referenced by GLATPsf(), and operator=().
double GLATPsf::costhetamin | ( | void | ) | const |
Returns minimum cos(theta) angle.
Returns the minimum cos(theta) angle for point spread function access. If no PSF has been allocated, 0 is returned.
Definition at line 445 of file GLATPsf.cpp.
References GLATPsfBase::costhetamin(), and m_psf.
void GLATPsf::costhetamin | ( | const double & | ctheta | ) |
Set minimum cos(theta) angle for point spread function access.
[in] | ctheta | Cosine of maximum zenith angle. |
Sets the minimum cos(theta) angle. No verification of the specified maximum cos(theta) value is done.
Definition at line 463 of file GLATPsf.cpp.
References GLATPsfBase::costhetamin(), and m_psf.
|
inline |
Return event type.
Returns the event type for this point spread function.
Definition at line 120 of file GLATPsf.hpp.
References m_evtype.
|
private |
Delete class members.
Definition at line 584 of file GLATPsf.cpp.
References m_psf.
Referenced by clear(), operator=(), and ~GLATPsf().
|
inline |
Signals if PSF has phi dependence.
Definition at line 132 of file GLATPsf.hpp.
|
private |
Initialise class members.
Definition at line 547 of file GLATPsf.cpp.
References m_evtype, and m_psf.
Referenced by clear(), GLATPsf(), and operator=().
void GLATPsf::load | ( | const GFilename & | filename, |
const std::string & | evtype | ||
) |
Load point spread function from FITS file.
[in] | filename | FITS file. |
[in] | evtype | Event type. |
Loads Fermi/LAT point spread function from FITS file.
Definition at line 231 of file GLATPsf.cpp.
References read().
Referenced by GLATPsf().
int GLATPsf::ncostheta | ( | void | ) | const |
Returns number of cos(theta) bins in PSF.
Returns the number of cos(theta) bins in PSF. If no PSF has been allocated, 0 is returned.
Definition at line 427 of file GLATPsf.cpp.
References m_psf, and GLATPsfBase::ncostheta().
Referenced by size().
int GLATPsf::nenergies | ( | void | ) | const |
Returns number of energy bins in PSF.
Returns the number of energy bins in PSF. If no PSF has been allocated, 0 is returned.
Definition at line 409 of file GLATPsf.cpp.
References m_psf, and GLATPsfBase::nenergies().
Referenced by size().
double GLATPsf::operator() | ( | const double & | offset, |
const double & | logE, | ||
const double & | ctheta | ||
) |
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. |
Returns the PSF value as function of the offset angle, the base 10 logarithm of the energy, and the cosine of the zenith angle. This method calls the version dependent method.
Returns 0 is no PSF has been allocated.
Definition at line 177 of file GLATPsf.cpp.
References m_psf, and GLATPsfBase::psf().
Assignment operator.
[in] | psf | Point spread function. |
Definition at line 143 of file GLATPsf.cpp.
References copy_members(), free_members(), and init_members().
Print point spread function information.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 501 of file GLATPsf.cpp.
References evtype(), m_psf, gammalib::parformat(), GLATPsfBase::scale_index(), GLATPsfBase::scale_par1(), GLATPsfBase::scale_par2(), SILENT, gammalib::str(), and version().
void GLATPsf::read | ( | const GFits & | fits, |
const std::string & | evtype | ||
) |
Read point spread function from FITS file.
[in] | fits | FITS file. |
[in] | evtype | Event type. |
GException::invalid_value | Unsupported response version found. |
Reads the Fermi LAT point spread function from FITS file. The method determines the PSF version from the information found in the FITS file and allocates the proper PSF version class. It reads the PSF information from the FITS file.
Definition at line 284 of file GLATPsf.cpp.
References clear(), GFits::contains(), evtype(), GLATPsfBase::front(), G_READ, GFitsHDU::has_card(), GFitsHDU::integer(), m_evtype, m_psf, GLATPsfBase::read(), GLATPsfBase::read_scale(), gammalib::str(), GFitsHDU::string(), gammalib::strip_whitespace(), GFits::table(), gammalib::toupper(), and version().
Referenced by load().
void GLATPsf::save | ( | const GFilename & | filename, |
const bool & | clobber = false |
||
) |
Save point spread function into FITS file.
[in] | filename | FITS file. |
[in] | clobber | Overwrite existing file? |
Saves Fermi/LAT point spread function into FITS file.
Definition at line 252 of file GLATPsf.cpp.
References GFits::saveto(), and write().
int GLATPsf::size | ( | void | ) | const |
Returns size of PSF.
Returns the size of the PSF which is defined as the number of energy bins times the number of cos(theta) bins. If no PSF has been allocated, 0 is returned.
Definition at line 394 of file GLATPsf.cpp.
References ncostheta(), and nenergies().
int GLATPsf::version | ( | void | ) | const |
Returns PSF version.
Returns the PSF version number.
Returns 0 if no PSF has been allocated.
Definition at line 485 of file GLATPsf.cpp.
References m_psf, and GLATPsfBase::version().
void GLATPsf::write | ( | GFits & | fits | ) | const |
Write point spread function into FITS file.
[in] | fits | FITS file. |
Writes the version dependent point spread function into the FITS file. The method does nothing if no PSF has been allocated.
Definition at line 367 of file GLATPsf.cpp.
References m_psf, GLATPsfBase::write(), and GLATPsfBase::write_scale().
Referenced by save().
|
private |
Event type.
Definition at line 95 of file GLATPsf.hpp.
Referenced by copy_members(), evtype(), init_members(), and read().
|
private |
Pointer to versioned point spread function.
Definition at line 96 of file GLATPsf.hpp.
Referenced by copy_members(), costhetamin(), free_members(), init_members(), ncostheta(), nenergies(), operator()(), print(), read(), version(), and write().