Loading [MathJax]/jax/output/HTML-CSS/config.js
GammaLib 2.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMEventCube.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOMEventCube.hpp - COMPTEL event bin container 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 GCOMEventCube.hpp
23 * @brief COMPTEL event bin container class interface definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOMEVENTCUBE_HPP
28#define GCOMEVENTCUBE_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <vector>
33#include "GEnergy.hpp"
34#include "GTime.hpp"
35#include "GSkyDir.hpp"
36#include "GEventCube.hpp"
37#include "GCOMEventBin.hpp"
38#include "GCOMInstDir.hpp"
39#include "GCOMDri.hpp"
40
41/* __ Forward declarations _______________________________________________ */
42class GFilename;
43class GEbounds;
44class GGti;
45
46
47/***********************************************************************//**
48 * @class GCOMEventCube
49 *
50 * @brief COMPTEL event bin container class
51 *
52 * This class is a container class for COMPTEL event bins.
53 ***************************************************************************/
54class GCOMEventCube : public GEventCube {
55
56public:
57 // Constructors and destructors
58 GCOMEventCube(void);
59 explicit GCOMEventCube(const GFilename& filename);
60 explicit GCOMEventCube(const GCOMDri& dre);
61 GCOMEventCube(const GCOMEventCube& cube);
62 virtual ~GCOMEventCube(void);
63
64 // Operators
65 virtual GCOMEventCube& operator=(const GCOMEventCube& cube);
66 virtual GCOMEventBin* operator[](const int& index);
67 virtual const GCOMEventBin* operator[](const int& index) const;
68
69 // Implemented pure virtual base class methods
70 virtual void clear(void);
71 virtual GCOMEventCube* clone(void) const;
72 virtual std::string classname(void) const;
73 virtual int size(void) const;
74 virtual int dim(void) const;
75 virtual int naxis(const int& axis) const;
76 virtual void load(const GFilename& filename);
77 virtual void save(const GFilename& filename,
78 const bool& clobber = false) const;
79 virtual void read(const GFits& file);
80 virtual void write(GFits& file) const;
81 virtual int number(void) const;
82 virtual std::string print(const GChatter& chatter = NORMAL) const;
83
84 // Other methods
85 const GCOMDri& dre(void) const;
86
87protected:
88 // Protected methods
89 void init_members(void);
90 void copy_members(const GCOMEventCube& cube);
91 void free_members(void);
92 void init_cube(void);
93 void set_scatter_directions(void);
94 void set_scatter_angles(void);
95 virtual void set_energies(void);
96 virtual void set_times(void);
97 void init_bin(void);
98 void set_bin(const int& index);
99
100 // Protected members
101 GCOMEventBin m_bin; //!< Actual event bin
102 GCOMInstDir m_dir; //!< Actual event direction
103 GCOMDri m_dri; //!< DRI cube
104 GTime m_time; //!< Event cube mean time
105 double m_ontime; //!< Event cube ontime (sec)
106 GEnergy m_energy; //!< Event cube mean energy
107 GEnergy m_ewidth; //!< Event cube energy bin width
108 int m_npix; //!< Number of DRI pixels
109 std::vector<GSkyDir> m_dirs; //!< Array of event scatter directions
110 std::vector<double> m_solidangle; //!< Array of solid angles (sr)
111 std::vector<double> m_phibar; //!< Array of event scatter angles
112};
113
114
115/***********************************************************************//**
116 * @brief Return class name
117 *
118 * @return String containing the class name ("GCOMEventCube").
119 ***************************************************************************/
120inline
121std::string GCOMEventCube::classname(void) const
122{
123 return ("GCOMEventCube");
124}
125
126
127/***********************************************************************//**
128 * @brief Return number of bins in event cube
129 *
130 * @return Number of bins in event cube.
131 ***************************************************************************/
132inline
133int GCOMEventCube::size(void) const
134{
135 return (m_dri.size());
136}
137
138
139/***********************************************************************//**
140 * @brief Return reference to DRE data
141 *
142 * @return Reference to DRE data.
143 ***************************************************************************/
144inline
145const GCOMDri& GCOMEventCube::dre(void) const
146{
147 return (m_dri);
148}
149
150#endif /* GCOMEVENTCUBE_HPP */
COMPTEL Data Space class definition.
COMPTEL event bin class interface definition.
COMPTEL instrument direction class definition.
Energy value class definition.
Abstract event bin container class interface definition.
Sky direction class interface definition.
Time class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
COMPTEL Data Space class.
Definition GCOMDri.hpp:61
int size(void) const
Return number of bins.
Definition GCOMDri.hpp:219
COMPTEL event bin class.
COMPTEL event bin container class.
virtual void set_times(void)
Set mean event time and ontime of event cube.
int m_npix
Number of DRI pixels.
GEnergy m_ewidth
Event cube energy bin width.
virtual int dim(void) const
Return dimension of event cube.
virtual void load(const GFilename &filename)
Load COMPTEL event cube from FITS file.
std::vector< double > m_phibar
Array of event scatter angles.
virtual int number(void) const
Return number of events in cube.
virtual GCOMEventBin * operator[](const int &index)
Event bin access operator.
virtual int size(void) const
Return number of bins in event cube.
void free_members(void)
Delete class members.
std::vector< double > m_solidangle
Array of solid angles (sr)
void set_scatter_directions(void)
Set sky directions and solid angles of events cube.
virtual ~GCOMEventCube(void)
Destructor.
void init_members(void)
Initialise class members.
virtual GCOMEventCube * clone(void) const
Clone instance.
GTime m_time
Event cube mean time.
virtual std::string classname(void) const
Return class name.
GCOMEventCube(void)
Void constructor.
virtual void save(const GFilename &filename, const bool &clobber=false) const
Save COMPTEL event cube into FITS file.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print event cube information.
virtual void read(const GFits &file)
Read COMPTEL event cube from FITS file.
void set_scatter_angles(void)
Set Compton scatter angles of event cube.
const GCOMDri & dre(void) const
Return reference to DRE data.
void init_bin(void)
Initialise event bin.
std::vector< GSkyDir > m_dirs
Array of event scatter directions.
double m_ontime
Event cube ontime (sec)
virtual GCOMEventCube & operator=(const GCOMEventCube &cube)
Assignment operator.
virtual void clear(void)
Clear instance.
void init_cube(void)
Initialise event cube.
virtual void set_energies(void)
Set log mean energy and energy width of event cube.
GCOMDri m_dri
DRI cube.
GEnergy m_energy
Event cube mean energy.
virtual void write(GFits &file) const
Write COMPTEL event cube into FITS file.
void copy_members(const GCOMEventCube &cube)
Copy class members.
GCOMEventBin m_bin
Actual event bin.
virtual int naxis(const int &axis) const
Return number of bins in axis.
void set_bin(const int &index)
Set event bin.
GCOMInstDir m_dir
Actual event direction.
Interface for the COMPTEL instrument direction class.
Energy boundaries container class.
Definition GEbounds.hpp:60
Class that handles energies in a unit independent way.
Definition GEnergy.hpp:48
Abstract event bin container class.
Filename class.
Definition GFilename.hpp:62
FITS file class.
Definition GFits.hpp:63
Good Time Interval class.
Definition GGti.hpp:62
Time class.
Definition GTime.hpp:55