Loading [MathJax]/jax/input/TeX/config.js
GammaLib 2.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAModelSpatialGradient.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCTAModelSpatialGradient.hpp - Spatial gradient CTA model class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2018 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 GCTAModelSpatialGradient.hpp
23 * @brief Spatial gradient CTA interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCTAMODELSPATIALGRADIENT_HPP
28#define GCTAMODELSPATIALGRADIENT_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GModelPar.hpp"
33#include "GCTAModelSpatial.hpp"
34
35/* __ Forward declarations _______________________________________________ */
36class GRan;
37class GXmlElement;
38class GCTAInstDir;
39class GEnergy;
40class GTime;
41class GCTAInstDir;
42class GCTAObservation;
43
44
45/***********************************************************************//**
46 * @class GCTAModelSpatialGradient
47 *
48 * @brief Spatial gradient CTA model class
49 ***************************************************************************/
51
52public:
53 // Constructors and destructors
56 const double& dety_gradient);
57 explicit GCTAModelSpatialGradient(const GXmlElement& xml);
59 virtual ~GCTAModelSpatialGradient(void);
60
61 // Operators
63
64 // Implemented pure virtual methods
65 virtual void clear(void);
66 virtual GCTAModelSpatialGradient* clone(void) const;
67 virtual std::string classname(void) const;
68 virtual std::string type(void) const;
69 virtual double eval(const GCTAInstDir& dir,
70 const GEnergy& energy,
71 const GTime& time,
72 const bool& gradients = false) const;
73 virtual double mc_max_value(const GCTAObservation& obs) const;
74 virtual void read(const GXmlElement& xml);
75 virtual void write(GXmlElement& xml) const;
76 virtual std::string print(const GChatter& chatter = NORMAL) const;
77
78 // Other methods
79 double detx_gradient(void) const;
80 double dety_gradient(void) const;
81 void detx_gradient(const double& detx_gradient);
82 void dety_gradient(const double& dety_gradient);
83
84protected:
85 // Protected methods
86 void init_members(void);
87 void copy_members(const GCTAModelSpatialGradient& model);
88 void free_members(void);
89
90 // Protected members
91 GModelPar m_detx_gradient; //!< DETX gradient
92 GModelPar m_dety_gradient; //!< DETY gradient
93};
94
95
96/***********************************************************************//**
97 * @brief Return class name
98 *
99 * @return String containing the class name ("GCTAModelSpatialGradient").
100 ***************************************************************************/
101inline
103{
104 return ("GCTAModelSpatialGradient");
105}
106
107
108/***********************************************************************//**
109 * @brief Return model type
110 *
111 * @return Model type "Gradient".
112 ***************************************************************************/
113inline
114std::string GCTAModelSpatialGradient::type(void) const
115{
116 return ("Gradient");
117}
118
119
120/***********************************************************************//**
121 * @brief Return DETX gradient
122 *
123 * @return DETX gradient.
124 ***************************************************************************/
125inline
127{
128 return (m_detx_gradient.value());
129}
130
131
132/***********************************************************************//**
133 * @brief Return DETY gradient
134 *
135 * @return DETY gradient.
136 ***************************************************************************/
137inline
139{
140 return (m_dety_gradient.value());
141}
142
143
144/***********************************************************************//**
145 * @brief Set DETX gradient
146 *
147 * @param[in] detx_gradient DETX gradient.
148 ***************************************************************************/
149inline
150void GCTAModelSpatialGradient::detx_gradient(const double& detx_gradient)
151{
153 return;
154}
155
156
157/***********************************************************************//**
158 * @brief Set DETY gradient
159 *
160 * @param[in] dety_gradient DETY gradient.
161 ***************************************************************************/
162inline
163void GCTAModelSpatialGradient::dety_gradient(const double& dety_gradient)
164{
166 return;
167}
168
169#endif /* GCTAMODELSPATIALGRADIENT_HPP */
Abstract spatial model class interface definition.
Model parameter class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
CTA instrument direction class.
Spatial gradient CTA model class.
void free_members(void)
Delete class members.
virtual std::string classname(void) const
Return class name.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
virtual GCTAModelSpatialGradient & operator=(const GCTAModelSpatialGradient &model)
Assignment operator.
double dety_gradient(void) const
Return DETY gradient.
GModelPar m_detx_gradient
DETX gradient.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual void clear(void)
Clear instance.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
void init_members(void)
Initialise class members.
virtual GCTAModelSpatialGradient * clone(void) const
Clone instance.
virtual std::string type(void) const
Return model type.
virtual ~GCTAModelSpatialGradient(void)
Destructor.
virtual void write(GXmlElement &xml) const
Write model into XML element.
GModelPar m_dety_gradient
DETY gradient.
double detx_gradient(void) const
Return DETX gradient.
GCTAModelSpatialGradient(void)
Void constructor.
void copy_members(const GCTAModelSpatialGradient &model)
Copy class members.
Abstract spatial model class.
CTA observation class.
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Model parameter class.
Definition GModelPar.hpp:87
double value(void) const
Return parameter value.
Random number generator class.
Definition GRan.hpp:44
Time class.
Definition GTime.hpp:55
XML element node class.