149 if (
this != &model) {
192 const bool& gradients)
const
206 #if defined(G_NAN_CHECK)
208 std::cout <<
"*** ERROR: GModelSpatialRadialProfile::eval";
209 std::cout <<
"(theta=" << theta <<
"): NaN/Inf encountered";
210 std::cout <<
" (value=" << value;
211 std::cout <<
")" << std::endl;
251 double phi = 360.0 * ran.
uniform();
272 const double& margin)
const
348 for (
int i = 0; i <
m_profile.size(); ++i) {
356 for (
int k = 0; k <
m_pars.size(); ++k) {
361 m_pars[k]->name() ==
"DEC" ||
362 m_pars[k]->name() ==
"GLON" ||
363 m_pars[k]->name() ==
"GLAT")) {
393 for (
int k = 0; k <
m_pars.size(); ++k) {
405 double mc = value * std::sin(r) * dr;
411 prf.
values.push_back(value);
412 prf.
mc.push_back(
mc);
419 double inv_norm = 1.0 /
norm;
421 prf.
values[j] *= inv_norm;
Exception handler interface definition.
Mathematical function definitions.
Radial profile model class interface definition.
Sky direction class interface definition.
double norm(const GVector &vector)
Computes vector norm.
XML element node class interface definition.
Class that handles energies in a unit independent way.
virtual bool contains(const GSkyDir &dir, const double &margin=0.0) const
Checks where model contains specified sky direction.
int cache_index(void) const
Return index to pre-computation cache.
int m_num_nodes
Number of profile nodes.
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const
Return MC sky direction.
virtual GModelSpatialRadialProfile & operator=(const GModelSpatialRadialProfile &model)
Assignment operator.
std::vector< profile > m_profile
Pre-computation cache.
virtual ~GModelSpatialRadialProfile(void)
Destructor.
virtual void set_region(void) const
Set boundary sky region.
bool m_coord_indep
True if model independent of sky coordinates.
virtual double profile_value(const double &theta) const =0
virtual double theta_max(void) const =0
GModelSpatialRadialProfile(void)
Void constructor.
virtual double eval(const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function (in units of sr^-1)
void init_members(void)
Initialise class members.
void free_members(void)
Delete class members.
void copy_members(const GModelSpatialRadialProfile &model)
Copy class members.
virtual double theta_min(void) const =0
Abstract radial spatial model base class.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual GModelSpatialRadial & operator=(const GModelSpatialRadial &model)
Assignment operator.
const GSkyDir & dir(void) const
Return position of radial spatial model.
const GSkyRegion * region(void) const
Return boundary sky region.
std::vector< GModelPar * > m_pars
Parameter pointers.
GSkyRegionCircle m_region
Bounding circle.
void clear(void)
Clear node array.
void append(const double &node)
Append one node to array.
Random number generator class.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
void rotate_deg(const double &phi, const double &theta)
Rotate sky direction by zenith and azimuth angle.
double dist(const GSkyDir &dir) const
Compute angular distance between sky directions in radians.
Interface for the circular sky region class.
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::vector< double > pars
Profile parameters.
std::vector< double > mc
Profile for MC.
double mc_max
Maximum of profile for MC.
std::vector< double > values
Profile values.
GNodeArray nodes
Profile nodes.