27 #ifndef GMODELSPECTRALMULTIPLICATIVE_HPP
28 #define GMODELSPECTRALMULTIPLICATIVE_HPP
66 virtual void clear(
void);
68 virtual std::string
classname(
void)
const;
69 virtual std::string
type(
void)
const;
72 const bool& gradients =
false)
const;
107 double value =
m_spec[0]->eval(energy);
108 for (
size_t i = 1 ; i <
m_spec.size(); ++i) {
109 value *=
m_spec[i]->eval(energy);
152 return (
"GModelSpectralMultiplicative");
virtual void read(const GXmlElement &xml)
Read model from XML element.
std::vector< std::string > m_components
Names of components.
virtual std::string classname(void) const
Return class name.
Energy value class definition.
Abstract spectral model base class.
GModelSpectralMultiplicative(void)
Void constructor.
Multiplicative spectral model class.
eflux_kern(std::vector< GModelSpectral * > spec)
std::vector< GModelSpectral * > m_spectral
Container of spectral models.
flux_kern(std::vector< GModelSpectral * > spec)
GEnergy m_mc_emin
Last minimum energy.
Random number generator class.
Spectral nodes model class definition.
int components(void) const
Return number of spectral components.
virtual GModelSpectralMultiplicative & operator=(const GModelSpectralMultiplicative &model)
Assignment operator.
virtual ~GModelSpectralMultiplicative(void)
Destructor.
const GModelSpectral * component(const int &index) const
Return spectral model component by index.
virtual GModelSpectralMultiplicative * clone(void) const
Clone multiplicative spectral model model.
double eval(const double &x)
std::vector< double > m_mc_values
Parameter values.
double eval(const double &x)
Spectral nodes model class.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between emin, emax
void copy_members(const GModelSpectralMultiplicative &model)
Copy class members.
Single parameter function abstract base class definition.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns Monte Carlo energy between [emin, emax].
std::string m_type
Model type.
void append(const GModelSpectral &spec, const std::string &name="")
Append spectral component.
virtual std::string type(void) const
Return model type.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual void clear(void)
Clear multiplicative spectral model.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print multiplicative spectral model information.
Abstract spectral model base class interface definition.
void update_mc_cache(const GEnergy &emin, const GEnergy &emax) const
Update Monte Carlo pre computation cache.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
GEnergy m_mc_emax
Last maximum energy.
void free_members(void)
Delete class members.
std::vector< GModelSpectral * > m_spec
Spectral models.
Single parameter function abstract base class.
GModelSpectralNodes m_mc_spectrum
MC spectrum cache.
void init_members(void)
Initialise class members.
Class that handles energies in a unit independent way.