GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GMWLResponse.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GMWLResponse.hpp - Multi-wavelength response class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-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 GMWLResponse.hpp
23  * @brief Multi-wavelength response class interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GMWLRESPONSE_HPP
28 #define GMWLRESPONSE_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include "GResponse.hpp"
32 #include "GEbounds.hpp"
33 
34 /* __ Forward declarations _______________________________________________ */
35 class GEvent;
36 class GPhoton;
37 class GSource;
38 class GObservation;
39 class GEnergy;
40 class GTime;
41 
42 
43 /***********************************************************************//**
44  * @class GMWLResponse
45  *
46  * @brief Multi-wavelength response class
47  *
48  * This class implements a dummy response class for multi-wavelength
49  * observations. Since the multi-wavelength instrument classes handles data
50  * that a provided in photon space, no instrument response is in fact needed.
51  * The dummy response implemented by this class provides a simple diagonal
52  * response matrix that allows integration of multi-wavelength observations
53  * using the standard instrument specific interface.
54  ***************************************************************************/
55 class GMWLResponse : public GResponse {
56 
57 public:
58  // Constructors and destructors
59  GMWLResponse(void);
60  GMWLResponse(const GMWLResponse& rsp);
61  virtual ~GMWLResponse(void);
62 
63  // Operators
64  virtual GMWLResponse& operator=(const GMWLResponse & rsp);
65 
66  // Implemented pure base class virtual methods
67  virtual void clear(void);
68  virtual GMWLResponse* clone(void) const;
69  virtual std::string classname(void) const;
70  virtual bool use_edisp(void) const;
71  virtual bool use_tdisp(void) const;
72  virtual double irf(const GEvent& event,
73  const GPhoton& photon,
74  const GObservation& obs) const;
75  virtual double nroi(const GModelSky& model,
76  const GEnergy& obsEng,
77  const GTime& obsTime,
78  const GObservation& obs) const;
79  virtual GEbounds ebounds(const GEnergy& obsEnergy) const;
80  virtual std::string print(const GChatter& chatter = NORMAL) const;
81 
82  // Overloaded virtual base class methods
83  virtual double irf_spatial(const GEvent& event,
84  const GSource& source,
85  const GObservation& obs) const;
86 
87 protected:
88  // Protected methods
89  void init_members(void);
90  void copy_members(const GMWLResponse& pnt);
91  void free_members(void);
92 };
93 
94 
95 /***********************************************************************//**
96  * @brief Return class name
97  *
98  * @return String containing the class name ("GMWLResponse").
99  ***************************************************************************/
100 inline
101 std::string GMWLResponse::classname(void) const
102 {
103  return ("GMWLResponse");
104 }
105 
106 
107 /***********************************************************************//**
108  * @brief Signal if response uses energy dispersion
109  *
110  * @return True if response uses energy dispersion.
111  ***************************************************************************/
112 inline
113 bool GMWLResponse::use_edisp(void) const
114 {
115  return false;
116 }
117 
118 
119 /***********************************************************************//**
120  * @brief Signal if response uses time dispersion
121  *
122  * @return True if response uses time dispersion.
123  ***************************************************************************/
124 inline
125 bool GMWLResponse::use_tdisp(void) const
126 {
127  return false;
128 }
129 
130 
131 /***********************************************************************//**
132  * @brief Return instrument response function
133  *
134  * @param[in] event Event.
135  * @param[in] photon Photon.
136  * @param[in] obs Observation.
137  *
138  * @return Instrument response function (always 1).
139  ***************************************************************************/
140 inline
141 double GMWLResponse::irf(const GEvent& event,
142  const GPhoton& photon,
143  const GObservation& obs) const
144 {
145  return 1.0;
146 }
147 
148 
149 /***********************************************************************//**
150  * @brief Return instrument response function
151  *
152  * @param[in] event Event.
153  * @param[in] source Source.
154  * @param[in] obs Observation.
155  *
156  * @return Instrument response function (always 1).
157  ***************************************************************************/
158 inline
159 double GMWLResponse::irf_spatial(const GEvent& event,
160  const GSource& source,
161  const GObservation& obs) const
162 {
163  return 1.0;
164 }
165 
166 #endif /* GMWLRESPONSE_HPP */
virtual bool use_edisp(void) const
Signal if response uses energy dispersion.
virtual GMWLResponse * clone(void) const
Clone instance.
Multi-wavelength response class.
virtual double nroi(const GModelSky &model, const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const
Return integral of event probability for a given sky model over ROI.
void copy_members(const GMWLResponse &pnt)
Copy class members.
Abstract interface for the event classes.
Definition: GEvent.hpp:71
virtual std::string print(const GChatter &chatter=NORMAL) const
Print response information.
Time class.
Definition: GTime.hpp:55
void free_members(void)
Delete class members.
Class that handles photons.
Definition: GPhoton.hpp:47
virtual double irf_spatial(const GEvent &event, const GSource &source, const GObservation &obs) const
Return instrument response function.
virtual double irf(const GEvent &event, const GPhoton &photon, const GObservation &obs) const
Return instrument response function.
Energy boundaries container class.
Definition: GEbounds.hpp:60
virtual void clear(void)
Clear instance.
virtual GMWLResponse & operator=(const GMWLResponse &rsp)
Assignment operator.
GChatter
Definition: GTypemaps.hpp:33
Abstract observation base class.
void init_members(void)
Initialise class members.
virtual std::string classname(void) const
Return class name.
Abstract response base class definition.
virtual ~GMWLResponse(void)
Destructor.
virtual GEbounds ebounds(const GEnergy &obsEnergy) const
Return true energy boundaries for a specific observed energy.
Sky model class.
Definition: GModelSky.hpp:122
Energy boundaries class interface definition.
GMWLResponse(void)
Void constructor.
Abstract instrument response base class.
Definition: GResponse.hpp:77
Class that handles gamma-ray sources.
Definition: GSource.hpp:53
virtual bool use_tdisp(void) const
Signal if response uses time dispersion.
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48