GammaLib
2.0.0
|
CTA performance table effective area class. More...
#include <GCTAAeffPerfTable.hpp>
Public Member Functions | |
GCTAAeffPerfTable (void) | |
Void constructor. More... | |
GCTAAeffPerfTable (const GFilename &filename) | |
File constructor. More... | |
GCTAAeffPerfTable (const GCTAAeffPerfTable &cta) | |
Copy constructor. More... | |
virtual | ~GCTAAeffPerfTable (void) |
Destructor. More... | |
GCTAAeffPerfTable & | operator= (const GCTAAeffPerfTable &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... | |
GCTAAeffPerfTable * | clone (void) const |
Clone instance. More... | |
std::string | classname (void) const |
Return class name. More... | |
void | load (const GFilename &filename) |
Load effective area from performance table. 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... | |
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 GCTAAeffPerfTable &aeff) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
void | set_boundaries (void) |
Set effective area boundaries. 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_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 performance table effective area class.
This class implements the CTA effective area 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 48 of file GCTAAeffPerfTable.hpp.
GCTAAeffPerfTable::GCTAAeffPerfTable | ( | void | ) |
Void constructor.
Definition at line 59 of file GCTAAeffPerfTable.cpp.
References init_members().
Referenced by clone().
|
explicit |
File constructor.
[in] | filename | Performance table file name. |
Construct instance by loading the effective area information from an ASCII performance table.
Definition at line 77 of file GCTAAeffPerfTable.cpp.
References init_members(), and load().
GCTAAeffPerfTable::GCTAAeffPerfTable | ( | const GCTAAeffPerfTable & | aeff | ) |
Copy constructor.
[in] | aeff | Effective area. |
Definition at line 95 of file GCTAAeffPerfTable.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GCTAAeff.
Definition at line 108 of file GCTAAeffPerfTable.hpp.
|
virtual |
Clear instance.
This method properly resets the object to an initial state.
Implements GCTAAeff.
Definition at line 222 of file GCTAAeffPerfTable.cpp.
References free_members(), GCTAAeff::free_members(), init_members(), and GCTAAeff::init_members().
|
virtual |
Clone instance.
Implements GCTAAeff.
Definition at line 242 of file GCTAAeffPerfTable.cpp.
References GCTAAeffPerfTable().
|
private |
Copy class members.
[in] | aeff | Effective area. |
Definition at line 419 of file GCTAAeffPerfTable.cpp.
References m_aeff, m_ebounds, m_filename, m_logE, m_logE_max, m_logE_min, and m_sigma.
Referenced by GCTAAeffPerfTable(), and operator=().
|
inlinevirtual |
Return energy boundaries.
Implements GCTAAeff.
Definition at line 132 of file GCTAAeffPerfTable.hpp.
References m_ebounds.
|
inlinevirtual |
Return filename.
Implements GCTAAeff.
Definition at line 120 of file GCTAAeffPerfTable.hpp.
References m_filename.
Referenced by load().
|
private |
Delete class members.
Definition at line 438 of file GCTAAeffPerfTable.cpp.
Referenced by clear(), operator=(), and ~GCTAAeffPerfTable().
|
private |
Initialise class members.
Definition at line 398 of file GCTAAeffPerfTable.cpp.
References GNodeArray::clear(), GFilename::clear(), GEbounds::clear(), m_aeff, m_ebounds, m_filename, m_logE, m_logE_max, m_logE_min, and m_sigma.
Referenced by clear(), GCTAAeffPerfTable(), and operator=().
|
virtual |
Load effective area from performance table.
[in] | filename | Performance table file name. |
GException::file_error | File could not be opened for read access. |
This method loads the effective area information from an ASCII performance table.
Implements GCTAAeff.
Definition at line 259 of file GCTAAeffPerfTable.cpp.
References GNodeArray::append(), GNodeArray::clear(), filename(), G_LOAD, m_aeff, m_filename, m_logE, set_boundaries(), gammalib::split(), gammalib::strip_whitespace(), gammalib::todouble(), and GFilename::url().
Referenced by GCTAAeffPerfTable().
|
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 328 of file GCTAAeffPerfTable.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 performance table the effective area will be set to zero.
Implements GCTAAeff.
Definition at line 175 of file GCTAAeffPerfTable.cpp.
References exp(), GNodeArray::interpolate(), m_aeff, m_logE, m_logE_max, m_logE_min, m_sigma, and gammalib::rad2deg.
GCTAAeffPerfTable & GCTAAeffPerfTable::operator= | ( | const GCTAAeffPerfTable & | aeff | ) |
Assignment operator.
[in] | aeff | Effective area. |
Definition at line 133 of file GCTAAeffPerfTable.cpp.
References copy_members(), free_members(), init_members(), and GCTAAeff::operator=().
Print effective area information.
[in] | chatter | Chattiness. |
Implements GCTAAeff.
Definition at line 352 of file GCTAAeffPerfTable.cpp.
References GEbounds::emax(), GEbounds::emin(), m_ebounds, m_filename, m_sigma, gammalib::parformat(), GEnergy::print(), SILENT, size(), and gammalib::str().
|
private |
Set effective area boundaries.
Sets the data members m_ebounds, m_logE_min and m_logE_max that define the validity range of the effective area.
Definition at line 451 of file GCTAAeffPerfTable.cpp.
References GEbounds::append(), GEbounds::clear(), GEnergy::log10TeV(), m_ebounds, m_logE, m_logE_max, m_logE_min, and GNodeArray::size().
Referenced by load().
|
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, no offset angle dependency will be assumed. By default, sigma
= 3.
Definition at line 160 of file GCTAAeffPerfTable.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 173 of file GCTAAeffPerfTable.hpp.
References m_sigma.
Referenced by sigma().
|
inline |
Return number of node energies in response.
Definition at line 144 of file GCTAAeffPerfTable.hpp.
References m_logE, and GNodeArray::size().
Referenced by print().
|
private |
Effective area in cm2.
Definition at line 94 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), init_members(), load(), max(), and operator()().
|
private |
Energy boundaries.
Definition at line 95 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), ebounds(), init_members(), print(), and set_boundaries().
|
private |
Name of Aeff response file.
Definition at line 92 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), filename(), init_members(), load(), and print().
|
private |
log(E) nodes for Aeff interpolation
Definition at line 93 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), init_members(), load(), max(), operator()(), set_boundaries(), and size().
|
private |
Maximum logE (log10(E/TeV))
Definition at line 98 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), init_members(), operator()(), and set_boundaries().
|
private |
Minimum logE (log10(E/TeV))
Definition at line 97 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), init_members(), operator()(), and set_boundaries().
|
private |
Sigma for offset angle computation (0=none)
Definition at line 96 of file GCTAAeffPerfTable.hpp.
Referenced by copy_members(), init_members(), operator()(), print(), and sigma().