GammaLib
2.0.0
|
CTA ARF effective area class. More...
#include <GCTAAeffArf.hpp>
Public Member Functions | |
GCTAAeffArf (void) | |
Void constructor. More... | |
GCTAAeffArf (const GFilename &filename) | |
File constructor. More... | |
GCTAAeffArf (const GCTAAeffArf &cta) | |
Copy constructor. More... | |
virtual | ~GCTAAeffArf (void) |
Destructor. More... | |
GCTAAeffArf & | operator= (const GCTAAeffArf &aeff) |
Assignment operator. More... | |
double | operator() (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 effective area in units of cm2. More... | |
void | clear (void) |
Clear instance. More... | |
GCTAAeffArf * | clone (void) const |
Clone instance. More... | |
std::string | classname (void) const |
Return class name. More... | |
void | load (const GFilename &filename) |
Load effective area from ARF FITS file. More... | |
GFilename | filename (void) const |
Return filename. More... | |
double | max (const double &logE, const double &zenith, const double &azimuth, const bool &etrue=true) const |
Return maximum effective area at a given energy. More... | |
GEbounds | ebounds (void) const |
Return energy boundaries. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print effective area information. More... | |
int | size (void) const |
Return number of node energies in response. More... | |
void | sigma (const double &sigma) |
Set sigma for offset angle dependence. More... | |
const double & | sigma (void) const |
Return sigma for offset angle dependence. More... | |
void | thetacut (const double &thetacut) |
Set theta cut angle. More... | |
const double & | thetacut (void) const |
Return theta cut angle. More... | |
void | scale (const double &scale) |
Set effective area scaling factor. More... | |
const double & | scale (void) const |
Return effective area scaling factor. More... | |
void | read (const GFitsTable &table) |
Read CTA ARF vector. More... | |
void | remove_thetacut (const GCTAResponseIrf &rsp) |
Remove thetacut. More... | |
Public Member Functions inherited from GCTAAeff | |
GCTAAeff (void) | |
Void constructor. More... | |
GCTAAeff (const GCTAAeff &aeff) | |
Copy constructor. More... | |
virtual | ~GCTAAeff (void) |
Destructor. More... | |
GCTAAeff & | operator= (const GCTAAeff &aeff) |
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 GCTAAeffArf &aeff) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. 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_aeff |
Effective area in cm2. More... | |
GEbounds | m_ebounds |
Energy boundaries. More... | |
double | m_sigma |
Sigma for offset angle computation (0=none) More... | |
double | m_thetacut |
Theta cut for ARF. More... | |
double | m_scale |
Scale for ARF. More... | |
double | m_logE_min |
Minimum logE (log10(E/TeV)) More... | |
double | m_logE_max |
Maximum logE (log10(E/TeV)) More... | |
Additional Inherited Members | |
Protected Member Functions inherited from GCTAAeff | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GCTAAeff &aeff) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
CTA ARF effective area class.
This class implements the CTA effective area response that is defined by an auxiliary response function (ARF) file.
Definition at line 51 of file GCTAAeffArf.hpp.
GCTAAeffArf::GCTAAeffArf | ( | void | ) |
Void constructor.
Definition at line 63 of file GCTAAeffArf.cpp.
References init_members().
Referenced by clone().
|
explicit |
File constructor.
[in] | filename | ARF FITS file name. |
Constructs effective area from an ARF FITS file.
Definition at line 80 of file GCTAAeffArf.cpp.
References init_members(), and load().
GCTAAeffArf::GCTAAeffArf | ( | const GCTAAeffArf & | aeff | ) |
Copy constructor.
[in] | aeff | Effective area. |
Definition at line 98 of file GCTAAeffArf.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GCTAAeff.
Definition at line 118 of file GCTAAeffArf.hpp.
|
virtual |
Clear instance.
This method properly resets the object to an initial state.
Implements GCTAAeff.
Definition at line 226 of file GCTAAeffArf.cpp.
References GCTAAeff::free_members(), free_members(), GCTAAeff::init_members(), and init_members().
|
virtual |
Clone instance.
Implements GCTAAeff.
Definition at line 246 of file GCTAAeffArf.cpp.
References GCTAAeffArf().
|
private |
Copy class members.
[in] | aeff | Effective area. |
Definition at line 537 of file GCTAAeffArf.cpp.
References m_aeff, m_ebounds, m_filename, m_logE, m_logE_max, m_logE_min, m_scale, m_sigma, and m_thetacut.
Referenced by GCTAAeffArf(), and operator=().
|
inlinevirtual |
Return energy boundaries.
Implements GCTAAeff.
Definition at line 142 of file GCTAAeffArf.hpp.
References m_ebounds.
|
inlinevirtual |
Return filename.
Implements GCTAAeff.
Definition at line 130 of file GCTAAeffArf.hpp.
References m_filename.
Referenced by load().
|
private |
Delete class members.
Definition at line 558 of file GCTAAeffArf.cpp.
Referenced by clear(), operator=(), and ~GCTAAeffArf().
|
private |
Initialise class members.
Definition at line 514 of file GCTAAeffArf.cpp.
References GNodeArray::clear(), GFilename::clear(), GEbounds::clear(), m_aeff, m_ebounds, m_filename, m_logE, m_logE_max, m_logE_min, m_scale, m_sigma, and m_thetacut.
Referenced by clear(), GCTAAeffArf(), and operator=().
|
virtual |
Load effective area from ARF FITS file.
[in] | filename | ARF FITS file name. |
Loads the effective area from an ARF FITS file.
If no extension name is provided, the effective area will be loaded from the SPECRESP
extension.
Implements GCTAAeff.
Definition at line 262 of file GCTAAeffArf.cpp.
References GFits::close(), GFilename::extname(), gammalib::extname_arf, filename(), m_filename, read(), and GFits::table().
Referenced by GCTAAeffArf().
|
virtual |
Return maximum effective area at a given energy.
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | zenith | Zenith angle in Earth system (rad). Not used in this method. |
[in] | azimuth | Azimuth angle in Earth system (rad). Not used in this method. |
[in] | etrue | Use true energy (true/false). Not used. |
Implements GCTAAeff.
Definition at line 444 of file GCTAAeffArf.cpp.
References GNodeArray::interpolate(), m_aeff, and m_logE.
|
virtual |
Return effective area in units of cm2.
[in] | logE | Log10 of the true photon energy (TeV). |
[in] | theta | Offset angle in camera system (rad). |
[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 effective area in units of cm2 for a given energy and offset angle. The effective area is linearily interpolated in log10(energy). The method assures that the effective area value never becomes negative.
Outside the energy range that is covered by the ARF vector the effective area will be set to zero.
Implements GCTAAeff.
Definition at line 179 of file GCTAAeffArf.cpp.
References exp(), GNodeArray::interpolate(), m_aeff, m_logE, m_logE_max, m_logE_min, m_sigma, gammalib::rad2deg, and scale().
GCTAAeffArf & GCTAAeffArf::operator= | ( | const GCTAAeffArf & | aeff | ) |
Assignment operator.
[in] | aeff | Effective area. |
Definition at line 136 of file GCTAAeffArf.cpp.
References copy_members(), free_members(), init_members(), and GCTAAeff::operator=().
Print effective area information.
[in] | chatter | Chattiness. |
Implements GCTAAeff.
Definition at line 468 of file GCTAAeffArf.cpp.
References GEbounds::emax(), GEbounds::emin(), m_ebounds, m_filename, m_sigma, gammalib::parformat(), GEnergy::print(), SILENT, size(), and gammalib::str().
void GCTAAeffArf::read | ( | const GFitsTable & | table | ) |
Read CTA ARF vector.
[in] | table | FITS table. |
Reads a CTA ARF vector from the FITS table
.
The energies are converted to TeV and the effective area is converted to cm2. Conversion is done based on the units provided for the energy and effective area columns. Units that are recognized are 'keV', 'MeV', 'GeV', 'TeV', 'm^2', 'm2', 'cm^2' and 'cm^2' (case independent).
Definition at line 300 of file GCTAAeffArf.cpp.
References GNodeArray::append(), GEbounds::append(), GNodeArray::clear(), GEbounds::clear(), m_aeff, m_ebounds, m_logE, m_logE_max, m_logE_min, m_scale, m_sigma, GFitsTableCol::nrows(), GFitsTableCol::real(), scale(), gammalib::strip_whitespace(), gammalib::tolower(), and GFitsTableCol::unit().
Referenced by load().
void GCTAAeffArf::remove_thetacut | ( | const GCTAResponseIrf & | rsp | ) |
Remove thetacut.
[in] | rsp | CTA response. |
Removes thetacut from Aeff values read from a FITS file. Note that this method should only be called once directly after loading all response components.
Definition at line 369 of file GCTAAeffArf.cpp.
References gammalib::deg2rad, GIntegral::fixed_iter(), m_aeff, m_logE, m_thetacut, GIntegral::romberg(), and scale().
Referenced by GCTAResponseIrf::load(), and GCTAResponseIrf::read().
|
inline |
Set effective area scaling factor.
[in] | scale | Set effective area scaling factor. |
Sets the scaling factor for the effective area (by default is 1).
Definition at line 226 of file GCTAAeffArf.hpp.
References m_scale, and scale().
Referenced by GCTAResponseIrf::read(), and GCTAResponseIrf::write().
|
inline |
Return effective area scaling factor.
Definition at line 239 of file GCTAAeffArf.hpp.
References m_scale.
Referenced by operator()(), read(), remove_thetacut(), and scale().
|
inline |
Set sigma for offset angle dependence.
[in] | sigma | Sigma for offset angle dependence. |
Sets the sigma parameter for the offset angle dependence of the effective area. If sigma
is 0 (which is the default value), no offset angle dependency will be assumed.
Definition at line 170 of file GCTAAeffArf.hpp.
References m_sigma, and sigma().
Referenced by GCTAResponseIrf::offset_sigma(), GCTAResponseIrf::read(), and GCTAResponseIrf::write().
|
inline |
Return sigma for offset angle dependence.
Definition at line 183 of file GCTAAeffArf.hpp.
References m_sigma.
Referenced by sigma().
|
inline |
Return number of node energies in response.
Definition at line 154 of file GCTAAeffArf.hpp.
References m_logE, and GNodeArray::size().
Referenced by print().
|
inline |
Set theta cut angle.
[in] | thetacut | Set theta cut angle. |
Sets the theta cut angle which defines the energy independent cut that has been assumed in deriving the ARF values. If thetacut
os 0 (which is the default value), not thetacut will be applied.
Definition at line 199 of file GCTAAeffArf.hpp.
References m_thetacut, and thetacut().
Referenced by GCTAResponseIrf::read(), and GCTAResponseIrf::write().
|
inline |
Return theta cut angle.
Definition at line 212 of file GCTAAeffArf.hpp.
References m_thetacut.
Referenced by thetacut().
|
private |
Effective area in cm2.
Definition at line 102 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), max(), operator()(), read(), and remove_thetacut().
|
private |
Energy boundaries.
Definition at line 103 of file GCTAAeffArf.hpp.
Referenced by copy_members(), ebounds(), init_members(), print(), and read().
|
private |
Name of Aeff response file.
Definition at line 100 of file GCTAAeffArf.hpp.
Referenced by copy_members(), filename(), init_members(), load(), and print().
|
private |
log(E) nodes for Aeff interpolation
Definition at line 101 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), max(), operator()(), read(), remove_thetacut(), and size().
|
private |
Maximum logE (log10(E/TeV))
Definition at line 108 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), operator()(), and read().
|
private |
Minimum logE (log10(E/TeV))
Definition at line 107 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), operator()(), and read().
|
private |
Scale for ARF.
Definition at line 106 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), read(), and scale().
|
private |
Sigma for offset angle computation (0=none)
Definition at line 104 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), operator()(), print(), read(), and sigma().
|
private |
Theta cut for ARF.
Definition at line 105 of file GCTAAeffArf.hpp.
Referenced by copy_members(), init_members(), remove_thetacut(), and thetacut().