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
275 double distance = dir.
dist(this->
dir());
279 ( distance >=
theta_min() + margin*gammalib::deg2rad ) ) ;
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) {
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;
GModelSpatialRadialProfile(void)
Void constructor.
double norm(const GVector &vector)
Computes vector norm.
double mc_max
Maximum of profile for MC.
XML element node class interface definition.
std::vector< profile > m_profile
Pre-computation cache.
virtual double theta_min(void) const =0
Sky direction class interface definition.
std::vector< double > pars
Profile parameters.
void clear(void)
Clear node array.
Random number generator class.
void copy_members(const GModelSpatialRadialProfile &model)
Copy class members.
Interface for the circular sky region class.
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const
Return MC sky direction.
Radial profile model class interface definition.
GSkyRegionCircle m_region
Bounding circle.
void init_members(void)
Initialise class members.
bool is_notanumber(const double &x)
Signal if argument is not a number.
bool is_infinite(const double &x)
Signal if argument is infinite.
const GSkyDir & dir(void) const
Return position of radial spatial model.
void free_members(void)
Delete class members.
std::vector< GModelPar * > m_pars
Parameter pointers.
void rotate_deg(const double &phi, const double &theta)
Rotate sky direction by zenith and azimuth angle.
virtual double theta_max(void) const =0
virtual void read(const GXmlElement &xml)
Read model from XML element.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
virtual double eval(const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function (in units of sr^-1)
GNodeArray nodes
Profile nodes.
int m_num_nodes
Number of profile nodes.
const GSkyRegion * region(void) const
Return boundary sky region.
virtual GModelSpatialRadial & operator=(const GModelSpatialRadial &model)
Assignment operator.
virtual GModelSpatialRadialProfile & operator=(const GModelSpatialRadialProfile &model)
Assignment operator.
int cache_index(void) const
Return index to pre-computation cache.
virtual void set_region(void) const
Set boundary sky region.
GVector sin(const GVector &vector)
Computes sine of vector elements.
Exception handler interface definition.
double dist(const GSkyDir &dir) const
Compute angular distance between sky directions in radians.
Abstract radial spatial model base class.
virtual ~GModelSpatialRadialProfile(void)
Destructor.
void append(const double &node)
Append one node to array.
virtual bool contains(const GSkyDir &dir, const double &margin=0.0) const
Checks where model contains specified sky direction.
virtual double profile_value(const double &theta) const =0
std::vector< double > mc
Profile for MC.
std::vector< double > values
Profile values.
bool m_coord_indep
True if model independent of sky coordinates.
Mathematical function definitions.
Class that handles energies in a unit independent way.