40 #define G_LOAD "GCTAEdispPerfTable::load(GFilename&)"
139 if (
this != &edisp) {
191 const double& zenith,
192 const double& azimuth)
const
202 double delta = logEobs - logEsrc;
276 FILE* fptr = std::fopen(filename.
url().c_str(),
"r");
278 std::string msg =
"Energy dispersion file \""+filename.
url()+
279 "\" not found or readable. Please specify a valid "
280 "and readable energy dispersion file.";
285 while (std::fgets(line, n, fptr) != NULL) {
289 for (
int i = elements.size()-1; i >= 0; i--) {
291 elements.erase(elements.begin()+i);
296 if (elements[0].find(
"log(E)") != std::string::npos) {
301 if (elements[0].find(
"----------") != std::string::npos) {
342 const double& zenith,
343 const double& azimuth)
const
381 const double& zenith,
382 const double& azimuth)
const
385 const double number_of_sigmas = 5.0;
388 double etrue_log10TeV = etrue.
log10TeV();
396 emin.
log10TeV(etrue_log10TeV - number_of_sigmas * sigma);
397 emax.
log10TeV(etrue_log10TeV + number_of_sigmas * sigma);
422 const double& zenith,
423 const double& azimuth)
const
426 const double number_of_sigmas = 5.0;
429 double ereco_log10TeV = ereco.
log10TeV();
437 emin.
log10TeV(ereco_log10TeV - number_of_sigmas * sigma);
438 emax.
log10TeV(ereco_log10TeV + number_of_sigmas * sigma);
469 const double& theta)
const
506 result.append(
"=== GCTAEdispPerfTable ===");
517 if (reduced_chatter >
SILENT) {
518 for(
int i=0; i < num; ++i) {
void free_members(void)
Delete class members.
int size(void) const
Return number of nodes in node array.
std::string print(const GChatter &chatter=NORMAL) const
Print energy dispersion information.
Random number generator class definition.
std::vector< double > m_sigma
Sigma value (rms) of energy resolution.
double gauss_integral(const double &x1, const double &x2)
Returns the integral of a Gaussian function.
void free_members(void)
Delete class members.
Abstract base class for the CTA energy dispersion.
double m_par_width
Gaussian width parameter.
void clear(void)
Clear node array.
double log10TeV(void) const
Return log10 of energy in TeV.
GEbounds ereco_bounds(const GEnergy &etrue, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0) const
Return observed energy interval that contains the energy dispersion.
Random number generator class.
std::vector< std::string > split(const std::string &s, const std::string &sep)
Split string.
double MeV(void) const
Return energy in MeV.
GCTAEdispPerfTable & operator=(const GCTAEdispPerfTable &psf)
Assignment operator.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
GCTAEdispPerfTable * clone(void) const
Clone instance.
GEnergy mc(GRan &ran, const GEnergy &etrue, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0) const
Simulate energy dispersion.
void copy_members(const GCTAEdispPerfTable &psf)
Copy class members.
void clear(void)
Clear instance.
double m_par_logE
Energy for which precomputation is done.
Energy boundaries container class.
GFilename filename(void) const
Return filename.
CTA performance table energy dispersion class.
virtual ~GCTAEdispPerfTable(void)
Destructor.
CTA performance table energy dispersion class definition.
double m_par_sigma
Gaussian sigma.
double operator()(const GEnergy &ereco, const GEnergy &etrue, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0) const
Return energy dispersion in units of MeV .
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
double normal(void)
Returns normal deviates.
double m_par_scale
Gaussian normalization.
GCTAEdisp & operator=(const GCTAEdisp &edisp)
Assignment operator.
void load(const GFilename &filename)
Load energy dispersion from performance table.
GCTAEdispPerfTable(void)
Void constructor.
std::string url(void) const
Return Uniform Resource Locator (URL)
void clear(void)
Clear file name.
GNodeArray m_logE
log(E) nodes for interpolation
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
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.
GEbounds etrue_bounds(const GEnergy &ereco, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0) const
Return true energy interval that contains the energy dispersion.
void init_members(void)
Initialise class members.
double prob_erecobin(const GEnergy &ereco_min, const GEnergy &ereco_max, const GEnergy &etrue, const double &theta) const
Return energy dispersion probability for reconstructed energy interval.
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.
GFilename m_filename
Name of response file.
void update(const double &logE) const
Update energy dispersion parameter cache.
void init_members(void)
Initialise class members.
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.