GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GLATLtCube Class Reference

Interface for the Fermi LAT livetime cube. More...

#include <GLATLtCube.hpp>

Inheritance diagram for GLATLtCube:
GBase

Public Member Functions

 GLATLtCube (void)
 Void constructor. More...
 
 GLATLtCube (const GFilename &filename)
 File constructor. More...
 
 GLATLtCube (const GLATLtCube &cube)
 Copy constructor. More...
 
virtual ~GLATLtCube (void)
 Destructor. More...
 
GLATLtCubeoperator= (const GLATLtCube &cube)
 Assignment operator. More...
 
double operator() (const GSkyDir &dir, const GEnergy &energy, _ltcube_ctheta fct) const
 Sum function multiplied by efficiency corrected livetime over zenith angle. More...
 
double operator() (const GSkyDir &dir, const GEnergy &energy, _ltcube_ctheta_phi fct) const
 Sum function multiplied by efficiency corrected livetime over zenith and azimuth angles. More...
 
double operator() (const GSkyDir &dir, const GEnergy &energy, const GLATAeff &aeff) const
 Sum effective area multiplied by efficiency corrected livetime over zenith and (optionally) azimuth angles. More...
 
double operator() (const GSkyDir &dir, const GEnergy &energy, const double &offset, const GLATPsf &psf, const GLATAeff &aeff) const
 Sum point spread function multiplied by efficiency corrected livetime over zenith angles. More...
 
void clear (void)
 Clear livetime cube. More...
 
GLATLtCubeclone (void) const
 Clone livetime cube. More...
 
std::string classname (void) const
 Return class name. More...
 
void load (const GFilename &filename)
 Load livetime cube from FITS file. More...
 
void save (const GFilename &filename, const bool &clobber=false) const
 Save livetime cube into FITS file. More...
 
void read (const GFits &file)
 Read livetime cube from FITS file. More...
 
void write (GFits &file) const
 Write livetime cube into FITS file. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print livetime cube information. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Private Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GLATLtCube &cube)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Private Attributes

GLATLtCubeMap m_exposure
 
GLATLtCubeMap m_weighted_exposure
 
GGti m_gti
 

Detailed Description

Interface for the Fermi LAT livetime cube.

The livetime cube holds the livetime as function and zenith and azimuth angles for a given observation. The azimuth dependence is optional.

Definition at line 59 of file GLATLtCube.hpp.

Constructor & Destructor Documentation

GLATLtCube::GLATLtCube ( void  )

Void constructor.

Definition at line 59 of file GLATLtCube.cpp.

References init_members().

Referenced by clone().

GLATLtCube::GLATLtCube ( const GFilename filename)
explicit

File constructor.

Parameters
[in]filenameLivetime cube filename.

Definition at line 74 of file GLATLtCube.cpp.

References init_members(), and load().

GLATLtCube::GLATLtCube ( const GLATLtCube cube)

Copy constructor.

Parameters
[in]cubeLivetime cube.

Definition at line 92 of file GLATLtCube.cpp.

References copy_members(), and init_members().

GLATLtCube::~GLATLtCube ( void  )
virtual

Destructor.

Definition at line 108 of file GLATLtCube.cpp.

References free_members().

Member Function Documentation

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

Return class name.

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

Implements GBase.

Definition at line 110 of file GLATLtCube.hpp.

void GLATLtCube::clear ( void  )
virtual

Clear livetime cube.

Implements GBase.

Definition at line 360 of file GLATLtCube.cpp.

References free_members(), and init_members().

Referenced by load(), and read().

GLATLtCube * GLATLtCube::clone ( void  ) const
virtual

Clone livetime cube.

Returns
Pointer to deep copy of livetime cube.

Implements GBase.

Definition at line 378 of file GLATLtCube.cpp.

References GLATLtCube().

Referenced by GLATObservation::copy_members().

void GLATLtCube::copy_members ( const GLATLtCube cube)
private

Copy class members.

Parameters
[in]cubeLivetime cube.

Definition at line 553 of file GLATLtCube.cpp.

References m_exposure, m_gti, and m_weighted_exposure.

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

void GLATLtCube::free_members ( void  )
private

Delete class members.

Definition at line 568 of file GLATLtCube.cpp.

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

void GLATLtCube::init_members ( void  )
private

Initialise class members.

Definition at line 536 of file GLATLtCube.cpp.

References GGti::clear(), GLATLtCubeMap::clear(), m_exposure, m_gti, and m_weighted_exposure.

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

void GLATLtCube::load ( const GFilename filename)

Load livetime cube from FITS file.

Parameters
[in]filenameFITS file name.

Definition at line 389 of file GLATLtCube.cpp.

References clear(), GFits::close(), and read().

Referenced by GLATLtCube(), GLATObservation::load_binned(), and GLATObservation::load_unbinned().

double GLATLtCube::operator() ( const GSkyDir dir,
const GEnergy energy,
_ltcube_ctheta  fct 
) const

Sum function multiplied by efficiency corrected livetime over zenith angle.

Parameters
[in]dirSky direction.
[in]energyEnergy.
[in]fctFunction to evaluate.

Computes

\[\sum_{\cos \theta} T_{\rm corr.~live}(\cos \theta) f(\cos \theta)\]

where \(T_{\rm corr.~live}(\cos \theta)\) is the efficiency corrected livetime as a function of the cosine of the zenith angle, and \(f(\cos \theta)\) is a function that depends on the cosine of the zenith angle.

Note that no efficieny correction is implemented for this method as the efficiency factors are stored together with the effective area. If we want efficiency correction here, we should think about passing this information to the method.

Definition at line 172 of file GLATLtCube.cpp.

References m_exposure.

double GLATLtCube::operator() ( const GSkyDir dir,
const GEnergy energy,
_ltcube_ctheta_phi  fct 
) const

Sum function multiplied by efficiency corrected livetime over zenith and azimuth angles.

Parameters
[in]dirSky direction.
[in]energyEnergy.
[in]fctFunction to evaluate.

Computes

\[\sum_{\cos \theta, \phi} T_{\rm corr.~live}(\cos \theta, \phi) f(\cos \theta, \phi)\]

where \(T_{\rm corr.~live}(\cos \theta, \phi)\) is the efficiency corrected livetime as a function of the cosine of the zenith and of the azimuth angle, and \(f(\cos \theta, \phi)\) is a function that depends on the cosine of the zenith angle and of the azimuth angle.

Note that no efficieny correction is implemented for this method as the efficiency factors are stored together with the effective area. If we want efficiency correction here, we should think about passing this information to the method.

Definition at line 224 of file GLATLtCube.cpp.

References m_exposure.

double GLATLtCube::operator() ( const GSkyDir dir,
const GEnergy energy,
const GLATAeff aeff 
) const

Sum effective area multiplied by efficiency corrected livetime over zenith and (optionally) azimuth angles.

Parameters
[in]dirSky direction.
[in]energyEnergy.
[in]aeffEffective area.

Computes

\[\sum_{\cos \theta, \phi} T_{\rm corr.~live}(\cos \theta, \phi) A_{\rm eff}(\cos \theta, \phi)\]

where \(T_{\rm corr.~live}(\cos \theta, \phi)\) is the efficiency corrected livetime as a function of the cosine of the zenith and of the azimuth angle, and \(A_{\rm eff}(\cos \theta, \phi)\) is the effective area that depends on the cosine of the zenith angle and (optionally) of the azimuth angle.

Definition at line 271 of file GLATLtCube.cpp.

References GLATAeff::efficiency_factor1(), GLATAeff::efficiency_factor2(), GLATAeff::has_efficiency(), m_exposure, and m_weighted_exposure.

double GLATLtCube::operator() ( const GSkyDir dir,
const GEnergy energy,
const double &  offset,
const GLATPsf psf,
const GLATAeff aeff 
) const

Sum point spread function multiplied by efficiency corrected livetime over zenith angles.

Parameters
[in]dirSky direction.
[in]energyEnergy.
[in]offsetOffset from true direction (deg).
[in]psfPoint spread function.
[in]aeffEffective area.

Computes

\[\sum_{\cos \theta, \phi} T_{\rm corr.~live}(\cos \theta, \phi) PSF(\log E, \delta, \cos \theta) A_{\rm eff}(\cos \theta, \phi)\]

where \(T_{\rm corr.~live}(\cos \theta, \phi)\) is the efficiency corrected livetime as a function of the cosine of the zenith and of the azimuth angle, \(PSF(\log E, \delta, \cos \theta)\) is the point spread function that depends on the log10 of the energy (in MeV), the offset angle from the true direction (in degrees), and the cosine of the zenith angle, and \(A_{\rm eff}(\cos \theta, \phi)\) is the effective area that depends on the cosine of the zenith angle and (optionally) of the azimuth angle.

Definition at line 323 of file GLATLtCube.cpp.

References GLATAeff::efficiency_factor1(), GLATAeff::efficiency_factor2(), GLATAeff::has_efficiency(), m_exposure, and m_weighted_exposure.

GLATLtCube & GLATLtCube::operator= ( const GLATLtCube cube)

Assignment operator.

Parameters
[in]cubeLivetime cube.
Returns
Livetime cube.

Definition at line 130 of file GLATLtCube.cpp.

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

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

Print livetime cube information.

Parameters
[in]chatterChattiness.
Returns
String containing livetime cube information.

Implements GBase.

Definition at line 501 of file GLATLtCube.cpp.

References m_exposure, m_gti, m_weighted_exposure, GLATLtCubeMap::print(), GGti::print(), gammalib::reduce(), and SILENT.

Referenced by GLATObservation::print().

void GLATLtCube::read ( const GFits fits)

Read livetime cube from FITS file.

Parameters
[in]fitsFITS.

Reads a livetime cube from a FITS file.

Todo:
Reading of cos theta boundaries not yet implemented. This is not critical since they are not really needed. We just need them once we want to implement also saving.

Definition at line 443 of file GLATLtCube.cpp.

References clear(), gammalib::extname_gti, gammalib::extname_lat_exposure, gammalib::extname_lat_wgtexposure, m_exposure, m_gti, m_weighted_exposure, GLATLtCubeMap::read(), GGti::read(), and GFits::table().

Referenced by load().

void GLATLtCube::save ( const GFilename filename,
const bool &  clobber = false 
) const

Save livetime cube into FITS file.

Parameters
[in]filenameFITS file name.
[in]clobberOverwrite existing file? (default: false)
Todo:
Not yet implemented.

Definition at line 416 of file GLATLtCube.cpp.

References GFits::saveto(), and write().

void GLATLtCube::write ( GFits fits) const

Write livetime cube into FITS file.

Parameters
[in]fitsFITS file.

Writes the livetime cube into a FITS file.

Definition at line 477 of file GLATLtCube.cpp.

References gammalib::extname_gti, gammalib::extname_lat_exposure, gammalib::extname_lat_wgtexposure, m_exposure, m_gti, m_weighted_exposure, GLATLtCubeMap::write(), and GGti::write().

Referenced by save().

Member Data Documentation

GLATLtCubeMap GLATLtCube::m_exposure
private

Definition at line 98 of file GLATLtCube.hpp.

Referenced by copy_members(), init_members(), operator()(), print(), read(), and write().

GGti GLATLtCube::m_gti
private

Definition at line 100 of file GLATLtCube.hpp.

Referenced by copy_members(), init_members(), print(), read(), and write().

GLATLtCubeMap GLATLtCube::m_weighted_exposure
private

Definition at line 99 of file GLATLtCube.hpp.

Referenced by copy_members(), init_members(), operator()(), print(), read(), and write().


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