GammaLib
2.0.0
|
CTA cube-style response function class. More...
#include <GCTAResponseCube.hpp>
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 GCTAResponseCube & | operator= (const GCTAResponseCube &rsp) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear instance. More... | |
virtual GCTAResponseCube * | clone (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... | |
virtual double | irf_spatial (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response integrated over the spatial model. More... | |
const GCTACubeExposure & | exposure (void) const |
Return exposure cube. More... | |
void | exposure (const GCTACubeExposure &exposure) |
Set exposure cube. More... | |
const GCTACubePsf & | psf (void) const |
Return cube analysis point spread function. More... | |
void | psf (const GCTACubePsf &psf) |
Set cube analysis point spread function cube. More... | |
const GCTACubeEdisp & | edisp (void) const |
Return cube analysis energy dispersion cube. More... | |
void | edisp (const GCTACubeEdisp &edisp) |
Set cube analysis energy dispersion cube. More... | |
const GCTACubeBackground & | background (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 GCTAResponse & | operator= (const GCTAResponse &rsp) |
Assignment operator. 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 GResponse & | operator= (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... | |
virtual GVector | convolve (const GModelSky &model, const GObservation &obs, GMatrixSparse *gradients=NULL) const |
Convolve sky model with the instrument response. More... | |
virtual GVector | irf_spatial (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response vector integrated over the spatial model. More... | |
virtual void | remove_response_cache (const std::string &name) |
Remove response cache for model. 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... | |
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... | |
GVector | irf_radial (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to radial source. More... | |
GVector | psf_radial (const GModelSpatialRadial *model, const double &zeta, const GSkyDir &obsDir, const GEnergies &srcEngs, const GTime &srcTime, const bool &grad) const |
Integrate Psf over radial model. 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< std::string > | m_cache_names |
Model names. More... | |
std::vector< GNdarray > | m_cache_values |
Cached values. 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... | |
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... | |
GVector | eval_probs (const GModelSky &model, const GObservation &obs, GMatrixSparse *gradients=NULL) const |
Convolve sky model with the instrument response. More... | |
int | size_edisp_vector (const GModelSky &model, const GObservation &obs, const bool &grad) const |
Return size of vector for energy dispersion computation. More... | |
GEbounds | ebounds_model (const GModelSky &model) const |
Return true energy intervals for sky model. More... | |
virtual double | irf_composite (const GEvent &event, const GSource &source, const GObservation &obs) const |
Return instrument response to composite source. More... | |
virtual GVector | irf_ptsrc (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to point source sky model. More... | |
virtual GVector | irf_elliptical (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to ellipitical source sky model. More... | |
virtual GVector | irf_diffuse (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to diffuse source sky model. More... | |
virtual GVector | irf_composite (const GModelSky &model, const GObservation &obs, GMatrix *gradients=NULL) const |
Return instrument response to composite source sky model. More... | |
Protected Attributes inherited from GResponse | |
bool | m_use_irf_cache |
Control usage of irf cache. More... | |
bool | m_use_nroi_cache |
Control usage of nroi cache. More... | |
int | m_irf_radial_iter_theta |
Radial model integration theta iterations. More... | |
int | m_irf_radial_iter_phi |
Radial model integration phi iterations. More... | |
int | m_irf_elliptical_iter_theta |
Elliptical model integration theta iterations. More... | |
int | m_irf_elliptical_iter_phi |
Elliptical model integration phi iterations. More... | |
double | m_irf_diffuse_resolution |
Angular resolution for diffuse model. More... | |
GResponseCache | m_irf_cache |
GResponseCache | m_nroi_cache |
GResponseVectorCache | m_irf_vector_cache |
CTA cube-style response function class.
Definition at line 64 of file GCTAResponseCube.hpp.
GCTAResponseCube::GCTAResponseCube | ( | void | ) |
Void constructor.
Constructs void CTA response.
Definition at line 97 of file GCTAResponseCube.cpp.
References init_members().
Referenced by clone().
GCTAResponseCube::GCTAResponseCube | ( | const GCTAResponseCube & | rsp | ) |
Copy constructor.
[in] | rsp | CTA response. |
Constructs CTA cube response by making a deep copy of an existing object.
Definition at line 115 of file GCTAResponseCube.cpp.
References copy_members(), and init_members().
|
explicit |
XML constructor.
[in] | xml | XML element. |
Construct CTA response from XML element.
Definition at line 136 of file GCTAResponseCube.cpp.
References init_members(), and read().
GCTAResponseCube::GCTAResponseCube | ( | const GCTACubeExposure & | exposure, |
const GCTACubePsf & | psf, | ||
const GCTACubeBackground & | background | ||
) |
Response constructor.
[in] | exposure | CTA cube analysis exposure. |
[in] | psf | CTA cube analysis point spread function. |
[in] | background | CTA 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 159 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.
[in] | exposure | CTA cube analysis exposure. |
[in] | psf | CTA cube analysis point spread function. |
[in] | edisp | CTA cube energy dispersion response. |
[in] | background | CTA 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 191 of file GCTAResponseCube.cpp.
References background(), edisp(), exposure(), init_members(), m_background, m_edisp, m_exposure, m_has_edisp, m_psf, and psf().
|
virtual |
Destructor.
Destroys instance of CTA response object.
Definition at line 219 of file GCTAResponseCube.cpp.
References free_members().
|
inlinevirtual |
Signal if energy dispersion should be applied.
Implements GCTAResponse.
Definition at line 240 of file GCTAResponseCube.hpp.
References m_apply_edisp.
Referenced by apply_edisp(), and print().
|
inlinevirtual |
Signal if energy dispersion should be applied.
[in] | apply_edisp | Set true if energy dispersion should be applied |
Implements GCTAResponse.
Definition at line 251 of file GCTAResponseCube.hpp.
References apply_edisp(), and m_apply_edisp.
|
inline |
Return cube analysis background cube.
Definition at line 353 of file GCTAResponseCube.hpp.
References m_background.
Referenced by background(), GCTAModelCubeBackground::eval(), GCTAResponseCube(), and GCTAModelCubeBackground::npred().
|
inline |
Set cube analysis background cube.
[in] | background | Cube analysis background cube. |
Definition at line 340 of file GCTAResponseCube.hpp.
References background(), and m_background.
|
inlinevirtual |
Return class name.
Implements GCTAResponse.
Definition at line 186 of file GCTAResponseCube.hpp.
|
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 282 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().
|
virtual |
Clone instance.
Creates a clone (deep copy) of a CTA response object.
Implements GCTAResponse.
Definition at line 306 of file GCTAResponseCube.cpp.
References GCTAResponseCube().
|
private |
Copy class members.
[in] | rsp | Response. |
Definition at line 843 of file GCTAResponseCube.cpp.
References m_apply_edisp, m_background, m_cache_names, m_cache_values, m_edisp, m_exposure, m_has_edisp, and m_psf.
Referenced by GCTAResponseCube(), and operator=().
Return true energy boundaries for a specific observed energy.
[in] | obsEng | Observed photon energy. |
Implements GCTAResponse.
Definition at line 443 of file GCTAResponseCube.cpp.
References GCTACubeEdisp::ebounds(), and m_edisp.
|
inline |
Return cube analysis energy dispersion cube.
Definition at line 328 of file GCTAResponseCube.hpp.
References m_edisp.
Referenced by edisp(), GCTAResponseCube(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), and irf_radial().
|
inline |
Set cube analysis energy dispersion cube.
[in] | edisp | Cube analysis energy dispersion cube. |
Definition at line 314 of file GCTAResponseCube.hpp.
References edisp(), m_edisp, and m_has_edisp.
|
inline |
Return exposure cube.
Definition at line 264 of file GCTAResponseCube.hpp.
References m_exposure.
Referenced by exposure(), GCTAResponseCube(), irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), and irf_radial().
|
inline |
Set exposure cube.
[in] | exposure | Exposure cube. |
Definition at line 276 of file GCTAResponseCube.hpp.
References exposure(), and m_exposure.
|
private |
Delete class members.
Definition at line 865 of file GCTAResponseCube.cpp.
Referenced by clear(), operator=(), and ~GCTAResponseCube().
|
private |
Initialise class members.
Definition at line 819 of file GCTAResponseCube.cpp.
References GCTACubeBackground::clear(), GCTACubeExposure::clear(), GCTACubePsf::clear(), GCTACubeEdisp::clear(), m_apply_edisp, m_background, m_cache_names, m_cache_values, m_edisp, m_exposure, m_has_edisp, and m_psf.
Referenced by clear(), GCTAResponseCube(), and operator=().
|
virtual |
Return instrument response.
[in] | event | Observed event. |
[in] | photon | Incident photon. |
[in] | obs | Observation (not used). |
Implements GCTAResponse.
Definition at line 320 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(), irf_spatial(), and psf_elliptical().
|
privatevirtual |
Return instrument response to diffuse source.
[in] | event | Observed event. |
[in] | source | Source. |
[in] | obs | Observation. |
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.
Reimplemented from GResponse.
Definition at line 1514 of file GCTAResponseCube.cpp.
References GModelSpatialDiffuse::contains(), GCTACubeExposure::deadc(), GCTACubePsf::delta_max(), GCTAEventBin::dir(), GCTAInstDir::dir(), edisp(), GSource::energy(), GCTAEventBin::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().
Referenced by irf_spatial().
|
privatevirtual |
Return instrument response to elliptical source.
[in] | event | Observed event. |
[in] | source | Source. |
[in] | obs | Observation (not used). |
Returns the instrument response to a specified elliptical source.
Reimplemented from GResponse.
Definition at line 1408 of file GCTAResponseCube.cpp.
References GCTACubeExposure::deadc(), GCTAEventBin::dir(), GCTAInstDir::dir(), GModelSpatialElliptical::dir(), GSkyDir::dist(), edisp(), GSource::energy(), GCTAEventBin::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().
Referenced by irf_spatial().
|
privatevirtual |
Return instrument response to point source.
[in] | event | Observed event. |
[in] | source | Source. |
[in] | obs | Observation (not used). |
Returns the instrument response to a specified point source.
Reimplemented from GResponse.
Definition at line 1213 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().
Referenced by irf_spatial().
|
privatevirtual |
Return instrument response to radial source.
[in] | event | Observed event. |
[in] | source | Source. |
[in] | obs | Observation (not used). |
Returns the instrument response to a specified radial source.
Reimplemented from GResponse.
Definition at line 1306 of file GCTAResponseCube.cpp.
References GCTACubeExposure::deadc(), GCTAEventBin::dir(), GCTAInstDir::dir(), GModelSpatialRadial::dir(), GSkyDir::dist(), edisp(), GSource::energy(), GCTAEventBin::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().
Referenced by irf_spatial().
|
privatevirtual |
Return instrument response to radial source.
[in] | model | Sky model. |
[in] | obs | Observation. |
[out] | gradients | Optional spatial model gradients for all events. |
Returns the instrument response to a specified radial source.
gradients
is an optional matrix where the number of rows corresponds to the number of events in the observation and the number of columns corresponds to the number of spatial model parameters.
Reimplemented from GResponse.
Definition at line 1625 of file GCTAResponseCube.cpp.
References GEnergies::append(), GMatrix::column(), GMatrixBase::columns(), GObservation::computed_gradient(), GCTAEventCube::counts(), gammalib::cta_event_cube(), GCTACubeExposure::deadc(), GModelSpatialRadial::dir(), GSkyDir::dist(), GCTAEventCube::ebins(), GCTAEventCube::energy(), GObservation::events(), exposure(), G_IRF_RADIAL2, GOptimizerPar::has_grad(), GOptimizerPar::is_free(), GCTACubeExposure::livetime(), norm(), GCTAEventCube::npix(), psf(), psf_radial(), GMatrixBase::rows(), GEvents::size(), GModelSpatial::size(), GModelSky::spatial(), gammalib::str(), and GCTAEventCube::time().
|
virtual |
Return instrument response integrated over the spatial model.
[in] | event | Event. |
[in] | source | Source. |
[in] | obs | Observation. |
Returns the instrument response for a given event, source and observation integrated over the spatial model component. The method computes
\[ {\tt irf}(p', E', t') = \int_p M_{\rm S}(p | E, t) \, R(p', E', t' | p, E, t) \, d\,p \]
where
The integration is done over all relevant true sky directions \(p\).
Depending on the type of the source model the method branches to the following methods to perform the actual computations
irf_ptsrc() - for the handling of a point source irf_radial() - for radial models irf_elliptical() - for elliptical models irf_diffuse() - for diffuse models irf_composite() - for composite models
The method implements a caching mechanism for spatial models that have all parameters fixed. For those models the instrument response for a given event and observation is only computed once and then stored in an internal cache from which it is fetched back in case that the method is called again for the same event and observation.
Reimplemented from GResponse.
Definition at line 496 of file GCTAResponseCube.cpp.
References GModelSpatial::code(), GResponseCache::contains(), GCTAEventCube::ebins(), GSource::energy(), GObservation::events(), GMODEL_SPATIAL_COMPOSITE, GMODEL_SPATIAL_DIFFUSE, GMODEL_SPATIAL_ELLIPTICAL, GMODEL_SPATIAL_POINT_SOURCE, GMODEL_SPATIAL_RADIAL, GModelSpatial::has_free_pars(), GObservation::id(), GCTAEventBin::ieng(), GCTAEventBin::ipix(), irf(), GResponse::irf_composite(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), m_cache_names, m_cache_values, GResponse::m_irf_cache, GResponse::m_use_irf_cache, GSource::model(), GSource::name(), GCTAEventCube::nx(), GCTAEventCube::ny(), GResponseCache::set(), and use_edisp().
|
inlinevirtual |
Signal if response is valid.
Implements GCTAResponse.
Definition at line 200 of file GCTAResponseCube.hpp.
|
virtual |
Return integral of event probability for a given sky model over ROI.
[in] | model | Sky model. |
[in] | obsEng | Observed photon energy. |
[in] | obsTime | Observed photon arrival time. |
[in] | obs | Observation. |
GException::feature_not_implemented | Method 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).
Implements GCTAResponse.
Definition at line 422 of file GCTAResponseCube.cpp.
References G_NROI.
|
virtual |
Assignment operator.
[in] | rsp | 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 246 of file GCTAResponseCube.cpp.
References copy_members(), free_members(), init_members(), and GCTAResponse::operator=().
Print response information.
[in] | chatter | Chattiness. |
Implements GCTAResponse.
Definition at line 753 of file GCTAResponseCube.cpp.
References apply_edisp(), m_background, m_edisp, m_exposure, m_has_edisp, GResponse::m_irf_cache, m_psf, NORMAL, gammalib::parformat(), GCTACubeBackground::print(), GResponseCache::print(), GCTACubeExposure::print(), GCTACubePsf::print(), GCTACubeEdisp::print(), gammalib::reduce(), SILENT, and use_edisp().
|
inline |
Return cube analysis point spread function.
Definition at line 289 of file GCTAResponseCube.hpp.
References m_psf.
Referenced by cta_psf_radial_kerns_delta::eval(), 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().
|
inline |
Set cube analysis point spread function cube.
[in] | psf | Cube analysis point spread function. |
Definition at line 301 of file GCTAResponseCube.hpp.
|
private |
Integrate PSF over diffuse model.
[in] | model | Diffuse spatial model. |
[in] | obsDir | Observed event direction. |
[in] | srcEng | True photon energy. |
[in] | srcTime | True 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 1147 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().
|
private |
Integrate Psf over elliptical model.
[in] | model | Elliptical model. |
[in] | rho_obs | Angle between model centre and measured photon direction (radians). |
[in] | posangle_obs | Position angle of measured photon direction with respect to model centre (radians). |
[in] | obsDir | Observed event direction. |
[in] | srcEng | True photon energy. |
[in] | srcTime | True 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 1009 of file GCTAResponseCube.cpp.
References gammalib::deg2rad, GCTACubePsf::delta_max(), GIntegral::fixed_iter(), irf(), gammalib::is_infinite(), gammalib::is_notanumber(), gammalib::iter_phi(), gammalib::iter_rho(), gammalib::pihalf, GModelSpatialElliptical::posangle(), psf(), GIntegral::romberg(), GModelSpatialElliptical::semimajor(), GModelSpatialElliptical::semiminor(), and GModelSpatialElliptical::theta_max().
Referenced by irf_elliptical().
|
private |
Integrate Psf over radial model.
[in] | model | Radial model. |
[in] | delta_mod | Angle between model centre and measured photon direction (radians). |
[in] | obsDir | Observed event direction. |
[in] | srcEng | True photon energy. |
[in] | srcTime | True 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 901 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().
|
private |
Integrate Psf over radial model.
[in] | model | Radial model. |
[in] | zeta | Angle between model centre and event direction (radians). |
[in] | obsDir | Observed event direction. |
[in] | srcEngs | True photon energies. |
[in] | srcTime | True photon arrival time. |
[in] | grad | Compute gradients? |
Definition at line 1784 of file GCTAResponseCube.cpp.
References GCTACubePsf::delta_max(), GIntegrals::fixed_iter(), gammalib::is_infinite(), gammalib::is_notanumber(), gammalib::iter_phi(), psf(), GIntegrals::romberg(), GEnergies::size(), and GModelSpatialRadial::theta_max().
|
virtual |
Read response information from XML element.
[in] | xml | XML 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 653 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().
|
inlinevirtual |
Signal 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 216 of file GCTAResponseCube.hpp.
References m_apply_edisp, and m_has_edisp.
Referenced by irf(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), irf_spatial(), and print().
|
inlinevirtual |
Signal if time dispersion will be used.
Implements GCTAResponse.
Definition at line 228 of file GCTAResponseCube.hpp.
|
virtual |
Write response information into XML element.
[in] | xml | XML 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 710 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().
|
mutableprivate |
Apply energy dispersion.
Definition at line 171 of file GCTAResponseCube.hpp.
Referenced by apply_edisp(), copy_members(), init_members(), and use_edisp().
|
private |
Background cube.
Definition at line 169 of file GCTAResponseCube.hpp.
Referenced by background(), copy_members(), GCTAResponseCube(), init_members(), print(), read(), and write().
|
mutableprivate |
Model names.
Definition at line 175 of file GCTAResponseCube.hpp.
Referenced by copy_members(), init_members(), and irf_spatial().
|
mutableprivate |
Cached values.
Definition at line 176 of file GCTAResponseCube.hpp.
Referenced by copy_members(), init_members(), and irf_spatial().
|
private |
Energy dispersion cube.
Definition at line 170 of file GCTAResponseCube.hpp.
Referenced by copy_members(), ebounds(), edisp(), GCTAResponseCube(), init_members(), print(), read(), and write().
|
private |
Exposure cube.
Definition at line 167 of file GCTAResponseCube.hpp.
Referenced by copy_members(), exposure(), GCTAResponseCube(), init_members(), print(), read(), and write().
|
mutableprivate |
Flag to indicate if energy.
Definition at line 172 of file GCTAResponseCube.hpp.
Referenced by copy_members(), edisp(), GCTAResponseCube(), init_members(), print(), read(), use_edisp(), and write().
|
private |
Mean point spread function.
Definition at line 168 of file GCTAResponseCube.hpp.
Referenced by copy_members(), GCTAResponseCube(), init_members(), print(), psf(), read(), and write().