GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GLATObservation.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GLATObservation.hpp - Fermi/LAT observation class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2008-2016 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 GLATObservation.hpp
23  * @brief Fermi/LAT observation class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GLATOBSERVATION_HPP
28 #define GLATOBSERVATION_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GTime.hpp"
33 #include "GObservation.hpp"
34 #include "GLATResponse.hpp"
35 #include "GLATLtCube.hpp"
36 
37 /* __ Forward declarations _______________________________________________ */
38 class GResponse;
39 class GXmlElement;
40 
41 
42 /***********************************************************************//**
43  * @class GLATObservation
44  *
45  * @brief Fermi/LAT observation class
46  *
47  * This class implements a Fermi/LAT observation.
48  ***************************************************************************/
49 class GLATObservation : public GObservation {
50 
51 public:
52  // Constructors and destructors
53  GLATObservation(void);
54  explicit GLATObservation(const GXmlElement& xml);
55  GLATObservation(const GLATObservation& obs);
56  virtual ~GLATObservation(void);
57 
58  // Operators
60 
61  // Implemented pure virtual base class methods
62  virtual void clear(void);
63  virtual GLATObservation* clone(void) const;
64  virtual std::string classname(void) const;
65  virtual void response(const GResponse& rsp);
66  virtual const GLATResponse* response(void) const;
67  virtual std::string instrument(void) const;
68  virtual double ontime(void) const;
69  virtual double livetime(void) const;
70  virtual double deadc(const GTime& time = GTime()) const;
71  virtual void read(const GXmlElement& xml);
72  virtual void write(GXmlElement& xml) const;
73  virtual std::string print(const GChatter& chatter = NORMAL) const;
74 
75  // Other methods
76  void load_unbinned(const std::string& ft1name,
77  const std::string& ft2name,
78  const std::string& ltcube_name);
79  void load_binned(const std::string& cntmap_name,
80  const std::string& expmap_name,
81  const std::string& ltcube_name);
82  void response(const std::string& irfname);
83  const GLATLtCube* ltcube(void) const;
84 
85 protected:
86  // Protected methods
87  void init_members(void);
88  void copy_members(const GLATObservation& obs);
89  void free_members(void);
90 
91  // Protected members
92  std::string m_ft1file; //!< FT1 filename
93  std::string m_ft2file; //!< FT2 filename
94  std::string m_ltfile; //!< Lifetime cube filename
95  std::string m_cntfile; //!< Counts map filename
96  std::string m_expfile; //!< Exposure map filename
97  GLATResponse m_response; //!< Instrument response functions
98  GLATLtCube* m_ltcube; //!< Pointer to livetime cube
99 };
100 
101 
102 /***********************************************************************//**
103  * @brief Return class name
104  *
105  * @return String containing the class name ("GLATObservation").
106  ***************************************************************************/
107 inline
108 std::string GLATObservation::classname(void) const
109 {
110  return ("GLATObservation");
111 }
112 
113 
114 /***********************************************************************//**
115  * @brief Return Fermi/LAT response function
116  *
117  * @return Fermi/LAT response function
118  ***************************************************************************/
119 inline
121 {
122  // Return response pointer
123  return &m_response;
124 }
125 
126 
127 /***********************************************************************//**
128  * @brief Return Fermi/LAT livetime cube
129  *
130  * @return Fermi/LAT livetime cube
131  ***************************************************************************/
132 inline
134 {
135  // Return livetime cube pointer
136  return m_ltcube;
137 }
138 
139 
140 /***********************************************************************//**
141  * @brief Return instrument name
142  *
143  * @return Instrument name ("LAT")
144  ***************************************************************************/
145 inline
146 std::string GLATObservation::instrument(void) const
147 {
148  // Return instrument name
149  return ("LAT");
150 }
151 
152 
153 /***********************************************************************//**
154  * @brief Return ontime
155  *
156  * @return Ontime
157  ***************************************************************************/
158 inline
159 double GLATObservation::ontime(void) const
160 {
161  // Return ontime
162  return 0.0;
163 }
164 
165 
166 /***********************************************************************//**
167  * @brief Return livetime
168  *
169  * @return Livetime
170  ***************************************************************************/
171 inline
172 double GLATObservation::livetime(void) const
173 {
174  // Return livetime
175  return 0.0;
176 }
177 
178 
179 /***********************************************************************//**
180  * @brief Return deadtime correction factor
181  *
182  * @return Deadtime correction factor
183  ***************************************************************************/
184 inline
185 double GLATObservation::deadc(const GTime& time) const
186 {
187  // Return deadtime correction factor
188  return 0.0;
189 }
190 
191 #endif /* GLATOBSERVATION_HPP */
std::string m_ltfile
Lifetime cube filename.
void init_members(void)
Initialise class members.
Fermi/LAT observation class.
std::string m_ft2file
FT2 filename.
virtual void read(const GXmlElement &xml)
Read observation from XML element.
void copy_members(const GLATObservation &obs)
Copy class members.
GLATObservation(void)
Void constructor.
XML element node class.
Definition: GXmlElement.hpp:48
Fermi/LAT Response class.
void free_members(void)
Delete class members.
Time class.
Definition: GTime.hpp:55
virtual GLATObservation * clone(void) const
Clone Fermi/LAT observation.
GLATObservation & operator=(const GLATObservation &obs)
Assignment operator.
std::string m_ft1file
FT1 filename.
virtual ~GLATObservation(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print LAT observation information.
virtual void clear(void)
Clear Fermi/LAT observation.
virtual double livetime(void) const
Return livetime.
const GLATLtCube * ltcube(void) const
Return Fermi/LAT livetime cube.
GLATLtCube * m_ltcube
Pointer to livetime cube.
Fermi/LAT livetime cube class definition.
virtual double ontime(void) const
Return ontime.
void load_binned(const std::string &cntmap_name, const std::string &expmap_name, const std::string &ltcube_name)
Load data for binned analysis.
virtual std::string classname(void) const
Return class name.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
GChatter
Definition: GTypemaps.hpp:33
Abstract observation base class.
Abstract observation base class interface definition.
std::string m_expfile
Exposure map filename.
virtual const GLATResponse * response(void) const
Return Fermi/LAT response function.
virtual double deadc(const GTime &time=GTime()) const
Return deadtime correction factor.
std::string m_cntfile
Counts map filename.
Fermi LAT Response class definition.
virtual std::string instrument(void) const
Return instrument name.
Abstract instrument response base class.
Definition: GResponse.hpp:77
GLATResponse m_response
Instrument response functions.
Time class interface definition.
Interface for the Fermi LAT livetime cube.
Definition: GLATLtCube.hpp:59
void load_unbinned(const std::string &ft1name, const std::string &ft2name, const std::string &ltcube_name)
Load data for unbinned analysis.