GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 _______________________________________________ */
39 class GFitsTable;
40 class 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  ***************************************************************************/
51 class GCTAAeffArf : public GCTAAeff {
52 
53 public:
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 
93 private:
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  ***************************************************************************/
117 inline
118 std::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  ***************************************************************************/
129 inline
131 {
132  return m_filename;
133 }
134 
135 
136 /***********************************************************************//**
137  * @brief Return energy boundaries
138  *
139  * @return Energy boundaries of effective area
140  ***************************************************************************/
141 inline
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  ***************************************************************************/
153 inline
154 int 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  ***************************************************************************/
169 inline
170 void 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  ***************************************************************************/
182 inline
183 const 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  ***************************************************************************/
198 inline
199 void 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  ***************************************************************************/
211 inline
212 const 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  ***************************************************************************/
225 inline
226 void 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  ***************************************************************************/
238 inline
239 const double& GCTAAeffArf::scale(void) const
240 {
241  return (m_scale);
242 }
243 
244 #endif /* GCTAAEFFARF_HPP */
GFilename filename(void) const
Return filename.
int size(void) const
Return number of nodes in node array.
Definition: GNodeArray.hpp:192
void remove_thetacut(const GCTAResponseIrf &rsp)
Remove thetacut.
Node array class.
Definition: GNodeArray.hpp:60
GCTAAeffArf & operator=(const GCTAAeffArf &aeff)
Assignment operator.
const double & scale(void) const
Return effective area scaling factor.
GNodeArray m_logE
log(E) nodes for Aeff interpolation
GEbounds m_ebounds
Energy boundaries.
GCTAAeffArf * clone(void) const
Clone instance.
std::vector< double > m_aeff
Effective area in cm2.
GFilename m_filename
Name of Aeff response file.
const double & sigma(void) const
Return sigma for offset angle dependence.
void clear(void)
Clear 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.
int size(void) const
Return number of node energies in response.
const double & thetacut(void) const
Return theta cut angle.
virtual ~GCTAAeffArf(void)
Destructor.
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.
GCTAAeffArf(void)
Void constructor.
Definition: GCTAAeffArf.cpp:63
CTA effective area base class definition.
Node array class interface definition.
Energy boundaries container class.
Definition: GEbounds.hpp:60
GEbounds ebounds(void) const
Return energy boundaries.
Filename class.
Definition: GFilename.hpp:62
std::string classname(void) const
Return class name.
double m_thetacut
Theta cut for ARF.
Abstract interface for FITS table.
Definition: GFitsTable.hpp:44
void free_members(void)
Delete class members.
GChatter
Definition: GTypemaps.hpp:33
void copy_members(const GCTAAeffArf &aeff)
Copy class members.
double m_sigma
Sigma for offset angle computation (0=none)
CTA instrument response function class.
Abstract base class for the CTA effective area.
Definition: GCTAAeff.hpp:54
void read(const GFitsTable &table)
Read CTA ARF vector.
void load(const GFilename &filename)
Load effective area from ARF FITS file.
double m_scale
Scale for ARF.
Energy boundaries class interface definition.
double m_logE_max
Maximum logE (log10(E/TeV))
void init_members(void)
Initialise class members.
double m_logE_min
Minimum logE (log10(E/TeV))
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
Filename class interface definition.
CTA ARF effective area class.
Definition: GCTAAeffArf.hpp:51