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)
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";
496 double radius = std::sqrt(std::log(arg + 1.0) /
m_par_width);
519 double emin = std::pow(10.0,
m_logE[0]);
520 double emax = std::pow(10.0,
m_logE[num-1]);
523 result.append(
"=== GCTAPsfVector ===");
#define G_CONTAINMENT_RADIUS
CTA point spread function vector class definition.
Exception handler interface definition.
Filename class interface definition.
FITS table column abstract base class definition.
FITS table abstract base class interface definition.
FITS file class interface definition.
Mathematical function definitions.
Random number generator class definition.
GVector log10(const GVector &vector)
Computes base10 logarithm of vector elements.
CTA vector point spread function class.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
void free_members(void)
Delete class members.
virtual ~GCTAPsfVector(void)
Destructor.
GCTAPsfVector & operator=(const GCTAPsfVector &psf)
Assignment operator.
std::vector< double > m_sigma
Sigma value of PSF in radians.
GCTAPsfVector(void)
Void constructor.
void init_members(void)
Initialise class members.
double m_par_logE
Energy for which precomputation is done.
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)
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 copy_members(const GCTAPsfVector &psf)
Copy class members.
std::vector< double > m_r68
68% containment radius of PSF in degrees
GFilename m_filename
Name of Aeff response file.
double m_par_scale
Gaussian normalization.
void clear(void)
Clear instance.
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 m_par_sigma
Gaussian sigma (radians)
void read(const GFitsTable &table)
Read point spread function vector from FITS table.
GCTAPsfVector * clone(void) const
Clone instance.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
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.
double m_par_width
Gaussian width parameter.
void update(const double &logE) const
Update PSF parameter cache.
GFilename filename(void) const
Return filename.
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.
std::string extname(const std::string &defaultname="") const
Return extension name.
void clear(void)
Clear file name.
Abstract interface for FITS table column.
virtual double real(const int &row, const int &inx=0) const =0
void unit(const std::string &unit)
Set column unit.
void nrows(const int &nrows)
Set number of rows in column.
Abstract interface for FITS table.
bool contains(const std::string &colname) const
Checks the presence of a column in table.
void close(void)
Close FITS file.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
void clear(void)
Clear node array.
int size(void) const
Return number of nodes in node array.
void append(const double &node)
Append one node to array.
Random number generator class.
double chisq2(void)
Returns Chi2 deviates for 2 degrees of freedom.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string tolower(const std::string &s)
Convert string to lower case.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.