GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GLATLtCube.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GLATLtCube.hpp - Fermi/LAT livetime cube class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-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 GLATLtCube.hpp
23  * @brief Fermi/LAT livetime cube class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GLATLTCUBE_HPP
28 #define GLATLTCUBE_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 #include "GGti.hpp"
34 #include "GLATLtCubeMap.hpp"
35 
36 /* __ Forward declarations _______________________________________________ */
37 class GFilename;
38 class GSkyDir;
39 class GEnergy;
40 class GLATAeff;
41 class GLATPsf;
42 
43 /* __ Constants __________________________________________________________ */
44 namespace gammalib {
45  const std::string extname_lat_exposure = "EXPOSURE";
46  const std::string extname_lat_wgtexposure = "WEIGHTED_EXPOSURE";
47  const std::string extname_lat_cthetabounds = "CTHETABOUNDS";
48 }
49 
50 
51 /***********************************************************************//**
52  * @class GLATLtCube
53  *
54  * @brief Interface for the Fermi LAT livetime cube
55  *
56  * The livetime cube holds the livetime as function and zenith and azimuth
57  * angles for a given observation. The azimuth dependence is optional.
58  ***************************************************************************/
59 class GLATLtCube : public GBase {
60 
61 public:
62  // Constructors and destructors
63  GLATLtCube(void);
64  explicit GLATLtCube(const GFilename& filename);
65  GLATLtCube(const GLATLtCube& cube);
66  virtual ~GLATLtCube(void);
67 
68  // Operators
69  GLATLtCube& operator= (const GLATLtCube& cube);
70  double operator()(const GSkyDir& dir, const GEnergy& energy,
71  _ltcube_ctheta fct) const;
72  double operator()(const GSkyDir& dir, const GEnergy& energy,
73  _ltcube_ctheta_phi fct) const;
74  double operator()(const GSkyDir& dir, const GEnergy& energy,
75  const GLATAeff& aeff) const;
76  double operator()(const GSkyDir& dir, const GEnergy& energy,
77  const double& offset, const GLATPsf& psf,
78  const GLATAeff& aeff) const;
79 
80  // Methods
81  void clear(void);
82  GLATLtCube* clone(void) const;
83  std::string classname(void) const;
84  void load(const GFilename& filename);
85  void save(const GFilename& filename,
86  const bool& clobber = false) const;
87  void read(const GFits& file);
88  void write(GFits& file) const;
89  std::string print(const GChatter& chatter = NORMAL) const;
90 
91 private:
92  // Methods
93  void init_members(void);
94  void copy_members(const GLATLtCube& cube);
95  void free_members(void);
96 
97  // Protected members
101 };
102 
103 
104 /***********************************************************************//**
105  * @brief Return class name
106  *
107  * @return String containing the class name ("GLATLtCube").
108  ***************************************************************************/
109 inline
110 std::string GLATLtCube::classname(void) const
111 {
112  return ("GLATLtCube");
113 }
114 
115 #endif /* GLATLTCUBE_HPP */
double(* _ltcube_ctheta_phi)(const double &costheta, const double &phi)
void read(const GFits &file)
Read livetime cube from FITS file.
Definition: GLATLtCube.cpp:443
double operator()(const GSkyDir &dir, const GEnergy &energy, _ltcube_ctheta fct) const
Sum function multiplied by efficiency corrected livetime over zenith angle.
Definition: GLATLtCube.cpp:172
void load(const GFilename &filename)
Load livetime cube from FITS file.
Definition: GLATLtCube.cpp:389
void write(GFits &file) const
Write livetime cube into FITS file.
Definition: GLATLtCube.cpp:477
GLATLtCubeMap m_weighted_exposure
Definition: GLATLtCube.hpp:99
Definition of interface for all GammaLib classes.
FITS file class.
Definition: GFits.hpp:63
GLATLtCube * clone(void) const
Clone livetime cube.
Definition: GLATLtCube.cpp:378
std::string print(const GChatter &chatter=NORMAL) const
Print livetime cube information.
Definition: GLATLtCube.cpp:501
Good time interval class interface definition.
const std::string extname_lat_exposure
Definition: GLATLtCube.hpp:45
Interface for the Fermi LAT point spread function.
Definition: GLATPsf.hpp:54
Filename class.
Definition: GFilename.hpp:62
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
void save(const GFilename &filename, const bool &clobber=false) const
Save livetime cube into FITS file.
Definition: GLATLtCube.cpp:416
virtual ~GLATLtCube(void)
Destructor.
Definition: GLATLtCube.cpp:108
GChatter
Definition: GTypemaps.hpp:33
Interface for the Fermi/LAT effective area.
Definition: GLATAeff.hpp:59
const std::string extname_lat_cthetabounds
Definition: GLATLtCube.hpp:47
Good Time Interval class.
Definition: GGti.hpp:62
void init_members(void)
Initialise class members.
Definition: GLATLtCube.cpp:536
std::string classname(void) const
Return class name.
Definition: GLATLtCube.hpp:110
GLATLtCube(void)
Void constructor.
Definition: GLATLtCube.cpp:59
Fermi LAT livetime cube map class definition.
void free_members(void)
Delete class members.
Definition: GLATLtCube.cpp:568
GLATLtCubeMap m_exposure
Definition: GLATLtCube.hpp:98
void copy_members(const GLATLtCube &cube)
Copy class members.
Definition: GLATLtCube.cpp:553
const std::string extname_lat_wgtexposure
Definition: GLATLtCube.hpp:46
double(* _ltcube_ctheta)(const double &costheta)
GLATLtCube & operator=(const GLATLtCube &cube)
Assignment operator.
Definition: GLATLtCube.cpp:130
Sky direction class.
Definition: GSkyDir.hpp:62
void clear(void)
Clear livetime cube.
Definition: GLATLtCube.cpp:360
Fermi LAT livetime cube map class.
Interface for the Fermi LAT livetime cube.
Definition: GLATLtCube.hpp:59
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48