44 #define G_READ "GCTAPsfTable::read(GFitsTable&)"
45 #define G_CONTAINMENT_RADIUS "GCTAPsfTable::containment_radius(double&,"\
46 " double&, double&, double&, double&, double&, bool&)"
196 const double& zenith,
197 const double& azimuth,
198 const bool& etrue)
const
304 std::string msg =
"Expected three-dimensional point spread function "
305 "response table but found "+
307 " dimensions. Please specify a three-dimensional "
308 "point spread function.";
368 GFits fits(filename);
373 if (extname.empty()) {
419 if (fits.contains(extname)) {
461 const double& zenith,
462 const double& azimuth,
463 const bool& etrue)
const
481 double value = this->
operator()(delta, logE, theta, phi, zenith,
488 if (uniform <= value) {
516 const double& zenith,
517 const double& azimuth,
518 const bool& etrue)
const
547 const double& zenith,
548 const double& azimuth,
549 const bool& etrue)
const
552 if (fraction <= 0.0 || fraction >= 1.0) {
553 std::string message =
"Containment fraction "+
555 "0.0 and 1.0, not inclusive.";
568 for (
int idelta = 0; idelta < ndelta; ++idelta) {
579 sum += this->
operator()(delta, logE, theta, phi, zenith, azimuth, etrue) *
583 if (sum >= fraction) {
609 result.append(
"=== GCTAPsfTable ===");
744 for (
int ieng = 0; ieng < neng; ++ieng) {
745 for (
int itheta = 0; itheta < ntheta; ++itheta) {
751 int inx =
element(ieng, itheta, 0);
755 for (
int idelta = 0; idelta < ndelta; ++idelta, inx += inx_inc) {
776 int inx =
element(ieng, itheta, 0);
779 for (
int idelta = 0; idelta < ndelta; ++idelta, inx += inx_inc) {
void free_members(void)
Delete class members.
const GNodeArray & axis_nodes(const int &axis) const
Return axis nodes.
int m_inx_energy
Energy index.
GCTAPsfTable & operator=(const GCTAPsfTable &psf)
Assignment operator.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
double m_psf_max
Maximum PSF value.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
Random number generator class definition.
GCTAResponseTable m_psf
PSF response table.
int m_inx_theta
Theta index.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
const GCTAResponseTable & table(void) const
Return response table.
Abstract base class for the CTA point spread function.
GCTAPsfTable(void)
Void constructor.
double sum(const GVector &vector)
Computes vector sum.
double acos(const double &arg)
Computes acos by avoiding NaN due to rounding errors.
std::string extname(const std::string &defaultname="") const
Return extension name.
Random number generator class.
void axis_radians(const int &axis)
Set nodes for a radians axis.
GCTAPsf & operator=(const GCTAPsf &psf)
Assignment operator.
FITS file class interface definition.
void copy_members(const GCTAPsfTable &psf)
Copy class members.
void read(const GFitsTable &table)
Read response table from FITS table HDU.
void save(const GFilename &filename, const bool &clobber=false) const
Save point spread function table into FITS file.
int m_inx_delta
Delta index.
void init_members(void)
Initialise class members.
bool is_notanumber(const double &x)
Signal if argument is not a number.
const double & axis_lo(const int &axis, const int &bin) const
Return lower bin boundary for bin in axis.
bool is_infinite(const double &x)
Signal if argument is infinite.
Definition of support function used by CTA classes.
void write(GFitsTable &table) const
Write response table into FITS table HDU.
int axis(const std::string &name) const
Determine index of an axis.
void free_members(void)
Delete class members.
int element(const int &ieng, const int &itheta, const int &idelta)
Return element index.
void read(const GFitsTable &table)
Read point spread function from FITS table.
void remove(const int &extno)
Remove HDU from FITS file.
void clear(void)
Clear response table.
double operator()(const double &delta, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const
Return point spread function (in units of sr^-1)
GFilename filename(void) const
Return filename.
int m_inx_rpsf
PSF histogram.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
const std::string extname_cta_psftable
double containment_radius(const double &fraction, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const
Return the radius that contains a fraction of the events (radians)
#define G_CONTAINMENT_RADIUS
const int & elements(void) const
Return number of elements per table.
Abstract interface for FITS table.
void load(const GFilename &filename)
Load point spread function from FITS file.
virtual ~GCTAPsfTable(void)
Destructor.
const std::string & extname(void) const
Return extension name.
void axis_log10(const int &axis)
Set nodes for a logarithmic (base 10) axis.
int table(const std::string &name) const
Determine index of table.
std::string gadf_hduclas4(const GFits &fits, const std::string &hduclas4)
Return extension name for GADF response table of given HDU class 4.
std::string url(void) const
Return Uniform Resource Locator (URL)
int axis_bins(const int &axis) const
Return number bins in an axis.
double delta_max(const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const
Return maximum size of PSF (radians)
double mc(GRan &ran, const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const
Simulate PSF offset (radians)
GCTAPsfTable * clone(void) const
Clone point spread functions.
void clear(void)
Clear file name.
void write(GFitsBinTable &table) const
Write point spread function into FITS table.
const double & axis_hi(const int &axis, const int &bin) const
Return upper bin boundary for bin in axis.
GVector sin(const GVector &vector)
Computes sine of vector elements.
Exception handler interface definition.
CTA point spread function table class definition.
FITS binary table class definition.
GFilename m_filename
Name of Aeff response file.
CTA response table class.
CTA point spread function table class.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void precompute(void)
Performs precomputations for point spread function.
double m_delta_max
Maximum delta angle (radians)
void close(void)
Close FITS file.
const int & axes(void) const
Return number of axes of the tables.
Filename class interface definition.
void clear(void)
Clear point spread function.
Mathematical function definitions.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.
void init_members(void)
Initialise class members.