40 #define G_PSF_RADIAL_KERNS_PHI "cta_psf_radial_kerns_phi::eval(double&)"
73 int size = (
m_grad) ? nengs * (npars+1) : nengs;
97 const double& theta_max,
137 double alpha_reco =
m_par_cel ? obsDir.
ra() : obsDir.
l();
139 double sin_beta_0 =
std::sin(beta_0);
140 double cos_beta_0 =
std::cos(beta_0);
141 double tan_beta_0 =
std::tan(beta_0);
142 double sin_beta_reco =
std::sin(beta_reco);
143 double cos_beta_reco =
std::cos(beta_reco);
144 double sin_dalpha =
std::sin(alpha_0 - alpha_reco);
145 double cos_dalpha =
std::cos(alpha_0 - alpha_reco);
146 double arg = cos_beta_reco * tan_beta_0 -
147 sin_beta_reco * cos_dalpha;
148 double denom = sin_dalpha * sin_dalpha + arg * arg;
159 m_dphi_dalpha_0 = (sin_beta_reco - cos_dalpha * cos_beta_reco * tan_beta_0) /
161 m_dphi_dbeta_0 = (sin_dalpha * cos_beta_reco * (1.0 + tan_beta_0 * tan_beta_0)) /
230 double phi_min = -dphi;
231 double phi_max = +dphi;
236 double sin_delta_sin_zeta = sin_delta *
m_sin_zeta;
237 double sin_delta_cos_zeta = sin_delta *
m_cos_zeta;
243 double cos_delta_sin_zeta = cos_delta *
m_sin_zeta;
244 double cos_delta_cos_zeta = cos_delta *
m_cos_zeta;
261 double value = irf[0];
264 for (
int i = 0; i < nengs; ++i) {
274 values[i] = value * psf;
279 for (
int k = 1, ig = i+nengs; k <= npars; ++k, ig += nengs) {
280 values[ig] = irf[k] * psf;
295 static const GTime srcTime;
309 double value = integral.
romberg(phi_min, phi_max,
m_iter) * sin_delta;
312 for (
int i = 0; i < nengs; ++i) {
320 values[i] = value * psf;
378 static const GTime srcTime;
398 double theta_kluge = theta - 1.0e-12;
399 if (theta_kluge < 0.0) {
413 double sin_theta2 = 1.0 - cos_theta * cos_theta;
414 double sin_theta = (sin_theta2 > 0.0) ?
std::sqrt(sin_theta2) : 0.0;
417 if (sin_theta != 0.0) {
418 double norm = 1.0 / sin_theta;
447 for (
int i = 1, k = 0; i <
m_size; ++i, ++k) {
453 #if defined(G_NAN_CHECK)
456 std::string msg =
"NaN/Inf encountered for phi="+
gammalib::str(phi);
CTA response helper classes definition.
GVector eval(const double &delta)
Kernel for PSF integration of radial model.
double m_dzeta_dalpha_0
d(zeta)/d(alpha0)
double roi_arclength(const double &rad, const double &dist, const double &cosdist, const double &sindist, const double &roi, const double &cosroi)
Returns length of circular arc within circular ROI.
const double & factor_gradient(void) const
Return parameter factor gradient.
double norm(const GVector &vector)
Computes vector norm.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
double m_cos_zeta
Cosine of m_zeta.
CTA cube-style response function class definition.
void warning(const std::string &origin, const std::string &message)
Emits warning.
int size(void) const
Return number of parameters.
const double & b(void) const
Return galactic latitude in radians.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
Abstract radial spatial model base class interface definition.
double m_dzeta_dbeta_0
d(zeta)/d(beta0)
CTA cube-style response function class.
void fixed_iter(const int &iter)
Set fixed number of iterations.
GSkyDir m_obsDir
Reconstructed event direction.
std::string coordsys(void) const
Return coordinate system.
double acos(const double &arg)
Computes acos by avoiding NaN due to rounding errors.
double m_cos_delta_sin_zeta
cos(delta) * sin(zeta)
cta_psf_radial_kerns_delta * m_outer
Pointer to outer integr.
int m_iter
Integration iterations.
double m_sin_delta_cos_zeta
sin(delta) * cos(zeta)
GIntegral class interface definition.
GVector eval(const double &phi)
Kernel for azimuthal radial model integration.
const double & ra(void) const
Return Right Ascension in radians.
bool m_par_cel
Celestial or galactic coordinates.
double m_dphi_dbeta_0
d(phi)/d(beta0)
GModelPar * m_par_lat
Latitude parameter.
const GCTAResponseCube * m_rsp
Response cube.
bool is_notanumber(const double &x)
Signal if argument is not a number.
Model parameter class interface definition.
bool is_infinite(const double &x)
Signal if argument is infinite.
virtual double eval(const double &theta, const GEnergy &energy, const GTime &time, const bool &gradients=false) const =0
double m_zeta
Distance of model from Psf.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
bool m_grad
Compute gradients.
const GSkyDir & dir(void) const
Return position of radial spatial model.
Kernel for Psf phi angle integration used for stacked analysis.
GVector tan(const GVector &vector)
Computes tangens of vector elements.
cta_psf_radial_kerns_delta(const GCTAResponseCube *rsp, const GModelSpatialRadial *model, const GSkyDir &obsDir, const GEnergies &srcEngs, const double &zeta, const double &theta_max, const int &iter, const bool &grad)
Kernel constructor for PSF integration of radial model.
const GCTACubePsf & psf(void) const
Return cube analysis point spread function.
Integration class for set of functions interface definition.
int size(void) const
Return number of energies in container.
Implementation of CTA helper classes for stacked vector response.
GVector m_values
Return value.
GModelPar * m_par_lon
Longitude parameter.
double m_cos_delta_cos_zeta
cos(delta) * cos(zeta)
const double & l(void) const
Return galactic longitude in radians.
const double & dec(void) const
Return Declination in radians.
double m_sin_zeta
Sine of m_zeta.
GEnergies m_srcEngs
True photon energies.
Kernel for radial spatial model PSF phi angle integration.
double m_sin_delta_sin_zeta
sin(delta) * sin(zeta)
double m_dphi_dalpha_0
d(phi)/d(alpha0)
GVector sin(const GVector &vector)
Computes sine of vector elements.
GVector romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
#define G_PSF_RADIAL_KERNS_PHI
void fixed_iter(const int &iter)
Set fixed number of iterations.
int size(void) const
Return size of vector kernel for PSF integration of radial model.
Abstract radial spatial model base class.
Integration class for set of functions.
double m_theta_max
Maximum model radius.
double m_cos_theta_max
Cosine of m_theta_max.
Class that handles energies in a unit independent way.
const GModelSpatialRadial * m_model
Radial model.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.