GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAEventList Class Reference

CTA event list class. More...

#include <GCTAEventList.hpp>

Inheritance diagram for GCTAEventList:
GEventList GEvents GBase

Public Member Functions

 GCTAEventList (void)
 Void constructor. More...
 
 GCTAEventList (const GFilename &filename)
 File name constructor. More...
 
 GCTAEventList (const GCTAEventList &list)
 Copy constructor. More...
 
virtual ~GCTAEventList (void)
 Destructor. More...
 
virtual GCTAEventListoperator= (const GCTAEventList &list)
 Assignment operator. More...
 
virtual GCTAEventAtomoperator[] (const int &index)
 Event atom access operator. More...
 
virtual const GCTAEventAtomoperator[] (const int &index) const
 Event atom access operator. More...
 
virtual void clear (void)
 Clear event list. More...
 
virtual GCTAEventListclone (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 events from FITS file. More...
 
virtual void save (const GFilename &filename, const bool &clobber=false) const
 Save events into FITS file. More...
 
virtual void read (const GFits &fits)
 Read events from FITS file. More...
 
virtual void write (GFits &fits) const
 Write CTA events and Good Time Intervals into FITS file. More...
 
virtual int number (void) const
 Return number of events in list. More...
 
virtual void roi (const GRoi &roi)
 Set ROI. More...
 
virtual const GCTARoiroi (void) const
 Return Region of Interest. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print event list information. More...
 
void append (const GCTAEventAtom &event)
 Append event to event list. More...
 
void append_column (const GFitsTableCol &column)
 Append FITS table column 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...
 
void write (GFits &fits, const std::string &evtname, const std::string &gtiname) const
 Write CTA events and Good Time Intervals into FITS file. More...
 
void fetch (void) const
 Fetch events. More...
 
void dispose (void) const
 Dispose events. More...
 
const GPhasesphases (void) const
 Return phase intervals. More...
 
void phases (const GPhases &phases)
 Set phase intervals. More...
 
const std::string & gtiname (void) const
 Return Good Time Interval extension name. More...
 
void has_phase (const bool &has_phase)
 Set phase information flag. More...
 
void has_detxy (const bool &has_detxy)
 Set the DETX/DETY information flag. More...
 
void has_mc_id (const bool &has_mc_id)
 Set the Monte Carlo identifier flag. More...
 
const bool & has_phase () const
 
const bool & has_detxy () const
 
const bool & has_mc_id () const
 
void set_mc_id_names (const std::vector< int > &ids, const std::vector< std::string > &names)
 Set Monte Carlo identifiers and model names. 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 GCTAEventList &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 &table) const
 Read CTA events from FITS table. More...
 
void read_mc_ids (const GFitsTable &table)
 Read Monte Carlo identifier keywords from FITS HDU. More...
 
void write_events (GFitsBinTable &table) const
 Write CTA events into FITS table. More...
 
void write_ds_keys (GFitsHDU &hdu, const std::string &gtiname=gammalib::extname_gti) const
 Write data sub-space keywords into FITS HDU. More...
 
void write_mc_ids (GFitsHDU &hdu) const
 Write Monte Carlo identifier keywords into 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

GCTARoi m_roi
 Region of interest. More...
 
GCTAPointing m_pnt
 Pointing direction for DETX/Y conversion. More...
 
GPhases m_phases
 Phase intervals. More...
 
int m_num_events
 Number of events. More...
 
std::string m_gti_extname
 GTI extension name. More...
 
bool m_has_phase
 Signal presence of phase. More...
 
bool m_has_detxy
 Signal presence of detector coordinates. More...
 
bool m_has_mc_id
 Signal presence of MC identifier. More...
 
std::vector< int > m_mc_ids
 List of Monte Carlo IDs. More...
 
std::vector< std::string > m_mc_id_names
 List of model names. More...
 
std::vector< GCTAEventAtomm_events
 Events. More...
 
std::vector< GFitsTableCol * > m_columns
 Pointers to optional columns. More...
 
GFilename m_filename
 Event list file name. 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

CTA event list class.

This class implements an event list for CTA.

Definition at line 60 of file GCTAEventList.hpp.

Constructor & Destructor Documentation

GCTAEventList::GCTAEventList ( void  )

Void constructor.

Constructs empty event list.

Definition at line 78 of file GCTAEventList.cpp.

References init_members().

Referenced by clone().

GCTAEventList::GCTAEventList ( const GFilename filename)
explicit

File name constructor.

Parameters
[in]filenameCounts cube filename.

Constructs event list by loading the events from a FITS file.

Definition at line 95 of file GCTAEventList.cpp.

References init_members(), and load().

GCTAEventList::GCTAEventList ( const GCTAEventList list)

Copy constructor.

Parameters
[in]listEvent list.

Constructs event list by coping from another event list.

Definition at line 115 of file GCTAEventList.cpp.

References copy_members(), and init_members().

GCTAEventList::~GCTAEventList ( void  )
virtual

Destructor.

Destructs event list.

Definition at line 133 of file GCTAEventList.cpp.

References free_members().

Member Function Documentation

void GCTAEventList::append ( const GCTAEventAtom event)

Append event to event list.

Parameters
[in]eventEvent.

Appends an event to the end of the event list.

Definition at line 593 of file GCTAEventList.cpp.

References fetch(), m_columns, m_events, and m_num_events.

Referenced by GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), and GCTAModelBackground::mc().

void GCTAEventList::append_column ( const GFitsTableCol column)

Append FITS table column to event list.

Parameters
[in]columnFITS table column to be appended.
Exceptions
GException::invalid_argumentFITS column has incompatible number of rows.

Appends a FITS table column to the event list. The length of the FITS column must be identical to the number of events in the event list.

Definition at line 630 of file GCTAEventList.cpp.

References GFitsTableCol::clone(), fetch(), G_APPEND_COLUMN, m_columns, GFitsTableCol::nrows(), size(), and gammalib::str().

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

Return class name.

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

Implements GEventList.

Definition at line 149 of file GCTAEventList.hpp.

void GCTAEventList::clear ( void  )
virtual

Clear event list.

Clear event list.

Implements GEventList.

Definition at line 250 of file GCTAEventList.cpp.

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

Referenced by read().

GCTAEventList * GCTAEventList::clone ( void  ) const
virtual

Clone event list.

Returns
Pointer to deep copy of event list.

Returns a pointer to a deep copy of the event list.

Implements GEventList.

Definition at line 274 of file GCTAEventList.cpp.

References GCTAEventList().

void GCTAEventList::copy_members ( const GCTAEventList list)
protected

Copy class members.

Parameters
[in]listEvent list.

Definition at line 985 of file GCTAEventList.cpp.

References m_columns, m_events, m_filename, GEvents::m_gti, m_gti_extname, m_has_detxy, m_has_mc_id, m_has_phase, m_mc_id_names, m_mc_ids, m_num_events, m_phases, m_pnt, and m_roi.

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

void GCTAEventList::dispose ( void  ) const

Dispose events.

Disposes the events to save memory. The method free's all memory associated to the events. The method should be used with care as it does not check whether the events can actually be recovered using the fetch() method. Eventually, the events should be saved before so that fetch() can recover them.

Definition at line 796 of file GCTAEventList.cpp.

References m_columns, and m_events.

Referenced by GCTAObservation::dispose_events(), and read_events().

void GCTAEventList::fetch ( void  ) const

Fetch events.

Exceptions
GException::file_errorFile not found. Unable to load events.
GException::invalid_valueNo file name has been specified. Fetched number of events mismatches the expectation.

Fetches the events by reading them from a FITS file. This method does nothing if the events are already loaded, if there is nothing to fetch, or if the m_filename member is empty.

The method is thread save. The method furthermore checks whether the loaded number of events corresponds to the expectation. If also checks whether the file from which events should be loaded actually exists.

Definition at line 715 of file GCTAEventList.cpp.

References GFits::close(), GFilename::extname(), gammalib::extname_cta_events, GFits::filename(), G_FETCH, GFilename::is_empty(), m_events, m_filename, read_events(), size(), gammalib::str(), and GFits::table().

Referenced by append(), append_column(), operator[](), remove(), and write_events().

void GCTAEventList::free_members ( void  )
protected

Delete class members.

Definition at line 1018 of file GCTAEventList.cpp.

References m_columns.

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

const std::string & GCTAEventList::gtiname ( void  ) const
inline

Return Good Time Interval extension name.

Returns
Good Time Interval extension name.

Definition at line 237 of file GCTAEventList.hpp.

References m_gti_extname.

Referenced by write(), and write_ds_keys().

void GCTAEventList::has_detxy ( const bool &  has_detxy)
inline

Set the DETX/DETY information flag.

Parameters
[in]has_detxyDETX/DETY information flag.

Set the DETX/DETY information flag.

Definition at line 266 of file GCTAEventList.hpp.

References has_detxy(), and m_has_detxy.

const bool & GCTAEventList::has_detxy ( ) const
inline

Definition at line 306 of file GCTAEventList.hpp.

References m_has_detxy.

Referenced by has_detxy().

void GCTAEventList::has_mc_id ( const bool &  has_mc_id)
inline

Set the Monte Carlo identifier flag.

Parameters
[in]has_mc_idMonte Carlo identifier flag.

Set the Monte Carlo identifier flag.

Definition at line 281 of file GCTAEventList.hpp.

References has_mc_id(), and m_has_mc_id.

const bool & GCTAEventList::has_mc_id ( ) const
inline

Definition at line 318 of file GCTAEventList.hpp.

References m_has_mc_id.

Referenced by has_mc_id().

void GCTAEventList::has_phase ( const bool &  has_phase)
inline

Set phase information flag.

Parameters
[in]has_phasePhase information flag.

Sets the phase information flag of the event list.

Definition at line 251 of file GCTAEventList.hpp.

References has_phase(), and m_has_phase.

const bool & GCTAEventList::has_phase ( ) const
inline

Definition at line 294 of file GCTAEventList.hpp.

References m_has_phase.

Referenced by has_phase().

void GCTAEventList::init_members ( void  )
protected
void GCTAEventList::load ( const GFilename filename)
virtual

Load events from FITS file.

Parameters
[in]filenameFITS file name.

Loads the event list from a FITS file. See the read() method for details.

Implements GEventList.

Definition at line 288 of file GCTAEventList.cpp.

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

Referenced by GCTAEventList().

int GCTAEventList::number ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 173 of file GCTAEventList.hpp.

References m_num_events.

Referenced by remove().

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

Assignment operator.

Parameters
[in]listEvent list.
Returns
Event list.

Assigns events from another event list.

Definition at line 157 of file GCTAEventList.cpp.

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

GCTAEventAtom * GCTAEventList::operator[] ( const int &  index)
virtual

Event atom access operator.

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

Returns pointer to an event atom.

Implements GEventList.

Definition at line 192 of file GCTAEventList.cpp.

References fetch(), G_OPERATOR, m_events, and size().

const GCTAEventAtom * GCTAEventList::operator[] ( const int &  index) const
virtual

Event atom access operator.

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

Returns pointer to an event atom.

Implements GEventList.

Definition at line 221 of file GCTAEventList.cpp.

References fetch(), G_OPERATOR, m_events, and size().

const GPhases & GCTAEventList::phases ( void  ) const
inline

Return phase intervals.

Returns
Phase intervals.

Definition at line 197 of file GCTAEventList.hpp.

References m_phases.

Referenced by phases().

void GCTAEventList::phases ( const GPhases phases)
inline

Set phase intervals.

Parameters
[in]phasesPhase intervals.

Definition at line 209 of file GCTAEventList.hpp.

References m_phases, and phases().

std::string GCTAEventList::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 858 of file GCTAEventList.cpp.

References gammalib::centre(), GEvents::ebounds(), GEvents::emax(), GEvents::emin(), GEvents::gti(), GFilename::is_empty(), m_events, m_filename, gammalib::parformat(), gammalib::reduce(), roi(), SILENT, size(), gammalib::str(), GEvents::tstart(), and GEvents::tstop().

void GCTAEventList::read ( const GFits fits)
virtual

Read events from FITS file.

Parameters
[in]fitsFITS file.

Reads the event list from a FITS file.

The events will be read by default from the extension EVENTS unless an extension name is explicitly specified in the FITS file name. The FITS header of the extension will be scanned for data sub-space keywords to extract the energy boundaries, the region of interest, as well as the extension name for the Good Time Intervals. If no extension name for Good Time Intervals is found it is expected that the Good Time Intervals reside in the GTI extension.

If a Good Time Intervals is found in the same FITS file, the Good Time Intervals will be loaded. Otherwise, a single Good Time Interval will be assumed based on the TSTART and TSTOP keywords found in the header of the event list.

The method clears the event list before reading, thus any events that existed before in the event list will be lost. Note that the method will actually not read the events but only the event metadata. The events are only read from the FITS file when they are actually need. This reduces the memory requirements. Events can be manually loaded into memory using the fetch() method. Events can be unloaded using the dispose() method, but the user has to take care of saving the events to disk in case he wants to keep them for further use.

Implements GEventList.

Definition at line 359 of file GCTAEventList.cpp.

References GGti::append(), clear(), GFitsTable::contains(), GFits::contains(), GCTAPointing::dir(), GFilename::extname(), gammalib::extname_cta_events, gammalib::extname_gti, GFits::filename(), GEvents::gti(), GFilename::has_expression(), GFilename::is_empty(), GEvents::m_ebounds, m_filename, GEvents::m_gti, m_gti_extname, m_has_detxy, m_has_mc_id, m_has_phase, m_num_events, m_phases, m_pnt, m_roi, GFitsTable::nrows(), GSkyDir::radec_deg(), GGti::read(), gammalib::read_ds_ebounds(), gammalib::read_ds_gti_extname(), gammalib::read_ds_phase(), gammalib::read_ds_roi(), read_events(), read_mc_ids(), GFitsHDU::real(), GGti::reference(), GFits::table(), GEvents::tstart(), and GEvents::tstop().

Referenced by load(), and GCTAObservation::read().

void GCTAEventList::read_events ( const GFitsTable table) const
protected

Read CTA events from FITS table.

Parameters
[in]tableFITS table.

This method reads the CTA event list from a FITS table into memory. The following columns are mandatory in the FITS table:

 - EVENT_ID
 - TIME
 - RA
 - DEC
 - ENERGY

Optionally, the

 - DETX
 - DETY
 - PHASE

columns are read. Any other columns present in the FITS table will also be read, and written into the FITS table when the write_events() method is called.

Definition at line 1055 of file GCTAEventList.cpp.

References GFitsTableCol::clone(), gammalib::deg2rad, GCTAInstDir::detx(), GCTAInstDir::dety(), GCTAInstDir::dir(), dispose(), GCTAPointing::instdir(), GFitsTableCol::integer(), m_columns, GCTAEventAtom::m_dir, GCTAInstDir::m_dir, m_events, GEvents::m_gti, m_has_detxy, m_has_mc_id, m_has_phase, m_pnt, GFitsTableCol::name(), GFitsTable::ncols(), GFitsTable::nrows(), GSkyDir::radec_deg(), GFitsTableCol::real(), and GGti::reference().

Referenced by fetch(), and read().

void GCTAEventList::read_mc_ids ( const GFitsTable table)
protected

Read Monte Carlo identifier keywords from FITS HDU.

Parameters
[in]tableFITS table HDU.

Reads the Monte Carlo identifier keywords for an event list from the FITS table HDU.

Definition at line 1173 of file GCTAEventList.cpp.

References GFitsHDU::has_card(), GFitsHDU::integer(), m_mc_id_names, m_mc_ids, and GFitsHDU::string().

Referenced by read().

void GCTAEventList::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 667 of file GCTAEventList.cpp.

References fetch(), m_columns, m_events, m_num_events, number(), and size().

void GCTAEventList::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 224 of file GCTAEventList.hpp.

References m_events.

Referenced by GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), and GCTAModelBackground::mc().

const GCTARoi & GCTAEventList::roi ( void  ) const
inlinevirtual

Return Region of Interest.

Returns
Region of Interest.

Implements GEventList.

Definition at line 185 of file GCTAEventList.hpp.

References m_roi.

Referenced by print(), roi(), and write_ds_keys().

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

Save events into FITS file.

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

Saves the event list into a FITS file. See the write() method for details.

Implements GEventList.

Definition at line 312 of file GCTAEventList.cpp.

References GFilename::url(), and write().

virtual void GCTAEventList::set_energies ( void  )
inlineprotectedvirtual

Implements GEventList.

Definition at line 115 of file GCTAEventList.hpp.

void GCTAEventList::set_mc_id_names ( const std::vector< int > &  ids,
const std::vector< std::string > &  names 
)

Set Monte Carlo identifiers and model names.

Parameters
[in]idsMonte Carlo identifiers.
[in]namesModel name for each Monte Carlo identifier.

Sets the Monte Carlo identifiers and their corresponding model names. The information will then be written into the header file.

Definition at line 828 of file GCTAEventList.cpp.

References G_SET_MC_ID_NAMES, m_mc_id_names, m_mc_ids, and gammalib::str().

virtual void GCTAEventList::set_times ( void  )
inlineprotectedvirtual

Implements GEventList.

Definition at line 116 of file GCTAEventList.hpp.

int GCTAEventList::size ( void  ) const
inlinevirtual

Return number of events in list.

Returns
Number of events in list.

Implements GEventList.

Definition at line 161 of file GCTAEventList.hpp.

References m_num_events.

Referenced by append_column(), fetch(), GCTAModelSpatialLookup::fill_buffer(), operator[](), print(), remove(), GCTAOnOffObservation::set(), and write_events().

void GCTAEventList::write ( GFits fits) const
virtual

Write CTA events and Good Time Intervals into FITS file.

Parameters
[in]fitsFITS file.

Writes the CTA event list and the Good Time intervals into a FITS file.

The events will be written by default into the extension EVENTS unless an extension name is explicitly specified in the FITS file name. The method also writes the data sub-space keywords in the FITS header of the events table.

In addition, the method will also append a table containing the Good Time Intervals of the events to the FITS file. The extension name for the Good Time Intervals is either taken from the m_gti_extname member, or if empty, is set to GTI.

Implements GEventList.

Definition at line 487 of file GCTAEventList.cpp.

References GFilename::extname(), gammalib::extname_cta_events, gammalib::extname_gti, GFits::filename(), gtiname(), and m_gti_extname.

Referenced by save(), and GCTAObservation::write().

void GCTAEventList::write ( GFits fits,
const std::string &  evtname,
const std::string &  gtiname 
) const

Write CTA events and Good Time Intervals into FITS file.

Parameters
[in]fitsFITS file.
[in]evtnameEvent FITS extension name.
[in]gtinameGood Time Intervals FITS extension name.

Writes the CTA event list and the Good Time intervals into a FITS file.

The events will be written into the extension evtname while the Good Time Intervals will be written into the extension gtiname.

Definition at line 516 of file GCTAEventList.cpp.

References GFits::append(), GFitsHDU::card(), GSkyDir::dec_deg(), GCTAPointing::dir(), GFitsHDU::extname(), GFits::filename(), GEvents::gti(), m_filename, m_pnt, GSkyDir::ra_deg(), GGti::write(), write_ds_keys(), write_events(), and write_mc_ids().

void GCTAEventList::write_ds_keys ( GFitsHDU hdu,
const std::string &  gtiname = gammalib::extname_gti 
) const
protected

Write data sub-space keywords into FITS HDU.

Parameters
[in]hduFITS HDU.
[in]gtinameGood Time Interval FITS extension.
Exceptions
GException::vector_mismatchLower and upper phase boundaries have different size.

Writes the data sub-space keywords for an event list into the FITS HDU. The following keywords will be written:

 DSTYP1  = "TIME"                     / Data sub-space type
 DSUNI1  = "s"                        / Data sub-space unit
 DSVAL1  = "TABLE"                    / Data sub-space value
 DSREF1  = ":[extname]"               / Data sub-space reference
 DSTYP2  = "ENERGY"                   / Data sub-space type
 DSUNI2  = "TeV"                      / Data sub-space unit
 DSVAL2  = "[emin]:[emax]"            / Data sub-space value
 DSTYP3  = "POS(RA,DEC)"              / Data sub-space type
 DSUNI3  = "deg"                      / Data sub-space unit
 DSVAL3  = "CIRCLE([ra],[dec],[rad])" / Data sub-space value
 NDSKEYS = 3                          / Number of data sub-space keys

where

 [extname] is the GTI extension name @p gtiname
 [emin] is the minimum event energy in TeV
 [emax] is the maximum event energy in TeV
 [ra] is the Right Ascension of the Region of Interest centre in degrees
 [dec] is the Declination of the Region of Interest centre in degrees
 [rad] is the radius of the Region of Interest in degrees

Definition at line 1386 of file GCTAEventList.cpp.

References GFitsHDU::card(), GCTARoi::centre(), GCTAInstDir::dir(), GEvents::emax(), GEvents::emin(), gtiname(), GCTAInstDir::has_dir(), GCTARoi::is_valid(), m_phases, GPhases::pmax(), GPhases::pmin(), GCTARoi::radius(), roi(), GPhases::size(), gammalib::str(), and GEnergy::TeV().

Referenced by write().

void GCTAEventList::write_events ( GFitsBinTable hdu) const
protected

Write CTA events into FITS table.

Parameters
[in]hduFITS binary table.

Write the CTA event list into a FITS binary table.

The following mandatory columns will be written into the FITS table:

 - EVENT_ID
 - TIME
 - RA
 - DEC
 - ENERGY

If available, also the

 - DETX
 - DETY
 - PHASE

columns are written. Any other columns that were read by the read_events() method will be also written into the table.

Definition at line 1244 of file GCTAEventList.cpp.

References GFitsTable::append(), GFitsHDU::extname(), gammalib::extname_cta_events, fetch(), m_columns, m_events, GEvents::m_gti, m_has_detxy, m_has_mc_id, m_has_phase, gammalib::rad2deg, GGti::reference(), size(), and GFitsTableCol::unit().

Referenced by write().

void GCTAEventList::write_mc_ids ( GFitsHDU hdu) const
protected

Write Monte Carlo identifier keywords into FITS HDU.

Parameters
[in]hduFITS HDU.

Writes the Monte Carlo identifier keywords for an event list into the FITS HDU. The following keywords will be written:

 NMCIDS      Number of Monte Carlo identifiers
 MID00001    First Monte Carlo identifier
 MMN00001    Model name for first Monte Carlo identifier
 MID00002    Second Monte Carlo identifier
 MMN00002    Model name for second Monte Carlo identifier
 ...

Definition at line 1488 of file GCTAEventList.cpp.

References GFitsHDU::card(), m_mc_id_names, m_mc_ids, and gammalib::str().

Referenced by write().

Member Data Documentation

std::vector<GFitsTableCol*> GCTAEventList::m_columns
mutableprotected

Pointers to optional columns.

Definition at line 138 of file GCTAEventList.hpp.

Referenced by append(), append_column(), copy_members(), dispose(), free_members(), init_members(), read_events(), remove(), and write_events().

std::vector<GCTAEventAtom> GCTAEventList::m_events
mutableprotected
GFilename GCTAEventList::m_filename
mutableprotected

Event list file name.

Definition at line 139 of file GCTAEventList.hpp.

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

std::string GCTAEventList::m_gti_extname
protected

GTI extension name.

Definition at line 129 of file GCTAEventList.hpp.

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

bool GCTAEventList::m_has_detxy
protected

Signal presence of detector coordinates.

Definition at line 131 of file GCTAEventList.hpp.

Referenced by copy_members(), has_detxy(), init_members(), read(), read_events(), and write_events().

bool GCTAEventList::m_has_mc_id
protected

Signal presence of MC identifier.

Definition at line 132 of file GCTAEventList.hpp.

Referenced by copy_members(), has_mc_id(), init_members(), read(), read_events(), and write_events().

bool GCTAEventList::m_has_phase
protected

Signal presence of phase.

Definition at line 130 of file GCTAEventList.hpp.

Referenced by copy_members(), has_phase(), init_members(), read(), read_events(), and write_events().

std::vector<std::string> GCTAEventList::m_mc_id_names
protected

List of model names.

Definition at line 134 of file GCTAEventList.hpp.

Referenced by copy_members(), init_members(), read_mc_ids(), set_mc_id_names(), and write_mc_ids().

std::vector<int> GCTAEventList::m_mc_ids
protected

List of Monte Carlo IDs.

Definition at line 133 of file GCTAEventList.hpp.

Referenced by copy_members(), init_members(), read_mc_ids(), set_mc_id_names(), and write_mc_ids().

int GCTAEventList::m_num_events
protected

Number of events.

Definition at line 128 of file GCTAEventList.hpp.

Referenced by append(), copy_members(), init_members(), number(), read(), remove(), and size().

GPhases GCTAEventList::m_phases
protected

Phase intervals.

Definition at line 127 of file GCTAEventList.hpp.

Referenced by copy_members(), init_members(), phases(), read(), and write_ds_keys().

GCTAPointing GCTAEventList::m_pnt
protected

Pointing direction for DETX/Y conversion.

Definition at line 126 of file GCTAEventList.hpp.

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

GCTARoi GCTAEventList::m_roi
protected

Region of interest.

Definition at line 125 of file GCTAEventList.hpp.

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


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