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

Interface for the Fermi LAT energy dispersion. More...

#include <GLATEdisp.hpp>

Inheritance diagram for GLATEdisp:
GBase

Public Member Functions

 GLATEdisp (void)
 Void constructor. More...
 
 GLATEdisp (const GFilename &filename, const std::string &evtype)
 File constructor. More...
 
 GLATEdisp (const GLATEdisp &edisp)
 Copy constructor. More...
 
virtual ~GLATEdisp (void)
 Destructor. More...
 
GLATEdispoperator= (const GLATEdisp &edisp)
 Assignment operator. More...
 
void clear (void)
 Clear energy dispersion response. More...
 
GLATEdispclone (void) const
 Clone energy dispersion response. More...
 
std::string classname (void) const
 Return class name. More...
 
const std::string & evtype (void) const
 Return event type. More...
 
void load (const GFilename &filename, const std::string &evtype)
 Load energy dispersion from FITS file. More...
 
void save (const GFilename &filename, const bool &clobber=false)
 Save energy dispersion into FITS file. More...
 
void read (const GFits &file, const std::string &evtype)
 Read energy dispersion from FITS file. More...
 
void write (GFits &file) const
 Write energy dispersion into FITS file. More...
 
int size (void) const
 Return number of bins in energy dispersion response. More...
 
int nenergies (void) const
 Return number of energies in energy dispersion response. More...
 
int ncostheta (void) const
 Return number of cosine theta bins in energy dispersion response. More...
 
bool has_phi (void) const
 Signal that energy dispersion has Phi dependence. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print energy dispersion 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 GLATEdisp &edisp)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void read_edisp (const GFitsTable &table)
 Read energy dispersion from FITS table. More...
 
void write_edisp (GFits &file) const
 Write energy dispersion into FITS file. More...
 

Private Attributes

std::string m_evtype
 Event type. More...
 
GLATResponseTable m_edisp_bins
 Energy dispersion energy and cos theta binning. More...
 
std::vector< double > m_norm
 Energy dispersion normalization. More...
 
std::vector< double > m_ls1
 Energy dispersion ... More...
 
std::vector< double > m_scale
 Energy dispersion scaling parameters. More...
 

Detailed Description

Interface for the Fermi LAT energy dispersion.

Todo:
Implement support for older response functions?

Definition at line 55 of file GLATEdisp.hpp.

Constructor & Destructor Documentation

GLATEdisp::GLATEdisp ( void  )

Void constructor.

Definition at line 62 of file GLATEdisp.cpp.

References init_members().

Referenced by clone().

GLATEdisp::GLATEdisp ( const GFilename filename,
const std::string &  evtype 
)

File constructor.

Parameters
[in]filenameFITS file name.
[in]evtypeEvent type.

Construct instance by loading the energy dispersion information from FITS file.

Definition at line 81 of file GLATEdisp.cpp.

References init_members(), and load().

GLATEdisp::GLATEdisp ( const GLATEdisp edisp)

Copy constructor.

Parameters
[in]edispEnergy dispersion.

Definition at line 99 of file GLATEdisp.cpp.

References copy_members(), and init_members().

GLATEdisp::~GLATEdisp ( void  )
virtual

Destructor.

Definition at line 115 of file GLATEdisp.cpp.

References free_members().

Member Function Documentation

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

Return class name.

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

Implements GBase.

Definition at line 112 of file GLATEdisp.hpp.

void GLATEdisp::clear ( void  )
virtual

Clear energy dispersion response.

This method properly resets the object to an initial state.

Implements GBase.

Definition at line 169 of file GLATEdisp.cpp.

References free_members(), and init_members().

Referenced by read().

GLATEdisp * GLATEdisp::clone ( void  ) const
virtual

Clone energy dispersion response.

Returns
Pointer to deep copy of energy dispersion response.

Implements GBase.

Definition at line 187 of file GLATEdisp.cpp.

References GLATEdisp().

void GLATEdisp::copy_members ( const GLATEdisp edisp)
private

Copy class members.

Parameters
[in]edispEnergy dispersion.

Definition at line 347 of file GLATEdisp.cpp.

References m_edisp_bins, m_evtype, m_ls1, m_norm, and m_scale.

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

const std::string & GLATEdisp::evtype ( void  ) const
inline

Return event type.

Returns
Event type.

Definition at line 124 of file GLATEdisp.hpp.

References m_evtype.

Referenced by read().

void GLATEdisp::free_members ( void  )
private

Delete class members.

Definition at line 364 of file GLATEdisp.cpp.

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

bool GLATEdisp::has_phi ( void  ) const
inline

Signal that energy dispersion has Phi dependence.

Returns
True if energy dispersion has Phi dependence.

Definition at line 172 of file GLATEdisp.hpp.

void GLATEdisp::init_members ( void  )
private

Initialise class members.

Definition at line 328 of file GLATEdisp.cpp.

References GLATResponseTable::clear(), m_edisp_bins, m_evtype, m_ls1, m_norm, and m_scale.

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

void GLATEdisp::load ( const GFilename filename,
const std::string &  evtype 
)

Load energy dispersion from FITS file.

Parameters
[in]filenameFITS file.
[in]evtypeEvent type.

Definition at line 199 of file GLATEdisp.cpp.

References read().

Referenced by GLATEdisp().

int GLATEdisp::ncostheta ( void  ) const
inline

Return number of cosine theta bins in energy dispersion response.

Returns
Number of cosine theta bins in energy dispersion response.

Definition at line 160 of file GLATEdisp.hpp.

References m_edisp_bins, and GLATResponseTable::ncostheta().

Referenced by print(), and size().

int GLATEdisp::nenergies ( void  ) const
inline

Return number of energies in energy dispersion response.

Returns
Number of energies in energy dispersion response.

Definition at line 148 of file GLATEdisp.hpp.

References m_edisp_bins, and GLATResponseTable::nenergies().

Referenced by print(), and size().

GLATEdisp & GLATEdisp::operator= ( const GLATEdisp edisp)

Assignment operator.

Parameters
[in]edispEnergy dispersion.
Returns
Energy dispersion.

Definition at line 137 of file GLATEdisp.cpp.

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

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

Print energy dispersion information.

Parameters
[in]chatterChattiness.
Returns
String containing energy dispersion information.

Implements GBase.

Definition at line 295 of file GLATEdisp.cpp.

References ncostheta(), nenergies(), gammalib::parformat(), SILENT, and gammalib::str().

void GLATEdisp::read ( const GFits fits,
const std::string &  evtype 
)

Read energy dispersion from FITS file.

Parameters
[in]fitsFITS file.
[in]evtypeEvent type.
Todo:
Implement reading of scaling parameters

Definition at line 242 of file GLATEdisp.cpp.

References clear(), GFits::contains(), evtype(), gammalib::extname_lat_edisp, m_evtype, read_edisp(), and GFits::table().

Referenced by load().

void GLATEdisp::read_edisp ( const GFitsTable table)
private

Read energy dispersion from FITS table.

Parameters
[in]tableFITS table.
Exceptions
GException::invalid_argumentInconsistent response table encountered
Todo:
Implement reading of energy dispersion table

Definition at line 381 of file GLATEdisp.cpp.

References m_edisp_bins, m_ls1, m_norm, GLATResponseTable::read(), GLATResponseTable::size(), and size().

Referenced by read().

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

Save energy dispersion into FITS file.

Parameters
[in]filenameFITS file.
[in]clobberOverwrite existing file? (default: false)

Definition at line 218 of file GLATEdisp.cpp.

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

int GLATEdisp::size ( void  ) const
inline

Return number of bins in energy dispersion response.

Returns
Number of bins in energy dispersion response.

Definition at line 136 of file GLATEdisp.hpp.

References ncostheta(), and nenergies().

Referenced by read_edisp(), and write_edisp().

void GLATEdisp::write ( GFits fits) const

Write energy dispersion into FITS file.

Parameters
[in]fitsFITS file.

Definition at line 279 of file GLATEdisp.cpp.

References write_edisp().

Referenced by save().

void GLATEdisp::write_edisp ( GFits file) const
private

Write energy dispersion into FITS file.

Parameters
[in]fileFITS file.

This method does not write anything if the instance is empty.

Definition at line 440 of file GLATEdisp.cpp.

References GFits::append(), GFitsHDU::extname(), gammalib::extname_lat_edisp, m_edisp_bins, GLATResponseTable::size(), size(), and GLATResponseTable::write().

Referenced by write().

Member Data Documentation

GLATResponseTable GLATEdisp::m_edisp_bins
private

Energy dispersion energy and cos theta binning.

Definition at line 99 of file GLATEdisp.hpp.

Referenced by copy_members(), init_members(), ncostheta(), nenergies(), read_edisp(), and write_edisp().

std::string GLATEdisp::m_evtype
private

Event type.

Definition at line 98 of file GLATEdisp.hpp.

Referenced by copy_members(), evtype(), init_members(), and read().

std::vector<double> GLATEdisp::m_ls1
private

Energy dispersion ...

Definition at line 101 of file GLATEdisp.hpp.

Referenced by copy_members(), init_members(), and read_edisp().

std::vector<double> GLATEdisp::m_norm
private

Energy dispersion normalization.

Definition at line 100 of file GLATEdisp.hpp.

Referenced by copy_members(), init_members(), and read_edisp().

std::vector<double> GLATEdisp::m_scale
private

Energy dispersion scaling parameters.

Definition at line 102 of file GLATEdisp.hpp.

Referenced by copy_members(), and init_members().


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