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.";
375 GFits fits(filename);
380 if (extname.empty()) {
426 if (fits.contains(extname)) {
468 const double& zenith,
469 const double& azimuth,
470 const bool& etrue)
const
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.";
611 result.append(
"=== GCTAPsfKing ===");
771 if (m_par_rmax > r_max) {
786 else if (m_par_rmax == 0.0) {
814 const double& theta)
const
817 const double F = 0.999;
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)
void init_members(void)
Initialise class members.
GCTAPsfKing(void)
Void constructor.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
double norm(const GVector &vector)
Computes vector norm.
Random number generator class definition.
GCTAPsfKing * clone(void) const
Clone point spread functions.
const GCTAResponseTable & table(void) const
Return response table.
void load(const GFilename &filename)
Load point spread function from FITS file.
double m_par_rmax
Maximum PSF radius.
Abstract base class for the CTA point spread function.
CTA point spread function class with a King profile.
std::string extname(const std::string &defaultname="") const
Return extension name.
Random number generator class.
const int & tables(void) const
Return number of tables.
void scale(const int &table, const double &scale)
Scale table.
void axis_radians(const int &axis)
Set nodes for a radians axis.
GCTAPsf & operator=(const GCTAPsf &psf)
Assignment operator.
FITS file class interface definition.
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)
void read(const GFitsTable &table)
Read response table from FITS table HDU.
void read(const GFitsTable &table)
Read point spread function from FITS table.
void init_members(void)
Initialise class members.
GFilename filename(void) const
Return filename.
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)
const double & axis_lo(const int &axis, const int &bin) const
Return lower bin boundary for bin in axis.
GCTAResponseTable m_psf
PSF response table.
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.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
void clear(void)
Clear point spread function.
const std::string extname_cta_psfking
void remove(const int &extno)
Remove HDU from FITS file.
void clear(void)
Clear response table.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
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)
double r_max(const double &logE, const double &theta) const
Return maximum size of PSF (radians)
Abstract interface for FITS table.
void copy_members(const GCTAPsfKing &psf)
Copy class members.
void write(GFitsBinTable &table) const
Write point spread function into FITS table.
GCTAPsfKing & operator=(const GCTAPsfKing &psf)
Assignment operator.
GFilename m_filename
Name of Aeff response file.
void save(const GFilename &filename, const bool &clobber=false) const
Save point spread function table into FITS file.
King profile CTA point spread function class definition.
const std::string & extname(void) const
Return extension name.
int m_inx_energy
Energy index.
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.
void clear(void)
Clear file name.
double m_par_sigma
King profile sigma (radians)
double m_par_sigma2
King profile sigma squared.
double m_par_norm
King profile normalization.
#define G_CONTAINMENT_RADIUS
void free_members(void)
Delete class members.
const double & axis_hi(const int &axis, const int &bin) const
Return upper bin boundary for bin in axis.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
virtual ~GCTAPsfKing(void)
Destructor.
double m_par_theta
Cache offset angle.
Exception handler interface definition.
void update(const double &logE, const double &theta) const
Update PSF parameter cache.
FITS binary table class definition.
CTA response table class.
double m_par_gamma
King profile gamma parameter.
double m_par_logE
Cache energy.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void close(void)
Close FITS file.
int m_inx_theta
Theta index.
const int & axes(void) const
Return number of axes of the tables.
Filename class interface definition.
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.