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

Fermi/LAT event list class. More...

#include <GLATEventList.hpp>

Inheritance diagram for GLATEventList:
GEventList GEvents GBase

Public Member Functions

 GLATEventList (void)
 Void constructor. More...
 
 GLATEventList (const GFilename &filename)
 File name constructor. More...
 
 GLATEventList (const GLATEventList &list)
 Copy constructor. More...
 
virtual ~GLATEventList (void)
 Destructor. More...
 
virtual GLATEventListoperator= (const GLATEventList &list)
 Assignment operator. More...
 
virtual GLATEventAtomoperator[] (const int &index)
 Event atom access operator. More...
 
virtual const GLATEventAtomoperator[] (const int &index) const
 Event atom access operator. More...
 
virtual void clear (void)
 Clear event list. More...
 
virtual GLATEventListclone (void) const
 Clone event list. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual int size (void) const
 Return number of events in list. More...
 
virtual void load (const GFilename &filename)
 Load LAT events from FITS file. More...
 
virtual void save (const GFilename &filename, const bool &clobber=false) const
 Save LAT events. More...
 
virtual void read (const GFits &file)
 Read LAT events from FITS file. More...
 
virtual void write (GFits &file) const
 Write LAT event list into FITS file. More...
 
virtual int number (void) const
 Return number of events in list. More...
 
virtual void roi (const GRoi &roi)
 Set region of interest. More...
 
virtual const GLATRoiroi (void) const
 Return Region of Interest. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print event list information. More...
 
void append (const GLATEventAtom &event)
 Append event to event list. More...
 
void reserve (const int &number)
 Reserves space for events. More...
 
void remove (const int &index, const int &number=1)
 Remove events from event list. More...
 
- Public Member Functions inherited from GEventList
 GEventList (void)
 Void constructor. More...
 
 GEventList (const GEventList &list)
 Copy constructor. More...
 
virtual ~GEventList (void)
 Destructor. More...
 
virtual GEventListoperator= (const GEventList &list)
 Assignment operator. More...
 
- Public Member Functions inherited from GEvents
 GEvents (void)
 Void constructor. More...
 
 GEvents (const GEvents &events)
 Copy constructor. More...
 
virtual ~GEvents (void)
 Destructor. More...
 
virtual GEventsoperator= (const GEvents &events)
 Assignment operator. More...
 
void ebounds (const GEbounds &ebounds)
 Set energy boundaries. More...
 
void gti (const GGti &gti)
 Set Good Time Intervals. More...
 
const GEboundsebounds (void) const
 Return energy boundaries. More...
 
const GGtigti (void) const
 Return Good Time Intervals. More...
 
const GTimetstart (void) const
 Return start time. More...
 
const GTimetstop (void) const
 Return stop time. More...
 
const GEnergyemin (void) const
 Return minimum energy. More...
 
const GEnergyemax (void) const
 Return maximum energy. 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 GLATEventList &list)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
virtual void set_energies (void)
 
virtual void set_times (void)
 
void read_events (const GFitsTable &hdu)
 Read LAT events from FITS table. More...
 
void read_ds_keys (const GFitsHDU &hdu)
 Read data selection keywords from FITS HDU. More...
 
- Protected Member Functions inherited from GEventList
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GEventList &list)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GEvents
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GEvents &events)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Protected Attributes

GLATRoi m_roi
 Region of interest. More...
 
std::vector< GLATEventAtomm_events
 Events. More...
 
std::vector< std::string > m_difrsp_label
 Diffuse response model labels. More...
 
std::vector< std::string > m_ds_type
 Data selection types. More...
 
std::vector< std::string > m_ds_unit
 Data selection units. More...
 
std::vector< std::string > m_ds_value
 Data selection values. More...
 
std::vector< std::string > m_ds_reference
 Data selection references. More...
 
- Protected Attributes inherited from GEvents
GEbounds m_ebounds
 Energy boundaries covered by events. More...
 
GGti m_gti
 Good time intervals covered by events. More...
 

Detailed Description

Fermi/LAT event list class.

Definition at line 54 of file GLATEventList.hpp.

Constructor & Destructor Documentation

GLATEventList::GLATEventList ( void  )

Void constructor.

Definition at line 63 of file GLATEventList.cpp.

References init_members().

Referenced by clone().

GLATEventList::GLATEventList ( const GFilename filename)
explicit

File name constructor.

Parameters
[in]filenameEvent list filename.

Construct event list object by loading the events from a FITS file.

Definition at line 80 of file GLATEventList.cpp.

References init_members(), and load().

GLATEventList::GLATEventList ( const GLATEventList list)

Copy constructor.

Parameters
[in]listLAT event list.

Definition at line 98 of file GLATEventList.cpp.

References copy_members(), and init_members().

GLATEventList::~GLATEventList ( void  )
virtual

Destructor.

Definition at line 114 of file GLATEventList.cpp.

References free_members().

Member Function Documentation

void GLATEventList::append ( const GLATEventAtom event)

Append event to event list.

Parameters
[in]eventEvent.

Appends an event to the end of the event list.

Definition at line 393 of file GLATEventList.cpp.

References m_events.

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

Return class name.

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

Implements GEventList.

Definition at line 115 of file GLATEventList.hpp.

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

Clone event list.

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

Implements GEventList.

Definition at line 239 of file GLATEventList.cpp.

References GLATEventList().

void GLATEventList::copy_members ( const GLATEventList list)
protected

Copy class members.

Parameters
[in]listLAT event list.

Definition at line 513 of file GLATEventList.cpp.

References m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, m_events, and m_roi.

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

void GLATEventList::free_members ( void  )
protected

Delete class members.

Definition at line 532 of file GLATEventList.cpp.

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

void GLATEventList::init_members ( void  )
protected

Initialise class members.

Definition at line 492 of file GLATEventList.cpp.

References GLATRoi::clear(), m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, m_events, and m_roi.

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

void GLATEventList::load ( const GFilename filename)
virtual

Load LAT events from FITS file.

Parameters
[in]filenameFITS filename.

This method loads LAT events from a FT1 file.

Implements GEventList.

Definition at line 252 of file GLATEventList.cpp.

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

Referenced by GLATEventList().

int GLATEventList::number ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 139 of file GLATEventList.hpp.

References m_events.

Referenced by print(), and remove().

GLATEventList & GLATEventList::operator= ( const GLATEventList list)
virtual

Assignment operator.

Parameters
[in]listFermi/LAT event list.
Returns
Fermi/LAT event list.

Definition at line 136 of file GLATEventList.cpp.

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

GLATEventAtom * GLATEventList::operator[] ( const int &  index)
virtual

Event atom access operator.

Parameters
[in]indexEvent index [0,...,size()-1].
Exceptions
GException::out_of_rangeEvent index outside valid range.

Returns pointer to an event atom.

Implements GEventList.

Definition at line 170 of file GLATEventList.cpp.

References G_OPERATOR, m_events, and size().

const GLATEventAtom * GLATEventList::operator[] ( const int &  index) const
virtual

Event atom access operator.

Parameters
[in]indexEvent index [0,...,size()-1].
Exceptions
GException::out_of_rangeEvent index outside valid range.

Returns pointer to an event atom.

Implements GEventList.

Definition at line 194 of file GLATEventList.cpp.

References G_OPERATOR, m_events, and size().

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

Print event list information.

Parameters
[in]chatterChattiness.
Returns
String containing event list information.

Implements GEventList.

Definition at line 439 of file GLATEventList.cpp.

References m_difrsp_label, m_ds_reference, m_ds_type, m_ds_unit, number(), gammalib::parformat(), SILENT, and gammalib::str().

void GLATEventList::read ( const GFits file)
virtual

Read LAT events from FITS file.

Parameters
[in]fileFITS file.

This method read the LAT event list from a FITS file.

The method clears the object before loading, thus any events residing in the object before loading will be lost.

Implements GEventList.

Definition at line 296 of file GLATEventList.cpp.

References GGti::append(), clear(), GFits::contains(), gammalib::extname_gti, gammalib::extname_lat_events, GEvents::gti(), GEvents::m_gti, GGti::read(), read_ds_keys(), read_events(), GFitsHDU::real(), GGti::reference(), GFits::table(), GEvents::tstart(), and GEvents::tstop().

Referenced by load(), and GLATObservation::load_unbinned().

void GLATEventList::read_ds_keys ( const GFitsHDU hdu)
protected

Read data selection keywords from FITS HDU.

Parameters
[in]hduFITS HDU pointer.
Todo:

Declared header card const in to GFitsHDU.

Add check key method to GFitsHDU to avoid unneccesary try/catch blocks.

Definition at line 658 of file GLATEventList.cpp.

References GFitsHDU::has_card(), GFitsHDU::integer(), m_ds_reference, m_ds_type, m_ds_unit, m_ds_value, and GFitsHDU::string().

Referenced by read().

void GLATEventList::read_events ( const GFitsTable table)
protected

Read LAT events from FITS table.

Parameters
[in]tableEvent table.

Read the LAT events from the event table.

Definition at line 546 of file GLATEventList.cpp.

References GFitsHDU::has_card(), GFitsTableCol::integer(), GFitsHDU::integer(), m_difrsp_label, m_events, GEvents::m_gti, GLATEventAtom::m_time, GFitsTableCol::real(), GGti::reference(), GTime::set(), and GFitsHDU::string().

Referenced by read().

void GLATEventList::remove ( const int &  index,
const int &  number = 1 
)

Remove events from event list.

Parameters
[in]indexIndex from which on events should be removed.
[in]numberNumber of event to remove (default: 1).

Removes events from the event list. This method does nothing if index points beyond the event list. The method does also gently accept number arguments where index + number reach beyond the event list. In that case, all events from event index on will be removed.

Definition at line 414 of file GLATEventList.cpp.

References m_events, number(), and size().

void GLATEventList::reserve ( const int &  number)
inline

Reserves space for events.

Parameters
[in]numberNumber of events.

Reserves space for number events in the event list.

Definition at line 165 of file GLATEventList.hpp.

References m_events.

void GLATEventList::roi ( const GRoi roi)
virtual

Set region of interest.

Parameters
[in]roiRegion of interest.
Exceptions
GLATException::bad_roi_typeROI is not of type GLATRoi.

Implements GEventList.

Definition at line 368 of file GLATEventList.cpp.

References G_ROI, m_roi, and roi().

const GLATRoi & GLATEventList::roi ( void  ) const
inlinevirtual

Return Region of Interest.

Returns
Region of Interest.

Implements GEventList.

Definition at line 151 of file GLATEventList.hpp.

References m_roi.

Referenced by roi().

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

Save LAT events.

Parameters
[in]filenameFITS filename.
[in]clobberOverwrite existing FITS file (default=false).

This method saves LAT events into a FT1 file.

Todo:
To be implemented.

Implements GEventList.

Definition at line 278 of file GLATEventList.cpp.

virtual void GLATEventList::set_energies ( void  )
inlineprotectedvirtual

Implements GEventList.

Definition at line 93 of file GLATEventList.hpp.

virtual void GLATEventList::set_times ( void  )
inlineprotectedvirtual

Implements GEventList.

Definition at line 94 of file GLATEventList.hpp.

int GLATEventList::size ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 127 of file GLATEventList.hpp.

References m_events.

Referenced by operator[](), and remove().

void GLATEventList::write ( GFits file) const
virtual

Write LAT event list into FITS file.

Parameters
[in]fileFITS file.

Write the LAT event list into FITS file.

Todo:
To be implemented.

Implements GEventList.

Definition at line 353 of file GLATEventList.cpp.

Member Data Documentation

std::vector<std::string> GLATEventList::m_difrsp_label
protected

Diffuse response model labels.

Definition at line 101 of file GLATEventList.hpp.

Referenced by copy_members(), init_members(), print(), and read_events().

std::vector<std::string> GLATEventList::m_ds_reference
protected

Data selection references.

Definition at line 105 of file GLATEventList.hpp.

Referenced by copy_members(), init_members(), print(), and read_ds_keys().

std::vector<std::string> GLATEventList::m_ds_type
protected

Data selection types.

Definition at line 102 of file GLATEventList.hpp.

Referenced by copy_members(), init_members(), print(), and read_ds_keys().

std::vector<std::string> GLATEventList::m_ds_unit
protected

Data selection units.

Definition at line 103 of file GLATEventList.hpp.

Referenced by copy_members(), init_members(), print(), and read_ds_keys().

std::vector<std::string> GLATEventList::m_ds_value
protected

Data selection values.

Definition at line 104 of file GLATEventList.hpp.

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

std::vector<GLATEventAtom> GLATEventList::m_events
protected

Events.

Definition at line 100 of file GLATEventList.hpp.

Referenced by append(), copy_members(), init_members(), number(), operator[](), read_events(), remove(), reserve(), and size().

GLATRoi GLATEventList::m_roi
protected

Region of interest.

Definition at line 99 of file GLATEventList.hpp.

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


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