GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cta_helpers_response_stacked_vector.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * CTA helper classes for stacked vector response *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2020-2022 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file cta_helpers_response_stacked_vector.hpp
23  * @brief Defintion of CTA helper classes for stacked vector response
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef CTA_HELPERS_RESPONSE_STACKED_VECTOR_HPP
28 #define CTA_HELPERS_RESPONSE_STACKED_VECTOR_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include "GSkyDir.hpp"
32 #include "GEnergies.hpp"
33 #include "GVector.hpp"
34 #include "GFunctions.hpp"
35 #include "GModelSpatialRadial.hpp"
36 
37 /* __ Forward declarations _______________________________________________ */
38 class GModelPar;
39 class GCTAResponseCube;
40 
41 
42 /***********************************************************************//**
43  * @class cta_psf_radial_kerns_delta
44  *
45  * @brief Kernel for radial spatial model PSF delta angle integration
46  *
47  * This class provides the kernel for the radial spatial model integration
48  * of the delta angle of the PSF system.
49  ***************************************************************************/
52 public:
54  const GModelSpatialRadial* model,
55  const GSkyDir& obsDir,
56  const GEnergies& srcEngs,
57  const double& zeta,
58  const double& theta_max,
59  const int& iter,
60  const bool& grad);
61  int size(void) const;
62  GVector eval(const double& delta);
63 protected:
64  const GCTAResponseCube* m_rsp; //!< Response cube
65  const GModelSpatialRadial* m_model; //!< Radial model
66  GModelPar* m_par_lon; //!< Longitude parameter
67  GModelPar* m_par_lat; //!< Latitude parameter
68  bool m_par_cel; //!< Celestial or galactic coordinates
69  GSkyDir m_obsDir; //!< Reconstructed event direction
70  GEnergies m_srcEngs; //!< True photon energies
71  double m_zeta; //!< Distance of model from Psf
72  double m_cos_zeta; //!< Cosine of m_zeta
73  double m_sin_zeta; //!< Sine of m_zeta
74  double m_theta_max; //!< Maximum model radius
75  double m_cos_theta_max; //!< Cosine of m_theta_max
76  double m_dzeta_dalpha_0; //!< d(zeta)/d(alpha0)
77  double m_dzeta_dbeta_0; //!< d(zeta)/d(beta0)
78  double m_dphi_dalpha_0; //!< d(phi)/d(alpha0)
79  double m_dphi_dbeta_0; //!< d(phi)/d(beta0)
80  int m_iter; //!< Integration iterations
81  bool m_grad; //!< Compute gradients
82 };
83 
84 
85 /***********************************************************************//**
86  * @class cta_psf_radial_kerns_phi
87  *
88  * @brief Kernel for radial spatial model PSF phi angle integration
89  *
90  * This class provides the kernel for the radial spatial model integration
91  * of the azimuth angle of the PSF system.
92  *
93  * The eval() method of the kernel returns a vector that contains for a
94  * given azimuth angle phi the model value and all model parameter gradients.
95  ***************************************************************************/
97 public:
99  const double& sin_delta_sin_zeta,
100  const double& sin_delta_cos_zeta,
101  const double& cos_delta_sin_zeta,
102  const double& cos_delta_cos_zeta) :
103  m_outer(outer),
104  m_size(outer->m_model->size()+1),
105  m_sin_delta_sin_zeta(sin_delta_sin_zeta),
106  m_sin_delta_cos_zeta(sin_delta_cos_zeta),
107  m_cos_delta_sin_zeta(cos_delta_sin_zeta),
108  m_cos_delta_cos_zeta(cos_delta_cos_zeta),
109  m_values(GVector(outer->m_model->size()+1)) { }
110  int size(void) const { return m_size; }
111  GVector eval(const double& phi);
112 protected:
113  cta_psf_radial_kerns_delta* m_outer; //!< Pointer to outer integr.
114  int m_size; //!< Result size
115  double m_sin_delta_sin_zeta; //!< sin(delta) * sin(zeta)
116  double m_sin_delta_cos_zeta; //!< sin(delta) * cos(zeta)
117  double m_cos_delta_sin_zeta; //!< cos(delta) * sin(zeta)
118  double m_cos_delta_cos_zeta; //!< cos(delta) * cos(zeta)
119  GVector m_values; //!< Return value
120 };
121 
122 #endif /* CTA_HELPERS_RESPONSE_STACKED_VECTOR_HPP */
GVector eval(const double &delta)
Kernel for PSF integration of radial model.
Sky direction class interface definition.
Abstract radial spatial model base class interface definition.
CTA cube-style response function class.
GSkyDir m_obsDir
Reconstructed event direction.
double m_cos_delta_sin_zeta
cos(delta) * sin(zeta)
cta_psf_radial_kerns_delta * m_outer
Pointer to outer integr.
double m_sin_delta_cos_zeta
sin(delta) * cos(zeta)
GVector eval(const double &phi)
Kernel for azimuthal radial model integration.
Energy container class.
Definition: GEnergies.hpp:60
bool m_par_cel
Celestial or galactic coordinates.
cta_psf_radial_kerns_phi(cta_psf_radial_kerns_delta *outer, const double &sin_delta_sin_zeta, const double &sin_delta_cos_zeta, const double &cos_delta_sin_zeta, const double &cos_delta_cos_zeta)
GModelPar * m_par_lat
Latitude parameter.
const GCTAResponseCube * m_rsp
Response cube.
Model parameter class.
Definition: GModelPar.hpp:87
Kernel for radial spatial model PSF delta angle integration.
double m_zeta
Distance of model from Psf.
Single parameter functions abstract base class definition.
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.
Energy container class definition.
GModelPar * m_par_lon
Longitude parameter.
double m_cos_delta_cos_zeta
cos(delta) * cos(zeta)
Vector class interface definition.
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)
int size(void) const
Return size of vector kernel for PSF integration of radial model.
Abstract radial spatial model base class.
Vector class.
Definition: GVector.hpp:46
double m_cos_theta_max
Cosine of m_theta_max.
Sky direction class.
Definition: GSkyDir.hpp:62
Single parameter functions abstract base class.
Definition: GFunctions.hpp:50
const GModelSpatialRadial * m_model
Radial model.