27#ifndef GMODELSPECTRALBROKENPLAW_HPP
28#define GMODELSPECTRALBROKENPLAW_HPP
74 const std::string&
index2);
87 virtual void clear(
void);
89 virtual std::string
classname(
void)
const;
90 virtual std::string
type(
void)
const;
93 const bool& gradients =
false)
const;
109 double index1(
void)
const;
110 double index2(
void)
const;
161 return (
"GModelSpectralBrokenPlaw");
Energy value class definition.
Model parameter class interface 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.
Broken power law spectral model class.
GModelPar m_breakenergy
Energy of spectral break.
std::vector< double > m_mc_exp
Exponent for MC.
double m_mc_emax
Maximum energy.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between [emin, emax] (units: ph/cm2/s)
double m_mc_exponent1
Exponent (index1+1)
void init_members(void)
Initialise class members.
double index2(void) const
Return power law index2.
double m_last_breakenergy
Last breakenergy parameter.
double index1(void) const
Return power law index1.
GModelSpectralBrokenPlaw(void)
Void constructor.
void copy_members(const GModelSpectralBrokenPlaw &model)
Copy class members.
virtual ~GModelSpectralBrokenPlaw(void)
Destructor.
std::vector< double > m_mc_min
Lower boundary for MC.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual std::string type(void) const
Return model type.
void update_eval_cache(const GEnergy &energy) const
Update eval precomputation cache.
double m_mc_pow_emin
Power of minimum energy.
void free_members(void)
Delete class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print brokenpowerlaw information.
GEnergy breakenergy(void) const
Return breakenergy energy.
GModelPar m_index2
Spectral index2.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between [emin, emax] (units: erg/cm2/s)
virtual GModelSpectralBrokenPlaw * clone(void) const
Clone broken power law model.
virtual GModelSpectralBrokenPlaw & operator=(const GModelSpectralBrokenPlaw &model)
Assignment operator.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
std::vector< double > m_mc_max
Upper boundary for MC.
double m_mc_exponent2
Exponent (index2+1)
void update_mc_cache(const GEnergy &emin, const GEnergy &emax) const
Update Monte Carlo pre computation cache.
virtual std::string classname(void) const
Return class name.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
double m_last_log_e_norm
Last ln(E/Ebreakenergy) value.
GModelPar m_norm
Normalization factor.
double prefactor(void) const
Return pre factor.
double m_last_power
Last power value.
std::vector< double > m_mc_cum
Cumulative distribution.
virtual void write(GXmlElement &xml) const
Write model into XML element.
GEnergy m_last_energy
Last energy value.
double m_last_index1
Last index1 parameter.
double m_last_e_norm
Last E/Ebreakenergy value.
virtual void clear(void)
Clear broken power law model.
double m_mc_emin
Minimum energy.
std::string m_type
Model type.
double m_mc_pow_ewidth
Power of energy width.
double m_last_index2
Last index1 parameter.
GModelPar m_index1
Spectral index1.
Abstract spectral model base class.
double value(void) const
Return parameter value.
Random number generator class.