27 #ifndef GMODELSPECTRALPLAW_HPP
28 #define GMODELSPECTRALPLAW_HPP
66 const std::string&
index,
67 const std::string&
pivot);
79 virtual void clear(
void);
81 virtual std::string
classname(
void)
const;
82 virtual std::string
type(
void)
const;
85 const bool& gradients =
false)
const;
99 void type(
const std::string& type);
101 double index(
void)
const;
104 void index(
const double& index);
145 return (
"GModelSpectralPlaw");
void update_eval_cache(const GEnergy &energy) const
Update eval precomputation cache.
virtual GModelSpectralPlaw & operator=(const GModelSpectralPlaw &model)
Assignment operator.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
virtual ~GModelSpectralPlaw(void)
Destructor.
Energy value class definition.
Abstract spectral model base class.
std::string m_type
Model type.
double m_last_log_e_norm
Last ln(E/Epivot) value.
void update_mc_cache(const GEnergy &emin, const GEnergy &emax) const
Update Monte Carlo pre computation cache.
double m_last_index
Last index parameter.
Random number generator class.
double MeV(void) const
Return energy in MeV.
Power law spectral model class.
double m_last_power
Last power value.
Model parameter class interface definition.
double m_mc_exponent
Exponent (index+1)
virtual void clear(void)
Clear spectral power law model.
virtual void read(const GXmlElement &xml)
Read model from XML element.
GEnergy pivot(void) const
Return pivot energy.
double m_last_e_norm
Last E/Epivot value.
double m_mc_emin
Minimum energy.
GModelSpectralPlaw(void)
Void constructor.
double prefactor(void) const
Return pre factor.
virtual GModelSpectralPlaw * clone(void) const
Clone spectral power law model.
void init_members(void)
Initialise class members.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between emin, emax
GEnergy m_last_energy
Last energy value.
Abstract spectral model base class interface definition.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
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 powerlaw information.
double m_last_pivot
Last pivot parameter.
double value(void) const
Return parameter value.
GModelPar m_pivot
Pivot energy.
virtual std::string classname(void) const
Return class name.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
double m_mc_pow_ewidth
Power of energy width.
double index(void) const
Return power law index.
double m_mc_emax
Maximum energy.
virtual std::string type(void) const
Return model type.
GModelPar m_norm
Normalization factor.
GModelPar m_index
Spectral index.
virtual void write(GXmlElement &xml) const
Write model into XML element.
double m_last_norm
Last norm parameter.
Class that handles energies in a unit independent way.
void copy_members(const GModelSpectralPlaw &model)
Copy class members.