45 #define G_READ "GModelSpatialRadialProfileDMEinasto::read(GXmlElement&)"
46 #define G_WRITE "GModelSpatialRadialProfileDMEinasto::write(GXmlElement&)"
153 if (
this != &model) {
263 if (theta > theta_max) {
409 result.append(
"=== GModelSpatialRadialProfileDMEinasto ===");
414 for (
int i = 0; i <
size(); ++i) {
437 m_type =
"DMEinastoProfile";
610 integral.max_iter(30);
614 std::vector<double> bounds;
615 bounds.push_back(los_min);
616 bounds.push_back(los_max);
620 value = integral.romberg(bounds);
667 double g = los * los;
764 const double minradian = 0.0;
765 const int npoints = 200;
769 double dr = (angle - minradian) / npoints;
772 for (
int i = 0; i < npoints; ++i) {
773 double r = minradian + (i * dr);
GModelSpatialRadialProfileDMEinasto(void)
Void constructor.
GModelPar m_scale_density
Scale density of halo profile.
const std::string & name(void) const
Return parameter name.
XML element node class interface definition.
double gradient(void) const
Return parameter gradient.
int size(void) const
Return number of parameters.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print information.
void free_members(void)
Delete class members.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
virtual double profile_value(const double &theta) const
Radial profile.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
void init_members(void)
Initialise class members.
GModelPar m_alpha
Einasto spatial power index.
double max(void) const
Return parameter maximum boundary.
const GModelSpatialRadialDisk g_radial_disk_seed
GModelPar m_core_radius
Core radius.
double scale_density(void) const
Return scale density.
GIntegral class interface definition.
virtual double theta_max(void) const
Return maximum model radius (in radians)
Interface definition for the spatial model registry class.
double min(void) const
Return parameter minimum boundary.
void init_members(void)
Initialise class members.
GModelPar m_halo_distance
Distance from earth to halo center.
void init_members(void)
Initialise class members.
const double & scale(void) const
Return parameter scale.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
virtual GModelSpatialRadialProfileDMEinasto * clone(void) const
Clone radial DMEinasto profile model.
double m_last_scale_radius
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void free_members(void)
Delete class members.
double m_scale_density_squared
virtual double theta_min(void) const
Return minimum model radius (in radians)
void free_members(void)
Delete class members.
void free(void)
Free a parameter.
std::vector< GModelPar * > m_pars
Parameter pointers.
GModelPar m_scale_radius
Scale radius of halo profile.
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.
virtual void read(const GXmlElement &xml)
Read model from XML element.
void clear(void)
Clear parameter.
Spatial model registry class definition.
virtual void write(GXmlElement &xml) const
Write model into XML element.
double jfactor(const double &angle) const
Calculate J-factor.
double angle(const GVector &a, const GVector &b)
Computes angle between vectors.
double mass_density(const double &radius) const
Calculate halo mass density.
std::string type(void) const
Return model type.
GModelPar m_theta_max
Maximum theta angle.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void copy_members(const GModelSpatialRadialProfileDMEinasto &model)
Copy class members.
double m_last_scale_density
void free_members(void)
Delete class members.
GModelPar m_theta_min
Minimum theta angle.
std::string m_type
Spatial model type.
double scale_radius(void) const
Return scale radius.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
virtual GModelSpatialRadialProfile & operator=(const GModelSpatialRadialProfile &model)
Assignment operator.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
const std::string & unit(void) const
Return parameter unit.
virtual void clear(void)
Clear radial DMEinasto profile model.
Exception handler interface definition.
virtual GModelSpatialRadialProfileDMEinasto & operator=(const GModelSpatialRadialProfileDMEinasto &model)
Assignment operator.
Dark Matter Einasto profile model class interface definition.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
void init_members(void)
Initialise class members.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void update(void) const
Update precomputation cache.
GVector atan(const GVector &vector)
Computes arctan of vector elements.
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.
virtual ~GModelSpatialRadialProfileDMEinasto(void)
Destructor.
Mathematical function definitions.
double eval(const double &los)
Kernel for halo density profile squared.
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.