GammaLib
2.0.0
|
CTA performance table point spread function class. More...
#include <GCTAPsfPerfTable.hpp>
Public Member Functions | |
GCTAPsfPerfTable (void) | |
Void constructor. More... | |
GCTAPsfPerfTable (const GFilename &filename) | |
File constructor. More... | |
GCTAPsfPerfTable (const GCTAPsfPerfTable &psf) | |
Copy constructor. More... | |
virtual | ~GCTAPsfPerfTable (void) |
Destructor. More... | |
GCTAPsfPerfTable & | operator= (const GCTAPsfPerfTable &psf) |
Assignment operator. More... | |
double | operator() (const double &delta, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const |
Return point spread function (in units of sr^-1) More... | |
void | clear (void) |
Clear instance. More... | |
GCTAPsfPerfTable * | clone (void) const |
Clone instance. More... | |
std::string | classname (void) const |
Return class name. More... | |
void | load (const GFilename &filename) |
Load point spread function from performance table. More... | |
GFilename | filename (void) const |
Return filename. More... | |
double | mc (GRan &ran, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const |
Simulate PSF offset (radians) More... | |
double | delta_max (const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const |
Return maximum size of PSF (radians) More... | |
double | containment_radius (const double &fraction, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const |
Return the radius that contains a fraction of the events (radians) More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print point spread function information. More... | |
Public Member Functions inherited from GCTAPsf | |
GCTAPsf (void) | |
Void constructor. More... | |
GCTAPsf (const GCTAPsf &psf) | |
Copy constructor. More... | |
virtual | ~GCTAPsf (void) |
Destructor. More... | |
GCTAPsf & | operator= (const GCTAPsf &psf) |
Assignment operator. 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 GCTAPsfPerfTable &psf) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | update (const double &logE) const |
Update PSF parameter cache. More... | |
Private Attributes | |
GFilename | m_filename |
Name of Aeff response file. More... | |
GNodeArray | m_logE |
log(E) nodes for Aeff interpolation More... | |
std::vector< double > | m_r68 |
68% containment radius of PSF in degrees More... | |
std::vector< double > | m_r80 |
80% containment radius of PSF in degrees More... | |
std::vector< double > | m_sigma |
Sigma value of PSF in radians. More... | |
double | m_par_logE |
Energy for which precomputation is done. More... | |
double | m_par_scale |
Gaussian normalization. More... | |
double | m_par_sigma |
Gaussian sigma (radians) More... | |
double | m_par_width |
Gaussian width parameter. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GCTAPsf | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GCTAPsf &psf) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
CTA performance table point spread function class.
This class implements the CTA point spread function response as function of energy as determined from a performance table. The performance table is an ASCII file that specifies the CTA performance parameters in a simple way.
Definition at line 50 of file GCTAPsfPerfTable.hpp.
GCTAPsfPerfTable::GCTAPsfPerfTable | ( | void | ) |
Void constructor.
Definition at line 63 of file GCTAPsfPerfTable.cpp.
References init_members().
Referenced by clone().
GCTAPsfPerfTable::GCTAPsfPerfTable | ( | const GFilename & | filename | ) |
File constructor.
[in] | filename | Performance table file name. |
Construct instance by loading the point spread function information from an ASCII performance table.
Definition at line 81 of file GCTAPsfPerfTable.cpp.
References init_members(), and load().
GCTAPsfPerfTable::GCTAPsfPerfTable | ( | const GCTAPsfPerfTable & | psf | ) |
Copy constructor.
[in] | psf | Point spread function. |
Definition at line 99 of file GCTAPsfPerfTable.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GCTAPsf.
Definition at line 125 of file GCTAPsfPerfTable.hpp.
|
virtual |
Clear instance.
This method properly resets the object to an initial state.
Implements GCTAPsf.
Definition at line 224 of file GCTAPsfPerfTable.cpp.
References GCTAPsf::free_members(), free_members(), GCTAPsf::init_members(), and init_members().
|
virtual |
Clone instance.
Implements GCTAPsf.
Definition at line 244 of file GCTAPsfPerfTable.cpp.
References GCTAPsfPerfTable().
|
virtual |
Return the radius that contains a fraction of the events (radians)
[in] | fraction | of events (0.0-1.0) |
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | theta | Offset angle in camera system (rad). Not used. |
[in] | phi | Azimuth angle in camera system (rad). Not used. |
[in] | zenith | Zenith angle in Earth system (rad). Not used. |
[in] | azimuth | Azimuth angle in Earth system (rad). Not used. |
[in] | etrue | Use true energy (true/false). Not used. |
GException::invalid_argument | Invalid fraction specified. |
Evaluates:
\[ radius = \sqrt{ \frac{\ln{\left( \frac{ fraction * m\_par\_width} {\pi*m\_par\_scale} +1\right)}}{m\_par\_width} } \]
which is derived by integrating
\[ fraction = \int_{0}^{2\pi}\int_{0}^{radius}r * e^{ m\_par\_width * r^{2}}dr d\phi \]
and solving for radius.
Calculate the radius from the center that contains 'fraction' percent of the events. fraction * 100. = Containment % .
Implements GCTAPsf.
Definition at line 425 of file GCTAPsfPerfTable.cpp.
References G_CONTAINMENT_RADIUS, log(), m_par_scale, m_par_width, gammalib::pi, sqrt(), gammalib::str(), and update().
|
private |
Copy class members.
[in] | psf | Point spread function. |
Definition at line 521 of file GCTAPsfPerfTable.cpp.
References m_filename, m_logE, m_par_logE, m_par_scale, m_par_sigma, m_par_width, m_r68, m_r80, and m_sigma.
Referenced by GCTAPsfPerfTable(), and operator=().
|
virtual |
Return maximum size of PSF (radians)
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | theta | Offset angle in camera system (rad). Not used. |
[in] | phi | Azimuth angle in camera system (rad). Not used. |
[in] | zenith | Zenith angle in Earth system (rad). Not used. |
[in] | azimuth | Azimuth angle in Earth system (rad). Not used. |
[in] | etrue | Use true energy (true/false). Not used. |
Determine the radius beyond which the PSF becomes negligible. This radius is set by this method to \(5 \times \sigma\), where \(\sigma\) is the Gaussian width of the largest PSF component.
Implements GCTAPsf.
Definition at line 369 of file GCTAPsfPerfTable.cpp.
References m_par_sigma, and update().
|
inlinevirtual |
Return filename.
Implements GCTAPsf.
Definition at line 137 of file GCTAPsfPerfTable.hpp.
References m_filename.
Referenced by load().
|
private |
Delete class members.
Definition at line 542 of file GCTAPsfPerfTable.cpp.
Referenced by clear(), operator=(), and ~GCTAPsfPerfTable().
|
private |
Initialise class members.
Definition at line 498 of file GCTAPsfPerfTable.cpp.
References GNodeArray::clear(), GFilename::clear(), m_filename, m_logE, m_par_logE, m_par_scale, m_par_sigma, m_par_width, m_r68, m_r80, and m_sigma.
Referenced by clear(), GCTAPsfPerfTable(), and operator=().
|
virtual |
Load point spread function from performance table.
[in] | filename | Performance table file name. |
GException::file_error | File could not be opened for read access. |
This method loads the point spread function information from an ASCII performance table.
Implements GCTAPsf.
Definition at line 261 of file GCTAPsfPerfTable.cpp.
References GNodeArray::append(), GNodeArray::clear(), gammalib::deg2rad, filename(), G_LOAD, m_filename, m_logE, m_r68, m_r80, m_sigma, gammalib::split(), gammalib::strip_whitespace(), gammalib::todouble(), and GFilename::url().
Referenced by GCTAPsfPerfTable().
|
virtual |
Simulate PSF offset (radians)
[in] | ran | Random number generator. |
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | theta | Offset angle in camera system (rad). Not used. |
[in] | phi | Azimuth angle in camera system (rad). Not used. |
[in] | zenith | Zenith angle in Earth system (rad). Not used. |
[in] | azimuth | Azimuth angle in Earth system (rad). Not used. |
[in] | etrue | Use true energy (true/false). Not used. |
Implements GCTAPsf.
Definition at line 336 of file GCTAPsfPerfTable.cpp.
References GRan::chisq2(), m_par_sigma, and update().
|
virtual |
Return point spread function (in units of sr^-1)
[in] | delta | Angular separation between true and measured photon directions (rad). |
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | theta | Offset angle in camera system (rad). Not used. |
[in] | phi | Azimuth angle in camera system (rad). Not used. |
[in] | zenith | Zenith angle in Earth system (rad). Not used. |
[in] | azimuth | Azimuth angle in Earth system (rad). Not used. |
[in] | etrue | Use true energy (true/false). Not used. |
Returns the point spread function for a given angular separation in units of sr^-1 for a given energy.
Implements GCTAPsf.
Definition at line 176 of file GCTAPsfPerfTable.cpp.
References exp(), m_par_scale, m_par_width, and update().
GCTAPsfPerfTable & GCTAPsfPerfTable::operator= | ( | const GCTAPsfPerfTable & | psf | ) |
Assignment operator.
[in] | psf | Point spread function. |
Definition at line 137 of file GCTAPsfPerfTable.cpp.
References copy_members(), free_members(), init_members(), and GCTAPsf::operator=().
Print point spread function information.
[in] | chatter | Chattiness. |
Implements GCTAPsf.
Definition at line 459 of file GCTAPsfPerfTable.cpp.
References m_filename, m_logE, gammalib::parformat(), pow(), SILENT, GNodeArray::size(), and gammalib::str().
|
private |
Update PSF parameter cache.
[in] | logE | Log10 of the true photon energy (TeV). |
This method updates the PSF parameter cache. As the performance table PSF only depends on energy, the only parameter on which the cache values depend is the energy.
Definition at line 558 of file GCTAPsfPerfTable.cpp.
References GNodeArray::interpolate(), m_logE, m_par_logE, m_par_scale, m_par_sigma, m_par_width, m_sigma, and gammalib::twopi.
Referenced by containment_radius(), delta_max(), mc(), and operator()().
|
private |
Name of Aeff response file.
Definition at line 105 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), filename(), init_members(), load(), and print().
|
private |
log(E) nodes for Aeff interpolation
Definition at line 106 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), init_members(), load(), print(), and update().
|
mutableprivate |
Energy for which precomputation is done.
Definition at line 112 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), init_members(), and update().
|
mutableprivate |
Gaussian normalization.
Definition at line 113 of file GCTAPsfPerfTable.hpp.
Referenced by containment_radius(), copy_members(), init_members(), operator()(), and update().
|
mutableprivate |
Gaussian sigma (radians)
Definition at line 114 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), delta_max(), init_members(), mc(), and update().
|
mutableprivate |
Gaussian width parameter.
Definition at line 115 of file GCTAPsfPerfTable.hpp.
Referenced by containment_radius(), copy_members(), init_members(), operator()(), and update().
|
private |
68% containment radius of PSF in degrees
Definition at line 107 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), init_members(), and load().
|
private |
80% containment radius of PSF in degrees
Definition at line 108 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), init_members(), and load().
|
private |
Sigma value of PSF in radians.
Definition at line 109 of file GCTAPsfPerfTable.hpp.
Referenced by copy_members(), init_members(), load(), and update().