GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEnergy Class Reference

Class that handles energies in a unit independent way. More...

#include <GEnergy.hpp>

Inheritance diagram for GEnergy:
GBase

Public Member Functions

 GEnergy (void)
 Void constructor. More...
 
 GEnergy (const GEnergy &eng)
 Copy constructor. More...
 
 GEnergy (const double &eng, const std::string &unit)
 Energy constructor. More...
 
virtual ~GEnergy (void)
 Destructor. More...
 
GEnergyoperator= (const GEnergy &eng)
 Assignment operator. More...
 
GEnergyoperator+= (const GEnergy &eng)
 Energy unary addition operator. More...
 
GEnergyoperator-= (const GEnergy &eng)
 Energy unary differnce operator. More...
 
GEnergyoperator*= (const double &scale)
 Energy unary multiplication operator. More...
 
GEnergyoperator/= (const double &scale)
 Energy unary division operator. More...
 
void operator() (const double &eng, const std::string &unit)
 Unit set operator. More...
 
double operator() (const std::string &unit) const
 Unit access operator. More...
 
void clear (void)
 Clear instance. More...
 
GEnergyclone (void) const
 Clone object. More...
 
std::string classname (void) const
 Return class name. More...
 
double erg (void) const
 Return energy in erg. More...
 
double keV (void) const
 Return energy in keV. More...
 
double MeV (void) const
 Return energy in MeV. More...
 
double GeV (void) const
 Return energy in GeV. More...
 
double TeV (void) const
 Return energy in TeV. More...
 
double Angstrom (void) const
 Return energy as wavelength in Angstrom. More...
 
double log10erg (void) const
 Return log10 of energy in erg. More...
 
double log10keV (void) const
 Return log10 of energy in keV. More...
 
double log10MeV (void) const
 Return log10 of energy in MeV. More...
 
double log10GeV (void) const
 Return log10 of energy in GeV. More...
 
double log10TeV (void) const
 Return log10 of energy in TeV. More...
 
double log10 (const std::string &unit) const
 Set log10 of energy with unit specification. More...
 
void erg (const double &eng)
 Set energy in erg. More...
 
void keV (const double &eng)
 Set energy in keV. More...
 
void MeV (const double &eng)
 Set energy in MeV. More...
 
void GeV (const double &eng)
 Set energy in GeV. More...
 
void TeV (const double &eng)
 Set energy in TeV. More...
 
void Angstrom (const double &wavelength)
 Set energy from wavelength in Angstrom. More...
 
void log10erg (const double &eng)
 Set log10 of energy in erg. More...
 
void log10keV (const double &eng)
 Set log10 of energy in keV. More...
 
void log10MeV (const double &eng)
 Set log10 of energy in MeV. More...
 
void log10GeV (const double &eng)
 Set log10 of energy in GeV. More...
 
void log10TeV (const double &eng)
 Set log10 of energy in TeV. More...
 
void log10 (const double &eng, const std::string &unit)
 Set log10 of energy with unit specification. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print energy. 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 GEnergy &eng)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

double m_energy
 Energy in MeV. More...
 
double m_elog10
 log10 of energy in MeV More...
 
bool m_has_log10
 log10 of energy is valid More...
 

Friends

GEnergy operator+ (const GEnergy &a, const GEnergy &b)
 Energy addition operator friend. More...
 
GEnergy operator- (const GEnergy &a, const GEnergy &b)
 Energy subtraction operator friend. More...
 
GEnergy operator* (const double &a, const GEnergy &b)
 Energy multiplication operator friend. More...
 
GEnergy operator* (const GEnergy &a, const double &b)
 Energy multiplication operator friend. More...
 
GEnergy operator/ (const GEnergy &a, const double &b)
 Energy division operator friend. More...
 
double operator/ (const GEnergy &a, const GEnergy &b)
 Energy division operator friend. More...
 
bool operator== (const GEnergy &a, const GEnergy &b)
 Energy equality operator friend. More...
 
bool operator!= (const GEnergy &a, const GEnergy &b)
 Energy non-equality operator friend. More...
 
bool operator< (const GEnergy &a, const GEnergy &b)
 Energy smaller than operator friend. More...
 
bool operator<= (const GEnergy &a, const GEnergy &b)
 Energy smaller than or equal to operator friend. More...
 
bool operator> (const GEnergy &a, const GEnergy &b)
 Energy larger than operator friend. More...
 
bool operator>= (const GEnergy &a, const GEnergy &b)
 Energy larger than or equal to operator friend. More...
 

Detailed Description

Class that handles energies in a unit independent way.

The GEnergy class stores an energy value in units of MeV and implements methods that provide automatic conversion of the energy values in other units. This makes instrument specific implementations more robust and reduces the risk of unit errors. The method also holds on request the log10 of the energy in MeV, which is only recomputed when the energy value is changed. This considerably reduces the number of log10 operations in many applications and speeds up the performance.

Definition at line 48 of file GEnergy.hpp.

Constructor & Destructor Documentation

GEnergy::GEnergy ( void  )

Void constructor.

Definition at line 64 of file GEnergy.cpp.

References init_members().

Referenced by clone().

GEnergy::GEnergy ( const GEnergy eng)

Copy constructor.

Parameters
[in]engEnergy.

Definition at line 79 of file GEnergy.cpp.

References copy_members(), and init_members().

GEnergy::GEnergy ( const double &  eng,
const std::string &  unit 
)

Energy constructor.

Parameters
[in]engEnergy.
[in]unitEnergy unit (one of erg(s), keV, MeV, GeV, TeV).

Construct energy from an energy value and unit. The constructor interprets the unit string and performs automatic conversion of the energy value.

Definition at line 101 of file GEnergy.cpp.

References init_members(), and operator()().

GEnergy::~GEnergy ( void  )
virtual

Destructor.

Definition at line 117 of file GEnergy.cpp.

References free_members().

Member Function Documentation

double GEnergy::Angstrom ( void  ) const

Return energy as wavelength in Angstrom.

Returns
Energy as wavelength in Angstrom (1e-10 metres).
Exceptions
GException::invalid_valueCannot convert zero energy into a wavelength.

Definition at line 366 of file GEnergy.cpp.

References G_ANGSTROM_GET, m_energy, and gammalib::MeV2Angstrom.

Referenced by operator()().

void GEnergy::Angstrom ( const double &  wavelength)

Set energy from wavelength in Angstrom.

Parameters
[in]wavelengthWavelength in Angstrom.
Exceptions
GException::invalid_argumentCannot set energy from zero wavelength.

Definition at line 604 of file GEnergy.cpp.

References G_ANGSTROM_SET, m_energy, m_has_log10, and gammalib::MeV2Angstrom.

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

Return class name.

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

Implements GBase.

Definition at line 129 of file GEnergy.hpp.

GEnergy * GEnergy::clone ( void  ) const
virtual

Clone object.

Returns
Pointer to deep copy of energy.

Implements GBase.

Definition at line 279 of file GEnergy.cpp.

References GEnergy().

void GEnergy::copy_members ( const GEnergy eng)
protected

Copy class members.

Parameters
[in]engEnergy.

Definition at line 817 of file GEnergy.cpp.

References m_elog10, m_energy, and m_has_log10.

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

double GEnergy::erg ( void  ) const

Return energy in erg.

Returns
Energy in erg.

Definition at line 291 of file GEnergy.cpp.

References m_energy, and gammalib::MeV2erg.

Referenced by operator()().

void GEnergy::erg ( const double &  eng)

Set energy in erg.

Parameters
[in]engEnergy in erg.

Definition at line 511 of file GEnergy.cpp.

References gammalib::erg2MeV, m_energy, and m_has_log10.

void GEnergy::free_members ( void  )
protected

Delete class members.

Definition at line 832 of file GEnergy.cpp.

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

double GEnergy::GeV ( void  ) const

Return energy in GeV.

Returns
Energy in GeV.

Definition at line 333 of file GEnergy.cpp.

References m_energy.

Referenced by operator()(), and print().

void GEnergy::GeV ( const double &  eng)

Set energy in GeV.

Parameters
[in]engEnergy in GeV.

Definition at line 565 of file GEnergy.cpp.

References m_energy, and m_has_log10.

void GEnergy::init_members ( void  )
protected

Initialise class members.

Definition at line 800 of file GEnergy.cpp.

References m_elog10, m_energy, and m_has_log10.

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

double GEnergy::keV ( void  ) const

Return energy in keV.

Returns
Energy in keV.

Definition at line 306 of file GEnergy.cpp.

References m_energy.

Referenced by GModelSpectralTable::create_eng_table(), operator()(), print(), GSPIResponse::read_energies(), GCOMEventList::read_events(), GSPIResponse::set(), and GArf::write().

void GEnergy::keV ( const double &  eng)

Set energy in keV.

Parameters
[in]engEnergy in keV.

Definition at line 529 of file GEnergy.cpp.

References m_energy, and m_has_log10.

double GEnergy::log10 ( const std::string &  unit) const

Set log10 of energy with unit specification.

Parameters
[in]unitUnit of log10 of energy.
Returns
eng log10 of energy.
Exceptions
GException::invalid_argumentUnit argument is not valid.

Definition at line 473 of file GEnergy.cpp.

References G_LOG10_GET, log10erg(), log10GeV(), log10keV(), log10MeV(), log10TeV(), and gammalib::tolower().

void GEnergy::log10 ( const double &  eng,
const std::string &  unit 
)

Set log10 of energy with unit specification.

Parameters
[in]englog10 of energy.
[in]unitUnit of log10 of energy.
Exceptions
GException::invalid_argumentUnit argument is not valid.

Definition at line 712 of file GEnergy.cpp.

References G_LOG10_SET, log10erg(), log10GeV(), log10keV(), log10MeV(), log10TeV(), and gammalib::tolower().

double GEnergy::log10erg ( void  ) const

Return log10 of energy in erg.

Returns
Energy in log10 erg.

Returns the log10 of the energy in erg.

Definition at line 389 of file GEnergy.cpp.

References log10(), log10MeV(), and gammalib::MeV2erg.

Referenced by log10().

void GEnergy::log10erg ( const double &  eng)

Set log10 of energy in erg.

Parameters
[in]englog10 of energy in erg.

Definition at line 628 of file GEnergy.cpp.

References log10(), log10MeV(), and gammalib::MeV2erg.

double GEnergy::log10GeV ( void  ) const

Return log10 of energy in GeV.

Returns
Energy in log10 GeV.

Returns the log10 of the energy in GeV.

Definition at line 443 of file GEnergy.cpp.

References log10MeV().

Referenced by log10().

void GEnergy::log10GeV ( const double &  eng)

Set log10 of energy in GeV.

Parameters
[in]englog10 of energy in GeV.

Definition at line 678 of file GEnergy.cpp.

References log10MeV().

double GEnergy::log10keV ( void  ) const

Return log10 of energy in keV.

Returns
Energy in log10 keV.

Returns the log10 of the energy in keV.

Definition at line 406 of file GEnergy.cpp.

References log10MeV().

Referenced by log10().

void GEnergy::log10keV ( const double &  eng)

Set log10 of energy in keV.

Parameters
[in]englog10 of energy in keV.

Definition at line 646 of file GEnergy.cpp.

References log10MeV().

void GEnergy::log10MeV ( const double &  eng)

Set log10 of energy in MeV.

Parameters
[in]englog10 of energy in MeV.

Definition at line 661 of file GEnergy.cpp.

References m_elog10, m_energy, m_has_log10, and pow().

double GEnergy::log10TeV ( void  ) const

Return log10 of energy in TeV.

Returns
Energy in log10 TeV.

Returns the log10 of the energy in TeV.

Definition at line 457 of file GEnergy.cpp.

References log10MeV().

Referenced by GCTAOnOffObservation::compute_arf_cut(), GCTAEdisp2D::compute_ereco_bounds(), GCTAOnOffObservation::compute_rmf(), GCTAEdispPerfTable::ereco_bounds(), GCTAEdispPerfTable::etrue_bounds(), GCTAModelSkyCube::eval(), GCTAModelSpatialLookup::eval(), cta_irf_radial_kern_omega::eval(), cta_irf_elliptical_kern_omega::eval(), GCTAEdisp2D::get_max_edisp(), GCTAResponseIrf::irf(), GCTAResponseIrf::irf_diffuse(), GCTAResponseIrf::irf_elliptical(), GCTAResponseIrf::irf_radial(), GCTABackgroundPerfTable::load(), GCTAModelSkyCube::load(), log10(), GCTAModelAeffBackground::mc(), GCTABackground3D::mc(), GCTABackground2D::mc(), GCTAEdispPerfTable::mc(), GCTAResponseIrf::mc(), GCTAResponseIrf::nirf(), GCTAModelIrfBackground::npred(), GCTAModelAeffBackground::npred(), GCTAModelCubeBackground::npred(), GCTAModelSkyCube::npred(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTACubeBackground::operator()(), GCTACubeExposure::operator()(), GCTAEdispPerfTable::operator()(), GArf::operator()(), GCTACubePsf::operator()(), GCTAEdisp2D::operator()(), GCTAEdispRmf::prob_erecobin(), GCTAEdispPerfTable::prob_erecobin(), GCTAEdisp2D::prob_erecobin(), GCTABackgroundPerfTable::rate_ebin(), GCTABackground3D::rate_ebin(), GCTABackground2D::rate_ebin(), GCTAAeffPerfTable::set_boundaries(), GCTAEdispRmf::set_cache(), GCTACubeBackground::set_eng_axis(), GArf::set_logetrue(), GCTAEdispRmf::update(), and GCTACubeEdisp::update().

void GEnergy::log10TeV ( const double &  eng)

Set log10 of energy in TeV.

Parameters
[in]englog10 of energy in TeV.

Definition at line 693 of file GEnergy.cpp.

References log10MeV().

double GEnergy::MeV ( void  ) const

Return energy in MeV.

Returns
Energy in MeV.

Definition at line 321 of file GEnergy.cpp.

References m_energy.

Referenced by GModelSpectralBins::append(), GModelSpectralFunc::append(), GModelSpectralNodes::append(), GModelSpectralBins::bin_index(), GModelSpectralBrokenPlaw::breakenergy(), GModelSpectralSmoothBrokenPlaw::breakenergy(), GCOMIaq::compute_iaq_bin(), GCOMDri::compute_tof_correction(), GMWLSpectrum::conv_flux(), GResponse::convolve(), GModelSpectralExpPlaw::cutoff(), GModelSpectralSuperExpPlaw::cutoff(), GModelSpectralExpInvPlaw::cutoff(), GResponse::ebounds_model(), GModelSpectralMultiplicative::eflux(), GModelSpectralExponential::eflux(), GModelSpectralBins::eflux(), GModelSpectralConst::eflux(), GModelSpectralTable::eflux(), GModelSpectralFunc::eflux(), GModelSpectralGauss::eflux(), GModelSpectralPlaw::eflux(), GModelSpectralExpPlaw::eflux(), GModelSpectralLogParabola::eflux(), GModelSpectralBrokenPlaw::eflux(), GModelSpectralSuperExpPlaw::eflux(), GModelSpectralExpInvPlaw::eflux(), GModelSpectralPlawPhotonFlux::eflux(), GModelSpectralPlawEnergyFlux::eflux(), GModelSpectralNodes::eflux(), GModelSpectralSmoothBrokenPlaw::eflux(), GModelSky::eflux(), gammalib::elogmean(), GEbounds::elogmean(), GModelSpectralBins::emax(), GModelSpectralPlawEnergyFlux::emax(), GModelSpectralPlawPhotonFlux::emax(), GCTAEventBin::emin(), GModelSpectralBins::emin(), GModelSpectralPlawEnergyFlux::emin(), GModelSpectralPlawPhotonFlux::emin(), GModelSpectralFunc::energy(), GModelSpectralNodes::energy(), GCTAModelIrfBackground::eval(), GModelSpectralBins::eval(), GModelSpectralGauss::eval(), GModelSpectralBrokenPlaw::eval(), GModelSpectralExpInvPlaw::eval(), GModelSpectralLogParabola::flux_kern::eval(), cta_nroi_kern::eval(), GModelSpectralSmoothBrokenPlaw::flux_kern::eval(), GResponse::edisp_kerns::eval(), GObservation::npred_spec_kern::eval(), GCTAEdisp2D::edisp_ereco_kern::eval(), GModelSky::flux_kern::eval(), GModelSky::eflux_kern::eval(), GModelSpectralMultiplicative::flux(), GModelSpectralExponential::flux(), GModelSpectralBins::flux(), GModelSpectralConst::flux(), GModelSpectralTable::flux(), GModelSpectralFunc::flux(), GModelSpectralGauss::flux(), GModelSpectralPlaw::flux(), GModelSpectralExpPlaw::flux(), GModelSpectralLogParabola::flux(), GModelSpectralBrokenPlaw::flux(), GModelSpectralSuperExpPlaw::flux(), GModelSpectralExpInvPlaw::flux(), GModelSpectralPlawPhotonFlux::flux(), GModelSpectralPlawEnergyFlux::flux(), GModelSpectralNodes::flux(), GModelSpectralSmoothBrokenPlaw::flux(), GModelSky::flux(), GCOMObservation::GCOMObservation(), GModelSpectralBrokenPlaw::GModelSpectralBrokenPlaw(), GModelSpectralExpInvPlaw::GModelSpectralExpInvPlaw(), GModelSpectralExpPlaw::GModelSpectralExpPlaw(), GModelSpectralGauss::GModelSpectralGauss(), GModelSpectralLogParabola::GModelSpectralLogParabola(), GModelSpectralPlaw::GModelSpectralPlaw(), GModelSpectralPlawEnergyFlux::GModelSpectralPlawEnergyFlux(), GModelSpectralPlawPhotonFlux::GModelSpectralPlawPhotonFlux(), GModelSpectralSmoothBrokenPlaw::GModelSpectralSmoothBrokenPlaw(), GModelSpectralSuperExpPlaw::GModelSpectralSuperExpPlaw(), GResponseCache::hash(), GModelSpectralPlawPhotonFlux::init_members(), GModelSpectralPlawEnergyFlux::init_members(), GModelSpectralBins::insert(), GModelSpectralFunc::insert(), GModelSpectralNodes::insert(), GLATResponse::irf_spatial_bin(), GCOMObservation::load_dre(), GModelSpectralBins::mc(), GModelSpectralTable::mc(), GModelSpectralConst::mc(), GModelSpectralFunc::mc(), GModelSpectralGauss::mc(), GModelSpectralPlaw::mc(), GModelSpectralExpPlaw::mc(), GModelSpectralLogParabola::mc(), GModelSpectralBrokenPlaw::mc(), GModelSpectralSuperExpPlaw::mc(), GModelSpectralExpInvPlaw::mc(), GModelSpectralPlawPhotonFlux::mc(), GModelSpectralPlawEnergyFlux::mc(), GModelSpectralNodes::mc(), GModelSpectralBins::mc_update(), GModelSpectralFunc::mc_update(), GModelSpectralNodes::mc_update(), GModelSpectralGauss::mean(), GCTAOnOffObservation::N_bgd(), GCTAOnOffObservation::N_gamma(), GObservation::npred_spec(), GCTAResponseIrf::nroi(), operator()(), GCTAEdispPerfTable::operator()(), GCTAEdisp2D::operator()(), GModelSpectralPlaw::pivot(), GModelSpectralExpPlaw::pivot(), GModelSpectralLogParabola::pivot(), GModelSpectralExpInvPlaw::pivot(), GModelSpectralSuperExpPlaw::pivot(), GModelSpectralSmoothBrokenPlaw::pivot(), GMWLDatum::print(), print(), GCTAEdispRmf::prob_erecobin(), GCTABackgroundPerfTable::rate_ebin(), GCTABackground3D::rate_ebin(), GCTABackground2D::rate_ebin(), GPha::read(), GSPIEventCube::read_dsp(), GCOMIaq::save(), GCOMIaq::set(), GModelSpectralTable::set_energy_nodes(), GEnergies::set_log(), GCTAEdispRmf::set_matrix(), GCTAEdisp2D::set_max_edisp(), GEnergies::set_pow(), GModelSpectralGauss::sigma(), GCOMEventBin::size(), GLATEventBin::size(), GCTAEventBin::size(), GModelSpectralPlawPhotonFlux::update(), GModelSpectralPlawEnergyFlux::update(), GModelSpectralPlaw::update_eval_cache(), GModelSpectralExpPlaw::update_eval_cache(), GModelSpectralLogParabola::update_eval_cache(), GModelSpectralBrokenPlaw::update_eval_cache(), GModelSpectralExpInvPlaw::update_eval_cache(), GModelSpectralSuperExpPlaw::update_eval_cache(), GModelSpectralSmoothBrokenPlaw::update_eval_cache(), GModelSpectralTable::update_mc(), GModelSpectralPlaw::update_mc_cache(), GModelSpectralExpPlaw::update_mc_cache(), GModelSpectralLogParabola::update_mc_cache(), GModelSpectralBrokenPlaw::update_mc_cache(), GModelSpectralExpInvPlaw::update_mc_cache(), GModelSpectralSuperExpPlaw::update_mc_cache(), GModelSpectralSmoothBrokenPlaw::update_mc_cache(), GPha::write(), and GCOMDri::write_attributes().

void GEnergy::MeV ( const double &  eng)

Set energy in MeV.

Parameters
[in]engEnergy in MeV.

Definition at line 547 of file GEnergy.cpp.

References m_energy, and m_has_log10.

void GEnergy::operator() ( const double &  eng,
const std::string &  unit 
)

Unit set operator.

Parameters
[in]engEnergy.
[in]unitEnergy unit (one of erg(s), keV, MeV, GeV, TeV, Angstrom).
Exceptions
GException::invalid_argumentInvalid energy unit specified.

Construct energy from an energy value and unit. The constructor interprets the unit string and performs automatic conversion of the energy value.

Definition at line 172 of file GEnergy.cpp.

References Angstrom(), erg(), G_OPERATOR1, GeV(), keV(), MeV(), gammalib::strip_whitespace(), TeV(), and gammalib::tolower().

Referenced by GEnergy().

double GEnergy::operator() ( const std::string &  unit) const

Unit access operator.

Parameters
[in]unitEnergy unit (one of erg(s), keV, MeV, GeV, TeV, Angstrom).
Returns
Energy in requested units.
Exceptions
GException::invalid_argumentInvalid energy unit specified.

Returns the energy in the requested units.

Definition at line 216 of file GEnergy.cpp.

References Angstrom(), erg(), G_OPERATOR2, GeV(), keV(), MeV(), TeV(), and gammalib::tolower().

GEnergy & GEnergy::operator*= ( const double &  scale)
inline

Energy unary multiplication operator.

Parameters
[in]scaleScale.
Returns
Energy multiplied with scale.

Definition at line 172 of file GEnergy.hpp.

References m_energy, and m_has_log10.

GEnergy & GEnergy::operator+= ( const GEnergy eng)
inline

Energy unary addition operator.

Parameters
[in]engEnergy.
Returns
Sum of energies.

Definition at line 142 of file GEnergy.hpp.

References m_energy, and m_has_log10.

GEnergy & GEnergy::operator-= ( const GEnergy eng)
inline

Energy unary differnce operator.

Parameters
[in]engEnergy.
Returns
Difference of energies.

Definition at line 157 of file GEnergy.hpp.

References m_energy, and m_has_log10.

GEnergy & GEnergy::operator/= ( const double &  scale)
inline

Energy unary division operator.

Parameters
[in]scaleScale.
Returns
Energy divided by scale.

Definition at line 187 of file GEnergy.hpp.

References m_energy, and m_has_log10.

GEnergy & GEnergy::operator= ( const GEnergy eng)

Assignment operator.

Parameters
[in]engEnergy.
Returns
Energy.

Definition at line 139 of file GEnergy.cpp.

References copy_members(), free_members(), and init_members().

std::string GEnergy::print ( const GChatter chatter = NORMAL) const
virtual
void GEnergy::TeV ( const double &  eng)

Set energy in TeV.

Parameters
[in]engEnergy in TeV.

Definition at line 583 of file GEnergy.cpp.

References m_energy, and m_has_log10.

Friends And Related Function Documentation

bool operator!= ( const GEnergy a,
const GEnergy b 
)
friend

Energy non-equality operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if both energies are not equal.

Definition at line 311 of file GEnergy.hpp.

GEnergy operator* ( const double &  a,
const GEnergy b 
)
friend

Energy multiplication operator friend.

Parameters
[in]aScale.
[in]bEnergy.
Returns
Energy multiplied by scale.

Definition at line 235 of file GEnergy.hpp.

GEnergy operator* ( const GEnergy a,
const double &  b 
)
friend

Energy multiplication operator friend.

Parameters
[in]aEnergy.
[in]bScale.
Returns
Energy multiplied by scale.

Definition at line 251 of file GEnergy.hpp.

GEnergy operator+ ( const GEnergy a,
const GEnergy b 
)
friend

Energy addition operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
Sum of energies.

Definition at line 203 of file GEnergy.hpp.

GEnergy operator- ( const GEnergy a,
const GEnergy b 
)
friend

Energy subtraction operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
Difference of energies.

Definition at line 219 of file GEnergy.hpp.

GEnergy operator/ ( const GEnergy a,
const double &  b 
)
friend

Energy division operator friend.

Parameters
[in]aEnergy.
[in]bScale.
Returns
Energy divided by scale.

Definition at line 267 of file GEnergy.hpp.

double operator/ ( const GEnergy a,
const GEnergy b 
)
friend

Energy division operator friend.

Parameters
[in]aEnergy.
[in]bEnergy.
Returns
Fraction of energies.

Definition at line 283 of file GEnergy.hpp.

bool operator< ( const GEnergy a,
const GEnergy b 
)
friend

Energy smaller than operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if first energy is smaller than second energy.

Definition at line 325 of file GEnergy.hpp.

bool operator<= ( const GEnergy a,
const GEnergy b 
)
friend

Energy smaller than or equal to operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if first energy is smaller than or equal to second energy.

Definition at line 339 of file GEnergy.hpp.

bool operator== ( const GEnergy a,
const GEnergy b 
)
friend

Energy equality operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if both energies are equal.

Definition at line 297 of file GEnergy.hpp.

bool operator> ( const GEnergy a,
const GEnergy b 
)
friend

Energy larger than operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if first energy is larger than second energy.

Definition at line 353 of file GEnergy.hpp.

bool operator>= ( const GEnergy a,
const GEnergy b 
)
friend

Energy larger than or equal to operator friend.

Parameters
[in]aFirst energy.
[in]bSecond energy.
Returns
True if first energy is larger than or equal to second energy.

Definition at line 367 of file GEnergy.hpp.

Member Data Documentation

double GEnergy::m_elog10
mutableprotected

log10 of energy in MeV

Definition at line 118 of file GEnergy.hpp.

Referenced by copy_members(), init_members(), log10MeV(), and print().

bool GEnergy::m_has_log10
mutableprotected

log10 of energy is valid

Definition at line 119 of file GEnergy.hpp.

Referenced by Angstrom(), copy_members(), erg(), GeV(), init_members(), keV(), log10MeV(), MeV(), operator*=(), operator+=(), operator-=(), operator/=(), print(), and TeV().


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