42 #if defined(G_LEGACY_XML_FORMAT)
48 #define G_MC_NORM "GModelSpatialDiffuseConst::mc_norm(GSkyDir&, double&)"
49 #define G_READ "GModelSpatialDiffuseConst::read(GXmlElement&)"
50 #define G_WRITE "GModelSpatialDiffuseConst::write(GXmlElement&)"
90 const std::string& type) :
207 if (
this != &model) {
302 const bool& gradients)
const
347 double phi = 360.0 * ran.
uniform();
384 const double& radius)
const
387 if (radius < 0.0 || radius > 180.0) {
388 std::string msg =
"Invalid simulation cone radius "+
390 "a value comprised within 0 and 180 degrees.";
487 const GTime& srcTime)
const
515 result.append(
"=== GModelSpatialDiffuseConst ===");
520 for (
int i = 0; i <
size(); ++i) {
543 m_type =
"DiffuseIsotropic";
const double & factor_gradient(void) const
Return parameter factor gradient.
void init_members(void)
Initialise class members.
double norm(const GVector &vector)
Computes vector norm.
const std::string & name(void) const
Return parameter name.
double gradient(void) const
Return parameter gradient.
int size(void) const
Return number of parameters.
void free_members(void)
Delete class members.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
const double & solidangle(void) const
Return solid angle of region.
double acos(const double &arg)
Computes acos by avoiding NaN due to rounding errors.
Random number generator class.
Interface for the circular sky region class.
Interface definition for the spatial model registry class.
bool is_free(void) const
Signal if parameter is free.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print isotropic source model information.
GSkyRegionCircle m_region
Bounding circle.
virtual void set_region(void) const
Set boundary sky region.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual void write(GXmlElement &xml) const
Write model into XML element.
Class that handles photons.
const double & scale(void) const
Return parameter scale.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void init_members(void)
Initialise class members.
Abstract interface for the sky region class.
virtual double mc_norm(const GSkyDir &dir, const double &radius) const
Return normalization of constant diffuse source for Monte Carlo simulations.
virtual ~GModelSpatialDiffuseConst(void)
Destructor.
std::vector< GModelPar * > m_pars
Parameter pointers.
void rotate_deg(const double &phi, const double &theta)
Rotate sky direction by zenith and azimuth angle.
void fix(void)
Fix 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.
Spatial model registry class definition.
virtual void clear(void)
Clear isotropic spatial model.
GSkyDir m_mc_centre
Simulation cone centre.
double m_mc_cos_radius
Cosine of sim. cone radius.
Isotropic spatial model class interface definition.
virtual GModelSpatialDiffuse & operator=(const GModelSpatialDiffuse &model)
Assignment operator.
std::string type(void) const
Return model type.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
GModelSpatialDiffuseConst(void)
Void constructor.
void free_members(void)
Delete class members.
void copy_members(const GModelSpatialDiffuseConst &model)
Copy class members.
const GSkyRegion * region(void) const
Return boundary sky region.
void clear(void)
Clear sky direction.
void free_members(void)
Delete class members.
std::string m_type
Spatial model type.
virtual double eval(const GPhoton &photon, const bool &gradients=false) const
Evaluate isotropic spatial model value.
virtual GModelSpatialDiffuseConst * clone(void) const
Clone isotropic spatial model.
void range(const double &min, const double &max)
Set minimum and maximum parameter boundaries.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
const GModelSpatialDiffuseConst g_spatial_const_seed
GModelSpatialDiffuseConst & operator=(const GModelSpatialDiffuseConst &model)
Assignment operator.
Exception handler interface definition.
virtual double flux(const GSkyRegion ®ion, const GEnergy &srcEng=GEnergy(), const GTime &srcTime=GTime()) const
Returns isotropic flux integrated in sky region.
double value(void) const
Get model value.
void init_members(void)
Initialise class members.
Abstract diffuse spatial model base class.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
virtual GSkyDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const
Return MC sky direction.
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.
void autoscale(void)
Autoscale parameters.
Mathematical function definitions.
Class that handles energies in a unit independent way.
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.