GammaLib
2.1.0.dev
|
COMPTEL event list class. More...
#include <GCOMEventList.hpp>
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 GCOMEventList & | operator= (const GCOMEventList &list) |
Assignment operator. More... | |
virtual GCOMEventAtom * | operator[] (const int &index) |
COMPTEL event atom access operator. More... | |
virtual const GCOMEventAtom * | operator[] (const int &index) const |
COMPTEL event atom access operator. More... | |
virtual void | clear (void) |
Clear COMPTEL event list. More... | |
virtual GCOMEventList * | clone (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 GCOMRoi & | roi (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 GEventList & | operator= (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 GEvents & | operator= (const GEvents &events) |
Assignment operator. More... | |
void | ebounds (const GEbounds &ebounds) |
Set energy boundaries. More... | |
void | gti (const GGti >i) |
Set Good Time Intervals. More... | |
const GEbounds & | ebounds (void) const |
Return energy boundaries. More... | |
const GGti & | gti (void) const |
Return Good Time Intervals. More... | |
const GTime & | tstart (void) const |
Return start time. More... | |
const GTime & | tstop (void) const |
Return stop time. More... | |
const GEnergy & | emin (void) const |
Return minimum energy. More... | |
const GEnergy & | emax (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< GCOMEventAtom > | m_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... | |
COMPTEL event list class.
Definition at line 51 of file GCOMEventList.hpp.
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().
|
explicit |
File name constructor.
[in] | filename | COMPTEL 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.
[in] | list | COMPTEL event list. |
Definition at line 98 of file GCOMEventList.cpp.
References copy_members(), and init_members().
|
virtual |
void GCOMEventList::append | ( | const GCOMEventAtom & | event | ) |
Append event to event list.
[in] | event | Event. |
Appends an event to the end of the event list.
Definition at line 388 of file GCOMEventList.cpp.
References m_events.
|
inlinevirtual |
Return class name.
Implements GEventList.
Definition at line 107 of file GCOMEventList.hpp.
|
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().
|
virtual |
Clone event list.
Implements GEventList.
Definition at line 244 of file GCOMEventList.cpp.
References GCOMEventList().
|
protected |
Copy class members.
[in] | list | COMPTEL event list. |
Definition at line 511 of file GCOMEventList.cpp.
References m_events, and m_roi.
Referenced by GCOMEventList(), and operator=().
|
protected |
Delete class members.
Definition at line 525 of file GCOMEventList.cpp.
Referenced by clear(), operator=(), and ~GCOMEventList().
|
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=().
|
virtual |
Load COMPTEL events from FITS file.
[in] | filename | COMPTEL 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().
|
inlinevirtual |
Return number of events in list.
Implements GEventList.
Definition at line 131 of file GCOMEventList.hpp.
References m_events.
|
virtual |
Assignment operator.
[in] | list | COMPTEL event list. |
Definition at line 136 of file GCOMEventList.cpp.
References copy_members(), free_members(), init_members(), and GEventList::operator=().
|
virtual |
COMPTEL event atom access operator.
[in] | index | Event index [0,...,size()-1]. |
GException::out_of_range | Event 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().
|
virtual |
COMPTEL event atom access operator.
[in] | index | Event index [0,...,size()-1]. |
GException::out_of_range | Event 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().
Print COMPTEL event list information.
[in] | chatter | Chattiness. |
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().
|
virtual |
Read COMPTEL events from FITS file.
[in] | file | FITS 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().
|
protected |
Read COMPTEL events from FITS table.
[in] | table | FITS 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.
[in] | index | Index from which on events should be removed. |
[in] | number | Number 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.
|
inline |
Reserves space for events.
[in] | number | Number of events. |
Reserves space for a number
events in the event list.
Definition at line 157 of file GCOMEventList.hpp.
References m_events.
|
virtual |
Set region of interest.
[in] | roi | Region of interest. |
GException::invalid_argument | Specified RoI is not a COMPTEL RoI. |
Sets the region of interest for the observation.
Implements GEventList.
Definition at line 361 of file GCOMEventList.cpp.
|
inlinevirtual |
Return Region of Interest.
Implements GEventList.
Definition at line 143 of file GCOMEventList.hpp.
References m_roi.
Referenced by roi().
|
virtual |
Save COMPTEL events.
[in] | filename | COMPTEL event list FITS file name. |
[in] | clobber | Overwrite 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().
|
inlineprotectedvirtual |
Set energies.
Sets energies.
Implements GEventList.
Definition at line 170 of file GCOMEventList.hpp.
|
inlineprotectedvirtual |
|
inlinevirtual |
Return 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().
|
protected |
Compute TOF correction.
[in] | d1e | D1 energy deposit (keV). |
[in] | d2e | D2 energy deposit (keV). |
[in] | tof | TOF 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().
|
virtual |
Write COMPTEL event list into FITS file.
[in] | file | FITS file. |
Write the COMPTEL event list into FITS file.
Implements GEventList.
Definition at line 341 of file GCOMEventList.cpp.
Referenced by save().
|
protected |
Events.
Definition at line 97 of file GCOMEventList.hpp.
Referenced by append(), copy_members(), init_members(), number(), operator[](), read(), read_events(), remove(), reserve(), and size().
|
protected |
Region of interest.
Definition at line 96 of file GCOMEventList.hpp.
Referenced by copy_members(), init_members(), read_events(), and roi().