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;
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) {
577 for (
int i = 0; i < n_sigma; ++i) {
virtual void write(GXmlElement &xml) const =0
virtual ~GCTAModelSpatialGaussSpectrum(void)
Destructor.
Abstract spatial model class.
virtual void clear(void)
Clear instance.
Energy value class definition.
Abstract spectral model base class.
void free_members(void)
Delete class members.
double gradient(void) const
Return parameter gradient.
int size(void) const
Return number of parameters.
void init_members(void)
Initialise class members.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const =0
virtual GCTAModelSpatial & operator=(const GCTAModelSpatial &model)
Assignment operator.
Spectral model registry class definition.
virtual GCTAModelSpatialGaussSpectrum * clone(void) const
Clone instance.
virtual int elements(void) const
Return number of GXMLElement children of node.
virtual std::string type(void) const =0
Interface definition for the spatial model registry class.
virtual void write(GXmlElement &xml) const
Write model into XML element.
bool is_notanumber(const double &x)
Signal if argument is not a number.
bool is_infinite(const double &x)
Signal if argument is infinite.
Spatial energy dependent Gaussian interface definition.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
double theta(void) const
Return offset angle (in radians)
void free_members(void)
Delete class members.
virtual GCTAModelSpatialGaussSpectrum & operator=(const GCTAModelSpatialGaussSpectrum &model)
Assignment operator.
Constant spectral model class interface definition.
virtual std::string type(void) const
Return model type.
void init_members(void)
Initialise class members.
const GModelSpectral * sigma(void) const
Return pointer to sigma spectrum.
CTA instrument direction class interface definition.
GModelSpectral * alloc(const GXmlElement &xml) const
Allocate spectral model that is found in XML element.
Spatial energy dependent Gaussian model class.
Interface definition for the spectral model registry class.
void copy_members(const GCTAModelSpatialGaussSpectrum &model)
Copy class members.
const GCTAModelSpatialGaussSpectrum g_cta_spatial_gauss_spec_seed
virtual GModelSpectral * clone(void) const =0
Clones object.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
GCTAModelSpatialGaussSpectrum(void)
Void constructor.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
virtual void read(const GXmlElement &xml)
Read model from XML element.
CTA instrument direction class.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::vector< GModelPar * > m_pars
Parameter pointers.
Time class interface definition.
Spatial model registry class definition.
Constant spectral model class.
Mathematical function definitions.
void set_pointers(void)
Set pointers.
Class that handles energies in a unit independent way.