43#define G_READ_AEFF "GLATAeff::read_aeff(GFitsTable&)"
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);
Energy value class definition.
Exception handler interface definition.
Filename class interface definition.
FITS binary table class definition.
FITS table column abstract base class definition.
FITS table float column class interface definition.
FITS table abstract base class interface definition.
FITS file class interface definition.
Fermi LAT effective area class definition.
Class that handles energies in a unit independent way.
double log10MeV(void) const
Return log10 of energy in MeV.
const std::string & extname(void) const
Return extension name.
std::string string(const std::string &keyname) const
Return card value as string.
GFitsHeaderCard & card(const int &cardno)
Return header card.
Abstract interface for FITS table column.
void number(const int &number)
Set number of elements in column.
virtual double real(const int &row, const int &inx=0) const =0
void nrows(const int &nrows)
Set number of rows in column.
Abstract interface for FITS table.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
bool contains(const int &extno) const
Check if HDU exists in FITS file.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Interface for the Fermi/LAT effective area.
virtual ~GLATAeff(void)
Destructor.
void read(const GFits &file, const std::string &evtype)
Read effective area from FITS file.
GLATAeff * clone(void) const
Clone effective area.
bool has_efficiency(void) const
Signals whether efficiency factors are present.
int ncostheta(void) const
Return number of cosine theta bins in effective area response.
double operator()(const double &logE, const double &ctheta)
Return effective area in units of cm2.
double m_min_ctheta
Minimum valid cos(theta)
void save(const GFilename &filename, const bool &clobber=false)
Save effective area into FITS file.
void write_efficiency(GFits &file) const
Write efficiency factors into FITS file.
GLATAeff & operator=(const GLATAeff &aeff)
Assignment operator.
std::string m_evtype
Event type.
double efficiency_factor1(const GEnergy &srcEng) const
Returns efficiency factor 1.
GLATEfficiency * m_eff_func1
Efficiency functor 1.
void write_aeff(GFits &file) const
Write effective area into FITS file.
void write(GFits &file) const
Write effective area into FITS file.
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
void clear(void)
Clear effective area.
int nenergies(void) const
Return number of energies in effective area response.
void load(const GFilename &filename, const std::string &evtype)
Load effective area from FITS file.
GLATEfficiency * m_eff_func2
Efficiency functor 2.
GLATResponseTable m_aeff_bins
Aeff energy and cos theta binning.
double efficiency_factor2(const GEnergy &srcEng) const
Returns efficiency factor 2.
GLATAeff(void)
Void constructor.
std::vector< double > m_aeff
Aeff array.
void read_aeff(const GFitsTable &hdu)
Read effective area from FITS table.
const std::string & evtype(void) const
Return event type.
void read_efficiency(const GFitsTable &hdu)
Read efficiency factor parameters from FITS table.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
void copy_members(const GLATAeff &aeff)
Copy class members.
int size(void) const
Return number of bins in effective area response.
Interface for the Fermi/LAT efficiency factor functor.
std::vector< double > pars(void) const
Return efficiency parameters.
GLATEfficiency * clone(void) const
Clone efficiency factor functor.
double costheta_lo(const int &inx) const
Return lower bin cos theta [.
void read(const GFitsTable &hdu)
Read response table from FITS table HDU.
double interpolate(const double &logE, const double &ctheta, const std::vector< double > &array)
Perform bi-linear interpolation of 2D array.
void write(GFitsTable &hdu) const
Write response table into FITS table.
int size(void) const
Return number of bins in response table.
void clear(void)
Clear instance.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const std::string extname_lat_efficiency
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
const std::string extname_lat_aeff