GammaLib
2.1.0.dev
|
Abstract spatial model class. More...
#include <GCTAModelSpatial.hpp>
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 GCTAModelSpatial & | operator= (const GCTAModelSpatial &model) |
Assignment operator. More... | |
virtual GModelPar & | operator[] (const int &index) |
Returns model parameter. More... | |
virtual const GModelPar & | operator[] (const int &index) const |
Returns model parameter (const version) More... | |
virtual GModelPar & | operator[] (const std::string &name) |
Returns reference to model parameter. More... | |
virtual const GModelPar & | operator[] (const std::string &name) const |
Returns reference to model parameter (const version) More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GCTAModelSpatial * | clone (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... | |
Abstract spatial model class.
This class implements the spatial component of the CTA background model.
Definition at line 53 of file GCTAModelSpatial.hpp.
GCTAModelSpatial::GCTAModelSpatial | ( | void | ) |
GCTAModelSpatial::GCTAModelSpatial | ( | const GCTAModelSpatial & | model | ) |
Copy constructor.
[in] | model | Spatial model. |
Definition at line 83 of file GCTAModelSpatial.cpp.
References copy_members(), and init_members().
|
virtual |
|
pure virtual |
Return 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.
|
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.
|
pure virtual |
Clones object.
Creates a deep copy of the object and returns a pointer to the object.
Implements GBase.
Implemented in GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadial, GCTAModelRadialGauss, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.
Referenced by GCTAModelSpatialMultiplicative::append(), GCTAModelBackground::copy_members(), GCTAModelBackground::GCTAModelBackground(), and GCTAModelBackground::spatial().
|
protected |
Copy class members.
[in] | model | Spatial background model component. |
Definition at line 459 of file GCTAModelSpatial.cpp.
References m_pars.
Referenced by GCTAModelSpatial(), and operator=().
|
pure virtual |
Implemented in GCTAModelSpatialLookup, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, GCTAModelSpatialGaussSpectrum, and GCTAModelRadial.
Referenced by GCTAModelBackground::eval(), and mc().
|
protected |
Delete class members.
Definition at line 472 of file GCTAModelSpatial.cpp.
Referenced by GCTAModelSpatialGaussSpectrum::clear(), GCTAModelSpatialGradient::clear(), GCTAModelSpatialMultiplicative::clear(), GCTAModelSpatialLookup::clear(), operator=(), and ~GCTAModelSpatial().
|
protected |
Initialise class members.
Definition at line 444 of file GCTAModelSpatial.cpp.
References m_pars.
Referenced by GCTAModelSpatialGaussSpectrum::clear(), GCTAModelSpatialGradient::clear(), GCTAModelSpatialMultiplicative::clear(), GCTAModelSpatialLookup::clear(), GCTAModelSpatial(), and operator=().
|
virtual |
Returns MC instrument direction.
[in] | energy | Event energy. |
[in] | time | Event time. |
[in] | obs | CTA Observation. |
[in,out] | ran | Random number generator. |
GException::invalid_return_value | Spatial 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().
|
pure virtual |
Implemented in GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadialGauss, GCTAModelRadial, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.
Referenced by mc().
|
virtual |
Return integral of spatial model component.
[in] | energy | Measured event energy. |
[in] | time | Measured event time. |
[in] | obs | Observation. |
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().
|
virtual |
Assignment operator.
[in] | model | Spatial model. |
Definition at line 120 of file GCTAModelSpatial.cpp.
References copy_members(), free_members(), and init_members().
Referenced by GCTAModelSpatialGaussSpectrum::operator=(), GCTAModelSpatialGradient::operator=(), GCTAModelSpatialMultiplicative::operator=(), and GCTAModelSpatialLookup::operator=().
|
virtual |
Returns model parameter.
[in] | index | Parameter index [0,...,size()-1]. |
GException::out_of_range | Parameter index is out of range. |
Definition at line 149 of file GCTAModelSpatial.cpp.
|
virtual |
Returns model parameter (const version)
[in] | index | Parameter index [0,...,size()-1]. |
GException::out_of_range | Parameter index is out of range. |
Definition at line 172 of file GCTAModelSpatial.cpp.
|
virtual |
Returns reference to model parameter.
[in] | name | Parameter name. |
GException::invalid_argument | Parameter with specified name not found in container. |
Definition at line 195 of file GCTAModelSpatial.cpp.
|
virtual |
Returns reference to model parameter (const version)
[in] | name | Parameter name. |
GException::invalid_argument | Parameter with specified name not found in container. |
Definition at line 224 of file GCTAModelSpatial.cpp.
Print content of object.
[in] | chatter | Chattiness (defaults to NORMAL). |
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.
|
pure virtual |
|
inline |
Return number of model parameters.
Definition at line 158 of file GCTAModelSpatial.hpp.
References m_pars.
Referenced by GCTAModelSpatialMultiplicative::copy_members(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), operator[](), GCTAModelSpatialGradient::print(), GCTAModelSpatialMultiplicative::print(), GCTAModelRadialAcceptance::print(), GCTAModelRadialGauss::print(), GCTAModelRadialPolynom::print(), GCTAModelRadialProfile::print(), GCTAModelBackground::print(), GCTAModelRadialAcceptance::set_pointers(), GCTAModelBackground::set_pointers(), and GCTAModelSpatialMultiplicative::write().
|
pure virtual |
|
pure virtual |
Implemented in GCTAModelSpatialLookup, GCTAModelRadialProfile, GCTAModelRadialPolynom, GCTAModelRadialGauss, GCTAModelRadial, GCTAModelSpatialMultiplicative, GCTAModelSpatialGradient, and GCTAModelSpatialGaussSpectrum.
Referenced by GCTAModelSpatialMultiplicative::write(), and GCTAModelBackground::write().
|
protected |
Parameter pointers.
Definition at line 148 of file GCTAModelSpatial.hpp.
Referenced by GCTAModelSpatialMultiplicative::append(), GCTAModelSpatialGradient::copy_members(), GCTAModelSpatialMultiplicative::copy_members(), GCTAModelRadialGauss::copy_members(), copy_members(), GCTAModelRadialProfile::copy_members(), GCTAModelSpatialLookup::copy_members(), GCTAModelSpatialGaussSpectrum::init_members(), GCTAModelSpatialGradient::init_members(), GCTAModelRadialGauss::init_members(), init_members(), GCTAModelRadialProfile::init_members(), GCTAModelSpatialLookup::init_members(), operator[](), GCTAModelSpatialGradient::print(), GCTAModelSpatialMultiplicative::print(), GCTAModelRadialGauss::print(), GCTAModelRadialPolynom::print(), GCTAModelRadialProfile::print(), GCTAModelSpatialGaussSpectrum::set_pointers(), size(), and GCTAModelRadialPolynom::update_pars().