39 #define G_LOAD "GCTAAeffPerfTable::load(std::string&)"
178 const double& zenith,
179 const double& azimuth,
180 const bool& etrue)
const
199 double arg = offset * offset /
m_sigma;
200 double scale =
std::exp(-0.5 * arg * arg);
270 FILE* fptr = std::fopen(filename.
url().c_str(),
"r");
272 std::string msg =
"Effective area file \""+filename.
url()+
"\" not "
273 "found or readable. Please specify a valid and "
274 "readable effective area file.";
279 while (std::fgets(line, n, fptr) != NULL) {
283 for (
int i = elements.size()-1; i >= 0; i--) {
285 elements.erase(elements.begin()+i);
290 if (elements[0].find(
"log(E)") != std::string::npos) {
295 if (elements[0].find(
"----------") != std::string::npos) {
329 const double& zenith,
330 const double& azimuth,
331 const bool& etrue)
const
337 if (aeff_max < 0.0) {
361 result.append(
"=== GCTAAeffPerfTable ===");
void load(const GFilename &filename)
Load effective area from performance table.
int size(void) const
Return number of nodes in node array.
GCTAAeffPerfTable & operator=(const GCTAAeffPerfTable &aeff)
Assignment operator.
double operator()(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 effective area in units of cm2.
CTA performance table effective area class.
GEbounds m_ebounds
Energy boundaries.
double m_logE_min
Minimum logE (log10(E/TeV))
void set_boundaries(void)
Set effective area boundaries.
void free_members(void)
Delete class members.
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
void append(const GEnergy &emin, const GEnergy &emax)
Append energy interval.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
double m_logE_max
Maximum logE (log10(E/TeV))
void clear(void)
Clear node array.
virtual ~GCTAAeffPerfTable(void)
Destructor.
GCTAAeffPerfTable * clone(void) const
Clone instance.
double log10TeV(void) const
Return log10 of energy in TeV.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
GCTAAeff & operator=(const GCTAAeff &aeff)
Assignment operator.
void copy_members(const GCTAAeffPerfTable &aeff)
Copy class members.
double max(const double &logE, const double &zenith, const double &azimuth, const bool &etrue=true) const
Return maximum effective area at a given energy.
GFilename filename(void) const
Return filename.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
void free_members(void)
Delete class members.
CTA performance table effective area class definition.
double m_sigma
Sigma for offset angle computation (0=none)
std::string print(const GChatter &chatter=NORMAL) const
Print energy.
GFilename m_filename
Name of Aeff response file.
const GEnergy & emin(void) const
Return minimum energy of all intervals.
void clear(void)
Clear instance.
void init_members(void)
Initialise class members.
void init_members(void)
Initialise class members.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
GCTAAeffPerfTable(void)
Void constructor.
void clear(void)
Clear energy boundaries.
Abstract base class for the CTA effective area.
std::vector< double > m_aeff
Effective area in cm2.
std::string url(void) const
Return Uniform Resource Locator (URL)
void clear(void)
Clear file name.
Exception handler interface definition.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
const GEnergy & emax(void) const
Return maximum energy of all intervals.
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.
int size(void) const
Return number of node energies in response.
Mathematical function definitions.
double todouble(const std::string &arg)
Convert string into double precision value.
Class that handles energies in a unit independent way.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.