GammaLib
2.0.0
|
Multi-wavelength spectral point class. More...
#include <GMWLDatum.hpp>
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 GMWLDatum & | operator= (const GMWLDatum &datum) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear instance. More... | |
virtual GMWLDatum * | clone (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 GMWLInstDir & | dir (void) const |
Return instrument direction (dummy method) More... | |
virtual const GEnergy & | energy (void) const |
Return energy of spectral bin. More... | |
virtual const GTime & | time (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 GEnergy & | energy_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 GEventBin & | operator= (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 GEvent & | operator= (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... | |
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.
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.
[in] | energy | Energy. |
[in] | energy_err | Uncertainty in energy. |
[in] | flux | Flux. |
[in] | flux_err | Uncertainty 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.
[in] | datum | Spectral point. |
Creates instance by copying an existing spectral point.
Definition at line 102 of file GMWLDatum.cpp.
References copy_members(), and init_members().
|
virtual |
Destructor.
Destroy instance.
Definition at line 120 of file GMWLDatum.cpp.
References free_members().
|
inlinevirtual |
Return class name.
Implements GEventBin.
Definition at line 106 of file GMWLDatum.hpp.
|
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().
|
virtual |
Clone instance.
Implements GEventBin.
Definition at line 199 of file GMWLDatum.cpp.
References GMWLDatum().
|
protected |
Copy class members.
[in] | datum | Instance 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=().
|
inlinevirtual |
Return flux of spectral bin.
Implements GEventBin.
Definition at line 166 of file GMWLDatum.hpp.
References m_flux.
|
inlinevirtual |
Set flux of spectral bin.
[in] | flux | Flux of spectral bin. |
Implements GEventBin.
Definition at line 178 of file GMWLDatum.hpp.
|
inlinevirtual |
Return instrument direction (dummy method)
Implements GEventBin.
Definition at line 130 of file GMWLDatum.hpp.
References m_dir.
|
inlinevirtual |
Return energy of spectral bin.
Implements GEventBin.
Definition at line 142 of file GMWLDatum.hpp.
References m_eng.
Referenced by energy(), and GMWLDatum().
|
inline |
Set energy of spectral bin.
[in] | energy | Energy of spectral bin. |
Definition at line 241 of file GMWLDatum.hpp.
|
inline |
Return energy error of spectral bin.
Definition at line 254 of file GMWLDatum.hpp.
References m_eng_err.
Referenced by GMWLDatum().
|
inline |
Set energy error of spectral bin.
[in] | error | Energy error of spectral bin. |
Definition at line 266 of file GMWLDatum.hpp.
|
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().
|
inline |
Return flux of spectral bin.
Definition at line 191 of file GMWLDatum.hpp.
References m_flux.
Referenced by counts(), flux(), and GMWLDatum().
|
inline |
Set flux of spectral bin.
[in] | flux | Flux of spectral bin. |
Definition at line 203 of file GMWLDatum.hpp.
|
inline |
Return flux error of spectral bin.
Definition at line 216 of file GMWLDatum.hpp.
References m_flux_err.
Referenced by GMWLDatum().
|
inline |
Set flux error of spectral bin.
[in] | error | Flux error of spectral bin. |
Definition at line 228 of file GMWLDatum.hpp.
References error(), and m_flux_err.
|
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().
|
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=().
Assignment operator.
[in] | datum | 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=().
Print spectral point information.
[in] | chatter | Chattiness. |
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().
|
inlinevirtual |
Return size of spectral bins.
Implements GEventBin.
Definition at line 118 of file GMWLDatum.hpp.
|
inlinevirtual |
Return time of spectral bin.
Implements GEventBin.
Definition at line 154 of file GMWLDatum.hpp.
References m_time.
|
friend |
Needs access to load data.
Definition at line 48 of file GMWLDatum.hpp.
|
protected |
Instrument direction of spectral point (not used)
Definition at line 90 of file GMWLDatum.hpp.
Referenced by copy_members(), dir(), and init_members().
|
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().
|
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().
|
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().
|
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().
|
protected |
Time of spectral point (not used)
Definition at line 91 of file GMWLDatum.hpp.
Referenced by copy_members(), init_members(), and time().