GammaLib 2.1.0.dev
Loading...
Searching...
No Matches
GCTAModelSpatialMultiplicative.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCTAModelSpatialMultiplicative.hpp - Multiplicative spatial model class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2018-2020 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 GCTAModelSpatialMultiplicative.hpp
23 * @brief Multiplicative spatial model class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCTAMODELSPATIALMULTIPLICATIVE_HPP
28#define GCTAMODELSPATIALMULTIPLICATIVE_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <vector>
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 GCTAModelSpatialMultiplicative
47 *
48 * @brief Multiplicative spatial model class
49 *
50 * This class implements a multiplicative spatial component of the CTA
51 * background model.
52 ***************************************************************************/
54
55public:
56 // Constructors and destructors
61
62 // Operators
64
65 // Pure virtual methods
66 virtual void clear(void);
67 virtual GCTAModelSpatialMultiplicative* clone(void) const;
68 virtual std::string classname(void) const;
69 virtual std::string type(void) const;
70 virtual double eval(const GCTAInstDir& dir,
71 const GEnergy& energy,
72 const GTime& time,
73 const bool& gradients = false) const;
74 virtual double mc_max_value(const GCTAObservation& obs) const;
75 virtual void read(const GXmlElement& xml);
76 virtual void write(GXmlElement& xml) const;
77 virtual std::string print(const GChatter& chatter = NORMAL) const;
78
79 // Other methods
80 void append(const GCTAModelSpatial& spatial,
81 const std::string& name="");
82 int components(void) const;
83 const GCTAModelSpatial* component(const int& index) const;
84 const GCTAModelSpatial* component(const std::string& name) const;
85
86protected:
87 // Protected methods
88 void init_members(void);
90 void free_members(void);
91
92 // Protected members
93 std::string m_type; //!< Model type
94 std::vector<GCTAModelSpatial*> m_spatial; //!< Container of spatial models
95 std::vector<std::string> m_components; //!< Names of components
96};
97
98
99/***********************************************************************//**
100 * @brief Return class name
101 *
102 * @return String containing the class name ("GCTAModelSpatialMultiplicative").
103 ***************************************************************************/
104inline
106{
107 return ("GCTAModelSpatialMultiplicative");
108}
109
110
111/***********************************************************************//**
112 * @brief Return model type
113 *
114 * @return Model type.
115 *
116 * Returns the type of the spatial multiplicative model.
117 ***************************************************************************/
118inline
120{
121 return (m_type);
122}
123
124
125/***********************************************************************//**
126 * @brief Return number of spatial components
127 *
128 * @return Number of model components.
129 *
130 * Returns the number of spatial components.
131 ***************************************************************************/
132inline
134{
135 return ((int)m_spatial.size());
136}
137
138#endif /* GCTAMODELSPATIALMULTIPLICATIVE_HPP */
Abstract spatial model class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
CTA instrument direction class.
Multiplicative spatial model class.
virtual GCTAModelSpatialMultiplicative & operator=(const GCTAModelSpatialMultiplicative &model)
Assignment operator.
int components(void) const
Return number of spatial components.
void init_members(void)
Initialise class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print multiplicative spatial model information.
void append(const GCTAModelSpatial &spatial, const std::string &name="")
Append spatial component.
virtual std::string classname(void) const
Return class name.
virtual void clear(void)
Clear instance.
std::vector< GCTAModelSpatial * > m_spatial
Container of spatial models.
const GCTAModelSpatial * component(const int &index) const
Return spatial model component by index.
void copy_members(const GCTAModelSpatialMultiplicative &model)
Copy class members.
virtual double eval(const GCTAInstDir &dir, const GEnergy &energy, const GTime &time, const bool &gradients=false) const
Evaluate function (in units of sr^-1)
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
virtual std::string type(void) const
Return model type.
virtual void write(GXmlElement &xml) const
Write model into XML element.
void free_members(void)
Delete class members.
virtual GCTAModelSpatialMultiplicative * clone(void) const
Clone instance.
std::vector< std::string > m_components
Names of components.
virtual void read(const GXmlElement &xml)
Read model from XML element.
Abstract spatial model class.
CTA observation class.
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Random number generator class.
Definition GRan.hpp:44
Time class.
Definition GTime.hpp:55
XML element node class.