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");
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
GModelSpectralComposite(void)
Void constructor.
std::vector< double > m_mc_probs
Probailities of individual components.
std::vector< GModelSpectral * > m_spectral
Container of spectral models.
Energy value class definition.
Abstract spectral model base class.
void init_members(void)
Initialise class members.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between emin, emax
Random number generator class.
std::string m_type
Model type.
int components(void) const
Return number of spectral components.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
Model parameter class interface definition.
virtual void read(const GXmlElement &xml)
Read model from XML element.
void append(const GModelSpectral &spec, const std::string &name="")
Append spectral component.
double m_mc_flux
Flux cache.
virtual void clear(void)
Clear composite spectral model.
std::vector< double > m_mc_values
Parameter values.
const GModelSpectral * component(const int &index) const
Returns spectral component element.
void update_mc_cache(const GEnergy &emin, const GEnergy &emax) const
Update Monte Carlo pre computation cache.
void free_members(void)
Delete class members.
Abstract spectral model base class interface definition.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void copy_members(const GModelSpectralComposite &model)
Copy class members.
Composite spectral model class.
virtual std::string classname(void) const
Return class name.
GEnergy m_mc_emax
Last maximum energy.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print composite spectral model information.
virtual std::string type(void) const
Return model type.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
virtual GModelSpectralComposite & operator=(const GModelSpectralComposite &model)
Assignment operator.
std::vector< std::string > m_components
Names of components.
virtual GModelSpectralComposite * clone(void) const
Clone composite spectral model.
virtual ~GModelSpectralComposite(void)
Destructor.
GEnergy m_mc_emin
Last minimum energy.
Class that handles energies in a unit independent way.