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.";
473 result.append(
"=== GCTAPsfPerfTable ===");
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)
int size(void) const
Return number of nodes in node array.
double chisq2(void)
Returns Chi2 deviates for 2 degrees of freedom.
void update(const double &logE) const
Update PSF parameter cache.
Random number generator class definition.
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)
double m_par_scale
Gaussian normalization.
GCTAPsfPerfTable * clone(void) const
Clone instance.
Abstract base class for the CTA point spread function.
void load(const GFilename &filename)
Load point spread function from performance table.
void clear(void)
Clear node array.
Random number generator class.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
GFilename m_filename
Name of Aeff response file.
GCTAPsf & operator=(const GCTAPsf &psf)
Assignment operator.
double m_par_sigma
Gaussian sigma (radians)
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
void init_members(void)
Initialise class members.
std::string print(const GChatter &chatter=NORMAL) const
Print point spread function information.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
#define G_CONTAINMENT_RADIUS
void free_members(void)
Delete class members.
void clear(void)
Clear instance.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
void copy_members(const GCTAPsfPerfTable &psf)
Copy class members.
std::vector< double > m_r80
80% containment radius of PSF in degrees
CTA performance table point spread function class definition.
std::vector< double > m_r68
68% containment radius of PSF in degrees
std::string url(void) const
Return Uniform Resource Locator (URL)
void clear(void)
Clear file name.
void init_members(void)
Initialise class members.
GFilename filename(void) const
Return filename.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
Exception handler interface definition.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
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)
GCTAPsfPerfTable & operator=(const GCTAPsfPerfTable &psf)
Assignment operator.
CTA performance table point spread function class.
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)
std::vector< double > m_sigma
Sigma value of PSF in radians.
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.
GCTAPsfPerfTable(void)
Void constructor.
double m_par_width
Gaussian width parameter.
Mathematical function definitions.
double todouble(const std::string &arg)
Convert string into double precision value.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
double m_par_logE
Energy for which precomputation is done.