43 #define G_READ_AEFF "GLATAeff::read_aeff(GFitsTable&)"
89 load(filename, evtype);
266 GFits fits(filename);
295 fits.
saveto(filename, clobber);
412 factor = (*m_eff_func2)(srcEng.
log10MeV());
441 factor = (*m_eff_func1)(srcEng.
log10MeV());
464 result.append(
"=== GLATAeff ===");
474 result.append(
"present");
477 result.append(
"absent");
585 std::string msg =
"Number of elements in response table ("+
587 "the expectation according to the number of "
589 "). Please specify a consistent effective area "
595 for (
int i = 0; i <
size; ++i) {
635 for (
int i = 0; i <
size; ++i) {
636 col_aeff(0,i) =
m_aeff[i] * 1.0e-4;
686 std::vector<double> par1;
687 std::vector<double> par2;
691 if (ptr->
nrows() == 2) {
692 for (
int i = 0; i < 6; ++i) {
693 par1.push_back(ptr->
real(0,i));
694 par2.push_back(ptr->
real(1,i));
705 for (
int i = 0; i < 6; ++i) {
706 par1.push_back(ptr->
real(0,i));
707 par2.push_back(ptr->
real(1,i));
713 for (
int i = 0; i < 6; ++i) {
714 par1.push_back(ptr->
real(2,i));
715 par2.push_back(ptr->
real(3,i));
722 if (par1.size() == 6) {
725 if (par2.size() == 6) {
761 for (
int i = 0; i < par1.size(); ++i) {
762 col_eff(0,i) = par1[i];
764 for (
int i = 0; i < par2.size(); ++i) {
765 col_eff(1,i) = par2[i];
769 efficiency.
append(col_eff);
GLATEfficiency * m_eff_func1
Efficiency functor 1.
int size(void) const
Return number of bins in effective area response.
void load(const GFilename &filename, const std::string &evtype)
Load effective area from FITS file.
void number(const int &number)
Set number of elements in column.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
bool contains(const int &extno) const
Check if HDU exists in FITS file.
GLATAeff & operator=(const GLATAeff &aeff)
Assignment operator.
void free_members(void)
Delete class members.
Energy value class definition.
void read(const GFitsTable &hdu)
Read response table from FITS table HDU.
double m_min_ctheta
Minimum valid cos(theta)
const std::string extname_lat_aeff
const std::string extname_lat_efficiency
void nrows(const int &nrows)
Set number of rows in column.
std::vector< double > pars(void) const
Return efficiency parameters.
void clear(void)
Clear instance.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
void write(GFitsTable &hdu) const
Write response table into FITS table.
Interface for the Fermi/LAT efficiency factor functor.
FITS table float column class interface definition.
void write_efficiency(GFits &file) const
Write efficiency factors into FITS file.
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
FITS file class interface definition.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
GLATAeff(void)
Void constructor.
FITS table column abstract base class definition.
GLATEfficiency * clone(void) const
Clone efficiency factor functor.
double log10MeV(void) const
Return log10 of energy in MeV.
double interpolate(const double &logE, const double &ctheta, const std::vector< double > &array)
Perform bi-linear interpolation of 2D array.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
Abstract interface for FITS table column.
void read_aeff(const GFitsTable &hdu)
Read effective area from FITS table.
void copy_members(const GLATAeff &aeff)
Copy class members.
void read_efficiency(const GFitsTable &hdu)
Read efficiency factor parameters from FITS table.
Abstract interface for FITS table.
Interface for the Fermi/LAT effective area.
void write_aeff(GFits &file) const
Write effective area into FITS file.
double operator()(const double &logE, const double &ctheta)
Return effective area in units of cm2.
void write(GFits &file) const
Write effective area into FITS file.
const std::string & extname(void) const
Return extension name.
double efficiency_factor1(const GEnergy &srcEng) const
Returns efficiency factor 1.
int nenergies(void) const
Return number of energies in effective area response.
int ncostheta(void) const
Return number of cosine theta bins in effective area response.
GLATResponseTable m_aeff_bins
Aeff energy and cos theta binning.
void clear(void)
Clear effective area.
virtual double real(const int &row, const int &inx=0) const =0
const std::string & evtype(void) const
Return event type.
std::string string(const std::string &keyname) const
Return card value as string.
std::vector< double > m_aeff
Aeff array.
Exception handler interface definition.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
FITS binary table class definition.
double costheta_lo(const int &inx) const
Return lower bin cos theta [.
GLATEfficiency * m_eff_func2
Efficiency functor 2.
void save(const GFilename &filename, const bool &clobber=false)
Save effective area into FITS file.
virtual ~GLATAeff(void)
Destructor.
void read(const GFits &file, const std::string &evtype)
Read effective area from FITS file.
void init_members(void)
Initialise class members.
Fermi LAT effective area class definition.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string m_evtype
Event type.
GLATAeff * clone(void) const
Clone effective area.
GFitsHeaderCard & card(const int &cardno)
Return header card.
int size(void) const
Return number of bins in response table.
bool has_efficiency(void) const
Signals whether efficiency factors are present.
Filename class interface definition.
Class that handles energies in a unit independent way.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.
double efficiency_factor2(const GEnergy &srcEng) const
Returns efficiency factor 2.