51 #define G_READ "GCTAModelRadialGauss::read(GXmlElement&)"
52 #define G_WRITE "GCTAModelRadialGauss::write(GXmlElement&)"
167 if (
this != &model) {
249 const bool& gradients)
const
252 double arg = offset * offset /
sigma();
253 double arg2 = arg * arg;
254 double value =
std::exp(-0.5 * arg2);
268 #if defined(G_NAN_CHECK)
270 std::cout <<
"*** ERROR: GCTAModelRadialGauss::eval";
271 std::cout <<
"(offset=" << offset <<
"): NaN/Inf encountered";
272 std::cout <<
" (value=" << value;
273 std::cout <<
", sigma=" <<
sigma();
274 std::cout <<
")" << std::endl;
304 #if defined(G_DEBUG_MC)
313 offset = ran.
uniform() * sigma_max;
314 double arg = offset * offset /
sigma();
315 double arg2 = arg * arg;
316 value =
sin(offset * gammalib::deg2rad) *
exp(-0.5 * arg2);
318 #if defined(G_DEBUG_MC)
322 #if defined(G_DEBUG_MC)
323 std::cout <<
"#=" << n_samples <<
" ";
327 double phi = 360.0 * ran.
uniform();
474 result.append(
"=== GCTAModelRadialGauss ===");
479 for (
int i = 0; i <
size(); ++i) {
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
virtual double eval(const double &offset, const bool &gradients=false) const
Evaluate function.
virtual ~GCTAModelRadialGauss(void)
Destructor.
GCTAModelRadialGauss(void)
Void constructor.
const double & factor_gradient(void) const
Return parameter factor gradient.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
const std::string & name(void) const
Return parameter name.
virtual GCTAModelRadialGauss & operator=(const GCTAModelRadialGauss &model)
Assignment operator.
Random number generator class definition.
void free_members(void)
Delete class members.
double gradient(void) const
Return parameter gradient.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
void free_members(void)
Delete class members.
Random number generator class.
void init_members(void)
Initialise class members.
virtual void clear(void)
Clear instance.
virtual void read(const GXmlElement &xml)
Read model from XML element.
GIntegral class interface definition.
CTA radial model registry class definition.
virtual std::string type(void) const
Return model type.
double min(void) const
Return parameter minimum boundary.
Radial Gaussian CTA model class.
Interface definition for the spatial model registry class.
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.
GModelPar m_sigma
Width parameter (degrees^2)
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void free(void)
Free a parameter.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
void clear(void)
Clear parameter.
CTA instrument direction class interface definition.
void copy_members(const GCTAModelRadialGauss &model)
Copy class members.
int size(void) const
Return number of model parameters.
double sigma(void) const
Return Gaussian width parameter.
virtual GCTAModelRadialGauss * clone(void) const
Clone instance.
CTA observation class interface definition.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
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.
Interface definition for the CTA radial model registry class.
const GCTAModelRadialGauss g_cta_radial_gauss_seed
GVector sin(const GVector &vector)
Computes sine of vector elements.
Exception handler interface definition.
Radial Gaussian model class interface definition.
void init_members(void)
Initialise class members.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
CTA instrument direction class.
virtual GCTAInstDir mc(GRan &ran) const
Returns MC instrument direction.
Abstract radial acceptance model class.
virtual double omega(void) const
Returns integral over radial model (in steradians)
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::vector< GModelPar * > m_pars
Parameter pointers.
Integration class interface definition.
virtual GCTAModelRadial & operator=(const GCTAModelRadial &model)
Assignment operator.
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.
virtual void write(GXmlElement &xml) const
Write model into XML element.
Mathematical function definitions.
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.