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