GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GModelData Class Referenceabstract

Abstract data model class. More...

#include <GModelData.hpp>

Inheritance diagram for GModelData:
GModel GBase GCOMModelDRBFitting GCTAModelAeffBackground GCTAModelBackground GCTAModelCubeBackground GCTAModelIrfBackground GCTAModelRadialAcceptance

Public Member Functions

 GModelData (void)
 Void constructor. More...
 
 GModelData (const GXmlElement &xml)
 XML constructor. More...
 
 GModelData (const GModelData &model)
 Copy constructor. More...
 
virtual ~GModelData (void)
 Destructor. More...
 
virtual GModelDataoperator= (const GModelData &model)
 Assignment operator. More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GModelDataclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual std::string type (void) const =0
 
virtual bool is_constant (void) const =0
 
virtual double eval (const GEvent &event, const GObservation &obs, const bool &gradients=false) const =0
 
virtual double npred (const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const =0
 
virtual GEventsmc (const GObservation &obs, GRan &ran) const =0
 
virtual void read (const GXmlElement &xml)=0
 
virtual void write (GXmlElement &xml) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. More...
 
- Public Member Functions inherited from GModel
 GModel (void)
 Void constructor. More...
 
 GModel (const GXmlElement &xml)
 XML constructor. More...
 
 GModel (const GModel &model)
 Copy constructor. More...
 
virtual ~GModel (void)
 Destructor. More...
 
virtual GModeloperator= (const GModel &model)
 Assignment operator. More...
 
virtual GModelParoperator[] (const int &index)
 Returns reference to model parameter by index. More...
 
virtual const GModelParoperator[] (const int &index) const
 Returns reference to model parameter by index (const version) More...
 
virtual GModelParoperator[] (const std::string &name)
 Returns reference to model parameter by name. More...
 
virtual const GModelParoperator[] (const std::string &name) const
 Returns reference to model parameter by name const version) More...
 
int size (void) const
 Return number of parameters in model. More...
 
int scales (void) const
 Return number of scale parameters in model. More...
 
GModelParat (const int &index)
 Returns reference to model parameter by index. More...
 
const GModelParat (const int &index) const
 Returns reference to model parameter by index (const version) More...
 
bool has_par (const std::string &name) const
 Checks if parameter name exists. More...
 
bool has_scales (void) const
 Signals that model has scales. More...
 
const std::string & name (void) const
 Return parameter name. More...
 
void name (const std::string &name)
 Set parameter name. More...
 
const double & ts (void) const
 Return Test Statistic value. More...
 
void ts (const double &ts)
 Set Test Statistic value. More...
 
const bool & tscalc (void) const
 Return Test Statistic computation flag. More...
 
void tscalc (const bool &tscalc)
 Set Test Statistic computation flag. More...
 
const bool & has_ts (void) const
 Signals that model has Test Statistics value. More...
 
std::string instruments (void) const
 Returns instruments to which model applies. More...
 
void instruments (const std::string &instruments)
 Set instruments to which model applies. More...
 
GModelParscale (const int &index)
 Returns reference to scale parameter by index. More...
 
const GModelParscale (const int &index) const
 Returns reference to scale parameter by index (const version) More...
 
GModelPar scale (const std::string &instrument) const
 Returns model scale factor for a given instrument. More...
 
void scale (const GModelPar &par)
 Set model scale factor for a given instrument. More...
 
std::string ids (void) const
 Returns observation identifiers to which model applies. More...
 
void ids (const std::string &ids)
 Set observation identifiers to which model applies. More...
 
bool is_valid (const std::string &instruments, const std::string &ids) const
 Verifies if model is valid for a given instrument and identifier. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GModelData &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GModel
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GModel &model)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void read_attributes (const GXmlElement &xml)
 Read model attributes. More...
 
void write_attributes (GXmlElement &xml) const
 Write model attributes. More...
 
std::string print_attributes (void) const
 Print model attributes. More...
 
void read_scales (const GXmlElement &xml)
 Read instrument scales from XML element. More...
 
void write_scales (GXmlElement &xml) const
 Write instrument scales into XML element. More...
 

Additional Inherited Members

- Protected Attributes inherited from GModel
std::string m_name
 Model name. More...
 
std::vector< std::string > m_instruments
 Instruments to which model applies. More...
 
std::vector< GModelParm_scales
 Model instrument scale factors. More...
 
std::vector< std::string > m_ids
 Identifiers to which model applies. More...
 
std::vector< GModelPar * > m_pars
 Pointers to all model parameters. More...
 
bool m_has_ts
 Signals if TS is available. More...
 
bool m_has_tscalc
 Signals if tscalc attribute is available. More...
 
bool m_tscalc
 Signals if TS should be computed. More...
 
double m_ts
 Test Statistic of the model. More...
 

Detailed Description

Abstract data model class.

This abstract base class implements a model of the event distribution in the instrument's data space.

Definition at line 53 of file GModelData.hpp.

Constructor & Destructor Documentation

GModelData::GModelData ( void  )

Void constructor.

Definition at line 53 of file GModelData.cpp.

References init_members().

GModelData::GModelData ( const GXmlElement xml)
explicit

XML constructor.

Parameters
[in]xmlXML element.

Definition at line 68 of file GModelData.cpp.

References init_members().

GModelData::GModelData ( const GModelData model)

Copy constructor.

Parameters
[in]modelData model.

Definition at line 83 of file GModelData.cpp.

References copy_members(), and init_members().

GModelData::~GModelData ( void  )
virtual

Destructor.

Definition at line 99 of file GModelData.cpp.

References free_members().

Member Function Documentation

virtual std::string GModelData::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GModel.

Implemented in GCTAModelBackground, GCTAModelRadialAcceptance, GCTAModelCubeBackground, GCOMModelDRBFitting, GCTAModelAeffBackground, and GCTAModelIrfBackground.

virtual void GModelData::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GModel.

Implemented in GCTAModelBackground, GCTAModelRadialAcceptance, GCTAModelCubeBackground, GCOMModelDRBFitting, GCTAModelAeffBackground, and GCTAModelIrfBackground.

virtual GModelData* GModelData::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GModel.

Implemented in GCTAModelBackground, GCTAModelRadialAcceptance, GCTAModelCubeBackground, GCOMModelDRBFitting, GCTAModelAeffBackground, and GCTAModelIrfBackground.

void GModelData::copy_members ( const GModelData model)
protected

Copy class members.

Parameters
[in]modelData model.

Definition at line 171 of file GModelData.cpp.

Referenced by GModelData(), and operator=().

virtual double GModelData::eval ( const GEvent event,
const GObservation obs,
const bool &  gradients = false 
) const
pure virtual
virtual bool GModelData::is_constant ( void  ) const
pure virtual
virtual GEvents* GModelData::mc ( const GObservation obs,
GRan ran 
) const
pure virtual
virtual double GModelData::npred ( const GEnergy obsEng,
const GTime obsTime,
const GObservation obs 
) const
pure virtual
virtual std::string GModelData::print ( const GChatter chatter = NORMAL) const
pure virtual

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GModel.

Implemented in GCTAModelBackground, GCTAModelRadialAcceptance, GCTAModelCubeBackground, GCOMModelDRBFitting, GCTAModelAeffBackground, and GCTAModelIrfBackground.

virtual void GModelData::read ( const GXmlElement xml)
pure virtual
virtual std::string GModelData::type ( void  ) const
pure virtual
virtual void GModelData::write ( GXmlElement xml) const
pure virtual

The documentation for this class was generated from the following files: