GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAAeffArf Class Reference

CTA ARF effective area class. More...

#include <GCTAAeffArf.hpp>

Inheritance diagram for GCTAAeffArf:
GCTAAeff GBase

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...
 
GCTAAeffArfoperator= (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...
 
GCTAAeffArfclone (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...
 
GCTAAeffoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

GCTAAeffArf::GCTAAeffArf ( void  )

Void constructor.

Definition at line 63 of file GCTAAeffArf.cpp.

References init_members().

Referenced by clone().

GCTAAeffArf::GCTAAeffArf ( const GFilename filename)
explicit

File constructor.

Parameters
[in]filenameARF 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.

Parameters
[in]aeffEffective area.

Definition at line 98 of file GCTAAeffArf.cpp.

References copy_members(), and init_members().

GCTAAeffArf::~GCTAAeffArf ( void  )
virtual

Destructor.

Definition at line 114 of file GCTAAeffArf.cpp.

References free_members().

Member Function Documentation

std::string GCTAAeffArf::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCTAAeffArf").

Implements GCTAAeff.

Definition at line 118 of file GCTAAeffArf.hpp.

void GCTAAeffArf::clear ( void  )
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().

GCTAAeffArf * GCTAAeffArf::clone ( void  ) const
virtual

Clone instance.

Returns
Deep copy of effective area instance.

Implements GCTAAeff.

Definition at line 246 of file GCTAAeffArf.cpp.

References GCTAAeffArf().

void GCTAAeffArf::copy_members ( const GCTAAeffArf aeff)
private

Copy class members.

Parameters
[in]aeffEffective 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=().

GEbounds GCTAAeffArf::ebounds ( void  ) const
inlinevirtual

Return energy boundaries.

Returns
Energy boundaries of effective area

Implements GCTAAeff.

Definition at line 142 of file GCTAAeffArf.hpp.

References m_ebounds.

GFilename GCTAAeffArf::filename ( void  ) const
inlinevirtual

Return filename.

Returns
Filename from which effective area was loaded.

Implements GCTAAeff.

Definition at line 130 of file GCTAAeffArf.hpp.

References m_filename.

Referenced by load().

void GCTAAeffArf::free_members ( void  )
private

Delete class members.

Definition at line 558 of file GCTAAeffArf.cpp.

Referenced by clear(), operator=(), and ~GCTAAeffArf().

void GCTAAeffArf::init_members ( void  )
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=().

void GCTAAeffArf::load ( const GFilename filename)
virtual

Load effective area from ARF FITS file.

Parameters
[in]filenameARF 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().

double GCTAAeffArf::max ( const double &  logE,
const double &  zenith,
const double &  azimuth,
const bool &  etrue = true 
) const
virtual

Return maximum effective area at a given energy.

Parameters
[in]logELog10 of the true photon energy (TeV).
[in]zenithZenith angle in Earth system (rad). Not used in this method.
[in]azimuthAzimuth angle in Earth system (rad). Not used in this method.
[in]etrueUse true energy (true/false). Not used.
Returns
Maximum effective area (cm2).

Implements GCTAAeff.

Definition at line 444 of file GCTAAeffArf.cpp.

References GNodeArray::interpolate(), m_aeff, and m_logE.

double GCTAAeffArf::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
virtual

Return effective area in units of cm2.

Parameters
[in]logELog10 of the true photon energy (TeV).
[in]thetaOffset angle in camera system (rad).
[in]phiAzimuth angle in camera system (rad). Not used.
[in]zenithZenith angle in Earth system (rad). Not used.
[in]azimuthAzimuth angle in Earth system (rad). Not used.
[in]etrueUse true energy (true/false). Not used.
Returns
Effective area in cm2.

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.

Parameters
[in]aeffEffective area.
Returns
Effective area.

Definition at line 136 of file GCTAAeffArf.cpp.

References copy_members(), free_members(), init_members(), and GCTAAeff::operator=().

std::string GCTAAeffArf::print ( const GChatter chatter = NORMAL) const
virtual

Print effective area information.

Parameters
[in]chatterChattiness.
Returns
String containing effective area information.

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.

Parameters
[in]tableFITS 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).

Todo:
Assign appropriate theta angle for PSF. So far we use onaxis. For appropriate theta angle assignment, we would need this information in the response header.

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.

Parameters
[in]rspCTA 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().

void GCTAAeffArf::scale ( const double &  scale)
inline

Set effective area scaling factor.

Parameters
[in]scaleSet 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().

const double & GCTAAeffArf::scale ( void  ) const
inline

Return effective area scaling factor.

Returns
Effective area scaling factor.

Definition at line 239 of file GCTAAeffArf.hpp.

References m_scale.

Referenced by operator()(), read(), remove_thetacut(), and scale().

void GCTAAeffArf::sigma ( const double &  sigma)
inline

Set sigma for offset angle dependence.

Parameters
[in]sigmaSigma 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().

const double & GCTAAeffArf::sigma ( void  ) const
inline

Return sigma for offset angle dependence.

Returns
Sigma for offset angle dependence.

Definition at line 183 of file GCTAAeffArf.hpp.

References m_sigma.

Referenced by sigma().

int GCTAAeffArf::size ( void  ) const
inline

Return number of node energies in response.

Returns
Number of node energies.

Definition at line 154 of file GCTAAeffArf.hpp.

References m_logE, and GNodeArray::size().

Referenced by print().

void GCTAAeffArf::thetacut ( const double &  thetacut)
inline

Set theta cut angle.

Parameters
[in]thetacutSet 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().

const double & GCTAAeffArf::thetacut ( void  ) const
inline

Return theta cut angle.

Returns
Theta cut angle.

Definition at line 212 of file GCTAAeffArf.hpp.

References m_thetacut.

Referenced by thetacut().

Member Data Documentation

std::vector<double> GCTAAeffArf::m_aeff
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().

GEbounds GCTAAeffArf::m_ebounds
private

Energy boundaries.

Definition at line 103 of file GCTAAeffArf.hpp.

Referenced by copy_members(), ebounds(), init_members(), print(), and read().

GFilename GCTAAeffArf::m_filename
private

Name of Aeff response file.

Definition at line 100 of file GCTAAeffArf.hpp.

Referenced by copy_members(), filename(), init_members(), load(), and print().

GNodeArray GCTAAeffArf::m_logE
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().

double GCTAAeffArf::m_logE_max
private

Maximum logE (log10(E/TeV))

Definition at line 108 of file GCTAAeffArf.hpp.

Referenced by copy_members(), init_members(), operator()(), and read().

double GCTAAeffArf::m_logE_min
private

Minimum logE (log10(E/TeV))

Definition at line 107 of file GCTAAeffArf.hpp.

Referenced by copy_members(), init_members(), operator()(), and read().

double GCTAAeffArf::m_scale
private

Scale for ARF.

Definition at line 106 of file GCTAAeffArf.hpp.

Referenced by copy_members(), init_members(), read(), and scale().

double GCTAAeffArf::m_sigma
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().

double GCTAAeffArf::m_thetacut
private

Theta cut for ARF.

Definition at line 105 of file GCTAAeffArf.hpp.

Referenced by copy_members(), init_members(), remove_thetacut(), and thetacut().


The documentation for this class was generated from the following files: