GammaLib  1.7.0.dev
Go to the documentation of this file.
1 /***************************************************************************
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2011-2018 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
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 /**
23  * @brief Radial Polynom model class interface definition
24  * @author Juergen Knoedlseder
25  */
26
29
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include <vector>
33 #include <cmath>
34 #include "GMath.hpp"
35 #include "GModelPar.hpp"
37 #include "GFunction.hpp"
38
39 /* __ Forward declarations _______________________________________________ */
40 class GRan;
41 class GXmlElement;
42 class GCTAObservation;
43 class GCTAInstDir;
44
45
46 /***********************************************************************//**
48  *
49  * @brief Radial Polynom CTA model class
50  *
51  * This class implements the radial function
52  * \f[f(\theta) = \sum_{i=0}^m c_i \theta^i\f]
53  * where
54  * \f$\theta\f$ is the offset angle (in degrees), and
55  * \f$c_i\f$ are the polynomial coefficients.
56  *
57  * This function represents a Polynom in \f$\theta\f$.
58  ***************************************************************************/
60
61 public:
62  // Constructors and destructors
68
69  // Operators
71
72  // Implemented pure virtual methods
73  virtual void clear(void);
75  virtual std::string classname(void) const;
76  virtual std::string type(void) const;
77  virtual double eval(const double& offset,
78  const bool& gradients = false) const;
79  virtual GCTAInstDir mc(GRan& ran) const;
80  virtual double mc_max_value(const GCTAObservation& obs) const;
81  virtual double omega(void) const;
82  virtual void read(const GXmlElement& xml);
83  virtual void write(GXmlElement& xml) const;
84  virtual std::string print(const GChatter& chatter = NORMAL) const;
85
86  // Other methods
87  //double coeff(void) const;
88  //void coeff(const double& value);
89
90 protected:
91  // Protected methods
92  void init_members(void);
94  void free_members(void);
95  void update_pars(void);
96
97  // Radial integration class (used by omega() method). Note that the
98  // integration is done in radians
99  class integrand : public GFunction {
100  public:
101  integrand(const GCTAModelRadialPolynom* model) : m_model(model) { }
102  double eval(const double& x) {
104  }
105  private:
107  };
108
109  // Protected members
110  std::vector<GModelPar> m_coeffs; //!< Coefficients
111 };
112
113
114 /***********************************************************************//**
115  * @brief Return class name
116  *
117  * @return String containing the class name ("GCTAModelRadialPolynom").
118  ***************************************************************************/
119 inline
121 {
123 }
124
125
126 /***********************************************************************//**
127  * @brief Return model type
128  *
129  * @return Model type "Polynom".
130  ***************************************************************************/
131 inline
133 {
134  return ("Polynom");
135 }
136
void free_members(void)
Delete class members.
virtual double omega(void) const
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
virtual void write(GXmlElement &xml) const
Write model into XML element.
Copy class members.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
XML element node class.
Definition: GXmlElement.hpp:47
Random number generator class.
Definition: GRan.hpp:44
void update_pars(void)
Update parameter mapping.
Model parameter class interface definition.
Destructor.
void init_members(void)
Initialise class members.
virtual GCTAInstDir mc(GRan &ran) const
Returns MC instrument direction.
Single parameter function abstract base class definition.
Abstract radial acceptance model class interface definition.
GChatter
Definition: GTypemaps.hpp:33
Void constructor.
Assignment operator.
virtual void clear(void)
Clear instance.
Single parameter function abstract base class.
Definition: GFunction.hpp:44
virtual std::string classname(void) const
Return class name.
GVector sin(const GVector &vector)
Computes sine of vector elements.
Definition: GVector.cpp:1226
virtual std::string type(void) const
Return model type.
CTA instrument direction class.
Definition: GCTAInstDir.hpp:59