27 #ifndef GOBSERVATION_HPP
28 #define GOBSERVATION_HPP
82 virtual void clear(
void) = 0;
84 virtual std::string
classname(
void)
const = 0;
87 virtual std::string
instrument(
void)
const = 0;
88 virtual double ontime(
void)
const = 0;
89 virtual double livetime(
void)
const = 0;
102 double*
npred)
const;
105 GVector* gradients = NULL)
const;
110 GVector* gradients = NULL)
const;
114 const GEvent& event)
const;
126 void name(
const std::string& name);
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);
const std::string & statistic(void) const
Return optimizer statistic.
virtual double livetime(void) const =0
virtual std::string classname(void) const =0
Return class name.
double eval(const double &x)
Integration kernel for npred_spec() method.
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...
double m_grad_step_size
Gradient step size.
const GEvent * m_event
Event.
void computed_gradient(const GModel &model, const GModelPar &par) const
Signals that an analytical gradient was computed for a model parameter.
const GObservation * m_parent
Observation.
double eval(const double &x)
Integration kernel for npred() method.
virtual void read(const GXmlElement &xml)=0
virtual double ontime(void) const =0
std::string m_name
Observation name.
Sparse matrix class interface definition.
virtual std::string instrument(void) const =0
model_func(const GObservation *parent, const GModel *model, GModelPar *par, const GEvent *event)
virtual double npred_grad(const GModel &model, const GModelPar &par) const
Returns parameter gradient of Npred.
GEvents * m_events
Pointer to event container.
const GObservation * m_parent
Observation.
virtual double npred(const GModels &models, GVector *gradients=NULL) const
Return total number (and optionally gradients) of predicted counts for all models.
virtual double likelihood(const GModels &models, GVector *gradients, GMatrixSparse *curvature, double *npred) const
Compute likelihood function.
Abstract interface for the event classes.
Definition of interface for all GammaLib classes.
const GModel * m_model
Model.
std::string m_id
Observation identifier.
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 remove_response_cache(const std::string &name)
Response cache removal hook.
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 int nobserved(void) const
Return total number of observed events.
void free_members(void)
Delete class members.
virtual ~GObservation(void)
Destructor.
Model parameter class interface definition.
const std::string & id(void) const
Return observation identifier.
Single parameter function abstract base class definition.
virtual double model(const GModels &models, const GEvent &event, GVector *gradients=NULL) const
Return model value and (optionally) gradients.
Interface class for all GammaLib classes.
virtual void clear(void)=0
Clear object.
GObservation(void)
Void constructor.
virtual bool use_event_for_likelihood(const int &index) const
Check whether bin should be used for likelihood analysis.
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...
const std::string & name(void) const
Return observation name.
double eval(const double &x)
Model function evaluation for gradient computation.
const GModel * m_model
Model.
const GObservation * m_parent
Observation.
virtual double deadc(const GTime &time=GTime()) const =0
virtual GObservation * clone(void) const =0
Clones object.
npred_spec_kern(const GObservation *parent, const GModel *model, const GTime *obsTime)
GModelPar * m_par
Model parameter.
GModelPar * m_par
Model parameter.
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...
void init_members(void)
Initialise class members.
Abstract observation base class.
virtual void write(GXmlElement &xml) const =0
const GModel * m_model
Model.
Abstract event container class.
const GTime * m_time
Time.
Single parameter function abstract base class.
std::string m_statistic
Optimizer statistic.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
virtual GEvents * events(void)
Return events.
const GModel * m_model
Model.
std::vector< std::string > m_pars_with_gradients
bool has_events(void) const
Signal if observation has events.
npred_func(const GObservation *parent, const GModel *model, GModelPar *par)
double eval(const double &x)
Npred function evaluation for gradient computation.
void copy_members(const GObservation &obs)
Copy class members.
virtual const double & grad_step_size(void) const
Return gradient step size.
Abstract instrument response base class.
bool has_gradient(const GModel &model, const GModelPar &par) const
Check whether a model parameter has an analytical gradient.
virtual const GResponse * response(void) const =0
Abstract event container class interface definition.
Time class interface definition.
const GObservation * m_parent
Observation.
npred_kern(const GObservation *parent, const GModel *model)