GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAModelSpatialGaussSpectrum.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCTAModelSpatialGaussSpectrum.hpp - Spatial energy dependent Gaussian *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2019 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 GCTAModelSpatialGaussSpectrum.hpp
23  * @brief Spatial energy dependent Gaussian interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCTAMODELSPATIALGAUSSSPECTRUM_HPP
28 #define GCTAMODELSPATIALGAUSSSPECTRUM_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GModelSpectral.hpp"
33 #include "GCTAModelSpatial.hpp"
34 
35 /* __ Forward declarations _______________________________________________ */
36 class GXmlElement;
37 class GCTAInstDir;
38 class GEnergy;
39 class GTime;
40 class GCTAObservation;
41 
42 
43 /***********************************************************************//**
44  * @class GCTAModelSpatialGaussSpectrum
45  *
46  * @brief Spatial energy dependent Gaussian model class
47  ***************************************************************************/
49 
50 public:
51  // Constructors and destructors
53  explicit GCTAModelSpatialGaussSpectrum(const double& sigma);
54  explicit GCTAModelSpatialGaussSpectrum(const GModelSpectral& sigma);
55  explicit GCTAModelSpatialGaussSpectrum(const GXmlElement& xml);
57  virtual ~GCTAModelSpatialGaussSpectrum(void);
58 
59  // Operators
61 
62  // Implemented pure virtual methods
63  virtual void clear(void);
64  virtual GCTAModelSpatialGaussSpectrum* clone(void) const;
65  virtual std::string classname(void) const;
66  virtual std::string type(void) const;
67  virtual double eval(const GCTAInstDir& dir,
68  const GEnergy& energy,
69  const GTime& time,
70  const bool& gradients = false) const;
71  virtual double mc_max_value(const GCTAObservation& obs) const;
72  virtual void read(const GXmlElement& xml);
73  virtual void write(GXmlElement& xml) const;
74  virtual std::string print(const GChatter& chatter = NORMAL) const;
75 
76  // Other methods
77  const GModelSpectral* sigma(void) const;
78  void sigma(const double& sigma);
79  void sigma(const GModelSpectral& sigma);
80 
81 protected:
82  // Protected methods
83  void init_members(void);
85  void free_members(void);
86  void set_pointers(void);
87 
88 
89  // Protected members
90  GModelSpectral* m_sigma; // Pointer to sigma spectrum
91 };
92 
93 
94 /***********************************************************************//**
95  * @brief Return class name
96  *
97  * @return String containing the class name ("GCTAModelSpatialGaussSpectrum").
98  ***************************************************************************/
99 inline
101 {
102  return ("GCTAModelSpatialGaussSpectrum");
103 }
104 
105 
106 /***********************************************************************//**
107  * @brief Return model type
108  *
109  * @return Model type "EnergyDependentGaussian".
110  ***************************************************************************/
111 inline
112 std::string GCTAModelSpatialGaussSpectrum::type(void) const
113 {
114  return ("EnergyDependentGaussian");
115 }
116 
117 
118 /***********************************************************************//**
119  * @brief Return maximum function value for Monte Carlo simulations
120  *
121  * @param[in] obs CTA Observation.
122  * @return Maximum function value for Monte Carlo simulations.
123  *
124  * This method always returns 1.
125  ***************************************************************************/
126 inline
128 {
129  return 1.0;
130 }
131 
132 
133 /***********************************************************************//**
134  * @brief Return pointer to sigma spectrum
135  *
136  * @return Pointer to sigma spectrum.
137  ***************************************************************************/
138 inline
140 {
141  return (m_sigma);
142 }
143 
144 #endif /* GCTAMODELSPATIALGAUSSSPECTRUM_HPP */
virtual ~GCTAModelSpatialGaussSpectrum(void)
Destructor.
Abstract spatial model class.
virtual void clear(void)
Clear instance.
Abstract spectral model base class.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
XML element node class.
Definition: GXmlElement.hpp:48
virtual GCTAModelSpatialGaussSpectrum * clone(void) const
Clone instance.
Time class.
Definition: GTime.hpp:55
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual std::string classname(void) const
Return class name.
virtual GCTAModelSpatialGaussSpectrum & operator=(const GCTAModelSpatialGaussSpectrum &model)
Assignment operator.
virtual std::string type(void) const
Return model type.
const GModelSpectral * sigma(void) const
Return pointer to sigma spectrum.
GChatter
Definition: GTypemaps.hpp:33
Spatial energy dependent Gaussian model class.
void copy_members(const GCTAModelSpatialGaussSpectrum &model)
Copy class members.
Abstract spectral model base class interface definition.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
GCTAModelSpatialGaussSpectrum(void)
Void constructor.
Abstract spatial model class interface definition.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
virtual void read(const GXmlElement &xml)
Read model from XML element.
CTA instrument direction class.
Definition: GCTAInstDir.hpp:63
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
CTA observation class.
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48