GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAResponseCube Class Reference

CTA cube-style response function class. More...

#include <GCTAResponseCube.hpp>

Inheritance diagram for GCTAResponseCube:
GCTAResponse GResponse GBase

Public Member Functions

 GCTAResponseCube (void)
 Void constructor. More...
 
 GCTAResponseCube (const GCTAResponseCube &rsp)
 Copy constructor. More...
 
 GCTAResponseCube (const GXmlElement &xml)
 XML constructor. More...
 
 GCTAResponseCube (const GCTACubeExposure &exposure, const GCTACubePsf &psf, const GCTACubeBackground &background)
 Response constructor. More...
 
 GCTAResponseCube (const GCTACubeExposure &exposure, const GCTACubePsf &psf, const GCTACubeEdisp &edisp, const GCTACubeBackground &background)
 Response constructor. More...
 
virtual ~GCTAResponseCube (void)
 Destructor. More...
 
virtual GCTAResponseCubeoperator= (const GCTAResponseCube &rsp)
 Assignment operator. More...
 
virtual void clear (void)
 Clear instance. More...
 
virtual GCTAResponseCubeclone (void) const
 Clone instance. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual bool is_valid (void) const
 Signal if response is valid. More...
 
virtual bool use_edisp (void) const
 Signal if response uses energy dispersion. More...
 
virtual bool use_tdisp (void) const
 Signal if time dispersion will be used. More...
 
virtual bool apply_edisp (void) const
 Signal if energy dispersion should be applied. More...
 
virtual void apply_edisp (const bool &apply_edisp) const
 Signal if energy dispersion should be applied. More...
 
virtual double irf (const GEvent &event, const GPhoton &photon, const GObservation &obs) const
 Return instrument response. More...
 
virtual double nroi (const GModelSky &model, const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const
 Return integral of event probability for a given sky model over ROI. More...
 
virtual GEbounds ebounds (const GEnergy &obsEng) const
 Return true energy boundaries for a specific observed energy. More...
 
virtual void read (const GXmlElement &xml)
 Read response information from XML element. More...
 
virtual void write (GXmlElement &xml) const
 Write response information into XML element. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print response information. More...
 
const GCTACubeExposureexposure (void) const
 Return exposure cube. More...
 
void exposure (const GCTACubeExposure &exposure)
 Set exposure cube. More...
 
const GCTACubePsfpsf (void) const
 Return cube analysis point spread function. More...
 
void psf (const GCTACubePsf &psf)
 Set cube analysis point spread function cube. More...
 
const GCTACubeEdispedisp (void) const
 Return cube analysis energy dispersion cube. More...
 
void edisp (const GCTACubeEdisp &edisp)
 Set cube analysis energy dispersion cube. More...
 
const GCTACubeBackgroundbackground (void) const
 Return cube analysis background cube. More...
 
void background (const GCTACubeBackground &background)
 Set cube analysis background cube. More...
 
- Public Member Functions inherited from GCTAResponse
 GCTAResponse (void)
 Void constructor. More...
 
 GCTAResponse (const GCTAResponse &rsp)
 Copy constructor. More...
 
virtual ~GCTAResponse (void)
 Destructor. More...
 
virtual GCTAResponseoperator= (const GCTAResponse &rsp)
 Assignment operator. More...
 
virtual double irf (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response. More...
 
virtual void remove_response_cache (const std::string &name)
 Remove response cache for model. More...
 
- Public Member Functions inherited from GResponse
 GResponse (void)
 Void constructor. More...
 
 GResponse (const GResponse &rsp)
 Copy constructor. More...
 
virtual ~GResponse (void)
 Destructor. More...
 
virtual GResponseoperator= (const GResponse &rsp)
 Assignment operator. More...
 
virtual double convolve (const GModelSky &model, const GEvent &event, const GObservation &obs, const bool &grad=true) const
 Convolve sky model with the instrument response. 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 GCTAResponseCube &rsp)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
int cache_index (const std::string &name) const
 Determine cache index for model. More...
 
double psf_radial (const GModelSpatialRadial *model, const double &rho_obs, const GSkyDir &obsDir, const GEnergy &srcEng, const GTime &srcTime) const
 Integrate Psf over radial model. More...
 
double psf_elliptical (const GModelSpatialElliptical *model, const double &rho_obs, const double &posangle_obs, const GSkyDir &obsDir, const GEnergy &srcEng, const GTime &srcTime) const
 Integrate Psf over elliptical model. More...
 
double psf_diffuse (const GModelSpatial *model, const GSkyDir &obsDir, const GEnergy &srcEng, const GTime &srcTime) const
 Integrate PSF over diffuse model. More...
 
double irf_ptsrc (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response to point source. More...
 
double irf_radial (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response to radial source. More...
 
double irf_elliptical (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response to elliptical source. More...
 
double irf_diffuse (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response to diffuse source. More...
 

Private Attributes

GCTACubeExposure m_exposure
 Exposure cube. More...
 
GCTACubePsf m_psf
 Mean point spread function. More...
 
GCTACubeBackground m_background
 Background cube. More...
 
GCTACubeEdisp m_edisp
 Energy dispersion cube. More...
 
bool m_apply_edisp
 Apply energy dispersion. More...
 
bool m_has_edisp
 Flag to indicate if energy. More...
 
std::vector< GCTACubeSource * > m_cache
 Response cache. More...
 
GNodeArray m_diffuse_logE
 Diffuse energy. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GCTAResponse
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GCTAResponse &rsp)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
virtual double irf_composite (const GEvent &event, const GSource &source, const GObservation &obs) const
 Return instrument response to composite source. More...
 
- Protected Member Functions inherited from GResponse
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GResponse &rsp)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
double eval_prob (const GModelSky &model, const GEvent &event, const GEnergy &srcEng, const GTime &srcTime, const GObservation &obs, const bool &grad) const
 Convolve sky model with the instrument response. More...
 
- Protected Attributes inherited from GCTAResponse
bool m_use_irf_cache
 Control usage of irf cache. More...
 
bool m_use_nroi_cache
 Control usage of nroi cache. More...
 
GCTAResponseCache m_irf_cache
 
GCTAResponseCache m_nroi_cache
 

Detailed Description

CTA cube-style response function class.

Definition at line 57 of file GCTAResponseCube.hpp.

Constructor & Destructor Documentation

GCTAResponseCube::GCTAResponseCube ( void  )

Void constructor.

Constructs void CTA response.

Definition at line 89 of file GCTAResponseCube.cpp.

References init_members().

Referenced by clone().

GCTAResponseCube::GCTAResponseCube ( const GCTAResponseCube rsp)

Copy constructor.

Parameters
[in]rspCTA response.

Constructs CTA cube response by making a deep copy of an existing object.

Definition at line 107 of file GCTAResponseCube.cpp.

References copy_members(), and init_members().

GCTAResponseCube::GCTAResponseCube ( const GXmlElement xml)
explicit

XML constructor.

Parameters
[in]xmlXML element.

Construct CTA response from XML element.

Definition at line 128 of file GCTAResponseCube.cpp.

References init_members(), and read().

GCTAResponseCube::GCTAResponseCube ( const GCTACubeExposure exposure,
const GCTACubePsf psf,
const GCTACubeBackground background 
)

Response constructor.

Parameters
[in]exposureCTA cube analysis exposure.
[in]psfCTA cube analysis point spread function.
[in]backgroundCTA cube background response.

Constructs CTA cube analysis response from a cube analysis exposure, a point spread function cube and a background cube.

Definition at line 151 of file GCTAResponseCube.cpp.

References background(), exposure(), init_members(), m_background, m_exposure, m_has_edisp, m_psf, and psf().

GCTAResponseCube::GCTAResponseCube ( const GCTACubeExposure exposure,
const GCTACubePsf psf,
const GCTACubeEdisp edisp,
const GCTACubeBackground background 
)

Response constructor.

Parameters
[in]exposureCTA cube analysis exposure.
[in]psfCTA cube analysis point spread function.
[in]edispCTA cube energy dispersion response.
[in]backgroundCTA cube background response.

Constructs CTA cube analysis response from a cube analysis exposure, a point spread function cube, an energy dispersion cube and a background cube.

Definition at line 183 of file GCTAResponseCube.cpp.

References background(), edisp(), exposure(), init_members(), m_background, m_edisp, m_exposure, m_has_edisp, m_psf, and psf().

GCTAResponseCube::~GCTAResponseCube ( void  )
virtual

Destructor.

Destroys instance of CTA response object.

Definition at line 211 of file GCTAResponseCube.cpp.

References free_members().

Member Function Documentation

bool GCTAResponseCube::apply_edisp ( void  ) const
inlinevirtual

Signal if energy dispersion should be applied.

Returns
True if energy dispersion should be applied

Implements GCTAResponse.

Definition at line 222 of file GCTAResponseCube.hpp.

References m_apply_edisp.

Referenced by apply_edisp(), and print().

void GCTAResponseCube::apply_edisp ( const bool &  apply_edisp) const
inlinevirtual

Signal if energy dispersion should be applied.

Parameters
[in]apply_edispSet true if energy dispersion should be applied

Implements GCTAResponse.

Definition at line 233 of file GCTAResponseCube.hpp.

References apply_edisp(), and m_apply_edisp.

const GCTACubeBackground & GCTAResponseCube::background ( void  ) const
inline

Return cube analysis background cube.

Returns
Reference to cube analysis background cube.

Definition at line 335 of file GCTAResponseCube.hpp.

References m_background.

Referenced by background(), GCTAModelCubeBackground::eval(), GCTAResponseCube(), and GCTAModelCubeBackground::npred().

void GCTAResponseCube::background ( const GCTACubeBackground background)
inline

Set cube analysis background cube.

Parameters
[in]backgroundCube analysis background cube.

Definition at line 322 of file GCTAResponseCube.hpp.

References background(), and m_background.

int GCTAResponseCube::cache_index ( const std::string &  name) const
private

Determine cache index for model.

Parameters
[in]nameModel name.
Returns
Cache index (-1 if model has not been found).

Determines the cache index for a given model name.

Definition at line 696 of file GCTAResponseCube.cpp.

References m_cache.

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

Return class name.

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

Implements GCTAResponse.

Definition at line 168 of file GCTAResponseCube.hpp.

void GCTAResponseCube::clear ( void  )
virtual

Clear instance.

Clears CTA response object by resetting all members to an initial state. Any information that was present in the object before will be lost.

Implements GCTAResponse.

Definition at line 274 of file GCTAResponseCube.cpp.

References GCTAResponse::free_members(), GResponse::free_members(), free_members(), GCTAResponse::init_members(), GResponse::init_members(), and init_members().

Referenced by read().

GCTAResponseCube * GCTAResponseCube::clone ( void  ) const
virtual

Clone instance.

Returns
Pointer to deep copy of CTA response.

Creates a clone (deep copy) of a CTA response object.

Implements GCTAResponse.

Definition at line 298 of file GCTAResponseCube.cpp.

References GCTAResponseCube().

void GCTAResponseCube::copy_members ( const GCTAResponseCube rsp)
private

Copy class members.

Parameters
[in]rspResponse.

Definition at line 652 of file GCTAResponseCube.cpp.

References m_apply_edisp, m_background, m_cache, m_edisp, m_exposure, m_has_edisp, and m_psf.

Referenced by GCTAResponseCube(), and operator=().

GEbounds GCTAResponseCube::ebounds ( const GEnergy obsEng) const
virtual

Return true energy boundaries for a specific observed energy.

Parameters
[in]obsEngObserved photon energy.
Returns
Boundaries in true energy.

Implements GCTAResponse.

Definition at line 435 of file GCTAResponseCube.cpp.

References GCTACubeEdisp::ebounds(), and m_edisp.

const GCTACubeEdisp & GCTAResponseCube::edisp ( void  ) const
inline

Return cube analysis energy dispersion cube.

Returns
Reference to cube analysis energy dispersion cube.

Definition at line 310 of file GCTAResponseCube.hpp.

References m_edisp.

Referenced by edisp(), GCTAResponseCube(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), and irf_radial().

void GCTAResponseCube::edisp ( const GCTACubeEdisp edisp)
inline

Set cube analysis energy dispersion cube.

Parameters
[in]edispCube analysis energy dispersion cube.

Definition at line 296 of file GCTAResponseCube.hpp.

References edisp(), m_edisp, and m_has_edisp.

const GCTACubeExposure & GCTAResponseCube::exposure ( void  ) const
inline

Return exposure cube.

Returns
Reference to exposure cube.

Definition at line 246 of file GCTAResponseCube.hpp.

References m_exposure.

Referenced by exposure(), GCTAResponseCube(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), and irf_radial().

void GCTAResponseCube::exposure ( const GCTACubeExposure exposure)
inline

Set exposure cube.

Parameters
[in]exposureExposure cube.

Definition at line 258 of file GCTAResponseCube.hpp.

References exposure(), and m_exposure.

void GCTAResponseCube::free_members ( void  )
private

Delete class members.

Definition at line 675 of file GCTAResponseCube.cpp.

References m_cache.

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

void GCTAResponseCube::init_members ( void  )
private
double GCTAResponseCube::irf ( const GEvent event,
const GPhoton photon,
const GObservation obs 
) const
virtual

Return instrument response.

Parameters
[in]eventObserved event.
[in]photonIncident photon.
[in]obsObservation (not used).
Returns
Instrument response.

Implements GCTAResponse.

Definition at line 312 of file GCTAResponseCube.cpp.

References gammalib::cta_dir(), GCTACubeExposure::deadc(), GCTACubePsf::delta_max(), GPhoton::dir(), GCTAInstDir::dir(), GSkyDir::dist(), edisp(), GPhoton::energy(), exposure(), G_IRF, gammalib::is_infinite(), gammalib::is_notanumber(), GCTACubeExposure::livetime(), psf(), and use_edisp().

Referenced by irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), and psf_elliptical().

double GCTAResponseCube::irf_diffuse ( const GEvent event,
const GSource source,
const GObservation obs 
) const
privatevirtual

Return instrument response to diffuse source.

Parameters
[in]eventObserved event.
[in]sourceSource.
[in]obsObservation.
Returns
Instrument response to diffuse source.

Returns the instrument response to a specified diffuse source.

The method uses a pre-computation cache to store the instrument response for the spatial model component. The pre-computation cache is initialised if no cache has yet been allocated, or if at the beginning of a scan over the events, the model parameters have changed. The beginning of a scan is defined by an event bin index of 0.

Implements GCTAResponse.

Definition at line 1484 of file GCTAResponseCube.cpp.

References GModelSpatialDiffuse::contains(), GCTACubeExposure::deadc(), GCTACubePsf::delta_max(), GCTAEventBin::dir(), GCTAInstDir::dir(), edisp(), GCTAEventBin::energy(), GSource::energy(), exposure(), G_IRF_DIFFUSE, irf(), GEvent::is_bin(), gammalib::is_infinite(), gammalib::is_notanumber(), GCTACubeExposure::livetime(), GSource::model(), psf(), psf_diffuse(), gammalib::rad2deg, GCTAEventBin::time(), and use_edisp().

double GCTAResponseCube::irf_elliptical ( const GEvent event,
const GSource source,
const GObservation obs 
) const
privatevirtual

Return instrument response to elliptical source.

Parameters
[in]eventObserved event.
[in]sourceSource.
[in]obsObservation (not used).
Returns
Instrument response to elliptical source.

Returns the instrument response to a specified elliptical source.

Todo:
Correct assumptions in exposure computation, PSF computation and energy dispersion computation.

Implements GCTAResponse.

Definition at line 1378 of file GCTAResponseCube.cpp.

References GCTACubeExposure::deadc(), GCTAEventBin::dir(), GCTAInstDir::dir(), GModelSpatialElliptical::dir(), GSkyDir::dist(), edisp(), GCTAEventBin::energy(), GSource::energy(), exposure(), G_IRF_RADIAL, irf(), GEvent::is_bin(), gammalib::is_infinite(), gammalib::is_notanumber(), GCTACubeExposure::livetime(), GSource::model(), GSkyDir::posang(), psf(), psf_elliptical(), GCTAEventBin::time(), and use_edisp().

double GCTAResponseCube::irf_ptsrc ( const GEvent event,
const GSource source,
const GObservation obs 
) const
privatevirtual

Return instrument response to point source.

Parameters
[in]eventObserved event.
[in]sourceSource.
[in]obsObservation (not used).
Returns
Instrument response to point source.

Returns the instrument response to a specified point source.

Implements GCTAResponse.

Definition at line 1183 of file GCTAResponseCube.cpp.

References GCTACubeExposure::deadc(), GCTACubePsf::delta_max(), GCTAEventBin::dir(), GCTAInstDir::dir(), GModelSpatialPointSource::dir(), edisp(), GSource::energy(), GCTAEventBin::energy(), exposure(), G_IRF_PTSRC, irf(), GEvent::is_bin(), gammalib::is_infinite(), gammalib::is_notanumber(), GCTACubeExposure::livetime(), GSource::model(), psf(), and use_edisp().

double GCTAResponseCube::irf_radial ( const GEvent event,
const GSource source,
const GObservation obs 
) const
privatevirtual

Return instrument response to radial source.

Parameters
[in]eventObserved event.
[in]sourceSource.
[in]obsObservation (not used).
Returns
Instrument response to radial source.

Returns the instrument response to a specified radial source.

Todo:
Correct assumptions in exposure computation, PSF computation and energy dispersion computation.

Implements GCTAResponse.

Definition at line 1276 of file GCTAResponseCube.cpp.

References GCTACubeExposure::deadc(), GCTAEventBin::dir(), GCTAInstDir::dir(), GModelSpatialRadial::dir(), GSkyDir::dist(), edisp(), GCTAEventBin::energy(), GSource::energy(), exposure(), G_IRF_RADIAL, irf(), GEvent::is_bin(), gammalib::is_infinite(), gammalib::is_notanumber(), GCTACubeExposure::livetime(), GSource::model(), psf(), psf_radial(), GCTAEventBin::time(), and use_edisp().

bool GCTAResponseCube::is_valid ( void  ) const
inlinevirtual

Signal if response is valid.

Returns
True if response is valid
Todo:
: To be implemented (check if GCTACubeExposure and GCTACubePsf is loaded)

Implements GCTAResponse.

Definition at line 182 of file GCTAResponseCube.hpp.

double GCTAResponseCube::nroi ( const GModelSky model,
const GEnergy obsEng,
const GTime obsTime,
const GObservation obs 
) const
virtual

Return integral of event probability for a given sky model over ROI.

Parameters
[in]modelSky model.
[in]obsEngObserved photon energy.
[in]obsTimeObserved photon arrival time.
[in]obsObservation.
Returns
0.0
Exceptions
GException::feature_not_implementedMethod is not implemented.

Computes the integral

\[ N_{\rm ROI}(E',t') = \int_{\rm ROI} P(p',E',t') dp' \]

of the event probability

\[ P(p',E',t') = \int \int \int S(p,E,t) \times R(p',E',t'|p,E,t) \, dp \, dE \, dt \]

for a given sky model \(S(p,E,t)\) and response function \(R(p',E',t'|p,E,t)\) over the Region of Interest (ROI).

Todo:
Implement method (is maybe not really needed)

Implements GCTAResponse.

Definition at line 414 of file GCTAResponseCube.cpp.

References G_NROI.

GCTAResponseCube & GCTAResponseCube::operator= ( const GCTAResponseCube rsp)
virtual

Assignment operator.

Parameters
[in]rspCTA response.
Returns
CTA response.

Assigns CTA response object to another CTA response object. The assignment performs a deep copy of all information, hence the original object from which the assignment has been performed can be destroyed after this operation without any loss of information.

Definition at line 238 of file GCTAResponseCube.cpp.

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

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

Print response information.

Parameters
[in]chatterChattiness.
Returns
String containing response information.

Implements GCTAResponse.

Definition at line 563 of file GCTAResponseCube.cpp.

References apply_edisp(), m_background, m_edisp, m_exposure, m_has_edisp, GCTAResponse::m_irf_cache, m_psf, NORMAL, gammalib::parformat(), GCTACubeBackground::print(), GCTAResponseCache::print(), GCTACubeExposure::print(), GCTACubePsf::print(), GCTACubeEdisp::print(), gammalib::reduce(), SILENT, and use_edisp().

const GCTACubePsf & GCTAResponseCube::psf ( void  ) const
inline

Return cube analysis point spread function.

Returns
Reference to cube analysis point spread function.

Definition at line 271 of file GCTAResponseCube.hpp.

References m_psf.

Referenced by cta_psf_radial_kern_omega::eval(), cta_psf_radial_kern_delta::eval(), cta_psf_elliptical_kern_omega::eval(), cta_psf_diffuse_kern_delta::eval(), GCTAResponseCube(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), psf(), psf_diffuse(), psf_elliptical(), and psf_radial().

void GCTAResponseCube::psf ( const GCTACubePsf psf)
inline

Set cube analysis point spread function cube.

Parameters
[in]psfCube analysis point spread function.

Definition at line 283 of file GCTAResponseCube.hpp.

References m_psf, and psf().

double GCTAResponseCube::psf_diffuse ( const GModelSpatial model,
const GSkyDir obsDir,
const GEnergy srcEng,
const GTime srcTime 
) const
private

Integrate PSF over diffuse model.

Parameters
[in]modelDiffuse spatial model.
[in]obsDirObserved event direction.
[in]srcEngTrue photon energy.
[in]srcTimeTrue photon arrival time.

Computes the integral

\[ \int_0^{\delta_{\rm max}} {\rm PSF}(\delta) \times \int_0^{2\pi} {\rm Map}(\delta, \phi) \sin \delta {\rm d}\phi {\rm d}\delta \]

where \({\rm Map}(\delta, \phi)\) is the diffuse map in the coordinate system of the point spread function, defined by the angle \(\delta\) between the true and the measured photon direction and the azimuth angle \(\phi\) around the measured photon direction. \({\rm PSF}(\delta)\) is the azimuthally symmetric point spread function.

Definition at line 1114 of file GCTAResponseCube.cpp.

References GSkyDir::dec_deg(), GCTACubePsf::delta_max(), GMatrix::eulery(), GMatrix::eulerz(), GIntegral::fixed_iter(), gammalib::iter_rho(), psf(), GSkyDir::ra_deg(), gammalib::resolution(), and GIntegral::romberg().

Referenced by irf_diffuse().

double GCTAResponseCube::psf_elliptical ( const GModelSpatialElliptical model,
const double &  rho_obs,
const double &  posangle_obs,
const GSkyDir obsDir,
const GEnergy srcEng,
const GTime srcTime 
) const
private

Integrate Psf over elliptical model.

Parameters
[in]modelElliptical model.
[in]rho_obsAngle between model centre and measured photon direction (radians).
[in]posangle_obsPosition angle of measured photon direction with respect to model centre (radians).
[in]obsDirObserved event direction.
[in]srcEngTrue photon energy.
[in]srcTimeTrue photon arrival time.

Integrates the product of the spatial model and the point spread function over the true photon arrival direction using

\[ \int_{\rho_{\rm min}}^{\rho_{\rm max}} \sin \rho \times \int_{\omega} S_{\rm p}(\rho, \omega | E, t) \times {\rm Psf}(\rho, \omega) d\omega d\rho \]

where \(S_{\rm p}(\rho, \omega | E, t)\) is the elliptical spatial model, \({\rm Psf}(\rho, \omega)\) is the point spread function, \(\rho\) is the radial distance from the model centre, and \(\omega\) is the position angle around the model centre measured counterclockwise from the connecting line between the model centre and the observed photon arrival direction.

Definition at line 976 of file GCTAResponseCube.cpp.

References gammalib::deg2rad, GCTACubePsf::delta_max(), GIntegral::fixed_iter(), irf(), gammalib::is_infinite(), gammalib::is_notanumber(), gammalib::pihalf, GModelSpatialElliptical::posangle(), psf(), GIntegral::romberg(), GModelSpatialElliptical::semimajor(), GModelSpatialElliptical::semiminor(), and GModelSpatialElliptical::theta_max().

Referenced by irf_elliptical().

double GCTAResponseCube::psf_radial ( const GModelSpatialRadial model,
const double &  delta_mod,
const GSkyDir obsDir,
const GEnergy srcEng,
const GTime srcTime 
) const
private

Integrate Psf over radial model.

Parameters
[in]modelRadial model.
[in]delta_modAngle between model centre and measured photon direction (radians).
[in]obsDirObserved event direction.
[in]srcEngTrue photon energy.
[in]srcTimeTrue photon arrival time.

Integrates the product of the spatial model and the point spread function over the true photon arrival direction using

\[ \int_{\delta_{\rm min}}^{\delta_{\rm max}} \sin \delta \times {\rm Psf}(\delta) \times \int_{\phi_{\rm min}}^{\phi_{\rm max}} S_{\rm p}(\delta, \phi | E, t) d\phi d\delta \]

where \(S_{\rm p}(\delta, \phi | E, t)\) is the radial spatial model, \({\rm Psf}(\delta)\) is the point spread function, \(\delta\) is angular distance between the true and the measured photon direction, and \(\phi\) is the position angle around the observed photon direction measured counterclockwise from the connecting line between the model centre and the observed photon arrival direction.

Definition at line 749 of file GCTAResponseCube.cpp.

References GCTACubePsf::delta_max(), GIntegral::fixed_iter(), gammalib::is_infinite(), gammalib::is_notanumber(), gammalib::iter_phi(), psf(), GIntegral::romberg(), and GModelSpatialRadial::theta_max().

Referenced by irf_radial().

void GCTAResponseCube::read ( const GXmlElement xml)
virtual

Read response information from XML element.

Parameters
[in]xmlXML element.

Reads response information from an XML element. The Exposure, Psf, background cubes, and optionally the energy dispersion cube, are specified using

 <observation name="..." id="..." instrument="...">
   ...
   <parameter name="ExposureCube" file="..."/>
   <parameter name="PsfCube"      file="..."/>
   <parameter name="EdispCube"    file="..."/>
   <parameter name="BkgCube"      file="..."/>
 </observation>

Implements GCTAResponse.

Definition at line 463 of file GCTAResponseCube.cpp.

References GXmlElement::attribute(), clear(), G_READ, GCTACubeBackground::load(), GCTACubeExposure::load(), GCTACubePsf::load(), GCTACubeEdisp::load(), m_background, m_edisp, m_exposure, m_has_edisp, m_psf, gammalib::xml_file_expand(), gammalib::xml_get_par(), and gammalib::xml_has_par().

Referenced by GCTAResponseCube().

bool GCTAResponseCube::use_edisp ( void  ) const
inlinevirtual

Signal if response uses energy dispersion.

Returns
True if response uses energy dispersion

Signals if the response uses energy dispersion. This implies that the apply_edisp flag has been set to true and that energy dispersion response information is available.

Implements GCTAResponse.

Definition at line 198 of file GCTAResponseCube.hpp.

References m_apply_edisp, and m_has_edisp.

Referenced by irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), and print().

bool GCTAResponseCube::use_tdisp ( void  ) const
inlinevirtual

Signal if time dispersion will be used.

Returns
False.

Implements GCTAResponse.

Definition at line 210 of file GCTAResponseCube.hpp.

void GCTAResponseCube::write ( GXmlElement xml) const
virtual

Write response information into XML element.

Parameters
[in]xmlXML element.

Writes response information into an XML element. The Exposure, Psf and background cubes, and optionally the energy dispersion cube, are specified using

 <observation name="..." id="..." instrument="...">
   ...
   <parameter name="ExposureCube" file="..."/>
   <parameter name="PsfCube"      file="..."/>
   <parameter name="EdispCube"    file="..."/>
   <parameter name="BkgCube"      file="..."/>
 </observation>

Implements GCTAResponse.

Definition at line 520 of file GCTAResponseCube.cpp.

References GXmlElement::attribute(), GCTACubeBackground::filename(), GCTACubeExposure::filename(), GCTACubePsf::filename(), GCTACubeEdisp::filename(), G_WRITE, m_background, m_edisp, m_exposure, m_has_edisp, m_psf, gammalib::xml_file_reduce(), and gammalib::xml_need_par().

Member Data Documentation

bool GCTAResponseCube::m_apply_edisp
mutableprivate

Apply energy dispersion.

Definition at line 149 of file GCTAResponseCube.hpp.

Referenced by apply_edisp(), copy_members(), init_members(), and use_edisp().

GCTACubeBackground GCTAResponseCube::m_background
private

Background cube.

Definition at line 147 of file GCTAResponseCube.hpp.

Referenced by background(), copy_members(), GCTAResponseCube(), init_members(), print(), read(), and write().

std::vector<GCTACubeSource*> GCTAResponseCube::m_cache
mutableprivate

Response cache.

Definition at line 154 of file GCTAResponseCube.hpp.

Referenced by cache_index(), copy_members(), free_members(), and init_members().

GNodeArray GCTAResponseCube::m_diffuse_logE
mutableprivate

Diffuse energy.

Definition at line 155 of file GCTAResponseCube.hpp.

GCTACubeEdisp GCTAResponseCube::m_edisp
private

Energy dispersion cube.

Definition at line 148 of file GCTAResponseCube.hpp.

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

GCTACubeExposure GCTAResponseCube::m_exposure
private

Exposure cube.

Definition at line 145 of file GCTAResponseCube.hpp.

Referenced by copy_members(), exposure(), GCTAResponseCube(), init_members(), print(), read(), and write().

bool GCTAResponseCube::m_has_edisp
mutableprivate

Flag to indicate if energy.

Definition at line 150 of file GCTAResponseCube.hpp.

Referenced by copy_members(), edisp(), GCTAResponseCube(), init_members(), print(), read(), use_edisp(), and write().

GCTACubePsf GCTAResponseCube::m_psf
private

Mean point spread function.

Definition at line 146 of file GCTAResponseCube.hpp.

Referenced by copy_members(), GCTAResponseCube(), init_members(), print(), psf(), read(), and write().


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