44#define G_OPERATOR "GLATEventList::operator[](int&)"
45#define G_ROI "GLATEventList::roi(GRoi&)"
173 #if defined(G_RANGE_CHECK)
174 if (index < 0 || index >=
size()) {
197 #if defined(G_RANGE_CHECK)
198 if (index < 0 || index >=
size()) {
255 GFits fits(filename);
279 const bool& clobber)
const
374 if (latroi == NULL) {
375 std::string cls = std::string(
typeid(&
roi).name());
376 std::string msg =
"Invalid RoI type \""+cls+
"\" specified. Please "
377 "specify a \"GLATRoi\" instance as argument.";
420 if (index <
size()) {
427 m_events.begin() + index + n_remove);
451 result.append(
"=== GLATEventList ===");
460 for (
int i = 0; i <
m_ds_type.size(); ++i) {
555 int num = table.
integer(
"NAXIS2");
571 const GFitsTableCol* ptr_azimuth = table[
"EARTH_AZIMUTH_ANGLE"];
582 for (
int i = 0; i < num; ++i) {
584 event.m_energy.MeV(ptr_energy->
real(i));
585 event.m_dir.dir().radec_deg(ptr_ra->
real(i), ptr_dec->
real(i));
586 event.m_theta = ptr_theta->
real(i);
587 event.m_phi = ptr_phi->
real(i);
588 event.m_zenith_angle = ptr_zenith->
real(i);
589 event.m_earth_azimuth_angle = ptr_azimuth->
real(i);
590 event.m_event_id = ptr_eid->
integer(i);
591 event.m_run_id = ptr_rid->
integer(i);
592 event.m_recon_version = ptr_recon->
integer(i);
593 event.m_calib_version[0] = ptr_calib->
integer(i,0);
594 event.m_calib_version[1] = ptr_calib->
integer(i,1);
595 event.m_calib_version[2] = ptr_calib->
integer(i,2);
596 event.m_event_class = ptr_class->
integer(i);
597 event.m_conversion_type = ptr_conv->
integer(i);
598 event.m_livetime = ptr_ltime->
real(i);
603 int num_difrsp = table.
integer(
"NDIFRSP");
606 if (num_difrsp > 0) {
612 for (
int i = 0; i < num; ++i) {
613 m_events[i].m_difrsp =
new double[num_difrsp];
617 for (
int k = 0; k < num_difrsp; ++k) {
623 std::sprintf(keyword,
"DIFRSP%d", k);
626 if (table.
has_card(std::string(keyword))) {
637 for (
int i = 0; i < num; ++i) {
664 int ds_num = hdu.
integer(
"NDSKEYS");
683 for (
int i = 0; i < ds_num; ++i) {
686 std::sprintf(keyword,
"DSTYP%d", i+1);
687 if (hdu.
has_card(std::string(keyword))) {
695 std::sprintf(keyword,
"DSUNI%d", i+1);
696 if (hdu.
has_card(std::string(keyword))) {
704 std::sprintf(keyword,
"DSVAL%d", i+1);
705 if (hdu.
has_card(std::string(keyword))) {
713 std::sprintf(keyword,
"DSREF%d", i+1);
714 if (hdu.
has_card(std::string(keyword))) {
Exception handler interface definition.
Filename class interface definition.
FITS table double column class interface definition.
FITS table float column class interface definition.
FITS table long integer column class interface definition.
FITS table short integer column class interface definition.
FITS table abstract base class interface definition.
Fermi/LAT event list class definition.
Abstract event atom container class.
virtual GEventList & operator=(const GEventList &list)
Assignment operator.
void init_members(void)
Initialise class members.
void free_members(void)
Delete class members.
void free_members(void)
Delete class members.
GGti m_gti
Good time intervals covered by events.
const GTime & tstart(void) const
Return start time.
const GGti & gti(void) const
Return Good Time Intervals.
void init_members(void)
Initialise class members.
const GTime & tstop(void) const
Return stop time.
Abstract FITS extension base class.
bool has_card(const int &cardno) const
Check existence of header card.
double real(const std::string &keyname) const
Return card value as double precision.
std::string string(const std::string &keyname) const
Return card value as string.
int integer(const std::string &keyname) const
Return card value as integer.
Abstract interface for FITS table column.
virtual int integer(const int &row, const int &inx=0) const =0
virtual double real(const int &row, const int &inx=0) const =0
Abstract interface for FITS table.
bool contains(const int &extno) const
Check if HDU exists in FITS file.
void close(void)
Close FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
void reference(const GTimeReference &ref)
Set time reference for Good Time Intervals.
void read(const GFitsTable &table)
Read Good Time Intervals and time reference from FITS table.
void append(const GTime &tstart, const GTime &tstop)
Append Good Time Interval.
Fermi/LAT event atom class.
Fermi/LAT event list class.
std::vector< std::string > m_ds_type
Data selection types.
std::vector< GLATEventAtom > m_events
Events.
void read_ds_keys(const GFitsHDU &hdu)
Read data selection keywords from FITS HDU.
void remove(const int &index, const int &number=1)
Remove events from event list.
std::vector< std::string > m_ds_reference
Data selection references.
GLATEventList(void)
Void constructor.
virtual void clear(void)
Clear event list.
void append(const GLATEventAtom &event)
Append event to event list.
virtual void write(GFits &file) const
Write LAT event list into FITS file.
std::vector< std::string > m_difrsp_label
Diffuse response model labels.
virtual GLATEventList * clone(void) const
Clone event list.
virtual int size(void) const
Return number of events in list.
virtual const GLATRoi & roi(void) const
Return Region of Interest.
virtual void load(const GFilename &filename)
Load LAT events from FITS file.
void copy_members(const GLATEventList &list)
Copy class members.
std::vector< std::string > m_ds_value
Data selection values.
virtual ~GLATEventList(void)
Destructor.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save LAT events.
virtual int number(void) const
Return number of events in list.
virtual void read(const GFits &file)
Read LAT events from FITS file.
void free_members(void)
Delete class members.
std::vector< std::string > m_ds_unit
Data selection units.
void read_events(const GFitsTable &hdu)
Read LAT events from FITS table.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print event list information.
void init_members(void)
Initialise class members.
GLATRoi m_roi
Region of interest.
virtual GLATEventAtom * operator[](const int &index)
Event atom access operator.
virtual GLATEventList & operator=(const GLATEventList &list)
Assignment operator.
Fermi/LAT region of interest class.
virtual void clear(void)
Clear region of interest.
Interface for the region of interest classes.
Implements a time reference.
void set(const double &time, const GTimeReference &ref)
Set time given in specified reference.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const std::string extname_gti
const std::string extname_lat_events