GammaLib 2.0.0
Loading...
Searching...
No Matches
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 _______________________________________________ */
38class GResponse;
39class GXmlElement;
40
41
42/***********************************************************************//**
43 * @class GLATObservation
44 *
45 * @brief Fermi/LAT observation class
46 *
47 * This class implements a Fermi/LAT observation.
48 ***************************************************************************/
50
51public:
52 // Constructors and destructors
53 GLATObservation(void);
54 explicit GLATObservation(const GXmlElement& xml);
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
85protected:
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 ***************************************************************************/
107inline
108std::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 ***************************************************************************/
119inline
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 ***************************************************************************/
132inline
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 ***************************************************************************/
145inline
146std::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 ***************************************************************************/
158inline
159double 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 ***************************************************************************/
171inline
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 ***************************************************************************/
184inline
185double GLATObservation::deadc(const GTime& time) const
186{
187 // Return deadtime correction factor
188 return 0.0;
189}
190
191#endif /* GLATOBSERVATION_HPP */
Fermi/LAT livetime cube class definition.
Fermi LAT Response class definition.
Abstract observation base class interface definition.
Time class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface for the Fermi LAT livetime cube.
Fermi/LAT observation class.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
virtual void read(const GXmlElement &xml)
Read observation from XML element.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print LAT observation information.
void init_members(void)
Initialise class members.
std::string m_expfile
Exposure map filename.
virtual GLATObservation * clone(void) const
Clone Fermi/LAT observation.
void load_unbinned(const std::string &ft1name, const std::string &ft2name, const std::string &ltcube_name)
Load data for unbinned analysis.
virtual double deadc(const GTime &time=GTime()) const
Return deadtime correction factor.
std::string m_ltfile
Lifetime cube filename.
GLATObservation(void)
Void constructor.
void free_members(void)
Delete class members.
virtual double livetime(void) const
Return livetime.
void copy_members(const GLATObservation &obs)
Copy class members.
const GLATLtCube * ltcube(void) const
Return Fermi/LAT livetime cube.
virtual std::string classname(void) const
Return class name.
GLATLtCube * m_ltcube
Pointer to livetime cube.
std::string m_ft1file
FT1 filename.
virtual std::string instrument(void) const
Return instrument name.
std::string m_cntfile
Counts map filename.
virtual const GLATResponse * response(void) const
Return Fermi/LAT response function.
virtual void clear(void)
Clear Fermi/LAT observation.
void load_binned(const std::string &cntmap_name, const std::string &expmap_name, const std::string &ltcube_name)
Load data for binned analysis.
virtual double ontime(void) const
Return ontime.
GLATObservation & operator=(const GLATObservation &obs)
Assignment operator.
virtual ~GLATObservation(void)
Destructor.
std::string m_ft2file
FT2 filename.
GLATResponse m_response
Instrument response functions.
Fermi/LAT Response class.
Abstract observation base class.
Abstract instrument response base class.
Definition GResponse.hpp:77
Time class.
Definition GTime.hpp:55
XML element node class.