27 #ifndef GOBSERVATIONS_HPP
28 #define GOBSERVATIONS_HPP
112 int size(
void)
const;
117 void remove(
const int& index);
120 bool contains(
const std::string& instrument,
121 const std::string&
id)
const;
133 double logL(
void)
const;
135 double npred(
void)
const;
136 double npred(
const std::string& name,
137 const std::string& instrument =
"")
const;
139 const std::string& instrument =
"")
const;
158 virtual double value(
void)
const;
164 double npred(
void)
const;
194 int get_index(
const std::string& instrument,
195 const std::string&
id)
const;
212 return (
"GObservations");
255 return (
int)
m_obs.size();
269 return (
m_obs.empty());
GObservations * m_this
Pointer to GObservations object.
GObservations * clone(void) const
Clone observations.
likelihood(void)
Void constructor.
double m_value
Function value.
~likelihood(void)
Destructor.
Optimizer function abstract base class.
Sparse matrix class interface definition.
void save_csv(const GFilename &filename) const
Save likelihood fit results into CSV file.
Model container class definition.
virtual double value(void) const
Return log-likelihood value of optimizer function.
void save(const GFilename &filename) const
Save observations into XML file.
Optimizer parameter container class.
void save(const GFilename &filename) const
Save likelihood fit results into a CSV or FITS file.
std::string classname(void) const
Return class name.
GVector * m_gradient
Pointer to gradient vector.
GMatrixSparse hessian(const GOptimizerPars &pars)
Compute Hessian matrix.
GObservation * append(const GObservation &obs)
Append observation to container.
GMatrixSparse * m_curvature
Pointer to curvature matrix.
bool contains(const std::string &instrument, const std::string &id) const
Signals if observation exists.
double m_npred
Total number of predicted events.
double logL(void) const
Return log-likelihood of models.
void errors(GOptimizer &opt)
Computes parameter errors using optimizer.
void save_fits(const GFilename &filename) const
Save likelihood fit results into FITS file.
void free_members(void)
Delete class members.
const GModels & models(void) const
Return model container.
virtual ~GObservations(void)
Destructor.
std::string print(const GChatter &chatter=NORMAL) const
Print observation list information.
GObservation * set(const int &index, const GObservation &obs)
Set observation in container.
void copy_members(const GObservations &obs)
Copy class members.
std::vector< GObservation * > m_obs
List of observations.
virtual GMatrixSparse * curvature(void)
Return pointer to curvature matrix.
Optimizer function abstract base class.
const GObservations::likelihood & function(void) const
Return likelihood function.
void errors_hessian(void)
Computes parameter errors using hessian matrix and optimizer.
void set(GObservations *obs)
Set observation container.
GObservations(void)
Void constructor.
bool is_empty(void) const
Signals if there are no observations in container.
GModels m_models
List of models.
GObservations & operator=(const GObservations &obs)
Assignment operator.
double npred(void) const
Return total number of predicted events in models.
int get_index(const std::string &instrument, const std::string &id) const
Return observation index by instrument and identifier.
void read(const GXml &xml)
Read observations from XML document.
std::vector< std::string > covariance_names(void) const
Return covariance matrix row and column names.
void init_members(void)
Initialise class members.
likelihood & operator=(const likelihood &fct)
Assignment operator.
Abstract optimizer abstract base class.
double npred(void) const
Return total number of predicted events.
void optimize(GOptimizer &opt)
Optimize model parameters using optimizer.
Abstract observation base class.
int size(void) const
Return number of observations in container.
Abstract observation base class interface definition.
void eval(void)
Evaluate function.
Observation container class.
GObservation * insert(const int &index, const GObservation &obs)
Insert observation into container.
virtual void eval(const GOptimizerPars &pars)
Evaluate log-likelihood function.
int nobserved(void) const
Return total number of observed events.
void extend(const GObservations &obs)
Append observations from observation container.
GMatrixSparse covariance(void) const
Compute covariance matrix.
void write(GXml &xml) const
Write observations into XML document.
void copy_members(const likelihood &fct)
Copy class members.
GObservation * operator[](const int &index)
Return pointer to observation.
Definition of interface for container classes.
void load(const GFilename &filename)
Load observations from XML file.
void clear(void)
Clear observations.
void free_members(void)
Delete class members.
void remove_response_cache(void)
Remove response cache for all models.
GObservations::likelihood m_fct
Optimizer function.
void init_members(void)
Initialise class members.
GObservation * at(const int &index)
Return pointer to observation.
virtual GVector * gradient(void)
Return pointer to gradient vector.
Interface class for container classes.
void reserve(const int &num)
Reserves space for observations in container.