27#ifndef GOBSERVATION_HPP
28#define GOBSERVATION_HPP
88 virtual double ontime(
void)
const = 0;
102 double*
npred)
const;
105 GVector* gradients = NULL)
const;
110 GVector* gradients = NULL)
const;
114 const GEvent& event)
const;
127 void id(
const std::string&
id);
129 const std::string&
name(
void)
const;
130 const std::string&
id(
void)
const;
131 const std::string&
statistic(
void)
const;
145 double*
npred)
const;
149 double*
npred)
const;
153 double*
npred)
const;
167 double eval(
const double& x);
185 double eval(
const double& x);
195 const GTime* obsTime) :
199 double eval(
const double& x);
215 double eval(
const double& x);
Definition of interface for all GammaLib classes.
Abstract event container class interface definition.
Single parameter function abstract base class definition.
Model parameter class interface definition.
Time class interface definition.
Interface class for all GammaLib classes.
Abstract interface for the event classes.
Abstract event container class.
Single parameter function abstract base class.
Sparse matrix class interface definition.
GModelPar * m_par
Model parameter.
const GModel * m_model
Model.
const GObservation * m_parent
Observation.
double eval(const double &x)
Model function evaluation for gradient computation.
model_func(const GObservation *parent, const GModel *model, GModelPar *par, const GEvent *event)
const GEvent * m_event
Event.
double eval(const double &x)
Npred function evaluation for gradient computation.
npred_func(const GObservation *parent, const GModel *model, GModelPar *par)
GModelPar * m_par
Model parameter.
const GModel * m_model
Model.
const GObservation * m_parent
Observation.
const GObservation * m_parent
Observation.
npred_kern(const GObservation *parent, const GModel *model)
double eval(const double &x)
Integration kernel for npred() method.
const GModel * m_model
Model.
const GModel * m_model
Model.
const GTime * m_time
Time.
double eval(const double &x)
Integration kernel for npred_spec() method.
npred_spec_kern(const GObservation *parent, const GModel *model, const GTime *obsTime)
const GObservation * m_parent
Observation.
Abstract observation base class.
std::string m_statistic
Optimizer statistic.
virtual double ontime(void) const =0
const std::string & statistic(void) const
Return optimizer statistic.
virtual void read(const GXmlElement &xml)=0
virtual double livetime(void) const =0
virtual double npred(const GModels &models, GVector *gradients=NULL) const
Return total number (and optionally gradients) of predicted counts for all models.
virtual double model(const GModels &models, const GEvent &event, GVector *gradients=NULL) const
Return model value and (optionally) gradients.
virtual void write(GXmlElement &xml) const =0
void copy_members(const GObservation &obs)
Copy class members.
virtual void clear(void)=0
Clear object.
virtual int nobserved(void) const
Return total number of observed events.
const std::string & id(void) const
Return observation identifier.
virtual double likelihood(const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
Compute likelihood function.
const std::string & name(void) const
Return observation name.
virtual bool use_event_for_likelihood(const int &index) const
Check whether bin should be used for likelihood analysis.
virtual ~GObservation(void)
Destructor.
GObservation(void)
Void constructor.
double m_grad_step_size
Gradient step size.
virtual double likelihood_poisson_unbinned(const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for Poisson statistic and unbinned analysis (version with working ar...
virtual GEvents * events(void)
Return events.
virtual std::string classname(void) const =0
Return class name.
virtual double likelihood_gaussian_binned(const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for Gaussian statistic and binned analysis (version with working arr...
void computed_gradient(const GModel &model, const GModelPar &par) const
Signals that an analytical gradient was computed for a model parameter.
virtual const GResponse * response(void) const =0
bool has_gradient(const GModel &model, const GModelPar &par) const
Check whether a model parameter has an analytical gradient.
void init_members(void)
Initialise class members.
virtual double deadc(const GTime &time=GTime()) const =0
virtual double likelihood_poisson_binned(const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for Poisson statistic and binned analysis (version with working arra...
virtual GObservation * clone(void) const =0
Clones object.
virtual double npred_spec(const GModel &model, const GTime &obsTime) const
Integrates spatially integrated Npred kernel spectrally.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
std::vector< std::string > m_pars_with_gradients
bool has_events(void) const
Signal if observation has events.
GEvents * m_events
Pointer to event container.
virtual std::string instrument(void) const =0
void free_members(void)
Delete class members.
virtual void remove_response_cache(const std::string &name)
Response cache removal hook.
std::string m_name
Observation name.
virtual double npred_grad(const GModel &model, const GModelPar &par) const
Returns parameter gradient of Npred.
virtual const double & grad_step_size(void) const
Return gradient step size.
virtual double model_grad(const GModel &model, const GModelPar &par, const GEvent &event) const
Returns parameter gradient of model for a given event.
virtual void response(const GResponse &rsp)=0
std::string m_id
Observation identifier.
Abstract instrument response base class.