GammaLib
2.0.0
|
Fermi/LAT event bin class. More...
#include <GLATEventBin.hpp>
Public Member Functions | |
GLATEventBin (void) | |
Void constructor. More... | |
GLATEventBin (const GLATEventBin &bin) | |
Copy constructor. More... | |
virtual | ~GLATEventBin (void) |
Destructor. More... | |
virtual GLATEventBin & | operator= (const GLATEventBin &bin) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear event bin. More... | |
virtual GLATEventBin * | clone (void) const |
Clone event bin. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual double | size (void) const |
Return size of event bin. More... | |
virtual const GLATInstDir & | dir (void) const |
Return instrument direction of event bin. More... | |
virtual const GEnergy & | energy (void) const |
Return energy of event bin. More... | |
virtual const GTime & | time (void) const |
Return time of event bin. More... | |
virtual double | counts (void) const |
Return number of counts in event bin. More... | |
virtual double | error (void) const |
Return error in number of counts. More... | |
virtual void | counts (const double &counts) |
Set number of counts in event bin. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print event information. More... | |
const double & | solidangle (void) const |
Return solid angle of event bin. More... | |
const GEnergy & | ewidth (void) const |
Return energy width of event bin. More... | |
const double & | ontime (void) const |
Return ontime of event bin. More... | |
const int & | index (void) const |
Return event bin index in cube. More... | |
const int & | ipix (void) const |
Return event bin map pixel index in cube. More... | |
const int & | ieng (void) const |
Return event bin energy index in cube. More... | |
const GLATEventCube * | cube (void) const |
Return pointer to related map cube. 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 GLATEventBin &bin) |
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 | |
GLATEventCube * | m_cube |
Event cube back pointer. More... | |
int | m_index |
Actual skymap index. More... | |
int | m_ipix |
Actual spatial index. More... | |
int | m_ieng |
Actual energy index. More... | |
GEnergy * | m_energy |
Pointer to bin energy. More... | |
GLATInstDir * | m_dir |
Pointer to bin direction. More... | |
GTime * | m_time |
Pointer to bin time. More... | |
double * | m_counts |
Pointer to number of counts. More... | |
double * | m_solidangle |
Pointer to solid angle of pixel (sr) More... | |
GEnergy * | m_ewidth |
Pointer to energy width of bin. More... | |
double * | m_ontime |
Pointer to ontime of bin (seconds) More... | |
Friends | |
class | GLATEventCube |
Fermi/LAT event bin class.
This class implement a counts map bin for the Fermi/LAT telescope.
Definition at line 49 of file GLATEventBin.hpp.
GLATEventBin::GLATEventBin | ( | void | ) |
Void constructor.
Definition at line 63 of file GLATEventBin.cpp.
References init_members().
Referenced by clone().
GLATEventBin::GLATEventBin | ( | const GLATEventBin & | bin | ) |
Copy constructor.
[in] | bin | Event bin. |
Definition at line 78 of file GLATEventBin.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GEventBin.
Definition at line 112 of file GLATEventBin.hpp.
|
virtual |
Clear event bin.
Implements GEventBin.
Definition at line 149 of file GLATEventBin.cpp.
References free_members(), GEventBin::free_members(), GEvent::free_members(), init_members(), GEventBin::init_members(), and GEvent::init_members().
Referenced by GLATEventCube::init_members().
|
virtual |
Clone event bin.
Implements GEventBin.
Definition at line 171 of file GLATEventBin.cpp.
References GLATEventBin().
|
protected |
Copy class members.
[in] | bin | Event bin. |
Definition at line 475 of file GLATEventBin.cpp.
References m_counts, m_cube, m_dir, m_energy, m_ewidth, m_ieng, m_index, m_ipix, m_ontime, m_solidangle, and m_time.
Referenced by GLATEventBin(), and operator=().
|
virtual |
Return number of counts in event bin.
GLATException::no_member | Invalid counts pointer. |
Returns reference to the number of counts in the event bin.
Implements GEventBin.
Definition at line 281 of file GLATEventBin.cpp.
References G_COUNTS_GET, and m_counts.
|
virtual |
Set number of counts in event bin.
[in] | counts | Number of counts. |
GException::invalid_value | Invalid counts pointer encountered. |
Set the number of counts in the event bin.
Implements GEventBin.
Definition at line 305 of file GLATEventBin.cpp.
References counts(), G_COUNTS_SET, and m_counts.
|
inline |
Return pointer to related map cube.
Returns a pointer to the map cube in which the event bin is embedded. If the event bin is not part of a cube, NULL is returned.
Definition at line 174 of file GLATEventBin.hpp.
References m_cube.
|
virtual |
Return instrument direction of event bin.
GException::invalid_value | Invalid instrument direction pointer encountered. |
Returns reference to the instrument direction of the event bin.
Implements GEventBin.
Definition at line 209 of file GLATEventBin.cpp.
|
virtual |
Return energy of event bin.
GException::invalid_value | Invalid energy pointer encountered. |
Returns reference to the energy of the event bin.
Implements GEventBin.
Definition at line 233 of file GLATEventBin.cpp.
|
virtual |
Return error in number of counts.
Returns \(\sqrt(counts+delta)\) as the uncertainty in the number of counts in the bin. Adding delta avoids uncertainties of 0 which will lead in the optimisation step to the exlusion of the corresponding bin. In the actual implementation delta=1e-50.
Implements GEventBin.
Definition at line 335 of file GLATEventBin.cpp.
const GEnergy & GLATEventBin::ewidth | ( | void | ) | const |
Return energy width of event bin.
GException::invalid_value | Invalid energy width pointer encountered. |
Returns reference to the energy width of the event bin.
Definition at line 379 of file GLATEventBin.cpp.
References G_EWIDTH, and m_ewidth.
Referenced by size().
|
protected |
Delete class members.
Definition at line 498 of file GLATEventBin.cpp.
Referenced by clear(), operator=(), and ~GLATEventBin().
|
inline |
Return event bin energy index in cube.
Returns the energy index of the event in the counts map cube. The energy index relates to the 3rd dimension of the counts map cube. If the event bin is not part of a cube, -1 is returned.
Definition at line 159 of file GLATEventBin.hpp.
References m_ieng.
|
inline |
Return event bin index in cube.
Returns the index of the event in the counts map cube. If the event bin is not part of a cube, -1 is returned.
Definition at line 127 of file GLATEventBin.hpp.
References m_index.
|
protected |
Initialise class members.
Definition at line 450 of file GLATEventBin.cpp.
References m_counts, m_cube, m_dir, m_energy, m_ewidth, m_ieng, m_index, m_ipix, m_ontime, m_solidangle, and m_time.
Referenced by clear(), GLATEventBin(), and operator=().
|
inline |
Return event bin map pixel index in cube.
Returns the spatial index of the event in the counts map cube. The spatial index relates to the reconstructed photon arrival direction. If the event bin is not part of a cube, -1 is returned.
Definition at line 143 of file GLATEventBin.hpp.
References m_ipix.
const double & GLATEventBin::ontime | ( | void | ) | const |
Return ontime of event bin.
GException::invalid_value | Invalid ontime pointer encountered. |
Returns reference to the ontime of the event bin.
Definition at line 403 of file GLATEventBin.cpp.
References G_ONTIME, and m_ontime.
Referenced by GLATResponse::irf_spatial_bin(), and size().
|
virtual |
Assignment operator.
[in] | bin | LAT event bin. |
Definition at line 116 of file GLATEventBin.cpp.
References copy_members(), free_members(), init_members(), and GEventBin::operator=().
Print event information.
[in] | chatter | Chattiness. |
Implements GEventBin.
Definition at line 423 of file GLATEventBin.cpp.
References counts(), SILENT, and gammalib::str().
|
virtual |
Return size of event bin.
The size of the event bin (units sr MeV s) is given by
\[size = \Omega \times \Delta E \times \Delta T\]
where \(\Omega\) is the size of the spatial bin in sr, \(\Delta E\) is the size of the energy bin in MeV, and \(\Delta T\) is the ontime of the observation in seconds.
Implements GEventBin.
Definition at line 189 of file GLATEventBin.cpp.
References ewidth(), GEnergy::MeV(), ontime(), and solidangle().
const double & GLATEventBin::solidangle | ( | void | ) | const |
Return solid angle of event bin.
GException::invalid_value | Invalid solid angle pointer encountered. |
Returns reference to the solid angle of the event bin.
Definition at line 355 of file GLATEventBin.cpp.
References G_SOLIDANGLE, and m_solidangle.
Referenced by size().
|
virtual |
Return time of event bin.
GException::invalid_value | Invalid time pointer encountered. |
Returns reference to the time of the event bin.
Implements GEventBin.
Definition at line 257 of file GLATEventBin.cpp.
|
friend |
Definition at line 52 of file GLATEventBin.hpp.
|
protected |
Pointer to number of counts.
Definition at line 99 of file GLATEventBin.hpp.
Referenced by copy_members(), counts(), init_members(), and GLATEventCube::set_bin().
|
protected |
Event cube back pointer.
Definition at line 92 of file GLATEventBin.hpp.
Referenced by copy_members(), cube(), init_members(), and GLATEventCube::set_bin().
|
protected |
Pointer to bin direction.
Definition at line 97 of file GLATEventBin.hpp.
Referenced by copy_members(), dir(), init_members(), and GLATEventCube::set_bin().
|
protected |
Pointer to bin energy.
Definition at line 96 of file GLATEventBin.hpp.
Referenced by copy_members(), energy(), init_members(), and GLATEventCube::set_bin().
|
protected |
Pointer to energy width of bin.
Definition at line 101 of file GLATEventBin.hpp.
Referenced by copy_members(), ewidth(), init_members(), and GLATEventCube::set_bin().
|
protected |
Actual energy index.
Definition at line 95 of file GLATEventBin.hpp.
Referenced by copy_members(), ieng(), init_members(), and GLATEventCube::set_bin().
|
protected |
Actual skymap index.
Definition at line 93 of file GLATEventBin.hpp.
Referenced by copy_members(), index(), init_members(), and GLATEventCube::set_bin().
|
protected |
Actual spatial index.
Definition at line 94 of file GLATEventBin.hpp.
Referenced by copy_members(), init_members(), ipix(), and GLATEventCube::set_bin().
|
protected |
Pointer to ontime of bin (seconds)
Definition at line 102 of file GLATEventBin.hpp.
Referenced by copy_members(), init_members(), ontime(), and GLATEventCube::set_bin().
|
protected |
Pointer to solid angle of pixel (sr)
Definition at line 100 of file GLATEventBin.hpp.
Referenced by copy_members(), init_members(), GLATEventCube::set_bin(), and solidangle().
|
protected |
Pointer to bin time.
Definition at line 98 of file GLATEventBin.hpp.
Referenced by copy_members(), init_members(), GLATEventCube::set_bin(), and time().