GammaLib
2.1.0.dev
|
Class that handles gamma-ray sources. More...
#include <GSource.hpp>
Public Member Functions | |
GSource (void) | |
Void constructor. More... | |
GSource (const std::string &name, GModelSpatial *model, const GEnergy &energy, const GTime &time) | |
Source constructor. More... | |
GSource (const GSource &src) | |
Copy constructor. More... | |
virtual | ~GSource (void) |
Destructor. More... | |
GSource & | operator= (const GSource &src) |
Assignment operator. More... | |
void | clear (void) |
Clear instance. More... | |
GSource * | clone (void) const |
Clone object. More... | |
std::string | classname (void) const |
Return class name. More... | |
const std::string & | name (void) const |
Return model name. More... | |
const GModelSpatial * | model (void) const |
Return spatial model component. More... | |
const GEnergy & | energy (void) const |
Return photon energy. More... | |
const GTime & | time (void) const |
Return photon arrival time. More... | |
void | name (const std::string &name) |
Set model name. More... | |
void | model (GModelSpatial *model) |
Set spatial model component. More... | |
void | energy (const GEnergy &energy) |
Set photon energy. More... | |
void | time (const GTime &time) |
Set photon arrival time. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print source. 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 GSource &src) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::string | m_name |
Source name. More... | |
GModelSpatial * | m_model |
Spatial model. More... | |
GEnergy | m_energy |
Photon energy. More... | |
GTime | m_time |
Photon arrival time. More... | |
Class that handles gamma-ray sources.
The GSource class stores the physical attributes of a gamma-ray source, which is the distribution of photon arrival directions in form of a spatial source model, the photon energy, and the photon arrival time. The class is very similar to the GPhoton class, yet instead of a given photon arrival direction it contains a spatial model pointer. Note that the class does not allocate or deallocate the spatial model pointer, it just is a carrier of a pointer which is handled outside the class.
Each source also has a name so that it can be identified.
Definition at line 53 of file GSource.hpp.
GSource::GSource | ( | void | ) |
Void constructor.
Definition at line 54 of file GSource.cpp.
References init_members().
Referenced by clone().
GSource::GSource | ( | const std::string & | name, |
GModelSpatial * | model, | ||
const GEnergy & | energy, | ||
const GTime & | time | ||
) |
GSource::GSource | ( | const GSource & | src | ) |
Copy constructor.
[in] | src | Source. |
Definition at line 96 of file GSource.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 100 of file GSource.hpp.
|
virtual |
Clear instance.
Implements GBase.
Definition at line 164 of file GSource.cpp.
References free_members(), and init_members().
|
virtual |
Clone object.
Implements GBase.
Definition at line 182 of file GSource.cpp.
References GSource().
|
protected |
Copy class members.
[in] | src | Source. |
Definition at line 250 of file GSource.cpp.
References m_energy, m_model, m_name, and m_time.
Referenced by GSource(), and operator=().
|
inline |
Return photon energy.
Returns photon energy.
Definition at line 142 of file GSource.hpp.
References m_energy.
Referenced by energy(), GSource(), GResponse::irf_composite(), GResponse::irf_diffuse(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GResponse::irf_elliptical(), GCTAResponseCube::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GResponse::irf_ptsrc(), GCTAResponseCube::irf_ptsrc(), GCTAResponseIrf::irf_ptsrc(), GResponse::irf_radial(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GCTAResponseCube::irf_spatial(), GResponse::irf_spatial(), and GLATResponse::irf_spatial_bin().
|
inline |
Set photon energy.
[in] | energy | Photon energy. |
Sets the photon energy.
Definition at line 200 of file GSource.hpp.
|
protected |
Delete class members.
Definition at line 266 of file GSource.cpp.
Referenced by clear(), operator=(), and ~GSource().
|
protected |
Initialise class members.
Definition at line 232 of file GSource.cpp.
References GEnergy::clear(), GTime::clear(), m_energy, m_model, m_name, and m_time.
Referenced by clear(), GSource(), and operator=().
|
inline |
Return spatial model component.
Returns spatial model component.
Definition at line 128 of file GSource.hpp.
References m_model.
Referenced by GSource(), GResponse::irf_composite(), GResponse::irf_diffuse(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GResponse::irf_elliptical(), GCTAResponseCube::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GResponse::irf_ptsrc(), GCTAResponseCube::irf_ptsrc(), GCTAResponseIrf::irf_ptsrc(), GResponse::irf_radial(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GCTAResponseCube::irf_spatial(), GResponse::irf_spatial(), GLATResponse::irf_spatial_bin(), and model().
|
inline |
Set spatial model component.
[in] | model | Spatial model component. |
Sets the spatial model component.
Definition at line 185 of file GSource.hpp.
|
inline |
Return model name.
Returns the model name.
Definition at line 114 of file GSource.hpp.
References m_name.
Referenced by GSource(), GResponse::irf_composite(), GCTAResponseCube::irf_spatial(), GResponse::irf_spatial(), GLATResponse::irf_spatial_bin(), and name().
|
inline |
Set model name.
[in] | name | Model name. |
Sets the model name.
Definition at line 170 of file GSource.hpp.
Assignment operator.
[in] | src | Source. |
Definition at line 134 of file GSource.cpp.
References copy_members(), free_members(), and init_members().
Print source.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 195 of file GSource.cpp.
References m_energy, m_model, m_name, m_time, GEnergy::print(), GTime::print(), SILENT, and GModelSpatial::type().
|
inline |
Return photon arrival time.
Returns the photon arrival time.
Definition at line 156 of file GSource.hpp.
References m_time.
Referenced by GSource(), GResponse::irf_composite(), GResponse::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GResponse::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GResponse::irf_ptsrc(), GCTAResponseIrf::irf_ptsrc(), GResponse::irf_radial(), GCTAResponseIrf::irf_radial(), and time().
|
inline |
Set photon arrival time.
[in] | time | Photon arrival time. |
Sets the photon arrival time.
Definition at line 215 of file GSource.hpp.
|
protected |
Photon energy.
Definition at line 89 of file GSource.hpp.
Referenced by copy_members(), energy(), GSource(), init_members(), and print().
|
protected |
Spatial model.
Definition at line 88 of file GSource.hpp.
Referenced by copy_members(), GSource(), init_members(), model(), and print().
|
protected |
Source name.
Definition at line 87 of file GSource.hpp.
Referenced by copy_members(), GSource(), init_members(), name(), and print().
|
protected |
Photon arrival time.
Definition at line 90 of file GSource.hpp.
Referenced by copy_members(), GSource(), init_members(), print(), and time().