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

Abstract instrument response base class. More...

#include <GResponse.hpp>

Inheritance diagram for GResponse:
GBase GCOMResponse GCTAResponse GLATResponse GMWLResponse GCTAResponseCube GCTAResponseIrf

Classes

class  edisp_kern
 

Public Member Functions

 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 void clear (void)=0
 Clear object. More...
 
virtual GResponseclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual bool use_edisp (void) const =0
 
virtual bool use_tdisp (void) const =0
 
virtual double irf (const GEvent &event, const GPhoton &photon, const GObservation &obs) const =0
 
virtual double irf (const GEvent &event, const GSource &source, const GObservation &obs) const =0
 
virtual double nroi (const GModelSky &model, const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const =0
 
virtual GEbounds ebounds (const GEnergy &obsEng) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. 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...
 

Protected Member Functions

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...
 

Detailed Description

Abstract instrument response base class.

The response function provides conversion between physical parameters (such as source position, flux, ...) and the measured instrumental parameters (such as measured energy, photon interaction, ...).

For a given observation, the irf method returns the instrument response for a given event and photon. An alternative method exists that returns the response for a specific source.

The nroi method returns the spatial integral of the instrument response function times the sky model over the region of interest. This method is only required for unbinned analysis.

The ebounds method returns the true energy boundaries for a specified measured event energy. This method is used for computing the energy dispersion.

Definition at line 67 of file GResponse.hpp.

Constructor & Destructor Documentation

GResponse::GResponse ( void  )

Void constructor.

Definition at line 72 of file GResponse.cpp.

References init_members().

GResponse::GResponse ( const GResponse rsp)

Copy constructor.

Parameters
[in]rspResponse.

Definition at line 87 of file GResponse.cpp.

References copy_members(), and init_members().

GResponse::~GResponse ( void  )
virtual

Destructor.

Definition at line 103 of file GResponse.cpp.

References free_members().

Member Function Documentation

virtual std::string GResponse::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GBase.

Implemented in GCTAResponseCube, GCTAResponseIrf, GCOMResponse, GCTAResponse, GLATResponse, and GMWLResponse.

virtual void GResponse::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GBase.

Implemented in GCTAResponseCube, GCTAResponseIrf, GCOMResponse, GCTAResponse, GLATResponse, and GMWLResponse.

virtual GResponse* GResponse::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GBase.

Implemented in GCTAResponseCube, GCTAResponseIrf, GCOMResponse, GCTAResponse, GLATResponse, and GMWLResponse.

double GResponse::convolve ( const GModelSky model,
const GEvent event,
const GObservation obs,
const bool &  grad = true 
) const
virtual

Convolve sky model with the instrument response.

Parameters
[in]modelSky model.
[in]eventEvent.
[in]obsObservation.
[in]gradShould model gradients be computed? (default: true)
Returns
Event probability.

Computes 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 \]

without taking into account any time dispersion. Energy dispersion is correctly handled by this method. If time dispersion is indeed needed, an instrument specific method needs to be provided.

Definition at line 172 of file GResponse.cpp.

References ebounds(), GEbounds::emax(), GEbounds::emin(), GEvent::energy(), eval_prob(), GIntegral::fixed_iter(), gammalib::is_infinite(), gammalib::is_notanumber(), GEnergy::MeV(), GIntegral::romberg(), GEbounds::size(), GModelSky::spatial(), and use_edisp().

void GResponse::copy_members ( const GResponse rsp)
protected

Copy class members.

Parameters
[in]rspResponse.

Definition at line 272 of file GResponse.cpp.

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

virtual GEbounds GResponse::ebounds ( const GEnergy obsEng) const
pure virtual
double GResponse::eval_prob ( const GModelSky model,
const GEvent event,
const GEnergy srcEng,
const GTime srcTime,
const GObservation obs,
const bool &  grad 
) const
protected

Convolve sky model with the instrument response.

Parameters
[in]modelSky model.
[in]eventEvent.
[in]srcEngSource energy.
[in]srcTimeSource time.
[in]obsObservation.
[in]gradShould model gradients be computed? (default: true)
Returns
Event probability.

Computes the event probability

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

for a given true energy \(E\) and time \(t\).

Definition at line 308 of file GResponse.cpp.

References GModelTemporal::eval(), GModelSpectral::eval(), GOptimizerPar::factor_gradient(), GModel::has_scales(), GObservation::instrument(), irf(), GOptimizerPar::is_free(), gammalib::is_infinite(), gammalib::is_notanumber(), GModel::name(), GOptimizerPar::name(), GOptimizerPar::scale(), GModel::scale(), GModel::scales(), GModelTemporal::size(), GModelSpectral::size(), GModelSky::spatial(), GModelSky::spectral(), and GModelSky::temporal().

Referenced by convolve(), and GResponse::edisp_kern::eval().

void GResponse::free_members ( void  )
protected
void GResponse::init_members ( void  )
protected
virtual double GResponse::irf ( const GEvent event,
const GPhoton photon,
const GObservation obs 
) const
pure virtual
virtual double GResponse::irf ( const GEvent event,
const GSource source,
const GObservation obs 
) const
pure virtual
virtual double GResponse::nroi ( const GModelSky model,
const GEnergy obsEng,
const GTime obsTime,
const GObservation obs 
) const
pure virtual
GResponse & GResponse::operator= ( const GResponse rsp)
virtual

Assignment operator.

Parameters
[in]rspResponse.
Returns
Response.

Definition at line 125 of file GResponse.cpp.

References copy_members(), free_members(), and init_members().

Referenced by GMWLResponse::operator=(), GCTAResponse::operator=(), GLATResponse::operator=(), and GCOMResponse::operator=().

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

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GBase.

Implemented in GCTAResponseCube, GCTAResponseIrf, GCTAResponse, GCOMResponse, GLATResponse, and GMWLResponse.

virtual bool GResponse::use_edisp ( void  ) const
pure virtual
virtual bool GResponse::use_tdisp ( void  ) const
pure virtual

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