27 #ifndef GMODELSPECTRALBINS_HPP
28 #define GMODELSPECTRALBINS_HPP
61 const double&
index = -2.0);
70 virtual void clear(
void);
72 virtual std::string
classname(
void)
const;
73 virtual std::string
type(
void)
const;
76 const bool& gradients =
false)
const;
97 const double& intensity);
98 void remove(
const int&
index);
101 double index(
void)
const;
102 void index(
const double& index);
107 double intensity(
const int& index)
const;
108 void intensity(
const int& index,
const double& intensity);
109 double error(
const int& index)
const;
148 return (
"GModelSpectralBins");
162 return "BinFunction";
virtual double flux(const GEnergy &emin, const GEnergy &emax) const
Returns model photon flux between emin, emax
GEnergy emax(const int &index) const
Return upper energy limit of bin.
virtual GModelSpectralBins & operator=(const GModelSpectralBins &model)
Assignment operator.
GEnergy emin(const int &index) const
Return lower energy limit of bin.
double intensity(const int &index) const
Return bin intensity.
void insert(const int &index, const GEnergy &emin, const GEnergy &emax, const double &intensity)
Insert bin.
std::vector< GModelPar > m_emin
Lower energy limits.
Energy value class definition.
virtual std::string classname(void) const
Return class name.
void init_members(void)
Initialise class members.
Abstract spectral model base class.
std::vector< double > m_mc_max
Upper boundary for MC.
virtual double eval(const GEnergy &srcEng, const GTime &srcTime=GTime(), const bool &gradients=false) const
Evaluate function.
Random number generator class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print bin function information.
GEnergy m_mc_emax
Maximum energy.
virtual void read(const GXmlElement &xml)
Read model from XML element.
Spectral bins model class.
virtual GModelSpectralBins * clone(void) const
Clone spectral bins model.
virtual std::string type(void) const
Return model type.
std::vector< GModelPar > m_values
Bin values.
void update_pars(void)
Update parameter mapping.
void mc_update(const GEnergy &emin, const GEnergy &emax) const
Set MC pre-computation cache.
Model parameter class interface definition.
std::vector< GModelPar > m_emax
Upper energy limits.
Energy boundaries container class.
virtual double eflux(const GEnergy &emin, const GEnergy &emax) const
Returns model energy flux between emin, emax
void reserve(const int &num)
Reserve space for bins.
void append(const GEnergy &emin, const GEnergy &emax, const double &intensity)
Append bin.
std::vector< double > m_epivot
Power-law pivot energies in MeV.
void extend(const GModelSpectralBins &bins)
Append bins from bin function.
virtual ~GModelSpectralBins(void)
Destructor.
void free_members(void)
Delete class members.
GModelSpectralBins(void)
Void constructor.
int bins(void) const
Return number of bins.
Abstract spectral model base class interface definition.
GEnergy m_mc_emin
Minimum energy.
std::vector< double > m_mc_cum
Cumulative distribution.
void copy_members(const GModelSpectralBins &model)
Copy class members.
void set_cache(void) const
Set cache.
GModelPar m_index
Spectral index of all bins.
double index(void) const
Return spectral power law index.
virtual void clear(void)
Clear spectral bins model.
int bin_index(const GEnergy &energy) const
Return bin index for energy.
std::vector< double > m_mc_min
Lower boundary for MC.
std::vector< double > m_mc_exp
Exponent for MC.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual GEnergy mc(const GEnergy &emin, const GEnergy &emax, const GTime &time, GRan &ran) const
Returns MC energy between [emin, emax].
double error(const int &index) const
Return intensity error of bin.
Class that handles energies in a unit independent way.