48 #define G_READ "GCTAModelSpatialGradient::read(GXmlElement&)"
49 #define G_WRITE "GCTAModelSpatialGradient::write(GXmlElement&)"
85 const double& dety_gradient) :
168 if (
this != &model) {
263 const bool& gradients)
const
280 #if defined(G_NAN_CHECK)
282 std::cout <<
"*** ERROR: GCTAModelSpatialGradient::eval";
283 std::cout <<
"(detx=" << detx <<
", dety=" << dety;
284 std::cout <<
"): NaN/Inf encountered";
285 std::cout <<
" (value=" << value;
286 std::cout <<
")" << std::endl;
310 double detx_min = detx_centre - radius;
311 double detx_max = detx_centre + radius;
312 double dety_min = dety_centre - radius;
313 double dety_max = dety_centre + radius;
318 double valuex = (value_min > value_max) ? value_min : value_max;
321 double valuey = (value_min > value_max) ? value_min : value_max;
322 double value = 1.0 + valuex + valuey;
391 result.append(
"=== GCTAModelSpatialGradient ===");
396 for (
int i = 0; i <
size(); ++i) {
GModelPar m_detx_gradient
DETX gradient.
Abstract spatial model class.
const double & factor_gradient(void) const
Return parameter factor gradient.
void detx(const double &x)
Set DETX coordinate (in radians)
virtual GCTAModelSpatialGradient * clone(void) const
Clone instance.
const std::string & name(void) const
Return parameter name.
Random number generator class definition.
void copy_members(const GCTAModelSpatialGradient &model)
Copy class members.
double gradient(void) const
Return parameter gradient.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
virtual void clear(void)
Clear instance.
virtual GCTAModelSpatial & operator=(const GCTAModelSpatial &model)
Assignment operator.
const double & radius(void) const
Returns radius of region of interest in degrees.
Interface definition for the spatial model registry class.
const GCTAModelSpatialGradient g_cta_spatial_gradient_seed
void free_members(void)
Delete class members.
bool is_notanumber(const double &x)
Signal if argument is not a number.
const double & scale(void) const
Return parameter scale.
bool is_infinite(const double &x)
Signal if argument is infinite.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
virtual void read(const GXmlElement &xml)
Read model from XML element.
GCTARoi roi(void) const
Get Region of Interest.
void free(void)
Free a parameter.
GModelPar m_dety_gradient
DETY gradient.
const GCTAInstDir & centre(void) const
Returns region of interest centre.
void free_members(void)
Delete class members.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
GCTAModelSpatialGradient(void)
Void constructor.
virtual ~GCTAModelSpatialGradient(void)
Destructor.
void init_members(void)
Initialise class members.
void clear(void)
Clear parameter.
CTA instrument direction class interface definition.
int size(void) const
Return number of model parameters.
Spatial gradient CTA interface definition.
CTA observation class interface definition.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
void init_members(void)
Initialise class members.
Spatial gradient CTA model class.
double detx_gradient(void) const
Return DETX gradient.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
const std::string & unit(void) const
Return parameter unit.
Exception handler interface definition.
double dety_gradient(void) const
Return DETY gradient.
virtual GCTAModelSpatialGradient & operator=(const GCTAModelSpatialGradient &model)
Assignment operator.
CTA instrument direction class.
void dety(const double &y)
Set DETY coordinate (in radians)
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::vector< GModelPar * > m_pars
Parameter pointers.
virtual std::string type(void) const
Return model type.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
Spatial model registry class definition.
Mathematical function definitions.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
Class that handles energies in a unit independent way.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
void xml_check_type(const std::string &origin, GXmlElement &xml, const std::string &type)
Checks the model type.