27 #ifndef GCTAONOFFOBSERVATION_HPP
28 #define GCTAONOFFOBSERVATION_HPP
80 const std::string& srcname,
85 const bool& use_model_bkg =
true);
89 const std::string& srcname,
94 const bool& use_model_bkg =
true);
102 virtual void clear(
void);
104 virtual std::string
classname(
void)
const;
108 virtual double ontime(
void)
const;
109 virtual double livetime(
void)
const;
119 double*
npred)
const;
123 void instrument(
const std::string& instrument);
144 const std::string& srcname,
147 const bool& use_model_bkg);
157 const bool& use_model_bkg);
163 const bool& use_model_bkg);
175 double* npred)
const;
179 double* npred)
const;
187 double& d2logLdsky2)
const;
210 return (
"GCTAOnOffObservation");
double m_livetime
Livetime of On observation (seconds)
virtual double likelihood_wstat(const GModels &models, GVector *gradient, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for On/Off analysis in the case of Poisson signal with measured Pois...
std::string m_instrument
Instrument name.
void apply_ebounds(const GCTAObservation &obs)
Apply CTA observation energy boundaries to On/Off observation.
void init_members(void)
Initialise class members.
virtual const GCTAResponse * response(void) const
Return pointer to CTA response function.
virtual ~GCTAOnOffObservation(void)
Destructor.
virtual GCTAOnOffObservation * clone(void) const
Clone instance.
Sparse matrix class interface definition.
virtual void clear(void)
Clear instance.
virtual double livetime(void) const
Return livetime.
virtual double npred(const GModels &models, GVector *gradients=NULL) const
Return total number (and optionally gradients) of predicted counts for all models.
double counts(void) const
Number of counts in spectrum.
Optimizer parameter container class.
void compute_bgd(const GCTAObservation &obs, const GSkyRegions &off, const GModels &models, const bool &use_model_bkg)
Compute background rate in Off regions.
Redistribution Matrix File class.
GPha model_gamma(const GModels &models) const
const GPha & off_spec(void) const
Return Off spectrum.
virtual double wstat_value(const double &non, const double &noff, const double &alpha, const double &ngam, double &nonpred, double &nbgd, double &dlogLdsky, double &d2logLdsky2) const
Evaluate log-likelihood value in energy bin for On/Off analysis by profiling over the number of backg...
const GArf & arf(void) const
Return Auxiliary Response File.
GCTAResponse * m_response
Pointer to IRFs.
Auxiliary Response File class.
GArf m_arf
Auxiliary Response Function vector.
void compute_alpha(const GCTAObservation &obs_on, const GCTAObservation &obs_off, const GSkyRegions &on, const GSkyRegions &off, const GModels &models, const bool &use_model_bkg)
Compute vector of alpha parameters.
double N_gamma(const GModels &models, const int &ibin, GVector *grad) const
XSPEC Pulse Height Analyzer class definition.
const GRmf & rmf(void) const
Return Redistribution Matrix File.
void set(const GCTAObservation &obs_on, const GCTAObservation &obs_off, const GModels &models, const std::string &srcname, const GSkyRegions &on, const GSkyRegions &off, const bool &use_model_bkg)
Set On/Off observation from a CTA observation.
Node array class interface definition.
virtual void read(const GXmlElement &xml)
Read On/Off observation from an XML element.
GCTAOnOffObservation & operator=(const GCTAOnOffObservation &obs)
Assignment operator.
XSPEC Redistribution Matrix File class definition.
void set_exposure(void)
Set ontime, livetime and deadtime correction factor.
Energy boundaries container class.
Single parameter function abstract base class definition.
void copy_members(const GCTAOnOffObservation &obs)
Copy class members.
virtual void write(GXmlElement &xml) const
write observation to an xml element
XSPEC Auxiliary Response File class definition.
bool has_response(void) const
Signal if observation contains response information.
virtual double likelihood_cstat(const GModels &models, GVector *gradient, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for On/Off analysis in the case of Poisson signal with modeled Poiss...
virtual std::string instrument(void) const
Return instrument.
const GPha & on_spec(void) const
Return On spectrum.
virtual double deadc(const GTime &time=GTime()) const
Return deadtime correction factor.
Abstract observation base class.
GRmf m_rmf
Redistribution matrix.
Abstract observation base class interface definition.
GPha model_background(const GModels &models) const
Observation container class.
CTA instrument response function class.
double m_deadc
Deadtime correction (livetime/ontime)
CTA instrument response function class.
Sky region container class.
void compute_arf_cut(const GCTAObservation &obs, const GModelSpatial &spatial, const GSkyRegions &on)
Compute ARF of On/Off observation for a IRF with radius cut.
void compute_arf(const GCTAObservation &obs, const GModelSpatial &spatial, const GSkyRegions &on)
Compute ARF of On/Off observation.
void free_members(void)
Delete class members.
double N_bgd(const GModels &models, const int &ibin, GVector *grad) const
virtual std::string print(const GChatter &chatter=NORMAL) const
Print On/Off observation information.
GCTAOnOffObservation(void)
Void constructor.
virtual double ontime(void) const
Return ontime.
GPha m_off_spec
Off counts spectrum.
void check_consistency(const std::string &method) const
Check consistency of data members.
virtual int nobserved(void) const
Return number of observed events.
virtual double likelihood(const GModels &models, GVector *gradient, GMatrixSparse *curvature, double *npred) const
Evaluate log-likelihood function for On/Off analysis.
GRmf rmf_stacked(const GRmf &rmf, const GEnergy &emin, const GEnergy &emax) const
Return RMF for stacking.
void compute_rmf(const GCTAObservation &obs, const GSkyRegions &on)
Compute RMF of On/Off observation.
GPha m_on_spec
On counts spectrum.
Abstract spatial model base class.
double m_ontime
Ontime of On observation (seconds)
virtual std::string classname(void) const
Return class name.
Abstract instrument response base class.
GArf arf_stacked(const GArf &arf, const GEnergy &emin, const GEnergy &emax) const
Return ARF for stacking.
Pulse Height Analyzer class.
double arf_rad_max(const GCTAObservation &obs, const GSkyRegions &on) const
Check if effective area IRF has a radius cut.
Class that handles energies in a unit independent way.
CTA On/Off observation class.