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

Abstract spatial model class. More...

#include <GCTAModelSpatial.hpp>

Inheritance diagram for GCTAModelSpatial:
GBase GCTAModelRadial GCTAModelSpatialGaussSpectrum GCTAModelSpatialGradient GCTAModelSpatialLookup GCTAModelSpatialMultiplicative GCTAModelRadialGauss GCTAModelRadialPolynom GCTAModelRadialProfile

Classes

class  npred_roi_kern_phi
 
class  npred_roi_kern_theta
 

Public Member Functions

 GCTAModelSpatial (void)
 Void constructor. More...
 
 GCTAModelSpatial (const GCTAModelSpatial &model)
 Copy constructor. More...
 
virtual ~GCTAModelSpatial (void)
 Destructor. More...
 
virtual GCTAModelSpatialoperator= (const GCTAModelSpatial &model)
 Assignment operator. More...
 
virtual GModelParoperator[] (const int &index)
 Returns model parameter. More...
 
virtual const GModelParoperator[] (const int &index) const
 Returns model parameter (const version) More...
 
virtual GModelParoperator[] (const std::string &name)
 Returns reference to model parameter. More...
 
virtual const GModelParoperator[] (const std::string &name) const
 Returns reference to model parameter (const version) More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GCTAModelSpatialclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual std::string type (void) const =0
 
virtual double eval (const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const =0
 
virtual double mc_max_value (const GCTAObservation &obs) 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 GCTAInstDir mc (const GEnergy &energy, const GTime &time, const GCTAObservation &obs, GRan &ran) const
 Returns MC instrument direction. More...
 
int size (void) const
 Return number of model parameters. More...
 
virtual double npred (const GEnergy &energy, const GTime &time, const GObservation &obs) const
 Return integral of spatial model component. 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 GCTAModelSpatial &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

std::vector< GModelPar * > m_pars
 Parameter pointers. More...
 

Detailed Description

Abstract spatial model class.

This class implements the spatial component of the CTA background model.

Definition at line 53 of file GCTAModelSpatial.hpp.

Constructor & Destructor Documentation

GCTAModelSpatial::GCTAModelSpatial ( void  )

Void constructor.

Definition at line 68 of file GCTAModelSpatial.cpp.

References init_members().

GCTAModelSpatial::GCTAModelSpatial ( const GCTAModelSpatial model)

Copy constructor.

Parameters
[in]modelSpatial model.

Definition at line 83 of file GCTAModelSpatial.cpp.

References copy_members(), and init_members().

GCTAModelSpatial::~GCTAModelSpatial ( void  )
virtual

Destructor.

Definition at line 99 of file GCTAModelSpatial.cpp.

References free_members().

Member Function Documentation

virtual std::string GCTAModelSpatial::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 GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadial, GCTAModelRadialGauss, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.

virtual void GCTAModelSpatial::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 GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadial, GCTAModelRadialGauss, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.

virtual GCTAModelSpatial* GCTAModelSpatial::clone ( void  ) const
pure virtual
void GCTAModelSpatial::copy_members ( const GCTAModelSpatial model)
protected

Copy class members.

Parameters
[in]modelSpatial background model component.

Definition at line 459 of file GCTAModelSpatial.cpp.

References m_pars.

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

virtual double GCTAModelSpatial::eval ( const GCTAInstDir dir,
const GEnergy energy,
const GTime time,
const bool &  gradients = false 
) const
pure virtual
void GCTAModelSpatial::free_members ( void  )
protected
void GCTAModelSpatial::init_members ( void  )
protected
GCTAInstDir GCTAModelSpatial::mc ( const GEnergy energy,
const GTime time,
const GCTAObservation obs,
GRan ran 
) const
virtual

Returns MC instrument direction.

Parameters
[in]energyEvent energy.
[in]timeEvent time.
[in]obsCTA Observation.
[in,out]ranRandom number generator.
Returns
Instrument direction
Exceptions
GException::invalid_return_valueSpatial background model is empty, or method repeatedly encounters zero model values.

Return random instrument direction.

Reimplemented in GCTAModelRadial.

Definition at line 266 of file GCTAModelSpatial.cpp.

References GCTARoi::centre(), GCTARoi::contains(), gammalib::deg2rad, GCTAInstDir::detx(), GCTAInstDir::dety(), GCTAInstDir::dir(), eval(), G_MC, mc_max_value(), GCTAObservation::pointing(), GCTARoi::radius(), GCTAObservation::roi(), and GRan::uniform().

Referenced by GCTAModelBackground::mc().

double GCTAModelSpatial::npred ( const GEnergy energy,
const GTime time,
const GObservation obs 
) const
virtual

Return integral of spatial model component.

Parameters
[in]energyMeasured event energy.
[in]timeMeasured event time.
[in]obsObservation.
Returns
Integral of spatial model component.

Spatially integrates the spatial background model component for a given measured event energy and event time over the region of interest (RoI) of a given observation.

The method uses a 2D Romberg integration to numerically integrate the spatial background model component.

Definition at line 377 of file GCTAModelSpatial.cpp.

References gammalib::cta_event_list(), gammalib::cta_pnt(), gammalib::deg2rad, GIntegral::fixed_iter(), G_NPRED, g_npred_resolution, GCTAPointing::instdir(), gammalib::is_infinite(), gammalib::is_notanumber(), gammalib::iter_rho(), GCTAEventList::roi(), GIntegral::romberg(), gammalib::str(), and gammalib::warning().

Referenced by GCTAModelBackground::mc(), and GCTAModelBackground::npred().

GCTAModelSpatial & GCTAModelSpatial::operator= ( const GCTAModelSpatial model)
virtual
GModelPar & GCTAModelSpatial::operator[] ( const int &  index)
virtual

Returns model parameter.

Parameters
[in]indexParameter index [0,...,size()-1].
Exceptions
GException::out_of_rangeParameter index is out of range.

Definition at line 149 of file GCTAModelSpatial.cpp.

References G_ACCESS1, m_pars, and size().

const GModelPar & GCTAModelSpatial::operator[] ( const int &  index) const
virtual

Returns model parameter (const version)

Parameters
[in]indexParameter index [0,...,size()-1].
Exceptions
GException::out_of_rangeParameter index is out of range.

Definition at line 172 of file GCTAModelSpatial.cpp.

References G_ACCESS1, m_pars, and size().

GModelPar & GCTAModelSpatial::operator[] ( const std::string &  name)
virtual

Returns reference to model parameter.

Parameters
[in]nameParameter name.
Exceptions
GException::invalid_argumentParameter with specified name not found in container.

Definition at line 195 of file GCTAModelSpatial.cpp.

References G_ACCESS2, m_pars, and size().

const GModelPar & GCTAModelSpatial::operator[] ( const std::string &  name) const
virtual

Returns reference to model parameter (const version)

Parameters
[in]nameParameter name.
Exceptions
GException::invalid_argumentParameter with specified name not found in container.

Definition at line 224 of file GCTAModelSpatial.cpp.

References G_ACCESS2, m_pars, and size().

virtual std::string GCTAModelSpatial::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 GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadialGauss, GCTAModelRadial, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.

Member Data Documentation


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