GammaLib 2.1.0.dev
Loading...
Searching...
No Matches
GCOMModelDRM.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOMModelDRM.hpp - COMPTEL DRM model class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2021 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 GCOMModelDRM.hpp
23 * @brief COMPTEL DRM model class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOMMODELDRM_HPP
28#define GCOMMODELDRM_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GModelData.hpp"
33#include "GModelPar.hpp"
34#include "GEvent.hpp"
35#include "GObservation.hpp"
36#include "GNodeArray.hpp"
37#include "GXmlElement.hpp"
38#include "GCOMEventCube.hpp"
39
40
41/***********************************************************************//**
42 * @class GCOMModelDRM
43 *
44 * @brief COMPTEL DRM model class
45 *
46 * This class implements a COMPTEL data space model. The model has a
47 * normalization parameters.
48 ***************************************************************************/
49class GCOMModelDRM : public GModelData {
50
51public:
52 // Constructors and destructors
53 GCOMModelDRM(void);
54 explicit GCOMModelDRM(const GXmlElement& xml);
55 GCOMModelDRM(const GCOMModelDRM& model);
56 virtual ~GCOMModelDRM(void);
57
58 // Operators
59 virtual GCOMModelDRM& operator=(const GCOMModelDRM& model);
60
61 // Implemented pure virtual methods
62 virtual void clear(void);
63 virtual GCOMModelDRM* clone(void) const;
64 virtual std::string classname(void) const;
65 virtual std::string type(void) const;
66 virtual bool is_constant(void) const;
67 virtual double eval(const GEvent& event,
68 const GObservation& obs,
69 const bool& gradients = false) const;
70 virtual double npred(const GEnergy& obsEng, const GTime& obsTime,
71 const GObservation& obs) const;
72 virtual GCOMEventCube* mc(const GObservation& obs, GRan& ran) const;
73 virtual void read(const GXmlElement& xml);
74 virtual void write(GXmlElement& xml) const;
75 virtual std::string print(const GChatter& chatter = NORMAL) const;
76
77protected:
78 // Protected methods
79 void init_members(void);
80 void copy_members(const GCOMModelDRM& model);
81 void free_members(void);
82
83 // Proteced data members
84 GModelPar m_norm; //!< Normalisation
85 GCOMDri m_drm; //!< Model
86 GFilename m_filename; //!< Name of DRM FITS file
87};
88
89
90/***********************************************************************//**
91 * @brief Return class name
92 *
93 * @return String containing the class name ("GCOMModelDRM").
94 ***************************************************************************/
95inline
96std::string GCOMModelDRM::classname(void) const
97{
98 return ("GCOMModelDRM");
99}
100
101
102/***********************************************************************//**
103 * @brief Return model type
104 *
105 * @return Model type.
106 *
107 * Returns the type of the model. The type for a DRM model is "DRM".
108 ***************************************************************************/
109inline
110std::string GCOMModelDRM::type(void) const
111{
112 return ("DRM");
113}
114
115
116/***********************************************************************//**
117 * @brief Signals if model is temporally constant
118 *
119 * @return True if model is temporally constant, false otherwise.
120 *
121 * Signals if the model is temporally constant. By definition, a DRM model
122 * is always temporally constant.
123 ***************************************************************************/
124inline
126{
127 return (true);
128}
129
130#endif /* GCOMMODELDRM_HPP */
COMPTEL event bin container class interface definition.
Abstract event base class definition.
Abstract data model base class interface definition.
Model parameter class interface definition.
Node array class interface definition.
Abstract observation base class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
XML element node class interface definition.
COMPTEL Data Space class.
Definition GCOMDri.hpp:62
COMPTEL event bin container class.
COMPTEL DRM model class.
GCOMModelDRM(void)
Void constructor.
virtual double eval(const GEvent &event, const GObservation &obs, const bool &gradients=false) const
Evaluate function.
virtual void read(const GXmlElement &xml)
Read model from XML element.
void copy_members(const GCOMModelDRM &model)
Copy class members.
virtual GCOMEventCube * mc(const GObservation &obs, GRan &ran) const
Return simulated list of events.
virtual double npred(const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const
Return spatially integrated DRM model.
virtual void clear(void)
Clear instance.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print model information.
virtual void write(GXmlElement &xml) const
Write model into XML element.
GModelPar m_norm
Normalisation.
void free_members(void)
Delete class members.
virtual GCOMModelDRM & operator=(const GCOMModelDRM &model)
Assignment operator.
virtual ~GCOMModelDRM(void)
Destructor.
void init_members(void)
Initialise class members.
virtual bool is_constant(void) const
Signals if model is temporally constant.
virtual std::string classname(void) const
Return class name.
GFilename m_filename
Name of DRM FITS file.
GCOMDri m_drm
Model.
virtual std::string type(void) const
Return model type.
virtual GCOMModelDRM * clone(void) const
Clone instance.
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Abstract interface for the event classes.
Definition GEvent.hpp:71
Filename class.
Definition GFilename.hpp:62
Abstract data model class.
Model parameter class.
Definition GModelPar.hpp:87
Abstract observation base class.
Random number generator class.
Definition GRan.hpp:44
Time class.
Definition GTime.hpp:55
XML element node class.