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

CTA performance table effective area class. More...

#include <GCTAAeffPerfTable.hpp>

Inheritance diagram for GCTAAeffPerfTable:
GCTAAeff GBase

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...
 
GCTAAeffPerfTableoperator= (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...
 
GCTAAeffPerfTableclone (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...
 
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 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

GCTAAeffPerfTable::GCTAAeffPerfTable ( void  )

Void constructor.

Definition at line 59 of file GCTAAeffPerfTable.cpp.

References init_members().

Referenced by clone().

GCTAAeffPerfTable::GCTAAeffPerfTable ( const GFilename filename)
explicit

File constructor.

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

Parameters
[in]aeffEffective area.

Definition at line 95 of file GCTAAeffPerfTable.cpp.

References copy_members(), and init_members().

GCTAAeffPerfTable::~GCTAAeffPerfTable ( void  )
virtual

Destructor.

Definition at line 111 of file GCTAAeffPerfTable.cpp.

References free_members().

Member Function Documentation

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

Return class name.

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

Implements GCTAAeff.

Definition at line 108 of file GCTAAeffPerfTable.hpp.

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

GCTAAeffPerfTable * GCTAAeffPerfTable::clone ( void  ) const
virtual

Clone instance.

Returns
Deep copy of effective area instance.

Implements GCTAAeff.

Definition at line 242 of file GCTAAeffPerfTable.cpp.

References GCTAAeffPerfTable().

void GCTAAeffPerfTable::copy_members ( const GCTAAeffPerfTable aeff)
private

Copy class members.

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

GEbounds GCTAAeffPerfTable::ebounds ( void  ) const
inlinevirtual

Return energy boundaries.

Returns
Energy boundaries of effective area

Implements GCTAAeff.

Definition at line 132 of file GCTAAeffPerfTable.hpp.

References m_ebounds.

GFilename GCTAAeffPerfTable::filename ( void  ) const
inlinevirtual

Return filename.

Returns
Filename from which effective area was loaded.

Implements GCTAAeff.

Definition at line 120 of file GCTAAeffPerfTable.hpp.

References m_filename.

Referenced by load().

void GCTAAeffPerfTable::free_members ( void  )
private

Delete class members.

Definition at line 438 of file GCTAAeffPerfTable.cpp.

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

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

void GCTAAeffPerfTable::load ( const GFilename filename)
virtual

Load effective area from performance table.

Parameters
[in]filenamePerformance table file name.
Exceptions
GException::file_errorFile 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().

double GCTAAeffPerfTable::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 328 of file GCTAAeffPerfTable.cpp.

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

double GCTAAeffPerfTable::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 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.

Parameters
[in]aeffEffective area.
Returns
Effective area.

Definition at line 133 of file GCTAAeffPerfTable.cpp.

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

std::string GCTAAeffPerfTable::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 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().

void GCTAAeffPerfTable::set_boundaries ( void  )
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().

void GCTAAeffPerfTable::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, 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().

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

Return sigma for offset angle dependence.

Returns
Sigma for offset angle dependence.

Definition at line 173 of file GCTAAeffPerfTable.hpp.

References m_sigma.

Referenced by sigma().

int GCTAAeffPerfTable::size ( void  ) const
inline

Return number of node energies in response.

Returns
Number of node energies.

Definition at line 144 of file GCTAAeffPerfTable.hpp.

References m_logE, and GNodeArray::size().

Referenced by print().

Member Data Documentation

std::vector<double> GCTAAeffPerfTable::m_aeff
private

Effective area in cm2.

Definition at line 94 of file GCTAAeffPerfTable.hpp.

Referenced by copy_members(), init_members(), load(), max(), and operator()().

GEbounds GCTAAeffPerfTable::m_ebounds
private

Energy boundaries.

Definition at line 95 of file GCTAAeffPerfTable.hpp.

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

GFilename GCTAAeffPerfTable::m_filename
private

Name of Aeff response file.

Definition at line 92 of file GCTAAeffPerfTable.hpp.

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

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

double GCTAAeffPerfTable::m_logE_max
private

Maximum logE (log10(E/TeV))

Definition at line 98 of file GCTAAeffPerfTable.hpp.

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

double GCTAAeffPerfTable::m_logE_min
private

Minimum logE (log10(E/TeV))

Definition at line 97 of file GCTAAeffPerfTable.hpp.

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

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


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