40#define G_LOAD "GCTAPsfPerfTable::load(GFilename&)"
41#define G_CONTAINMENT_RADIUS "GCTAPsfPerfTable::containment_radius(double&,"\
42 " double&, double&, double&, double&, double&, bool&)"
180 const double& zenith,
181 const double& azimuth,
182 const bool& etrue)
const
184 #if defined(G_SMOOTH_PSF)
188 static const double offset = std::exp(-0.5*5.0*5.0);
195 #if defined(G_SMOOTH_PSF)
201 #if defined(G_SMOOTH_PSF)
277 FILE* fptr = std::fopen(
filename.
url().c_str(),
"r");
279 std::string msg =
"Point spread function file \""+
filename.
url()+
280 "\" not found or readable. Please specify a valid "
281 "and readable point spread function file.";
286 while (std::fgets(line, n, fptr) != NULL) {
290 for (
int i = elements.size()-1; i >= 0; i--) {
292 elements.erase(elements.begin()+i);
297 if (elements[0].find(
"log(E)") != std::string::npos) {
302 if (elements[0].find(
"----------") != std::string::npos) {
340 const double& zenith,
341 const double& azimuth,
342 const bool& etrue)
const
372 const double& zenith,
373 const double& azimuth,
374 const bool& etrue)
const
429 const double& zenith,
430 const double& azimuth,
431 const bool& etrue)
const
434 if (fraction <= 0.0 || fraction >= 1.0) {
435 std::string message =
"Containment fraction "+
437 "0.0 and 1.0, not inclusive.";
446 double radius = std::sqrt(std::log(arg + 1.0) /
m_par_width);
469 double emin = std::pow(10.0,
m_logE[0]);
470 double emax = std::pow(10.0,
m_logE[num-1]);
473 result.append(
"=== GCTAPsfPerfTable ===");
#define G_CONTAINMENT_RADIUS
CTA performance table point spread function class definition.
Exception handler interface definition.
Mathematical function definitions.
Random number generator class definition.
CTA performance table point spread function class.
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 init_members(void)
Initialise class members.
std::vector< double > m_r68
68% containment radius of PSF in degrees
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_width
Gaussian width parameter.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
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.
double m_par_logE
Energy for which precomputation is done.
virtual ~GCTAPsfPerfTable(void)
Destructor.
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::vector< double > m_sigma
Sigma value of PSF in radians.
void copy_members(const GCTAPsfPerfTable &psf)
Copy class members.
void update(const double &logE) const
Update PSF parameter cache.
GCTAPsfPerfTable(void)
Void constructor.
std::vector< double > m_r80
80% containment radius of PSF in degrees
GCTAPsfPerfTable * clone(void) const
Clone instance.
void clear(void)
Clear instance.
void load(const GFilename &filename)
Load point spread function from performance table.
GCTAPsfPerfTable & operator=(const GCTAPsfPerfTable &psf)
Assignment operator.
double m_par_scale
Gaussian normalization.
GFilename m_filename
Name of Aeff response file.
void free_members(void)
Delete class members.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
double m_par_sigma
Gaussian sigma (radians)
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 url(void) const
Return Uniform Resource Locator (URL)
void clear(void)
Clear file name.
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.
double todouble(const std::string &arg)
Convert string into double precision value.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.