GammaLib  1.7.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-2015 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 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 irf(const GEvent& event,
76  const GSource& source,
77  const GObservation& obs) const;
78  virtual double nroi(const GModelSky& model,
79  const GEnergy& obsEng,
80  const GTime& obsTime,
81  const GObservation& obs) const;
82  virtual GEbounds ebounds(const GEnergy& obsEnergy) const;
83  virtual std::string print(const GChatter& chatter = NORMAL) const;
84 
85 protected:
86  // Protected methods
87  void init_members(void);
88  void copy_members(const GMWLResponse& pnt);
89  void free_members(void);
90 };
91 
92 
93 /***********************************************************************//**
94  * @brief Return class name
95  *
96  * @return String containing the class name ("GMWLResponse").
97  ***************************************************************************/
98 inline
99 std::string GMWLResponse::classname(void) const
100 {
101  return ("GMWLResponse");
102 }
103 
104 
105 /***********************************************************************//**
106  * @brief Signal if response uses energy dispersion
107  *
108  * @return True if response uses energy dispersion.
109  ***************************************************************************/
110 inline
111 bool GMWLResponse::use_edisp(void) const
112 {
113  return false;
114 }
115 
116 
117 /***********************************************************************//**
118  * @brief Signal if response uses time dispersion
119  *
120  * @return True if response uses time dispersion.
121  ***************************************************************************/
122 inline
123 bool GMWLResponse::use_tdisp(void) const
124 {
125  return false;
126 }
127 
128 
129 /***********************************************************************//**
130  * @brief Return instrument response function
131  *
132  * @param[in] event Event.
133  * @param[in] photon Photon.
134  * @param[in] obs Observation.
135  *
136  * @return Instrument response function (always 1).
137  ***************************************************************************/
138 inline
139 double GMWLResponse::irf(const GEvent& event, const GPhoton& photon,
140  const GObservation& obs) const
141 {
142  return 1.0;
143 }
144 
145 
146 /***********************************************************************//**
147  * @brief Return instrument response function
148  *
149  * @param[in] event Event.
150  * @param[in] source Source.
151  * @param[in] obs Observation.
152  *
153  * @return Instrument response function (always 1).
154  ***************************************************************************/
155 inline
156 double GMWLResponse::irf(const GEvent& event, const GSource& source,
157  const GObservation& obs) const
158 {
159  return 1.0;
160 }
161 
162 #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:54
void free_members(void)
Delete class members.
Class that handles photons.
Definition: GPhoton.hpp:47
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:120
Energy boundaries class interface definition.
GMWLResponse(void)
Void constructor.
Abstract instrument response base class.
Definition: GResponse.hpp:67
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