GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTAResponse.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCTAResponse.cpp - CTA 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 GCTAResponse.cpp
23  * @brief CTA response class implementation
24  * @author Juergen Knoedlseder
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "GEvent.hpp"
32 #include "GSource.hpp"
33 #include "GObservations.hpp"
34 #include "GModelSpatial.hpp"
36 #include "GCTAResponse.hpp"
37 #include "GCTASupport.hpp"
38 
39 /* __ Method name definitions ____________________________________________ */
40 #define G_IRF "GCTAResponse::irf(GEvent&, GSource&, GObservation&)"
41 
42 /* __ Macros _____________________________________________________________ */
43 
44 /* __ Coding definitions _________________________________________________ */
45 
46 /* __ Debug definitions __________________________________________________ */
47 
48 /* __ Constants __________________________________________________________ */
49 
50 
51 /*==========================================================================
52  = =
53  = Constructors/destructors =
54  = =
55  ==========================================================================*/
56 
57 /***********************************************************************//**
58  * @brief Void constructor
59  *
60  * Constructs void CTA response.
61  ***************************************************************************/
63 {
64  // Initialise members
65  init_members();
66 
67  // Return
68  return;
69 }
70 
71 
72 /***********************************************************************//**
73  * @brief Copy constructor
74  *
75  * @param[in] rsp CTA response.
76  *
77  * Constructs CTA response by making a deep copy of an existing object.
78  **************************************************************************/
80 {
81  // Initialise members
82  init_members();
83 
84  // Copy members
85  copy_members(rsp);
86 
87  // Return
88  return;
89 }
90 
91 
92 /***********************************************************************//**
93  * @brief Destructor
94  *
95  * Destroys instance of CTA response object.
96  ***************************************************************************/
98 {
99  // Free members
100  free_members();
101 
102  // Return
103  return;
104 }
105 
106 
107 /*==========================================================================
108  = =
109  = Operators =
110  = =
111  ==========================================================================*/
112 
113 /***********************************************************************//**
114  * @brief Assignment operator
115  *
116  * @param[in] rsp CTA response.
117  * @return CTA response.
118  *
119  * Assigns CTA response object to another CTA response object. The assignment
120  * performs a deep copy of all information, hence the original object from
121  * which the assignment has been performed can be destroyed after this
122  * operation without any loss of information.
123  ***************************************************************************/
125 {
126  // Execute only if object is not identical
127  if (this != &rsp) {
128 
129  // Copy base class members
130  this->GResponse::operator=(rsp);
131 
132  // Free members
133  free_members();
134 
135  // Initialise members
136  init_members();
137 
138  // Copy members
139  copy_members(rsp);
140 
141  } // endif: object was not identical
142 
143  // Return this object
144  return *this;
145 }
146 
147 
148 /*==========================================================================
149  = =
150  = Public methods =
151  = =
152  ==========================================================================*/
153 
154 /*==========================================================================
155  = =
156  = Private methods =
157  = =
158  ==========================================================================*/
159 
160 /***********************************************************************//**
161  * @brief Initialise class members
162  ***************************************************************************/
164 {
165  // Return
166  return;
167 }
168 
169 
170 /***********************************************************************//**
171  * @brief Copy class members
172  *
173  * @param[in] rsp Response to be copied
174  ***************************************************************************/
176 {
177  // Return
178  return;
179 }
180 
181 
182 /***********************************************************************//**
183  * @brief Delete class members
184  ***************************************************************************/
186 {
187  // Return
188  return;
189 }
Abstract spatial model base class interface definition.
void copy_members(const GCTAResponse &rsp)
Copy class members.
Source class definition.
void init_members(void)
Initialise class members.
virtual GCTAResponse & operator=(const GCTAResponse &rsp)
Assignment operator.
Definition of support function used by CTA classes.
virtual ~GCTAResponse(void)
Destructor.
Abstract event base class definition.
void free_members(void)
Delete class members.
Spatial composite model class interface definition.
CTA response abstract base class definition.
CTA instrument response function class.
GCTAResponse(void)
Void constructor.
virtual GResponse & operator=(const GResponse &rsp)
Assignment operator.
Definition: GResponse.cpp:139
Abstract instrument response base class.
Definition: GResponse.hpp:77
Observations container class interface definition.