45#define G_READ "GCTAPsfKing::read(GFitsTable&)"
46#define G_CONTAINMENT_RADIUS "GCTAPsfKing::containment_radius(double&,"\
47 " double&, double&, double&, double&, double&, bool&)"
48#define G_UPDATE "GCTAPsfKing::update(double&, double&)"
195 const double& zenith,
196 const double& azimuth,
197 const bool& etrue)
const
211 double arg2 = arg * arg;
217 #if defined(G_SMOOTH_PSF)
219 double norm_down = 1.0 / (
m_par_rmax - ramp_down);
220 if (delta > ramp_down) {
221 double x = norm_down * (delta - ramp_down);
309 std::string msg =
"Expected two-dimensional point spread function "
310 "response table but found "+
312 " dimensions. Please specify a two-dimensional "
313 "point spread function.";
380 if (extname.empty()) {
437 table.extname(extname);
468 const double& zenith,
469 const double& azimuth,
470 const bool& etrue)
const
491 double u_max = (std::pow((1.0 - u), exponent) - 1.0) *
m_par_gamma;
520 const double& zenith,
521 const double& azimuth,
522 const bool& etrue)
const
532 radius =
r_max(logE, theta);
563 const double& zenith,
564 const double& azimuth,
565 const bool& etrue)
const
571 if (fraction <= 0.0 || fraction >= 1.0) {
572 std::string msg =
"Containment fraction "+
gammalib::str(fraction)+
573 " must be in interval ]0,1[. Please specify a valid "
574 "containment fraction.";
585 double arg1 = std::pow(1.0 - fraction, 1.0/(1.0-
m_par_gamma));
587 radius = (arg2 > 0) ?
m_par_sigma * std::sqrt(arg2) : 0.0;
611 result.append(
"=== GCTAPsfKing ===");
814 const double& theta)
const
817 const double F = 0.999;
820 double u_max = (std::pow((1.0 - F), (1.0/(1.0-
m_par_gamma))) - 1.0) *
#define G_CONTAINMENT_RADIUS
King profile CTA point spread function class definition.
Definition of support function used by CTA classes.
Exception handler interface definition.
Filename class interface definition.
FITS binary table class definition.
FITS table abstract base class interface definition.
FITS file class interface definition.
Mathematical function definitions.
Random number generator class definition.
double norm(const GVector &vector)
Computes vector norm.
CTA point spread function class with a King profile.
int m_inx_energy
Energy index.
const GCTAResponseTable & table(void) const
Return response table.
void read(const GFitsTable &table)
Read point spread function from FITS table.
void update(const double &logE, const double &theta) const
Update PSF parameter cache.
GCTAPsfKing * clone(void) const
Clone point spread functions.
void clear(void)
Clear point spread function.
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)
double m_par_logE
Cache energy.
GCTAPsfKing(void)
Void constructor.
void free_members(void)
Delete class members.
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)
GFilename filename(void) const
Return filename.
GCTAPsfKing & operator=(const GCTAPsfKing &psf)
Assignment operator.
double m_par_norm
King profile normalization.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
void init_members(void)
Initialise class members.
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)
void load(const GFilename &filename)
Load point spread function from FITS file.
void save(const GFilename &filename, const bool &clobber=false) const
Save point spread function table into FITS file.
double m_par_theta
Cache offset angle.
void copy_members(const GCTAPsfKing &psf)
Copy class members.
virtual ~GCTAPsfKing(void)
Destructor.
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 r_max(const double &logE, const double &theta) const
Return maximum size of PSF (radians)
double m_par_sigma
King profile sigma (radians)
double m_par_rmax
Maximum PSF radius.
void write(GFitsBinTable &table) const
Write point spread function into FITS table.
GCTAResponseTable m_psf
PSF response table.
int m_inx_theta
Theta index.
double m_par_gamma
King profile gamma parameter.
double m_par_sigma2
King profile sigma squared.
GFilename m_filename
Name of Aeff response file.
Abstract base class for the CTA point spread function.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
GCTAPsf & operator=(const GCTAPsf &psf)
Assignment operator.
CTA response table class.
void read(const GFitsTable &table)
Read response table from FITS table HDU.
int table(const std::string &name) const
Determine index of table.
void axis_log10(const int &axis)
Set nodes for a logarithmic (base 10) axis.
const int & tables(void) const
Return number of tables.
void axis_radians(const int &axis)
Set nodes for a radians axis.
int axis(const std::string &name) const
Determine index of an axis.
const int & axes(void) const
Return number of axes of the tables.
void write(GFitsTable &table) const
Write response table into FITS table HDU.
int axis_bins(const int &axis) const
Return number bins in an axis.
const double & axis_hi(const int &axis, const int &bin) const
Return upper bin boundary for bin in axis.
void scale(const int &table, const double &scale)
Scale table.
void clear(void)
Clear response table.
const double & axis_lo(const int &axis, const int &bin) const
Return lower bin boundary for bin in axis.
std::string url(void) const
Return Uniform Resource Locator (URL)
std::string extname(const std::string &defaultname="") const
Return extension name.
void clear(void)
Clear file name.
Abstract interface for FITS table.
bool contains(const int &extno) const
Check if HDU exists in FITS file.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
void close(void)
Close FITS file.
void remove(const int &extno)
Remove HDU from FITS file.
void save(const bool &clobber=false)
Saves FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Random number generator class.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
bool is_infinite(const double &x)
Signal if argument is infinite.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const std::string extname_cta_psfking
std::string gadf_hduclas4(const GFits &fits, const std::string &hduclas4)
Return extension name for GADF response table of given HDU class 4.