49#define G_READ "GCTAModelSpatialGaussSpectrum::read(GXmlElement&)"
50#define G_WRITE "GCTAModelSpatialGaussSpectrum::write(GXmlElement&)"
188 if (
this != &model) {
278 const bool& gradients)
const
293 double arg = offset * offset /
sigma;
294 double arg2 = arg * arg;
295 value = std::exp(-0.5 * arg2);
301 double g_sigma = value * arg2 /
sigma;
317 #if defined(G_NAN_CHECK)
319 std::cout <<
"*** ERROR: GCTAModelSpatialGaussSpectrum::eval";
320 std::cout <<
"(offset=" << offset <<
"): NaN/Inf encountered";
321 std::cout <<
" (value=" << value;
322 std::cout <<
", energy=" << energy;
323 std::cout <<
", sigma=" <<
sigma;
324 std::cout <<
")" << std::endl;
399 std::string msg =
"Spatial model \""+xml.
attribute(
"type")+
400 "\" is not of type \""+
type()+
"\".";
480 result.append(
"=== GCTAModelSpatialGaussSpectrum ===");
492 for (
int i = 0; i < n_sigma; ++i) {
493 result.append(
"\n"+(
m_sigma)[i].print());
577 for (
int i = 0; i < n_sigma; ++i) {
CTA instrument direction class interface definition.
const GCTAModelSpatialGaussSpectrum g_cta_spatial_gauss_spec_seed
Spatial energy dependent Gaussian interface definition.
Spatial model registry class definition.
Energy value class definition.
Mathematical function definitions.
Constant spectral model class interface definition.
Spectral model registry class definition.
Time class interface definition.
CTA instrument direction class.
double theta(void) const
Return offset angle (in radians)
Spatial energy dependent Gaussian model class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
void free_members(void)
Delete class members.
virtual ~GCTAModelSpatialGaussSpectrum(void)
Destructor.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual GCTAModelSpatialGaussSpectrum & operator=(const GCTAModelSpatialGaussSpectrum &model)
Assignment operator.
void copy_members(const GCTAModelSpatialGaussSpectrum &model)
Copy class members.
void set_pointers(void)
Set pointers.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
virtual GCTAModelSpatialGaussSpectrum * clone(void) const
Clone instance.
virtual std::string type(void) const
Return model type.
void init_members(void)
Initialise class members.
virtual void clear(void)
Clear instance.
GCTAModelSpatialGaussSpectrum(void)
Void constructor.
const GModelSpectral * sigma(void) const
Return pointer to sigma spectrum.
Interface definition for the spatial model registry class.
Abstract spatial model class.
void init_members(void)
Initialise class members.
std::vector< GModelPar * > m_pars
Parameter pointers.
virtual GCTAModelSpatial & operator=(const GCTAModelSpatial &model)
Assignment operator.
void free_members(void)
Delete class members.
Class that handles energies in a unit independent way.
Constant spectral model class.
Interface definition for the spectral model registry class.
GModelSpectral * alloc(const GXmlElement &xml) const
Allocate spectral model that is found in XML element.
Abstract spectral model base class.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const =0
virtual GModelSpectral * clone(void) const =0
Clones object.
virtual void write(GXmlElement &xml) const =0
virtual std::string type(void) const =0
int size(void) const
Return number of parameters.
double gradient(void) const
Return parameter gradient.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
virtual int elements(void) const
Return number of GXMLElement children of node.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
bool is_infinite(const double &x)
Signal if argument is infinite.
bool is_notanumber(const double &x)
Signal if argument is not a number.