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

COMPTEL event list class. More...

#include <GCOMEventList.hpp>

Inheritance diagram for GCOMEventList:
GEventList GEvents GBase

Public Member Functions

 GCOMEventList (void)
 Void constructor. More...
 
 GCOMEventList (const GFilename &filename)
 File name constructor. More...
 
 GCOMEventList (const GCOMEventList &list)
 Copy constructor. More...
 
virtual ~GCOMEventList (void)
 Destructor. More...
 
virtual GCOMEventListoperator= (const GCOMEventList &list)
 Assignment operator. More...
 
virtual GCOMEventAtomoperator[] (const int &index)
 COMPTEL event atom access operator. More...
 
virtual const GCOMEventAtomoperator[] (const int &index) const
 COMPTEL event atom access operator. More...
 
virtual void clear (void)
 Clear COMPTEL event list. More...
 
virtual GCOMEventListclone (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 COMPTEL events from FITS file. More...
 
virtual void save (const GFilename &filename, const bool &clobber=false) const
 Save COMPTEL events. More...
 
virtual void read (const GFits &file)
 Read COMPTEL events from FITS file. More...
 
virtual void write (GFits &file) const
 Write COMPTEL 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 GCOMRoiroi (void) const
 Return Region of Interest. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print COMPTEL event list information. More...
 
void append (const GCOMEventAtom &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 GCOMEventList &list)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
virtual void set_energies (void)
 Set energies. More...
 
virtual void set_times (void)
 Set times. More...
 
void read_events (const GFitsTable &table)
 Read COMPTEL events from FITS table. More...
 
double tofcor (const double &d1e, const double &d2e, double tof) const
 Compute TOF correction. 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

GCOMRoi m_roi
 Region of interest. More...
 
std::vector< GCOMEventAtomm_events
 Events. 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

COMPTEL event list class.

Definition at line 51 of file GCOMEventList.hpp.

Constructor & Destructor Documentation

GCOMEventList::GCOMEventList ( void  )

Void constructor.

Creates an empty COMPTEL event list.

Definition at line 62 of file GCOMEventList.cpp.

References init_members().

Referenced by clone().

GCOMEventList::GCOMEventList ( const GFilename filename)
explicit

File name constructor.

Parameters
[in]filenameCOMPTEL event list filename.

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

Definition at line 80 of file GCOMEventList.cpp.

References init_members(), and load().

GCOMEventList::GCOMEventList ( const GCOMEventList list)

Copy constructor.

Parameters
[in]listCOMPTEL event list.

Definition at line 98 of file GCOMEventList.cpp.

References copy_members(), and init_members().

GCOMEventList::~GCOMEventList ( void  )
virtual

Destructor.

Definition at line 114 of file GCOMEventList.cpp.

References free_members().

Member Function Documentation

void GCOMEventList::append ( const GCOMEventAtom event)

Append event to event list.

Parameters
[in]eventEvent.

Appends an event to the end of the event list.

Definition at line 388 of file GCOMEventList.cpp.

References m_events.

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

Return class name.

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

Implements GEventList.

Definition at line 107 of file GCOMEventList.hpp.

void GCOMEventList::clear ( void  )
virtual

Clear COMPTEL event list.

Clears COMPTEL event list by resetting all class members to an initial state. Any information that was present before will be lost.

Implements GEventList.

Definition at line 222 of file GCOMEventList.cpp.

References GEventList::free_members(), free_members(), GEvents::free_members(), GEventList::init_members(), init_members(), and GEvents::init_members().

Referenced by read().

GCOMEventList * GCOMEventList::clone ( void  ) const
virtual

Clone event list.

Returns
Pointer to deep copy of COMPTEL event list.

Implements GEventList.

Definition at line 244 of file GCOMEventList.cpp.

References GCOMEventList().

void GCOMEventList::copy_members ( const GCOMEventList list)
protected

Copy class members.

Parameters
[in]listCOMPTEL event list.

Definition at line 511 of file GCOMEventList.cpp.

References m_events, and m_roi.

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

void GCOMEventList::free_members ( void  )
protected

Delete class members.

Definition at line 525 of file GCOMEventList.cpp.

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

void GCOMEventList::init_members ( void  )
protected

Initialise class members.

Definition at line 495 of file GCOMEventList.cpp.

References GCOMRoi::clear(), m_events, and m_roi.

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

void GCOMEventList::load ( const GFilename filename)
virtual

Load COMPTEL events from FITS file.

Parameters
[in]filenameCOMPTEL event list FITS file name.

Loads COMPTEL events from a FITS file into the event list.

Implements GEventList.

Definition at line 257 of file GCOMEventList.cpp.

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

Referenced by GCOMEventList().

int GCOMEventList::number ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 131 of file GCOMEventList.hpp.

References m_events.

Referenced by print(), and remove().

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

Assignment operator.

Parameters
[in]listCOMPTEL event list.
Returns
COMPTEL event list.

Definition at line 136 of file GCOMEventList.cpp.

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

GCOMEventAtom * GCOMEventList::operator[] ( const int &  index)
virtual

COMPTEL event atom access operator.

Parameters
[in]indexEvent index [0,...,size()-1].
Returns
Pointer to COMPTEL event atom.
Exceptions
GException::out_of_rangeEvent index outside valid range.

Returns pointer to a COMPTEL event atom.

Implements GEventList.

Definition at line 171 of file GCOMEventList.cpp.

References G_OPERATOR, m_events, and size().

const GCOMEventAtom * GCOMEventList::operator[] ( const int &  index) const
virtual

COMPTEL event atom access operator.

Parameters
[in]indexEvent index [0,...,size()-1].
Returns
Pointer to COMPTEL event atom.
Exceptions
GException::out_of_rangeEvent index outside valid range.

Returns pointer to a COMPTEL event atom.

Implements GEventList.

Definition at line 196 of file GCOMEventList.cpp.

References G_OPERATOR, m_events, and size().

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

Print COMPTEL event list information.

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

Implements GEventList.

Definition at line 434 of file GCOMEventList.cpp.

References gammalib::com_tics(), gammalib::com_tjd(), GEvents::ebounds(), GEvents::emax(), GEvents::emin(), GEvents::gti(), number(), gammalib::parformat(), SILENT, size(), gammalib::str(), GEvents::tstart(), and GEvents::tstop().

void GCOMEventList::read ( const GFits file)
virtual

Read COMPTEL events from FITS file.

Parameters
[in]fileFITS file.

Read the COMPTEL event list from a FITS file object.

Implements GEventList.

Definition at line 308 of file GCOMEventList.cpp.

References GGti::append(), clear(), m_events, GEvents::m_gti, read_events(), size(), and GFits::table().

Referenced by load().

void GCOMEventList::read_events ( const GFitsTable table)
protected

Read COMPTEL events from FITS table.

Parameters
[in]tableFITS table.

Reads COMPTEL events from a FITS table. The method expects the data in the format that is provided by the HEASARC archive.

The method also sets the energy boundaries and Region of Interest of the data set as this information is not provided in the FITS table header. For that purpose it scans all data and determines the range that is covered by the data.

The method assumes that no events exist so far.

Definition at line 547 of file GCOMEventList.cpp.

References gammalib::centre(), GCOMInstDir::dir(), GSkyDir::dist_deg(), GEvents::emax(), GEvents::emin(), GFitsTableCol::integer(), GFitsHDU::integer(), GEnergy::keV(), GSkyDir::lb(), GSkyDir::lb_deg(), GEvents::m_ebounds, m_events, m_roi, GFitsTable::nrows(), GCOMInstDir::phibar(), gammalib::rad2deg, GFitsTableCol::real(), GFitsHDU::real(), and tofcor().

Referenced by read().

void GCOMEventList::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 409 of file GCOMEventList.cpp.

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

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

Reserves space for events.

Parameters
[in]numberNumber of events.

Reserves space for a number events in the event list.

Definition at line 157 of file GCOMEventList.hpp.

References m_events.

void GCOMEventList::roi ( const GRoi roi)
virtual

Set region of interest.

Parameters
[in]roiRegion of interest.
Exceptions
GException::invalid_argumentSpecified RoI is not a COMPTEL RoI.

Sets the region of interest for the observation.

Implements GEventList.

Definition at line 361 of file GCOMEventList.cpp.

References G_ROI, m_roi, and roi().

const GCOMRoi & GCOMEventList::roi ( void  ) const
inlinevirtual

Return Region of Interest.

Returns
Region of Interest.

Implements GEventList.

Definition at line 143 of file GCOMEventList.hpp.

References m_roi.

Referenced by roi().

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

Save COMPTEL events.

Parameters
[in]filenameCOMPTEL event list FITS file name.
[in]clobberOverwrite existing FITS file?

Save COMPTEL events from a FITS file into the event list.

Implements GEventList.

Definition at line 281 of file GCOMEventList.cpp.

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

void GCOMEventList::set_energies ( void  )
inlineprotectedvirtual

Set energies.

Sets energies.

Implements GEventList.

Definition at line 170 of file GCOMEventList.hpp.

void GCOMEventList::set_times ( void  )
inlineprotectedvirtual

Set times.

Sets times.

Implements GEventList.

Definition at line 182 of file GCOMEventList.hpp.

int GCOMEventList::size ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 119 of file GCOMEventList.hpp.

References m_events.

Referenced by GCOMDri::compute_dre(), GCOMDris::compute_drws_energy(), GCOMDris::compute_drws_phibar(), operator[](), print(), read(), remove(), and GCOMDris::vetorate_setup().

double GCOMEventList::tofcor ( const double &  d1e,
const double &  d2e,
double  tof 
) const
protected

Compute TOF correction.

Parameters
[in]d1eD1 energy deposit (keV).
[in]d2eD2 energy deposit (keV).
[in]tofTOF value from EVP dataset (version < 3).

Computes the TOF correction for EVP data sets with representation version < 3.

Definition at line 733 of file GCOMEventList.cpp.

Referenced by read_events().

void GCOMEventList::write ( GFits file) const
virtual

Write COMPTEL event list into FITS file.

Parameters
[in]fileFITS file.

Write the COMPTEL event list into FITS file.

Todo:
Implement method.

Implements GEventList.

Definition at line 341 of file GCOMEventList.cpp.

Referenced by save().

Member Data Documentation

std::vector<GCOMEventAtom> GCOMEventList::m_events
protected
GCOMRoi GCOMEventList::m_roi
protected

Region of interest.

Definition at line 96 of file GCOMEventList.hpp.

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


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