28#ifndef GMODELSPECTRALSMOOTHBROKENPLAW_HPP
29#define GMODELSPECTRALSMOOTHBROKENPLAW_HPP
83 const std::string&
pivot,
86 const std::string&
beta);
101 virtual void clear(
void);
103 virtual std::string
classname(
void)
const;
104 virtual std::string
type(
void)
const;
107 const bool& gradients =
false)
const;
123 double index1(
void)
const;
124 double index2(
void)
const;
127 double beta(
void)
const;
152 const double&
beta) :
161 double eval(
const double& energy) {
192 double eval(
const double& energy) {
238 return (
"GModelSpectralSmoothBrokenPlaw");
Energy value class definition.
Single parameter function abstract base class definition.
Model parameter class interface definition.
Broken power law spectrum class definition.
Abstract spectral model base class interface definition.
Class that handles energies in a unit independent way.
double MeV(void) const
Return energy in MeV.
Single parameter function abstract base class.
Broken power law spectral model class.
double eval(const double &energy)
eflux_kern(const double &prefactor, const double &index1, const GEnergy &pivot, const double &index2, const GEnergy &breakenergy, const double &beta)
double m_prefactor
Normalization.
GEnergy m_pivot
Pivot energy.
double eval(const double &energy)
flux_kern(const double &prefactor, const double &index1, const GEnergy &pivot, const double &index2, const GEnergy &breakenergy, const double &beta)
double m_beta
Break smoothness parameter.
double m_index2
Spectral index2.
double m_index1
Spectral index1.
GEnergy m_breakenergy
Break energy.
Smoothly broken power law spectral model class.
GModelPar m_index1
Spectral index1.
void copy_members(const GModelSpectralSmoothBrokenPlaw &model)
Copy class members.
GEnergy breakenergy(void) const
Return breakenergy energy.
double index1(void) const
Return smoothly broken power law index1.
double m_last_log_epivot_norm
Last ln(E/Epivot) value.
double m_last_epivot_norm
Last E/Epivot value.
double m_mc_prefactor
Last pre factor.
virtual GModelSpectralSmoothBrokenPlaw * clone(void) const
Clone smoothly broken power law model.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
double beta(void) const
Returns break smoothness parameter beta.
double m_mc_breakenergy
Last break energy.
double m_last_beta
Last beta parameter.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
double m_last_pivot
Last pivot parameter.
virtual std::string type(void) const
Return model type.
GEnergy m_last_energy
Last energy value.
GEnergy pivot(void) const
Return pivot energy.
double index2(void) const
Return smoothly broken power law index2.
double m_last_epivot_pow
Last pow(E/Epivot,index1) value.
virtual std::string classname(void) const
Return class name.
virtual void read(const GXmlElement &xml)
Read model from XML element.
double m_last_breakenergy
Last breakenergy parameter.
double m_last_ebreak_norm
Last E/Ebreakenergy value.
double prefactor(void) const
Return pre factor.
double m_mc_index2
Last second index.
GModelPar m_index2
Spectral index2.
void update_eval_cache(const GEnergy &energy) const
Update eval precomputation cache.
GModelPar m_breakenergy
Energy of spectral break.
void init_members(void)
Initialise class members.
double m_mc_pivot
Last pivot energy.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print smooth broken powerlaw information.
GModelSpectralSmoothBrokenPlaw(void)
Void constructor.
GModelPar m_pivot
Pivot energy.
GModelPar m_beta
Break smoothness.
double m_last_index2
Last index2 parameter.
virtual ~GModelSpectralSmoothBrokenPlaw(void)
Destructor.
virtual void clear(void)
Clear smoothly broken power law model.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between [emin, emax] (units: ph/cm2/s)
void update_mc_cache(void) const
Update Monte Carlo pre computation cache.
double m_last_log_ebreak_norm
Last ln(E/Ebreakenergy) value.
double m_mc_index1
Last first index.
void free_members(void)
Delete class members.
GModelPar m_norm
Normalization factor.
double m_last_ebreak_pow
Last pow(E/Ebreakenergy,(index1-index2)/beta)
double m_last_index1
Last index1 parameter.
std::string m_type
Model type.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between [emin, emax] (units: erg/cm2/s)
GModelSpectralBrokenPlaw m_mc_brokenplaw
Broken power plaw.
virtual GModelSpectralSmoothBrokenPlaw & operator=(const GModelSpectralSmoothBrokenPlaw &model)
Assignment operator.
Abstract spectral model base class.
double value(void) const
Return parameter value.
Random number generator class.