43 #define G_CONTAINMENT_RADIUS "GCTAPsfVector::containment_radius(double&,"\
44 " double&, double&, double&, double&, double&, bool&)"
181 const double& zenith,
182 const double& azimuth,
183 const bool& etrue)
const
185 #if defined(G_SMOOTH_PSF)
189 static const double offset =
std::exp(-0.5*5.0*5.0);
196 #if defined(G_SMOOTH_PSF)
202 #if defined(G_SMOOTH_PSF)
264 GFits fits(filename);
316 double r68_scale = 1.0;
321 r68 = table[
"ANGRES40"];
322 r68_scale = 1.0 / 0.6624305;
328 double c_energy_lo = 1.0;
329 double c_energy_hi = 1.0;
330 if (u_energy_lo ==
"kev") {
331 c_energy_lo = 1.0e-9;
333 else if (u_energy_lo ==
"mev") {
334 c_energy_lo = 1.0e-6;
336 else if (u_energy_lo ==
"gev") {
337 c_energy_lo = 1.0e-3;
339 if (u_energy_hi ==
"kev") {
340 c_energy_hi = 1.0e-9;
342 else if (u_energy_hi ==
"mev") {
343 c_energy_hi = 1.0e-6;
345 else if (u_energy_hi ==
"gev") {
346 c_energy_hi = 1.0e-3;
350 int num = energy_lo->
nrows();
353 for (
int i = 0; i < num; ++i) {
356 double e_min = energy_lo->
real(i) * c_energy_lo;
357 double e_max = energy_hi->
real(i) * c_energy_hi;
358 double logE = 0.5 * (
log10(e_min) +
log10(e_max));
361 double r68_value = r68->
real(i) * r68_scale;
365 m_r68.push_back(r68_value);
366 m_sigma.push_back(r68_value*conv);
390 const double& zenith,
391 const double& azimuth,
392 const bool& etrue)
const
422 const double& zenith,
423 const double& azimuth,
424 const bool& etrue)
const
479 const double& zenith,
480 const double& azimuth,
481 const bool& etrue)
const
484 if (fraction <= 0.0 || fraction >= 1.0) {
485 std::string msg =
"Containment fraction "+
gammalib::str(fraction)+
486 " must lie in interval ]0,1[. Please specify a "
487 "valid containment fraction";
523 result.append(
"=== GCTAPsfVector ===");
double m_par_width
Gaussian width parameter.
void free_members(void)
Delete class members.
void unit(const std::string &unit)
Set column unit.
int size(void) const
Return number of nodes in node array.
double chisq2(void)
Returns Chi2 deviates for 2 degrees of freedom.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
Random number generator class definition.
CTA vector point spread function class.
void load(const GFilename &filename)
Load point spread function from FITS file.
bool contains(const std::string &colname) const
Checks the presence of a column in table.
Abstract base class for the CTA point spread function.
std::vector< double > m_sigma
Sigma value of PSF in radians.
void nrows(const int &nrows)
Set number of rows in column.
void clear(void)
Clear node array.
std::string extname(const std::string &defaultname="") const
Return extension name.
Random number generator class.
void free_members(void)
Delete class members.
void clear(void)
Clear instance.
GCTAPsf & operator=(const GCTAPsf &psf)
Assignment operator.
FITS file class interface definition.
double m_par_logE
Energy for which precomputation is done.
void copy_members(const GCTAPsfVector &psf)
Copy class members.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
FITS table column abstract base class definition.
void init_members(void)
Initialise class members.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
virtual ~GCTAPsfVector(void)
Destructor.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
void update(const double &logE) const
Update PSF parameter cache.
Abstract interface for FITS table column.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
Abstract interface for FITS table.
GFilename filename(void) const
Return filename.
#define G_CONTAINMENT_RADIUS
GCTAPsfVector * clone(void) const
Clone instance.
GFilename m_filename
Name of Aeff response file.
CTA point spread function vector class definition.
void clear(void)
Clear file name.
GCTAPsfVector & operator=(const GCTAPsfVector &psf)
Assignment operator.
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.
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)
Exception handler interface definition.
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)
std::string tolower(const std::string &s)
Convert string to lower case.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
double m_par_scale
Gaussian normalization.
void read(const GFitsTable &table)
Read point spread function vector from FITS table.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void append(const double &node)
Append one node to array.
void close(void)
Close FITS file.
double m_par_sigma
Gaussian sigma (radians)
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)
std::vector< double > m_r68
68% containment radius of PSF in degrees
Filename class interface definition.
Mathematical function definitions.
GVector log10(const GVector &vector)
Computes base10 logarithm of vector elements.
GCTAPsfVector(void)
Void constructor.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.