GammaLib 2.0.0
Loading...
Searching...
No Matches
GCTAAeffArf.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCTAAeffArf.hpp - CTA ARF effective area class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2012-2017 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 GCTAAeffArf.hpp
23 * @brief CTA ARF effective area class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCTAAEFFARF_HPP
28#define GCTAAEFFARF_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <vector>
33#include "GEbounds.hpp"
34#include "GNodeArray.hpp"
35#include "GFilename.hpp"
36#include "GCTAAeff.hpp"
37
38/* __ Forward declarations _______________________________________________ */
39class GFitsTable;
40class GCTAResponseIrf;
41
42
43/***********************************************************************//**
44 * @class GCTAAeffArf
45 *
46 * @brief CTA ARF effective area class
47 *
48 * This class implements the CTA effective area response that is defined by
49 * an auxiliary response function (ARF) file.
50 ***************************************************************************/
51class GCTAAeffArf : public GCTAAeff {
52
53public:
54 // Constructors and destructors
55 GCTAAeffArf(void);
56 explicit GCTAAeffArf(const GFilename& filename);
57 GCTAAeffArf(const GCTAAeffArf& cta);
58 virtual ~GCTAAeffArf(void);
59
60 // Operators
61 GCTAAeffArf& operator=(const GCTAAeffArf& aeff);
62 double operator()(const double& logE,
63 const double& theta = 0.0,
64 const double& phi = 0.0,
65 const double& zenith = 0.0,
66 const double& azimuth = 0.0,
67 const bool& etrue = true) const;
68
69 // Implemented pure virtual methods
70 void clear(void);
71 GCTAAeffArf* clone(void) const;
72 std::string classname(void) const;
73 void load(const GFilename& filename);
74 GFilename filename(void) const;
75 double max(const double& logE,
76 const double& zenith,
77 const double& azimuth,
78 const bool& etrue = true) const;
79 GEbounds ebounds(void) const;
80 std::string print(const GChatter& chatter = NORMAL) const;
81
82 // Methods
83 int size(void) const;
84 void sigma(const double& sigma);
85 const double& sigma(void) const;
86 void thetacut(const double& thetacut);
87 const double& thetacut(void) const;
88 void scale(const double& scale);
89 const double& scale(void) const;
90 void read(const GFitsTable& table);
91 void remove_thetacut(const GCTAResponseIrf& rsp);
92
93private:
94 // Methods
95 void init_members(void);
96 void copy_members(const GCTAAeffArf& aeff);
97 void free_members(void);
98
99 // Members
100 GFilename m_filename; //!< Name of Aeff response file
101 GNodeArray m_logE; //!< log(E) nodes for Aeff interpolation
102 std::vector<double> m_aeff; //!< Effective area in cm2
103 GEbounds m_ebounds; //!< Energy boundaries
104 double m_sigma; //!< Sigma for offset angle computation (0=none)
105 double m_thetacut; //!< Theta cut for ARF
106 double m_scale; //!< Scale for ARF
107 double m_logE_min; //!< Minimum logE (log10(E/TeV))
108 double m_logE_max; //!< Maximum logE (log10(E/TeV))
109};
110
111
112/***********************************************************************//**
113 * @brief Return class name
114 *
115 * @return String containing the class name ("GCTAAeffArf").
116 ***************************************************************************/
117inline
118std::string GCTAAeffArf::classname(void) const
119{
120 return ("GCTAAeffArf");
121}
122
123
124/***********************************************************************//**
125 * @brief Return filename
126 *
127 * @return Filename from which effective area was loaded.
128 ***************************************************************************/
129inline
131{
132 return m_filename;
133}
134
135
136/***********************************************************************//**
137 * @brief Return energy boundaries
138 *
139 * @return Energy boundaries of effective area
140 ***************************************************************************/
141inline
143{
144 return m_ebounds;
145}
146
147
148/***********************************************************************//**
149 * @brief Return number of node energies in response
150 *
151 * @return Number of node energies.
152 ***************************************************************************/
153inline
154int GCTAAeffArf::size(void) const
155{
156 return (m_logE.size());
157}
158
159
160/***********************************************************************//**
161 * @brief Set sigma for offset angle dependence
162 *
163 * @param[in] sigma Sigma for offset angle dependence.
164 *
165 * Sets the sigma parameter for the offset angle dependence of the effective
166 * area. If @p sigma is 0 (which is the default value), no offset angle
167 * dependency will be assumed.
168 ***************************************************************************/
169inline
170void GCTAAeffArf::sigma(const double& sigma)
171{
172 m_sigma = sigma;
173 return;
174}
175
176
177/***********************************************************************//**
178 * @brief Return sigma for offset angle dependence
179 *
180 * @return Sigma for offset angle dependence.
181 ***************************************************************************/
182inline
183const double& GCTAAeffArf::sigma(void) const
184{
185 return (m_sigma);
186}
187
188
189/***********************************************************************//**
190 * @brief Set theta cut angle
191 *
192 * @param[in] thetacut Set theta cut angle.
193 *
194 * Sets the theta cut angle which defines the energy independent cut that
195 * has been assumed in deriving the ARF values. If @p thetacut os 0 (which
196 * is the default value), not thetacut will be applied.
197 ***************************************************************************/
198inline
199void GCTAAeffArf::thetacut(const double& thetacut)
200{
202 return;
203}
204
205
206/***********************************************************************//**
207 * @brief Return theta cut angle
208 *
209 * @return Theta cut angle.
210 ***************************************************************************/
211inline
212const double& GCTAAeffArf::thetacut(void) const
213{
214 return (m_thetacut);
215}
216
217
218/***********************************************************************//**
219 * @brief Set effective area scaling factor
220 *
221 * @param[in] scale Set effective area scaling factor.
222 *
223 * Sets the scaling factor for the effective area (by default is 1).
224 ***************************************************************************/
225inline
226void GCTAAeffArf::scale(const double& scale)
227{
228 m_scale = scale;
229 return;
230}
231
232
233/***********************************************************************//**
234 * @brief Return effective area scaling factor
235 *
236 * @return Effective area scaling factor.
237 ***************************************************************************/
238inline
239const double& GCTAAeffArf::scale(void) const
240{
241 return (m_scale);
242}
243
244#endif /* GCTAAEFFARF_HPP */
CTA effective area base class definition.
Energy boundaries class interface definition.
Filename class interface definition.
Node array class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
CTA ARF effective area class.
GFilename m_filename
Name of Aeff response file.
double m_thetacut
Theta cut for ARF.
GCTAAeffArf(void)
Void constructor.
const double & scale(void) const
Return effective area scaling factor.
GEbounds ebounds(void) const
Return energy boundaries.
double m_scale
Scale for ARF.
std::vector< double > m_aeff
Effective area in cm2.
GFilename filename(void) const
Return filename.
GCTAAeffArf & operator=(const GCTAAeffArf &aeff)
Assignment operator.
void clear(void)
Clear instance.
double m_logE_min
Minimum logE (log10(E/TeV))
double m_sigma
Sigma for offset angle computation (0=none)
void remove_thetacut(const GCTAResponseIrf &rsp)
Remove thetacut.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
virtual ~GCTAAeffArf(void)
Destructor.
int size(void) const
Return number of node energies in response.
double m_logE_max
Maximum logE (log10(E/TeV))
void free_members(void)
Delete class members.
double operator()(const double &logE, const double &theta=0.0, const double &phi=0.0, const double &zenith=0.0, const double &azimuth=0.0, const bool &etrue=true) const
Return effective area in units of cm2.
void init_members(void)
Initialise class members.
void copy_members(const GCTAAeffArf &aeff)
Copy class members.
void load(const GFilename &filename)
Load effective area from ARF FITS file.
std::string classname(void) const
Return class name.
GEbounds m_ebounds
Energy boundaries.
void read(const GFitsTable &table)
Read CTA ARF vector.
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
GCTAAeffArf * clone(void) const
Clone instance.
double max(const double &logE, const double &zenith, const double &azimuth, const bool &etrue=true) const
Return maximum effective area at a given energy.
const double & sigma(void) const
Return sigma for offset angle dependence.
const double & thetacut(void) const
Return theta cut angle.
Abstract base class for the CTA effective area.
Definition GCTAAeff.hpp:54
CTA instrument response function class.
Energy boundaries container class.
Definition GEbounds.hpp:60
Filename class.
Definition GFilename.hpp:62
Abstract interface for FITS table.
Node array class.
int size(void) const
Return number of nodes in node array.