GammaLib
2.1.0.dev
|
Class that handles photons. More...
#include <GPhoton.hpp>
Public Member Functions | |
GPhoton (void) | |
Void constructor. More... | |
GPhoton (const GSkyDir &dir, const GEnergy &energy, const GTime &time, const int &mc_id=-1) | |
Photon constructor. More... | |
GPhoton (const GPhoton &photon) | |
Copy constructor. More... | |
virtual | ~GPhoton (void) |
Destructor. More... | |
GPhoton & | operator= (const GPhoton &photon) |
Assignment operator. More... | |
void | clear (void) |
Clear photon. More... | |
GPhoton * | clone (void) const |
Clone photon. More... | |
std::string | classname (void) const |
Return class name. More... | |
const GSkyDir & | dir (void) const |
Return photon sky direction. More... | |
const GEnergy & | energy (void) const |
Return photon energy. More... | |
const GTime & | time (void) const |
Return photon time. More... | |
const int & | mc_id (void) const |
Return photon Monte-Carlo identifier. More... | |
void | dir (const GSkyDir &dir) |
Set photon sky direction. More... | |
void | energy (const GEnergy &energy) |
Set photon energy. More... | |
void | time (const GTime &time) |
Set photon time. More... | |
void | mc_id (const int &mc_id) |
Set photon Monte-Carlo identifier. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print photon. 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 GPhoton &photon) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
GSkyDir | m_dir |
Photon arrival direction. More... | |
GEnergy | m_energy |
Photon energy. More... | |
GTime | m_time |
Photon arrival time. More... | |
int | m_mc_id |
Monte Carlo simulation origin. More... | |
Friends | |
bool | operator== (const GPhoton &a, const GPhoton &b) |
Equality friend operator. More... | |
bool | operator!= (const GPhoton &a, const GPhoton &b) |
Non-equality friend operator. More... | |
Class that handles photons.
The GPhoton class stores the physical attributes of a photon such as the photon arrival direction, its energy and its arrival time. This class is mainly used for Monte Carlo simulations.
Definition at line 47 of file GPhoton.hpp.
GPhoton::GPhoton | ( | void | ) |
Void constructor.
Definition at line 54 of file GPhoton.cpp.
References init_members().
Referenced by clone().
GPhoton::GPhoton | ( | const GPhoton & | photon | ) |
Copy constructor.
[in] | photon | Photon. |
Definition at line 94 of file GPhoton.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 98 of file GPhoton.hpp.
|
virtual |
Clear photon.
Implements GBase.
Definition at line 162 of file GPhoton.cpp.
References free_members(), and init_members().
|
virtual |
Clone photon.
Implements GBase.
Definition at line 180 of file GPhoton.cpp.
References GPhoton().
|
protected |
Copy class members.
[in] | photon | Photon. |
Definition at line 246 of file GPhoton.cpp.
References m_dir, m_energy, m_mc_id, and m_time.
Referenced by GPhoton(), and operator=().
|
inline |
Return photon sky direction.
Definition at line 110 of file GPhoton.hpp.
References m_dir.
Referenced by GModelSpatialDiffuseCube::cube_intensity(), dir(), GModelSpatialDiffuseMap::eval(), GModelSpatialPointSource::eval(), GModelSpatialElliptical::eval(), GModelSpatialRadial::eval(), cta_irf_diffuse_kern_phi::eval(), GPhoton(), GLATResponse::irf(), GCOMResponse::irf(), GSPIResponse::irf(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GModelSpatialEllipticalDisk::mc(), GModelSpatialEllipticalGauss::mc(), GCTAResponseIrf::mc(), GModelSky::mc(), and GCTAResponseIrf::nirf().
|
inline |
Set photon sky direction.
[in] | dir | Sky direction of photon. |
Definition at line 158 of file GPhoton.hpp.
|
inline |
Return photon energy.
Definition at line 122 of file GPhoton.hpp.
References m_energy.
Referenced by GModelSpatialDiffuseCube::cube_intensity(), energy(), GModelSpatialElliptical::eval(), GModelSpatialRadial::eval(), cta_irf_diffuse_kern_phi::eval(), GPhoton(), GModelSky::gradients(), GLATResponse::irf(), GSPIResponse::irf(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GModelSpatialEllipticalDisk::mc(), GModelSpatialEllipticalGauss::mc(), GCTAResponseIrf::mc(), GModelSky::mc(), GCTAResponseIrf::nirf(), and GModelSky::value().
|
inline |
|
protected |
Delete class members.
Definition at line 262 of file GPhoton.cpp.
Referenced by clear(), operator=(), and ~GPhoton().
|
protected |
Initialise class members.
Definition at line 228 of file GPhoton.cpp.
References GSkyDir::clear(), GEnergy::clear(), GTime::clear(), m_dir, m_energy, m_mc_id, and m_time.
Referenced by clear(), GPhoton(), and operator=().
|
inline |
Return photon Monte-Carlo identifier.
Definition at line 146 of file GPhoton.hpp.
References m_mc_id.
|
inline |
Set photon Monte-Carlo identifier.
[in] | mc_id | Photon Monte-Carlo identifier. |
Definition at line 197 of file GPhoton.hpp.
Assignment operator.
[in] | photon | Photon. |
Definition at line 132 of file GPhoton.cpp.
References copy_members(), free_members(), and init_members().
Print photon.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 193 of file GPhoton.cpp.
References GSkyDir::dec_deg(), m_dir, m_energy, m_mc_id, m_time, GEnergy::print(), GTime::print(), GSkyDir::ra_deg(), SILENT, and gammalib::str().
|
inline |
Return photon time.
Definition at line 134 of file GPhoton.hpp.
References m_time.
Referenced by GModelSpatialElliptical::eval(), GModelSpatialRadial::eval(), cta_irf_diffuse_kern_phi::eval(), GPhoton(), GModelSky::gradients(), GCOMResponse::irf(), GCTAResponseIrf::irf(), GModelSpatialEllipticalDisk::mc(), GModelSpatialEllipticalGauss::mc(), GCTAResponseIrf::mc(), GModelSky::mc(), GCTAResponseIrf::nirf(), time(), and GModelSky::value().
|
inline |
Non-equality friend operator.
[in] | a | First photon. |
[in] | b | Second photon. |
Definition at line 227 of file GPhoton.hpp.
Equality friend operator.
[in] | a | First photon. |
[in] | b | Second photon. |
Definition at line 212 of file GPhoton.hpp.
|
protected |
Photon arrival direction.
Definition at line 85 of file GPhoton.hpp.
Referenced by copy_members(), dir(), GPhoton(), init_members(), operator!=(), operator==(), and print().
|
protected |
Photon energy.
Definition at line 86 of file GPhoton.hpp.
Referenced by copy_members(), energy(), GPhoton(), init_members(), operator!=(), operator==(), and print().
|
protected |
Monte Carlo simulation origin.
Definition at line 88 of file GPhoton.hpp.
Referenced by copy_members(), GPhoton(), init_members(), mc_id(), and print().
|
protected |
Photon arrival time.
Definition at line 87 of file GPhoton.hpp.
Referenced by copy_members(), GPhoton(), init_members(), operator!=(), operator==(), print(), and time().