36 #define G_ACCESS "GModelSpatial::operator[](std::string&)"
37 #define G_AT "GModelPar& GModelSpatial::at(int&)"
38 #define G_FLUX "GModelSpatial::flux(GSkyRegionCircle&, GEnergy&, GTime&)"
115 if (
this != &model) {
148 for (; index <
size(); ++index) {
149 if (
m_pars[index]->name() == name) {
155 if (index >=
size()) {
156 std::string msg =
"Model parameter \""+name+
"\" not found in model. "
157 "Please specify a valid model parameter name.";
181 for (; index <
size(); ++index) {
182 if (
m_pars[index]->name() == name) {
188 if (index >=
size()) {
189 std::string msg =
"Model parameter \""+name+
"\" not found in model. "
190 "Please specify a valid model parameter name.";
219 if (index < 0 || index >=
size()) {
242 if (index < 0 || index >=
size()) {
266 for (
int i = 0; i <
size(); ++i) {
267 if (
m_pars[i]->name() == name) {
289 for (
int i = 0; i <
size(); ++i) {
290 if (
m_pars[i]->is_free()) {
291 has_free_pars =
true;
309 for (
int i = 0; i <
m_pars.size(); ++i) {
345 const GTime& srcTime)
const
358 double rho_min = 0.0;
373 flux = integral.
romberg(rho_min, rho_max);
461 const double omega_min = 0.0;
479 flux = integral.
romberg(omega_min, omega_max) * sin_rho;
520 flux = m_model->eval(photon);
const GSkyDir & m_centre
Model centre.
bool overlaps(const GSkyRegion ®) const
Checks if region is overlapping with this region.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
Point source spatial model class interface definition.
int size(void) const
Return number of parameters.
GModelSpatial(void)
Void constructor.
bool has_free_pars(void) const
Checks if the spatial model has free parameters.
virtual ~GModelSpatial(void)
Destructor.
double eval(const double &omega)
Kernel for spatial model azimuth angle integration.
virtual GModelSpatial & operator=(const GModelSpatial &model)
Assignment operator.
Abstract spatial model base class interface definition.
virtual GModelPar & operator[](const int &index)
Returns model parameter.
GIntegral class interface definition.
std::string centre(const std::string &s, const int &n, const char &c= ' ')
Centre string to achieve a length of n characters.
GSkyRegionCircle m_region
Bounding circle.
void copy_members(const GModelSpatial &model)
Copy class members.
const double & radius(void) const
Return circular region radius (in degrees)
Class that handles photons.
Abstract interface for the sky region class.
double eval(const double &rho)
Kernel for spatial model radial integration.
const GModelSpatial * m_model
Spatial model.
GTime m_srcTime
Photon time.
std::vector< GModelPar * > m_pars
Parameter pointers.
void rotate(const double &phi, const double &theta)
Rotate sky direction by zenith and azimuth angle.
const double g_kludge_radius
Tiny angle (radians)
void silent(const bool &silent)
Set silence flag.
const GSkyDir & centre(void) const
Return circular region centre.
void free_members(void)
Delete class members.
std::string m_type
Spatial model type.
GModelPar & at(const int &index)
Returns model parameter.
bool has_par(const std::string &name) const
Checks if parameter name exists.
const GSkyRegion & m_region
Sky region.
virtual double flux(const GSkyRegion ®ion, const GEnergy &srcEng=GEnergy(), const GTime &srcTime=GTime()) const
Returns model flux within sky region.
GVector sin(const GVector &vector)
Computes sine of vector elements.
bool contains(const GSkyDir &dir) const
Checks if sky direction lies within region.
Exception handler interface definition.
Abstract spatial model base class.
virtual void set_region(void) const =0
void init_members(void)
Initialise class members.
GEnergy m_srcEng
Photon energy.
void autoscale(void)
Autoscale parameters.
void clear(void)
Clear instance.
Class that handles energies in a unit independent way.