27#ifndef GMODELSPECTRALCOMPOSITE_HPP
28#define GMODELSPECTRALCOMPOSITE_HPP
65 virtual void clear(
void);
67 virtual std::string
classname(
void)
const;
68 virtual std::string
type(
void)
const;
71 const bool& gradients =
false)
const;
86 const std::string& name=
"");
120 return (
"GModelSpectralComposite");
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.
Composite spectral model class.
double m_mc_flux
Flux cache.
std::string m_type
Model type.
void free_members(void)
Delete class members.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between [emin, emax] (units: erg/cm2/s)
virtual GModelSpectralComposite * clone(void) const
Clone composite spectral model.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void update_mc_cache(const GEnergy &emin, const GEnergy &emax) const
Update Monte Carlo pre computation cache.
virtual ~GModelSpectralComposite(void)
Destructor.
void init_members(void)
Initialise class members.
std::vector< double > m_mc_probs
Probailities of individual components.
const GModelSpectral * component(const int &index) const
Returns spectral component element.
std::vector< double > m_mc_values
Parameter values.
GModelSpectralComposite(void)
Void constructor.
virtual GModelSpectralComposite & operator=(const GModelSpectralComposite &model)
Assignment operator.
GEnergy m_mc_emin
Last minimum energy.
void copy_members(const GModelSpectralComposite &model)
Copy class members.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between [emin, emax] (units: ph/cm2/s)
virtual void clear(void)
Clear composite spectral model.
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.
virtual std::string type(void) const
Return model type.
std::vector< std::string > m_components
Names of components.
GEnergy m_mc_emax
Last maximum energy.
void append(const GModelSpectral &spec, const std::string &name="")
Append spectral component.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print composite spectral model information.
std::vector< GModelSpectral * > m_spectral
Container of spectral models.
int components(void) const
Return number of spectral components.
Abstract spectral model base class.
Random number generator class.