27 #ifndef GMODELSPECTRALLOGPARABOLA_HPP
28 #define GMODELSPECTRALLOGPARABOLA_HPP
71 const std::string&
index,
72 const std::string&
pivot,
77 const double& curvature);
86 virtual void clear(
void);
88 virtual std::string
classname(
void)
const;
89 virtual std::string
type(
void)
const;
92 const bool& gradients =
false)
const;
106 void type(
const std::string& type);
109 double index(
void)
const;
110 void index(
const double& index);
123 const GTime& time)
const;
131 const double& curvature,
158 const double& curvature,
160 flux_kern(norm, index, curvature, pivot) {};
204 return (
"GModelSpectralLogParabola");
double norm(const GVector &vector)
Computes vector norm.
Energy value class definition.
Abstract spectral model base class.
double m_mc_emax
Maximum energy.
GModelSpectralLogParabola(void)
Void constructor.
double m_mc_exponent
Exponent (index+1)
GModelPar m_index
Spectral index.
virtual void clear(void)
Clear log parabola model.
void copy_members(const GModelSpectralLogParabola &model)
Copy class members.
virtual GModelSpectralLogParabola * clone(void) const
Clone log parabola model.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print LogParabola information.
double m_last_exponent
Last exponent.
void update_eval_cache(const GEnergy &energy) const
Update eval precomputation cache.
GEnergy pivot(void) const
Return pivot energy.
Random number generator class.
double MeV(void) const
Return energy in MeV.
LogParabola spectral model class.
double m_last_log_e_norm
Last ln(E/Epivot) value.
double m_last_curvature
Last curvature parameters.
GModelPar m_pivot
Pivot energy.
virtual std::string classname(void) const
Return class name.
virtual std::string type(void) const
Return model type.
Model parameter class interface definition.
double prefactor(void) const
Return pre factor.
double m_norm
Normalization.
double eval(const double &x)
double eval(const double &x)
Single parameter function abstract base class definition.
double curvature(void) const
Return spectral curvature.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
void init_members(void)
Initialise class members.
GModelPar m_norm
Normalization factor.
eflux_kern(const double &norm, const double &index, const double &curvature, const GEnergy &pivot)
virtual void read(const GXmlElement &xml)
Read model from XML element.
void free_members(void)
Delete class members.
double m_curvature
Curvature.
std::string m_type
Model type.
double m_last_pivot
Last pivot parameter.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
GModelPar m_curvature
Curvature.
double m_mc_emin
Minimum energy.
double m_mc_pow_emin
Power of minimum energy.
Abstract spectral model base class interface definition.
double index(void) const
Return spectral index.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate model.
double m_last_e_norm
Last E/Epivot value.
GEnergy m_pivot
Pivot energy.
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
GEnergy m_last_energy
Last energy value.
double m_last_index
Last index parameter.
double value(void) const
Return parameter value.
Single parameter function abstract base class.
double m_index
Spectral index at pivot.
flux_kern(const double &norm, const double &index, const double &curvature, const GEnergy &pivot)
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
double m_mc_pow_ewidth
Power of energy width.
virtual ~GModelSpectralLogParabola(void)
Destructor.
void update_mc_cache(const GEnergy &emin, const GEnergy &emax, const GTime &time) const
Update Monte Carlo pre computation cache.
virtual GModelSpectralLogParabola & operator=(const GModelSpectralLogParabola &model)
Assignment operator.
double m_last_power
Last power value.
double m_mc_norm
Norm of powerlaw model at logparabola pivot energy.
Class that handles energies in a unit independent way.