45#define G_READ "GModelSpatialRadialProfileDMZhao::read(GXmlElement&)"
46#define G_WRITE "GModelSpatialRadialProfileDMZhao::write(GXmlElement&)"
153 if (
this != &model) {
427 result.append(
"=== GModelSpatialRadialProfileDMZhao ===");
432 for (
int i = 0; i <
size(); ++i) {
654 std::vector<double> bounds;
655 bounds.push_back(los_min);
656 bounds.push_back(los_max);
660 double value = integral.
romberg(bounds);
709 double g = los * los;
724 double f = std::pow(g,
m_alpha);
808 const double minradian = 0.0;
809 const int npoints = 200;
813 double dr = (
angle - minradian) / npoints;
816 for (
int i = 0; i < npoints; ++i) {
817 double r = minradian + (i * dr);
Exception handler interface definition.
Mathematical function definitions.
const GModelSpatialRadialProfileDMZhao g_radial_disk_seed
Dark Matter Zhao profile model class interface definition.
Spatial model registry class definition.
double angle(const GVector &a, const GVector &b)
Computes angle between vectors.
XML element node class interface definition.
GIntegral class interface definition.
void max_iter(const int &iter)
Set maximum number of iterations.
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.
double eval(const double &los)
Kernel for zhao halo density profile squared.
virtual double theta_max(void) const
Return maximum model radius (in radians)
virtual GModelSpatialRadialProfileDMZhao & operator=(const GModelSpatialRadialProfileDMZhao &model)
Assignment operator.
double scale_radius(void) const
Return scale radius.
void copy_members(const GModelSpatialRadialProfileDMZhao &model)
Copy class members.
GModelSpatialRadialProfileDMZhao(void)
Void constructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print information.
double m_scale_density_squared
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual ~GModelSpatialRadialProfileDMZhao(void)
Destructor.
GModelPar m_theta_min
Minimum theta angle.
virtual double profile_value(const double &theta) const
Radial profile.
GModelPar m_scale_density
Scale density of halo profile.
double jfactor(const double &angle) const
Calculate J-factor.
double m_last_scale_radius
double scale_density(void) const
Return scale density.
GModelPar m_halo_distance
Distance from earth to halo center.
GModelPar m_alpha
Power index, inverse transition region width.
virtual GModelSpatialRadialProfileDMZhao * clone(void) const
Clone radial DMZhao profile model.
void init_members(void)
Initialise class members.
GModelPar m_theta_max
Maximum theta angle.
virtual double theta_min(void) const
Return minimum model radius (in radians)
virtual void clear(void)
Clear radial DMZhao profile model.
GModelPar m_beta
Power index, slope at >> m_scale_radius.
void free_members(void)
Delete class members.
GModelPar m_scale_radius
Scale radius of halo profile.
double mass_density(const double &radius) const
Calculate Halo Mass Density.
GModelPar m_core_radius
Core radius.
double m_last_scale_density
void update(void) const
Update precomputation cache.
GModelPar m_gamma
Power index, slope at << m_scale_radius.
virtual GModelSpatialRadialProfile & operator=(const GModelSpatialRadialProfile &model)
Assignment operator.
void init_members(void)
Initialise class members.
void free_members(void)
Delete class members.
void free_members(void)
Delete class members.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual void read(const GXmlElement &xml)
Read model from XML element.
void init_members(void)
Initialise class members.
Interface definition for the spatial model registry class.
std::string m_type
Spatial model type.
std::string type(void) const
Return model type.
std::vector< GModelPar * > m_pars
Parameter pointers.
void init_members(void)
Initialise class members.
int size(void) const
Return number of parameters.
void free_members(void)
Delete class members.
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 max(void) const
Return parameter maximum boundary.
double min(void) const
Return parameter minimum boundary.
void fix(void)
Fix a parameter.
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.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
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.