GammaLib  2.1.0.dev
 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 _______________________________________________ */
36 class GRan;
37 class GXmlElement;
38 class GCTAInstDir;
39 class GEnergy;
40 class GTime;
41 class GCTAInstDir;
42 class GCTAObservation;
43 
44 
45 /***********************************************************************//**
46  * @class GCTAModelSpatialGradient
47  *
48  * @brief Spatial gradient CTA model class
49  ***************************************************************************/
51 
52 public:
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 
84 protected:
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  ***************************************************************************/
101 inline
102 std::string GCTAModelSpatialGradient::classname(void) const
103 {
104  return ("GCTAModelSpatialGradient");
105 }
106 
107 
108 /***********************************************************************//**
109  * @brief Return model type
110  *
111  * @return Model type "Gradient".
112  ***************************************************************************/
113 inline
114 std::string GCTAModelSpatialGradient::type(void) const
115 {
116  return ("Gradient");
117 }
118 
119 
120 /***********************************************************************//**
121  * @brief Return DETX gradient
122  *
123  * @return DETX gradient.
124  ***************************************************************************/
125 inline
127 {
128  return (m_detx_gradient.value());
129 }
130 
131 
132 /***********************************************************************//**
133  * @brief Return DETY gradient
134  *
135  * @return DETY gradient.
136  ***************************************************************************/
137 inline
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  ***************************************************************************/
149 inline
150 void GCTAModelSpatialGradient::detx_gradient(const double& detx_gradient)
151 {
152  m_detx_gradient.value(detx_gradient);
153  return;
154 }
155 
156 
157 /***********************************************************************//**
158  * @brief Set DETY gradient
159  *
160  * @param[in] dety_gradient DETY gradient.
161  ***************************************************************************/
162 inline
163 void GCTAModelSpatialGradient::dety_gradient(const double& dety_gradient)
164 {
165  m_dety_gradient.value(dety_gradient);
166  return;
167 }
168 
169 #endif /* GCTAMODELSPATIALGRADIENT_HPP */
GModelPar m_detx_gradient
DETX gradient.
Abstract spatial model class.
virtual GCTAModelSpatialGradient * clone(void) const
Clone instance.
void copy_members(const GCTAModelSpatialGradient &model)
Copy class members.
virtual void clear(void)
Clear instance.
XML element node class.
Definition: GXmlElement.hpp:48
Random number generator class.
Definition: GRan.hpp:44
Time class.
Definition: GTime.hpp:55
void free_members(void)
Delete class members.
Model parameter class interface definition.
Model parameter class.
Definition: GModelPar.hpp:87
virtual void read(const GXmlElement &xml)
Read model from XML element.
GModelPar m_dety_gradient
DETY gradient.
GCTAModelSpatialGradient(void)
Void constructor.
virtual ~GCTAModelSpatialGradient(void)
Destructor.
GChatter
Definition: GTypemaps.hpp:33
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
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.
void init_members(void)
Initialise class members.
Spatial gradient CTA model class.
double detx_gradient(void) const
Return DETX gradient.
Abstract spatial model class interface definition.
double value(void) const
Return parameter value.
double dety_gradient(void) const
Return DETY gradient.
virtual GCTAModelSpatialGradient & operator=(const GCTAModelSpatialGradient &model)
Assignment operator.
CTA instrument direction class.
Definition: GCTAInstDir.hpp:63
CTA observation class.
virtual std::string type(void) const
Return model type.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48