GammaLib 2.0.0
Loading...
Searching...
No Matches
GCTAAeff2D.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCTAAeff2D.hpp - CTA 2D effective area class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2012-2018 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 GCTAAeff2D.hpp
23 * @brief CTA 2D effective area class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCTAAEFF2D_HPP
28#define GCTAAEFF2D_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GFilename.hpp"
33#include "GEbounds.hpp"
34#include "GCTAAeff.hpp"
35#include "GCTAResponseTable.hpp"
36
37/* __ Forward declarations _______________________________________________ */
38class GFitsTable;
39class GFitsBinTable;
40
41/* __ Constants __________________________________________________________ */
42namespace gammalib {
43 const std::string extname_cta_aeff2d = "EFFECTIVE AREA";
44}
45
46
47/***********************************************************************//**
48 * @class GCTAAeff2D
49 *
50 * @brief CTA 2D effective area class
51 *
52 * This class implements the CTA effective area response as function of
53 * energy and offset angle.
54 ***************************************************************************/
55class GCTAAeff2D : public GCTAAeff {
56
57public:
58 // Constructors and destructors
59 GCTAAeff2D(void);
60 explicit GCTAAeff2D(const GFilename& filename);
61 GCTAAeff2D(const GCTAAeff2D& cta);
62 virtual ~GCTAAeff2D(void);
63
64 // Operators
65 GCTAAeff2D& operator=(const GCTAAeff2D& aeff);
66 double operator()(const double& logE,
67 const double& theta = 0.0,
68 const double& phi = 0.0,
69 const double& zenith = 0.0,
70 const double& azimuth = 0.0,
71 const bool& etrue = true) const;
72
73 // Implemented pure virtual methods
74 void clear(void);
75 GCTAAeff2D* clone(void) const;
76 std::string classname(void) const;
77 void load(const GFilename& filename);
78 GFilename filename(void) const;
79 double max(const double& logE,
80 const double& zenith,
81 const double& azimuth,
82 const bool& etrue = true) const;
83 GEbounds ebounds(void) const;
84 std::string print(const GChatter& chatter = NORMAL) const;
85
86 // Methods
87 const double& rad_max(void) const;
88 void rad_max(const double& rad_max);
89 const GCTAResponseTable& table(void) const;
90 void table(const GCTAResponseTable& table);
91 void read(const GFitsTable& table);
92 void write(GFitsBinTable& table) const;
93 void save(const GFilename& filename,
94 const bool& clobber = false) const;
95
96private:
97 // Methods
98 void init_members(void);
99 void copy_members(const GCTAAeff2D& aeff);
100 void free_members(void);
101 void set_indices(void);
102 void set_boundaries(void);
103
104 // Members
105 GFilename m_filename; //!< Name of Aeff response file
106 GCTAResponseTable m_aeff; //!< Aeff response table
107 GEbounds m_ebounds; //!< Energy boundaries
108 int m_inx_energy; //!< Energy index
109 int m_inx_theta; //!< Theta index
110 int m_inx_aeff; //!< Effective area (true energy)
111 int m_inx_aeff_reco; //!< Effective area (reco. energy)
112 double m_logE_min; //!< Minimum logE (log10(E/TeV))
113 double m_logE_max; //!< Maximum logE (log10(E/TeV))
114 double m_theta_min; //!< Minimum theta (radians)
115 double m_theta_max; //!< Maximum theta (radians)
116 double m_lo_thres; //!< Lower energy threshold (TeV)
117 double m_hi_thres; //!< Upper energy threshold (TeV)
118 double m_rad_max; //!< Radius cut (degrees)
119};
120
121
122/***********************************************************************//**
123 * @brief Return class name
124 *
125 * @return String containing the class name ("GCTAAeff2D").
126 ***************************************************************************/
127inline
128std::string GCTAAeff2D::classname(void) const
129{
130 return ("GCTAAeff2D");
131}
132
133
134/***********************************************************************//**
135 * @brief Return filename
136 *
137 * @return Filename from which effective area was loaded
138 ***************************************************************************/
139inline
141{
142 return m_filename;
143}
144
145
146/***********************************************************************//**
147 * @brief Return energy boundaries
148 *
149 * @return Energy boundaries of effective area
150 ***************************************************************************/
151inline
153{
154 return m_ebounds;
155}
156
157
158/***********************************************************************//**
159 * @brief Return radius cut value
160 *
161 * @return Radius cut value (degrees)
162 ***************************************************************************/
163inline
164const double& GCTAAeff2D::rad_max(void) const
165{
166 return m_rad_max;
167}
168
169
170/***********************************************************************//**
171 * @brief Set radius cut value
172 *
173 * @param[in] rad_max Radius cut value (degrees)
174 ***************************************************************************/
175inline
176void GCTAAeff2D::rad_max(const double& rad_max)
177{
179 return;
180}
181
182
183/***********************************************************************//**
184 * @brief Return response table
185 *
186 * @return Response table.
187 *
188 * Returns the response table of the effective area. The effective area
189 * values are given in units of cm2.
190 ***************************************************************************/
191inline
193{
194 return m_aeff;
195}
196
197#endif /* GCTAAEFF2D_HPP */
CTA effective area base class definition.
CTA response table class definition.
Energy boundaries class interface definition.
Filename class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
CTA 2D effective area class.
GFilename filename(void) const
Return filename.
void set_indices(void)
Set table indices.
GCTAAeff2D & operator=(const GCTAAeff2D &aeff)
Assignment operator.
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 free_members(void)
Delete class members.
virtual ~GCTAAeff2D(void)
Destructor.
GEbounds m_ebounds
Energy boundaries.
const double & rad_max(void) const
Return radius cut value.
double m_lo_thres
Lower energy threshold (TeV)
double max(const double &logE, const double &zenith, const double &azimuth, const bool &etrue=true) const
Return maximum effective area at a given energy in cm2.
GEbounds ebounds(void) const
Return energy boundaries.
void clear(void)
Clear effective area.
void load(const GFilename &filename)
Load effective area from FITS file.
void write(GFitsBinTable &table) const
Write effective area into FITS binary table.
double m_rad_max
Radius cut (degrees)
int m_inx_aeff
Effective area (true energy)
GFilename m_filename
Name of Aeff response file.
double m_logE_min
Minimum logE (log10(E/TeV))
GCTAAeff2D(void)
Void constructor.
GCTAAeff2D * clone(void) const
Clone effective area.
double m_theta_min
Minimum theta (radians)
std::string classname(void) const
Return class name.
double m_hi_thres
Upper energy threshold (TeV)
double m_logE_max
Maximum logE (log10(E/TeV))
void save(const GFilename &filename, const bool &clobber=false) const
Save effective area into FITS file.
int m_inx_energy
Energy index.
int m_inx_theta
Theta index.
void copy_members(const GCTAAeff2D &aeff)
Copy class members.
std::string print(const GChatter &chatter=NORMAL) const
Print effective area information.
GCTAResponseTable m_aeff
Aeff response table.
double m_theta_max
Maximum theta (radians)
void set_boundaries(void)
Set effective area boundaries.
void init_members(void)
Initialise class members.
void read(const GFitsTable &table)
Read effective area from FITS table.
int m_inx_aeff_reco
Effective area (reco. energy)
const GCTAResponseTable & table(void) const
Return response table.
Abstract base class for the CTA effective area.
Definition GCTAAeff.hpp:54
CTA response table class.
Energy boundaries container class.
Definition GEbounds.hpp:60
Filename class.
Definition GFilename.hpp:62
FITS binary table class.
Abstract interface for FITS table.
const std::string extname_cta_aeff2d