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

CTA instrument response function class. More...

#include <GCTAResponse.hpp>

Inheritance diagram for GCTAResponse:
GResponse GBase GCTAResponseCube GCTAResponseIrf

Public Member Functions

 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 void clear (void)=0
 Clear object. More...
 
virtual GCTAResponseclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual bool is_valid (void) const =0
 
virtual bool use_edisp (void) const =0
 
virtual bool use_tdisp (void) const =0
 
virtual bool apply_edisp (void) const =0
 
virtual void apply_edisp (const bool &apply_edisp) const =0
 
virtual double irf (const GEvent &event, const GPhoton &photon, 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 void read (const GXmlElement &xml)=0
 
virtual void write (GXmlElement &xml) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. 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...
 

Protected Member Functions

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_ptsrc (const GEvent &event, const GSource &source, const GObservation &obs) const =0
 
virtual double irf_radial (const GEvent &event, const GSource &source, const GObservation &obs) const =0
 
virtual double irf_elliptical (const GEvent &event, const GSource &source, const GObservation &obs) const =0
 
virtual double irf_diffuse (const GEvent &event, const GSource &source, const GObservation &obs) const =0
 
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

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 instrument response function class.

This class defines the interface for the CTA response function. It provides an abstract base class to CTA response function classes.

Definition at line 56 of file GCTAResponse.hpp.

Constructor & Destructor Documentation

GCTAResponse::GCTAResponse ( void  )

Void constructor.

Constructs void CTA response.

Definition at line 62 of file GCTAResponse.cpp.

References init_members().

GCTAResponse::GCTAResponse ( const GCTAResponse rsp)

Copy constructor.

Parameters
[in]rspCTA response.

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

Definition at line 79 of file GCTAResponse.cpp.

References copy_members(), and init_members().

GCTAResponse::~GCTAResponse ( void  )
virtual

Destructor.

Destroys instance of CTA response object.

Definition at line 97 of file GCTAResponse.cpp.

References free_members().

Member Function Documentation

virtual bool GCTAResponse::apply_edisp ( void  ) const
pure virtual

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual void GCTAResponse::apply_edisp ( const bool &  apply_edisp) const
pure virtual

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual std::string GCTAResponse::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 GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual void GCTAResponse::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 GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual GCTAResponse* GCTAResponse::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 GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

Referenced by GCTAOnOffObservation::copy_members(), GCTAObservation::copy_members(), GCTAObservation::response(), and GCTAOnOffObservation::response().

void GCTAResponse::copy_members ( const GCTAResponse rsp)
protected

Copy class members.

Parameters
[in]rspResponse to be copied

Definition at line 266 of file GCTAResponse.cpp.

References m_irf_cache, m_nroi_cache, m_use_irf_cache, and m_use_nroi_cache.

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

virtual GEbounds GCTAResponse::ebounds ( const GEnergy obsEng) const
pure virtual

Implements GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

void GCTAResponse::free_members ( void  )
protected

Delete class members.

Definition at line 282 of file GCTAResponse.cpp.

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

void GCTAResponse::init_members ( void  )
protected

Initialise class members.

< Switched on by default

< Switched on by default

Definition at line 248 of file GCTAResponse.cpp.

References GCTAResponseCache::clear(), m_irf_cache, m_nroi_cache, m_use_irf_cache, and m_use_nroi_cache.

Referenced by GCTAResponseCube::clear(), GCTAResponseIrf::clear(), GCTAResponse(), and operator=().

virtual double GCTAResponse::irf ( const GEvent event,
const GPhoton photon,
const GObservation obs 
) const
pure virtual

Implements GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

Referenced by irf(), and irf_composite().

double GCTAResponse::irf ( const GEvent event,
const GSource source,
const GObservation obs 
) const
virtual

Return instrument response.

Parameters
[in]eventEvent.
[in]sourceSource.
[in]obsObservation.
Returns
Instrument response.

Returns the instrument response for a given event, source and observation.

Implements GResponse.

Definition at line 164 of file GCTAResponse.cpp.

References GModelSpatial::code(), GCTAResponseCache::contains(), gammalib::cta_dir(), GSource::energy(), G_IRF, GMODEL_SPATIAL_COMPOSITE, GMODEL_SPATIAL_DIFFUSE, GMODEL_SPATIAL_ELLIPTICAL, GMODEL_SPATIAL_POINT_SOURCE, GMODEL_SPATIAL_RADIAL, GModelSpatial::has_free_pars(), GObservation::id(), irf(), irf_composite(), irf_diffuse(), irf_elliptical(), irf_ptsrc(), irf_radial(), m_irf_cache, m_use_irf_cache, GSource::model(), GSource::name(), and GCTAResponseCache::set().

double GCTAResponse::irf_composite ( const GEvent event,
const GSource source,
const GObservation obs 
) const
protectedvirtual

Return instrument response to composite source.

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

Returns the instrument response to a specified composite source.

Definition at line 299 of file GCTAResponse.cpp.

References GModelSpatialComposite::component(), GModelSpatialComposite::components(), GSource::energy(), irf(), GSource::model(), GSource::name(), GModelSpatialComposite::scale(), sum(), GModelSpatialComposite::sum_of_scales(), and GSource::time().

Referenced by irf().

virtual double GCTAResponse::irf_diffuse ( const GEvent event,
const GSource source,
const GObservation obs 
) const
protectedpure virtual

Implemented in GCTAResponseIrf, and GCTAResponseCube.

Referenced by irf().

virtual double GCTAResponse::irf_elliptical ( const GEvent event,
const GSource source,
const GObservation obs 
) const
protectedpure virtual

Implemented in GCTAResponseIrf, and GCTAResponseCube.

Referenced by irf().

virtual double GCTAResponse::irf_ptsrc ( const GEvent event,
const GSource source,
const GObservation obs 
) const
protectedpure virtual

Implemented in GCTAResponseIrf, and GCTAResponseCube.

Referenced by irf().

virtual double GCTAResponse::irf_radial ( const GEvent event,
const GSource source,
const GObservation obs 
) const
protectedpure virtual

Implemented in GCTAResponseIrf, and GCTAResponseCube.

Referenced by irf().

virtual bool GCTAResponse::is_valid ( void  ) const
pure virtual
virtual double GCTAResponse::nroi ( const GModelSky model,
const GEnergy obsEng,
const GTime obsTime,
const GObservation obs 
) const
pure virtual

Implements GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

GCTAResponse & GCTAResponse::operator= ( const GCTAResponse 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 124 of file GCTAResponse.cpp.

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

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

virtual std::string GCTAResponse::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 GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

Referenced by GCTAObservation::print().

virtual void GCTAResponse::read ( const GXmlElement xml)
pure virtual

Implemented in GCTAResponseCube, and GCTAResponseIrf.

Referenced by GCTAObservation::read().

void GCTAResponse::remove_response_cache ( const std::string &  name)
virtual

Remove response cache for model.

Parameters
[in]nameModel name.

Remove response cache for model name from response cache.

Definition at line 228 of file GCTAResponse.cpp.

References m_irf_cache, m_nroi_cache, and GCTAResponseCache::remove().

virtual bool GCTAResponse::use_edisp ( void  ) const
pure virtual

Implements GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual bool GCTAResponse::use_tdisp ( void  ) const
pure virtual

Implements GResponse.

Implemented in GCTAResponseCube, and GCTAResponseIrf.

virtual void GCTAResponse::write ( GXmlElement xml) const
pure virtual

Implemented in GCTAResponseCube, and GCTAResponseIrf.

Referenced by GCTAObservation::write().

Member Data Documentation

GCTAResponseCache GCTAResponse::m_irf_cache
mutableprotected
GCTAResponseCache GCTAResponse::m_nroi_cache
mutableprotected
bool GCTAResponse::m_use_irf_cache
protected

Control usage of irf cache.

Definition at line 120 of file GCTAResponse.hpp.

Referenced by copy_members(), init_members(), and irf().

bool GCTAResponse::m_use_nroi_cache
protected

Control usage of nroi cache.

Definition at line 121 of file GCTAResponse.hpp.

Referenced by copy_members(), init_members(), and GCTAResponseIrf::nroi().


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