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

Multi-wavelength spectral point class. More...

#include <GMWLDatum.hpp>

Inheritance diagram for GMWLDatum:
GEventBin GEvent GBase

Public Member Functions

 GMWLDatum (void)
 Void constructor. More...
 
 GMWLDatum (const GEnergy &energy, const GEnergy &energy_err, const double &flux, const double &flux_err)
 Value constructor. More...
 
 GMWLDatum (const GMWLDatum &datum)
 Copy constructor. More...
 
virtual ~GMWLDatum (void)
 Destructor. More...
 
virtual GMWLDatumoperator= (const GMWLDatum &datum)
 Assignment operator. More...
 
virtual void clear (void)
 Clear instance. More...
 
virtual GMWLDatumclone (void) const
 Clone instance. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual double size (void) const
 Return size of spectral bins. More...
 
virtual const GMWLInstDirdir (void) const
 Return instrument direction (dummy method) More...
 
virtual const GEnergyenergy (void) const
 Return energy of spectral bin. More...
 
virtual const GTimetime (void) const
 Return time of spectral bin. More...
 
virtual double counts (void) const
 Return flux of spectral bin. More...
 
virtual double error (void) const
 Returns flux error. More...
 
virtual void counts (const double &flux)
 Set flux of spectral bin. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print spectral point information. More...
 
const double & flux (void) const
 Return flux of spectral bin. More...
 
const double & flux_err (void) const
 Return flux error of spectral bin. More...
 
const GEnergyenergy_err (void) const
 Return energy error of spectral bin. More...
 
void flux (const double &flux)
 Set flux of spectral bin. More...
 
void flux_err (const double &error)
 Set flux error of spectral bin. More...
 
void energy (const GEnergy &energy)
 Set energy of spectral bin. More...
 
void energy_err (const GEnergy &error)
 Set energy error of spectral bin. More...
 
- Public Member Functions inherited from GEventBin
 GEventBin (void)
 Void constructor. More...
 
 GEventBin (const GEventBin &bin)
 Copy constructor. More...
 
virtual ~GEventBin (void)
 Destructor. More...
 
virtual GEventBinoperator= (const GEventBin &bin)
 Assignment operator. More...
 
bool is_atom (void) const
 Signal if event is an atom. More...
 
bool is_bin (void) const
 Signal if event is a bin. More...
 
- Public Member Functions inherited from GEvent
 GEvent (void)
 Void constructor. More...
 
 GEvent (const GEvent &event)
 Copy constructor. More...
 
virtual ~GEvent (void)
 Destructor. More...
 
virtual GEventoperator= (const GEvent &event)
 Assignment operator. 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 GMWLDatum &datum)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GEventBin
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GEventBin &bin)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GEvent
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GEvent &event)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

GMWLInstDir m_dir
 Instrument direction of spectral point (not used) More...
 
GTime m_time
 Time of spectral point (not used) More...
 
GEnergy m_eng
 Energy of spectral point. More...
 
GEnergy m_eng_err
 Uncertainty in energy. More...
 
double m_flux
 Flux of spectral point (ph/cm2/s/MeV) More...
 
double m_flux_err
 Uncertainty in flux (ph/cm2/s/MeV) More...
 

Friends

class GMWLSpectrum
 Needs access to load data. More...
 

Detailed Description

Multi-wavelength spectral point class.

This class defines a spectral data point for the multi-wavelength interface. It derives from the abstract GEventBin base class.

Definition at line 45 of file GMWLDatum.hpp.

Constructor & Destructor Documentation

GMWLDatum::GMWLDatum ( void  )

Void constructor.

Creates instance of an undefined spectral point.

Definition at line 56 of file GMWLDatum.cpp.

References init_members().

Referenced by clone().

GMWLDatum::GMWLDatum ( const GEnergy energy,
const GEnergy energy_err,
const double &  flux,
const double &  flux_err 
)

Value constructor.

Parameters
[in]energyEnergy.
[in]energy_errUncertainty in energy.
[in]fluxFlux.
[in]flux_errUncertainty in flux.

Constructs spectral point.

Definition at line 76 of file GMWLDatum.cpp.

References energy(), energy_err(), flux(), flux_err(), init_members(), m_eng, m_eng_err, m_flux, and m_flux_err.

GMWLDatum::GMWLDatum ( const GMWLDatum datum)

Copy constructor.

Parameters
[in]datumSpectral point.

Creates instance by copying an existing spectral point.

Definition at line 102 of file GMWLDatum.cpp.

References copy_members(), and init_members().

GMWLDatum::~GMWLDatum ( void  )
virtual

Destructor.

Destroy instance.

Definition at line 120 of file GMWLDatum.cpp.

References free_members().

Member Function Documentation

std::string GMWLDatum::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GMWLDatum").

Implements GEventBin.

Definition at line 106 of file GMWLDatum.hpp.

void GMWLDatum::clear ( void  )
virtual

Clear instance.

This method properly resets the instance to an initial state.

Implements GEventBin.

Definition at line 179 of file GMWLDatum.cpp.

References free_members(), GEventBin::free_members(), GEvent::free_members(), init_members(), GEventBin::init_members(), and GEvent::init_members().

GMWLDatum * GMWLDatum::clone ( void  ) const
virtual

Clone instance.

Implements GEventBin.

Definition at line 199 of file GMWLDatum.cpp.

References GMWLDatum().

void GMWLDatum::copy_members ( const GMWLDatum datum)
protected

Copy class members.

Parameters
[in]datumInstance to be copied.

Definition at line 284 of file GMWLDatum.cpp.

References m_dir, m_eng, m_eng_err, m_flux, m_flux_err, and m_time.

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

double GMWLDatum::counts ( void  ) const
inlinevirtual

Return flux of spectral bin.

Returns
Flux of spectral bin.

Implements GEventBin.

Definition at line 166 of file GMWLDatum.hpp.

References m_flux.

void GMWLDatum::counts ( const double &  flux)
inlinevirtual

Set flux of spectral bin.

Parameters
[in]fluxFlux of spectral bin.

Implements GEventBin.

Definition at line 178 of file GMWLDatum.hpp.

References flux(), and m_flux.

const GMWLInstDir & GMWLDatum::dir ( void  ) const
inlinevirtual

Return instrument direction (dummy method)

Returns
Instrument direction.

Implements GEventBin.

Definition at line 130 of file GMWLDatum.hpp.

References m_dir.

const GEnergy & GMWLDatum::energy ( void  ) const
inlinevirtual

Return energy of spectral bin.

Returns
Energy of spectral bin.

Implements GEventBin.

Definition at line 142 of file GMWLDatum.hpp.

References m_eng.

Referenced by energy(), and GMWLDatum().

void GMWLDatum::energy ( const GEnergy energy)
inline

Set energy of spectral bin.

Parameters
[in]energyEnergy of spectral bin.

Definition at line 241 of file GMWLDatum.hpp.

References energy(), and m_eng.

const GEnergy & GMWLDatum::energy_err ( void  ) const
inline

Return energy error of spectral bin.

Returns
Energy error of spectral bin.

Definition at line 254 of file GMWLDatum.hpp.

References m_eng_err.

Referenced by GMWLDatum().

void GMWLDatum::energy_err ( const GEnergy error)
inline

Set energy error of spectral bin.

Parameters
[in]errorEnergy error of spectral bin.

Definition at line 266 of file GMWLDatum.hpp.

References error(), and m_eng_err.

double GMWLDatum::error ( void  ) const
virtual

Returns flux error.

Returns flux error value in units of ph/cm2/s/MeV.

If the flux error is 0 it is assumed that no flux error information is available, and in that case the flux error is assumed to 10% of the flux value. This is mainly needed for the optimizer methods to work.

Implements GEventBin.

Definition at line 214 of file GMWLDatum.cpp.

References m_flux, and m_flux_err.

Referenced by energy_err(), and flux_err().

const double & GMWLDatum::flux ( void  ) const
inline

Return flux of spectral bin.

Returns
Flux of spectral bin.

Definition at line 191 of file GMWLDatum.hpp.

References m_flux.

Referenced by counts(), flux(), and GMWLDatum().

void GMWLDatum::flux ( const double &  flux)
inline

Set flux of spectral bin.

Parameters
[in]fluxFlux of spectral bin.

Definition at line 203 of file GMWLDatum.hpp.

References flux(), and m_flux.

const double & GMWLDatum::flux_err ( void  ) const
inline

Return flux error of spectral bin.

Returns
Flux error of spectral bin.

Definition at line 216 of file GMWLDatum.hpp.

References m_flux_err.

Referenced by GMWLDatum().

void GMWLDatum::flux_err ( const double &  error)
inline

Set flux error of spectral bin.

Parameters
[in]errorFlux error of spectral bin.

Definition at line 228 of file GMWLDatum.hpp.

References error(), and m_flux_err.

void GMWLDatum::free_members ( void  )
protected

Delete class members.

This class does not allocate any memory but simply holds pointers. Hence nothing has to be deallocated.

Definition at line 305 of file GMWLDatum.cpp.

Referenced by clear(), operator=(), and ~GMWLDatum().

void GMWLDatum::init_members ( void  )
protected

Initialise class members.

Definition at line 264 of file GMWLDatum.cpp.

References GMWLInstDir::clear(), GEnergy::clear(), GTime::clear(), m_dir, m_eng, m_eng_err, m_flux, m_flux_err, and m_time.

Referenced by clear(), GMWLDatum(), and operator=().

GMWLDatum & GMWLDatum::operator= ( const GMWLDatum datum)
virtual

Assignment operator.

Parameters
[in]datumSpectral point.
Returns
Spectral point.

Copies spectral point into the instance.

Definition at line 144 of file GMWLDatum.cpp.

References copy_members(), free_members(), init_members(), and GEventBin::operator=().

std::string GMWLDatum::print ( const GChatter chatter = NORMAL) const
virtual

Print spectral point information.

Parameters
[in]chatterChattiness.
Returns
String containing spectral point information.

Implements GEventBin.

Definition at line 230 of file GMWLDatum.cpp.

References m_eng, m_eng_err, m_flux, m_flux_err, GEnergy::MeV(), GEnergy::print(), SILENT, and gammalib::str().

double GMWLDatum::size ( void  ) const
inlinevirtual

Return size of spectral bins.

Returns
Size of spectrl bin (always 1).

Implements GEventBin.

Definition at line 118 of file GMWLDatum.hpp.

const GTime & GMWLDatum::time ( void  ) const
inlinevirtual

Return time of spectral bin.

Returns
Time of spectral bin.

Implements GEventBin.

Definition at line 154 of file GMWLDatum.hpp.

References m_time.

Friends And Related Function Documentation

friend class GMWLSpectrum
friend

Needs access to load data.

Definition at line 48 of file GMWLDatum.hpp.

Member Data Documentation

GMWLInstDir GMWLDatum::m_dir
protected

Instrument direction of spectral point (not used)

Definition at line 90 of file GMWLDatum.hpp.

Referenced by copy_members(), dir(), and init_members().

GEnergy GMWLDatum::m_eng
protected

Energy of spectral point.

Definition at line 92 of file GMWLDatum.hpp.

Referenced by copy_members(), energy(), GMWLDatum(), init_members(), print(), and GMWLSpectrum::read_fits().

GEnergy GMWLDatum::m_eng_err
protected

Uncertainty in energy.

Definition at line 93 of file GMWLDatum.hpp.

Referenced by copy_members(), energy_err(), GMWLDatum(), init_members(), print(), and GMWLSpectrum::read_fits().

double GMWLDatum::m_flux
protected

Flux of spectral point (ph/cm2/s/MeV)

Definition at line 94 of file GMWLDatum.hpp.

Referenced by copy_members(), counts(), error(), flux(), GMWLDatum(), init_members(), print(), and GMWLSpectrum::read_fits().

double GMWLDatum::m_flux_err
protected

Uncertainty in flux (ph/cm2/s/MeV)

Definition at line 95 of file GMWLDatum.hpp.

Referenced by copy_members(), error(), flux_err(), GMWLDatum(), init_members(), print(), and GMWLSpectrum::read_fits().

GTime GMWLDatum::m_time
protected

Time of spectral point (not used)

Definition at line 91 of file GMWLDatum.hpp.

Referenced by copy_members(), init_members(), and time().


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