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

Fermi/LAT event bin class. More...

#include <GLATEventBin.hpp>

Inheritance diagram for GLATEventBin:
GEventBin GEvent GBase

Public Member Functions

 GLATEventBin (void)
 Void constructor. More...
 
 GLATEventBin (const GLATEventBin &bin)
 Copy constructor. More...
 
virtual ~GLATEventBin (void)
 Destructor. More...
 
virtual GLATEventBinoperator= (const GLATEventBin &bin)
 Assignment operator. More...
 
virtual void clear (void)
 Clear event bin. More...
 
virtual GLATEventBinclone (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 GLATInstDirdir (void) const
 Return instrument direction of event bin. More...
 
virtual const GEnergyenergy (void) const
 Return energy of event bin. More...
 
virtual const GTimetime (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 GEnergyewidth (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 GLATEventCubecube (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 GEventBinoperator= (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 GEventoperator= (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

GLATEventCubem_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...
 
GEnergym_energy
 Pointer to bin energy. More...
 
GLATInstDirm_dir
 Pointer to bin direction. More...
 
GTimem_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...
 
GEnergym_ewidth
 Pointer to energy width of bin. More...
 
double * m_ontime
 Pointer to ontime of bin (seconds) More...
 

Friends

class GLATEventCube
 

Detailed Description

Fermi/LAT event bin class.

This class implement a counts map bin for the Fermi/LAT telescope.

Todo:
Implement stand alone version of event bin.

Definition at line 49 of file GLATEventBin.hpp.

Constructor & Destructor Documentation

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.

Parameters
[in]binEvent bin.

Definition at line 78 of file GLATEventBin.cpp.

References copy_members(), and init_members().

GLATEventBin::~GLATEventBin ( void  )
virtual

Destructor.

Definition at line 94 of file GLATEventBin.cpp.

References free_members().

Member Function Documentation

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

Return class name.

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

Implements GEventBin.

Definition at line 112 of file GLATEventBin.hpp.

void GLATEventBin::clear ( void  )
virtual
GLATEventBin * GLATEventBin::clone ( void  ) const
virtual

Clone event bin.

Returns
Pointer to deep copy of Fermi/LAT event bin.

Implements GEventBin.

Definition at line 171 of file GLATEventBin.cpp.

References GLATEventBin().

void GLATEventBin::copy_members ( const GLATEventBin bin)
protected

Copy class members.

Parameters
[in]binEvent 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=().

double GLATEventBin::counts ( void  ) const
virtual

Return number of counts in event bin.

Returns
Number of counts in event bin.
Exceptions
GLATException::no_memberInvalid 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.

Referenced by counts(), error(), and print().

void GLATEventBin::counts ( const double &  counts)
virtual

Set number of counts in event bin.

Parameters
[in]countsNumber of counts.
Exceptions
GException::invalid_valueInvalid 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.

const GLATEventCube * GLATEventBin::cube ( void  ) const
inline

Return pointer to related map cube.

Returns
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.

const GLATInstDir & GLATEventBin::dir ( void  ) const
virtual

Return instrument direction of event bin.

Returns
Instrument direction of event bin.
Exceptions
GException::invalid_valueInvalid instrument direction pointer encountered.

Returns reference to the instrument direction of the event bin.

Implements GEventBin.

Definition at line 209 of file GLATEventBin.cpp.

References G_DIR, and m_dir.

const GEnergy & GLATEventBin::energy ( void  ) const
virtual

Return energy of event bin.

Returns
Energy of event bin.
Exceptions
GException::invalid_valueInvalid energy pointer encountered.

Returns reference to the energy of the event bin.

Implements GEventBin.

Definition at line 233 of file GLATEventBin.cpp.

References G_ENERGY, and m_energy.

double GLATEventBin::error ( void  ) const
virtual

Return error in number of counts.

Returns
Error in number of counts in event bin.

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.

Todo:
The choice of delta has been made somewhat arbitrary, mainly because the optimizer routines filter error^2 below 1e-100.

Implements GEventBin.

Definition at line 335 of file GLATEventBin.cpp.

References counts(), and sqrt().

const GEnergy & GLATEventBin::ewidth ( void  ) const

Return energy width of event bin.

Returns
Energy width of event bin.
Exceptions
GException::invalid_valueInvalid 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().

void GLATEventBin::free_members ( void  )
protected

Delete class members.

Definition at line 498 of file GLATEventBin.cpp.

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

const int & GLATEventBin::ieng ( void  ) const
inline

Return event bin energy index in cube.

Returns
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.

const int & GLATEventBin::index ( void  ) const
inline

Return event bin index in cube.

Returns
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.

void GLATEventBin::init_members ( void  )
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=().

const int & GLATEventBin::ipix ( void  ) const
inline

Return event bin map pixel index in cube.

Returns
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.

Returns
Ontime of event bin.
Exceptions
GException::invalid_valueInvalid 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().

GLATEventBin & GLATEventBin::operator= ( const GLATEventBin bin)
virtual

Assignment operator.

Parameters
[in]binLAT event bin.
Returns
Lat event bin.

Definition at line 116 of file GLATEventBin.cpp.

References copy_members(), free_members(), init_members(), and GEventBin::operator=().

std::string GLATEventBin::print ( const GChatter chatter = NORMAL) const
virtual

Print event information.

Parameters
[in]chatterChattiness.
Returns
String containing number of counts in event bin.

Implements GEventBin.

Definition at line 423 of file GLATEventBin.cpp.

References counts(), SILENT, and gammalib::str().

double GLATEventBin::size ( void  ) const
virtual

Return size of event bin.

Returns
Size of event bin in units of sr MeV s.

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.

Returns
Solid angle of event bin.
Exceptions
GException::invalid_valueInvalid 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().

const GTime & GLATEventBin::time ( void  ) const
virtual

Return time of event bin.

Returns
Time of event bin.
Exceptions
GException::invalid_valueInvalid time pointer encountered.

Returns reference to the time of the event bin.

Implements GEventBin.

Definition at line 257 of file GLATEventBin.cpp.

References G_TIME, and m_time.

Friends And Related Function Documentation

friend class GLATEventCube
friend

Definition at line 52 of file GLATEventBin.hpp.

Member Data Documentation

double* GLATEventBin::m_counts
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().

GLATEventCube* GLATEventBin::m_cube
protected

Event cube back pointer.

Definition at line 92 of file GLATEventBin.hpp.

Referenced by copy_members(), cube(), init_members(), and GLATEventCube::set_bin().

GLATInstDir* GLATEventBin::m_dir
protected

Pointer to bin direction.

Definition at line 97 of file GLATEventBin.hpp.

Referenced by copy_members(), dir(), init_members(), and GLATEventCube::set_bin().

GEnergy* GLATEventBin::m_energy
protected

Pointer to bin energy.

Definition at line 96 of file GLATEventBin.hpp.

Referenced by copy_members(), energy(), init_members(), and GLATEventCube::set_bin().

GEnergy* GLATEventBin::m_ewidth
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().

int GLATEventBin::m_ieng
protected

Actual energy index.

Definition at line 95 of file GLATEventBin.hpp.

Referenced by copy_members(), ieng(), init_members(), and GLATEventCube::set_bin().

int GLATEventBin::m_index
protected

Actual skymap index.

Definition at line 93 of file GLATEventBin.hpp.

Referenced by copy_members(), index(), init_members(), and GLATEventCube::set_bin().

int GLATEventBin::m_ipix
protected

Actual spatial index.

Definition at line 94 of file GLATEventBin.hpp.

Referenced by copy_members(), init_members(), ipix(), and GLATEventCube::set_bin().

double* GLATEventBin::m_ontime
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().

double* GLATEventBin::m_solidangle
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().

GTime* GLATEventBin::m_time
protected

Pointer to bin time.

Definition at line 98 of file GLATEventBin.hpp.

Referenced by copy_members(), init_members(), GLATEventCube::set_bin(), and time().


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