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()) {
423 int n_remove = (index + number >
size()) ?
size() - index :
number;
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))) {
virtual void write(GFits &file) const
Write LAT event list into FITS file.
virtual GLATEventList * clone(void) const
Clone event list.
const GGti & gti(void) const
Return Good Time Intervals.
FITS table double column class interface definition.
void copy_members(const GLATEventList &list)
Copy class members.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
bool contains(const int &extno) const
Check if HDU exists in FITS file.
bool has_card(const int &cardno) const
Check existence of header card.
std::vector< std::string > m_ds_unit
Data selection units.
virtual int size(void) const
Return number of events in list.
Abstract FITS extension base class.
virtual ~GLATEventList(void)
Destructor.
void init_members(void)
Initialise class members.
Abstract event atom container class.
void init_members(void)
Initialise class members.
const GTime & tstop(void) const
Return stop time.
void append(const GLATEventAtom &event)
Append event to event list.
void remove(const int &index, const int &number=1)
Remove events from event list.
FITS table float column class interface definition.
const std::string extname_gti
void append(const GTime &tstart, const GTime &tstop)
Append Good Time Interval.
GLATRoi m_roi
Region of interest.
double real(const std::string &keyname) const
Return card value as double precision.
void reference(const GTimeReference &ref)
Set time reference for Good Time Intervals.
virtual GLATEventAtom * operator[](const int &index)
Event atom access operator.
virtual void clear(void)
Clear event list.
GLATEventList(void)
Void constructor.
void free_members(void)
Delete class members.
Abstract interface for FITS table column.
virtual GEventList & operator=(const GEventList &list)
Assignment operator.
Abstract interface for FITS table.
GGti m_gti
Good time intervals covered by events.
std::vector< std::string > m_difrsp_label
Diffuse response model labels.
void free_members(void)
Delete class members.
int integer(const std::string &keyname) const
Return card value as integer.
virtual void clear(void)
Clear region of interest.
virtual void load(const GFilename &filename)
Load LAT events from FITS file.
void read_ds_keys(const GFitsHDU &hdu)
Read data selection keywords from FITS HDU.
Fermi/LAT event list class.
void free_members(void)
Delete class members.
virtual int integer(const int &row, const int &inx=0) const =0
Fermi/LAT event list class definition.
virtual double real(const int &row, const int &inx=0) const =0
const std::string extname_lat_events
void read(const GFitsTable &table)
Read Good Time Intervals and time reference from FITS table.
std::vector< GLATEventAtom > m_events
Events.
std::vector< std::string > m_ds_reference
Data selection references.
std::string string(const std::string &keyname) const
Return card value as string.
Exception handler interface definition.
FITS table long integer column class interface definition.
virtual void read(const GFits &file)
Read LAT events from FITS file.
Implements a time reference.
FITS table short integer column class interface definition.
std::vector< std::string > m_ds_value
Data selection values.
void init_members(void)
Initialise class members.
virtual GLATEventList & operator=(const GLATEventList &list)
Assignment operator.
Interface for the region of interest classes.
std::vector< std::string > m_ds_type
Data selection types.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const GTime & tstart(void) const
Return start time.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save LAT events.
Fermi/LAT region of interest class.
void close(void)
Close FITS file.
void read_events(const GFitsTable &hdu)
Read LAT events from FITS table.
virtual const GLATRoi & roi(void) const
Return Region of Interest.
void set(const double &time, const GTimeReference &ref)
Set time given in specified reference.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print event list information.
virtual int number(void) const
Return number of events in list.
Fermi/LAT event atom class.
Filename class interface definition.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.