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