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