39 #define G_READ "GLATPsfV1::read(GFitsTable&)"
46 #define G_CHECK_PSF_NORM 0
216 std::string msg =
"Number of elements in \"NCORE\" column ("+
218 "with the expected size ("+
220 "point spread function table.";
224 std::string msg =
"Number of elements in \"SIGMA\" column ("+
226 "with the expected size ("+
228 "point spread function table.";
232 std::string msg =
"Number of elements in \"GCORE\" column ("+
234 "with the expected size ("+
236 "point spread function table.";
240 std::string msg =
"Number of elements in \"GTAIL\" column ("+
242 "with the expected size ("+
244 "point spread function table.";
249 for (
int i = 0; i <
size; ++i) {
298 for (
int i = 0; i <
size; ++i) {
306 hdu_rpsf->
append(col_ncore);
307 hdu_rpsf->
append(col_sigma);
308 hdu_rpsf->
append(col_gcore);
309 hdu_rpsf->
append(col_gtail);
312 std::string detnam = (
front()) ?
"FRONT" :
"BACK";
315 hdu_rpsf->
card(
"PSFVER", 1,
"File format version");
316 hdu_rpsf->
card(
"DETNAM", detnam,
"Detector section");
343 const double& ctheta)
346 const double ub = 10.0;
361 double energy =
pow(10.0, logE);
368 double u = 0.5 * r * r;
376 if (energy < 120.0) {
383 double umax = 0.5 * rmax * rmax;
399 std::cout <<
"Energy=" << energy;
400 std::cout <<
" Offset=" << offset;
401 std::cout <<
" cos(theta)=" << ctheta;
402 std::cout <<
" error=" << sum-1.0 << std::endl;
426 result.append(
"=== GLATPsfV1 ===");
500 double base = (gamma == 1)
501 ? (1.0 - 1.0/1.001) *
std::pow(1.0 + u/1.001, -1.001)
502 : (1.0 - 1.0/gamma) *
std::pow(1.0 + u/gamma, -gamma);
525 double integral = 1.0 -
std::pow(1.0 + u/gamma, 1.0 - gamma);
void read(const GFitsTable &table)
Read point spread function from FITS table.
void number(const int &number)
Set number of elements in column.
double norm(const GVector &vector)
Computes vector norm.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
std::vector< double > m_sigma
PSF sigma parameter.
Fermi/LAT point spread function version 1 class definition.
void read(const GFitsTable &hdu)
Read response table from FITS table HDU.
Fermi/LAT point spread function version 1 class.
void copy_members(const GLATPsfV1 &psf)
Copy class members.
double sum(const GVector &vector)
Computes vector sum.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
void write(GFitsTable &hdu) const
Write response table into FITS table.
void write(GFits &file) const
Write point spread function into FITS file.
std::vector< double > m_ncore
PSF ncore parameter.
FITS table float column class interface definition.
GIntegral class interface definition.
void init_members(void)
Initialise class members.
GLATPsfV1 * clone(void) const
Clone point spread function.
std::vector< double > m_gtail
PSF gtail parameter.
void clear(void)
Clear point spread function.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function.
double scale_factor(const double &energy) const
Return scale factor for energy (in MeV)
double interpolate(const double &logE, const double &ctheta, const std::vector< double > &array)
Perform bi-linear interpolation of 2D array.
double psf(const double &offset, const double &logE, const double &ctheta)
Return point spread function value.
void free_members(void)
Delete class members.
Abstract Fermi/LAT point spread function base class.
virtual ~GLATPsfV1(void)
Destructor.
GLATPsfV1(void)
Void constructor.
Abstract interface for FITS table column.
GLATPsfV1 & operator=(const GLATPsfV1 &psf)
Assignment operator.
Abstract interface for FITS table.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
const std::string & extname(void) const
Return extension name.
std::vector< double > m_gcore
PSF gcore parameter.
double m_min_ctheta
Minimum valid cos(theta)
GLATPsfBase & operator=(const GLATPsfBase &psf)
Assignment operator.
static double base_fct(const double &u, const double &gamma)
Return point spread base function value.
static double base_int(const double &u, const double &gamma)
Return approximation of point spread base function integral.
GLATResponseTable m_rpsf_bins
PSF energy and cos theta binning.
virtual double real(const int &row, const int &inx=0) const =0
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
int size(void) const
Return number of bins in point spread function.
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 [.
Integration class interface definition.
GFitsHeaderCard & card(const int &cardno)
Return header card.
const bool & front(void) const
Signal that point spread function is for front section.
int size(void) const
Return number of bins in response table.
Mathematical function definitions.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.