GammaLib 2.0.0
Loading...
Searching...
No Matches
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 _______________________________________________ */
36class GXmlElement;
37class GCTAInstDir;
38class GEnergy;
39class GTime;
40class GCTAObservation;
41
42
43/***********************************************************************//**
44 * @class GCTAModelSpatialGaussSpectrum
45 *
46 * @brief Spatial energy dependent Gaussian model class
47 ***************************************************************************/
49
50public:
51 // Constructors and destructors
53 explicit GCTAModelSpatialGaussSpectrum(const double& sigma);
55 explicit GCTAModelSpatialGaussSpectrum(const GXmlElement& xml);
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
81protected:
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 ***************************************************************************/
99inline
101{
102 return ("GCTAModelSpatialGaussSpectrum");
103}
104
105
106/***********************************************************************//**
107 * @brief Return model type
108 *
109 * @return Model type "EnergyDependentGaussian".
110 ***************************************************************************/
111inline
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 ***************************************************************************/
126inline
128{
129 return 1.0;
130}
131
132
133/***********************************************************************//**
134 * @brief Return pointer to sigma spectrum
135 *
136 * @return Pointer to sigma spectrum.
137 ***************************************************************************/
138inline
140{
141 return (m_sigma);
142}
143
144#endif /* GCTAMODELSPATIALGAUSSSPECTRUM_HPP */
Abstract spatial model class interface definition.
Abstract spectral model base class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
CTA instrument direction class.
Spatial energy dependent Gaussian model class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
void free_members(void)
Delete class members.
virtual ~GCTAModelSpatialGaussSpectrum(void)
Destructor.
virtual void write(GXmlElement &xml) const
Write model into XML element.
virtual GCTAModelSpatialGaussSpectrum & operator=(const GCTAModelSpatialGaussSpectrum &model)
Assignment operator.
void copy_members(const GCTAModelSpatialGaussSpectrum &model)
Copy class members.
virtual void read(const GXmlElement &xml)
Read model from XML element.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function.
virtual GCTAModelSpatialGaussSpectrum * clone(void) const
Clone instance.
virtual std::string type(void) const
Return model type.
void init_members(void)
Initialise class members.
virtual void clear(void)
Clear instance.
virtual std::string classname(void) const
Return class name.
const GModelSpectral * sigma(void) const
Return pointer to sigma spectrum.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
Abstract spatial model class.
CTA observation class.
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Abstract spectral model base class.
Time class.
Definition GTime.hpp:55
XML element node class.