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