GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMRoi.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCOMRoi.hpp - COMPTEL region of interest class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 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 GCOMRoi.hpp
23  * @brief COMPTEL region of interest class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCOMROI_HPP
28 #define GCOMROI_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GRoi.hpp"
33 #include "GCOMInstDir.hpp"
34 
35 
36 /***********************************************************************//**
37  * @class GCOMRoi
38  *
39  * @brief COMPTEL region of interest class
40  *
41  * The COMPTEL region of interest class defines the event direction
42  * region that is used for unbinned data analysis.
43  ***************************************************************************/
44 class GCOMRoi : public GRoi {
45 
46 public:
47  // Constructors and destructors
48  GCOMRoi(void);
49  GCOMRoi(const GCOMRoi& roi);
50  GCOMRoi(const GCOMInstDir& centre, const double& radius,
51  const double& phibar_min, const double& phibar_max);
52  virtual ~GCOMRoi(void);
53 
54  // Operators
55  GCOMRoi& operator=(const GCOMRoi& roi);
56 
57  // Implemented pure virtual base class methods
58  virtual void clear(void);
59  virtual GCOMRoi* clone(void) const;
60  virtual std::string classname(void) const;
61  virtual bool contains(const GEvent& event) const;
62  virtual std::string print(const GChatter& chatter = NORMAL) const;
63 
64  // Other methods
65  const GCOMInstDir& centre(void) const;
66  void centre(const GCOMInstDir& centre);
67  const double& radius(void) const;
68  void radius(const double& radius);
69  const double& phibar_min(void) const;
70  void phibar_min(const double& phibar_min);
71  const double& phibar_max(void) const;
72  void phibar_max(const double& phibar_max);
73 
74 protected:
75  // Protected methods
76  void init_members(void);
77  void copy_members(const GCOMRoi& roi);
78  void free_members(void);
79 
80  // Protected members
81  GCOMInstDir m_centre; //!< Centre of RoI in instrument coordinates
82  double m_radius; //!< Radius of region of interest
83  double m_phibar_min; //!< Minimum Phibar of region of interest
84  double m_phibar_max; //!< Minimum Phibar of region of interest
85 };
86 
87 
88 /***********************************************************************//**
89  * @brief Return class name
90  *
91  * @return String containing the class name ("GCOMRoi").
92  ***************************************************************************/
93 inline
94 std::string GCOMRoi::classname(void) const
95 {
96  return ("GCOMRoi");
97 }
98 
99 
100 /***********************************************************************//**
101  * @brief Return centre of region of interest
102  *
103  * @return Centre of region of interest centre.
104  *
105  * Returns the instrument direction of the centre of the region of interest.
106  ***************************************************************************/
107 inline
108 const GCOMInstDir& GCOMRoi::centre(void) const
109 {
110  return (m_centre);
111 }
112 
113 
114 /***********************************************************************//**
115  * @brief Set centre of region of interest
116  *
117  * @param[in] centre Instrument direction.
118  *
119  * Set the instrument direction of the centre of the region of interest.
120  ***************************************************************************/
121 inline
123 {
124  m_centre = centre;
125  return;
126 }
127 
128 
129 /***********************************************************************//**
130  * @brief Return radius of region of interest
131  *
132  * @return Radius of region of interest (deg).
133  *
134  * Returns the radius of the region of interest.
135  ***************************************************************************/
136 inline
137 const double& GCOMRoi::radius(void) const
138 {
139  return (m_radius);
140 }
141 
142 
143 /***********************************************************************//**
144  * @brief Set radius of region of interest
145  *
146  * @param[in] radius Radius of region of interest (deg).
147  *
148  * Set the radius of the region of interest.
149  ***************************************************************************/
150 inline
151 void GCOMRoi::radius(const double& radius)
152 {
153  m_radius = radius;
154  return;
155 }
156 
157 
158 /***********************************************************************//**
159  * @brief Return minimum Phibar of region of interest
160  *
161  * @return Minimum Phibar of region of interest (deg).
162  *
163  * Returns the minimum Phibar of region of interest.
164  ***************************************************************************/
165 inline
166 const double& GCOMRoi::phibar_min(void) const
167 {
168  return (m_phibar_min);
169 }
170 
171 
172 /***********************************************************************//**
173  * @brief Set minimum Phibar of region of interest
174  *
175  * @param[in] phibar_min Minimum Phibar of region of interest (deg).
176  *
177  * Set the minimum Phibar of region of interest.
178  ***************************************************************************/
179 inline
180 void GCOMRoi::phibar_min(const double& phibar_min)
181 {
183  return;
184 }
185 
186 
187 /***********************************************************************//**
188  * @brief Return maximum Phibar of region of interest
189  *
190  * @return Maximum Phibar of region of interest (deg).
191  *
192  * Returns the maximum Phibar of region of interest.
193  ***************************************************************************/
194 inline
195 const double& GCOMRoi::phibar_max(void) const
196 {
197  return (m_phibar_max);
198 }
199 
200 
201 /***********************************************************************//**
202  * @brief Set maximum Phibar of region of interest
203  *
204  * @param[in] phibar_max Maximum Phibar of region of interest (deg).
205  *
206  * Set the maximum Phibar of region of interest.
207  ***************************************************************************/
208 inline
209 void GCOMRoi::phibar_max(const double& phibar_max)
210 {
212  return;
213 }
214 
215 #endif /* GCOMROI_HPP */
const GCOMInstDir & centre(void) const
Return centre of region of interest.
Definition: GCOMRoi.hpp:108
double m_radius
Radius of region of interest.
Definition: GCOMRoi.hpp:82
virtual std::string classname(void) const
Return class name.
Definition: GCOMRoi.hpp:94
void free_members(void)
Delete class members.
Definition: GCOMRoi.cpp:298
Abstract interface for the event classes.
Definition: GEvent.hpp:71
virtual GCOMRoi * clone(void) const
Clone region of interest.
Definition: GCOMRoi.cpp:186
Abstract Region of interest base class definition.
std::string centre(const std::string &s, const int &n, const char &c= ' ')
Centre string to achieve a length of n characters.
Definition: GTools.cpp:1118
virtual std::string print(const GChatter &chatter=NORMAL) const
Print region of interest information.
Definition: GCOMRoi.cpp:228
GCOMInstDir m_centre
Centre of RoI in instrument coordinates.
Definition: GCOMRoi.hpp:81
virtual bool contains(const GEvent &event) const
Check if region of interest contains an event.
Definition: GCOMRoi.cpp:197
GCOMRoi(void)
Void constructor.
Definition: GCOMRoi.cpp:54
virtual ~GCOMRoi(void)
Destructor.
Definition: GCOMRoi.cpp:111
virtual void clear(void)
Clear region of interest.
Definition: GCOMRoi.cpp:166
double m_phibar_min
Minimum Phibar of region of interest.
Definition: GCOMRoi.hpp:83
GChatter
Definition: GTypemaps.hpp:33
void copy_members(const GCOMRoi &roi)
Copy class members.
Definition: GCOMRoi.cpp:282
COMPTEL region of interest class.
Definition: GCOMRoi.hpp:44
double m_phibar_max
Minimum Phibar of region of interest.
Definition: GCOMRoi.hpp:84
const double & phibar_max(void) const
Return maximum Phibar of region of interest.
Definition: GCOMRoi.hpp:195
const double & phibar_min(void) const
Return minimum Phibar of region of interest.
Definition: GCOMRoi.hpp:166
void init_members(void)
Initialise class members.
Definition: GCOMRoi.cpp:264
Interface for the region of interest classes.
Definition: GRoi.hpp:48
COMPTEL instrument direction class definition.
const double & radius(void) const
Return radius of region of interest.
Definition: GCOMRoi.hpp:137
GCOMRoi & operator=(const GCOMRoi &roi)
Assignment operator.
Definition: GCOMRoi.cpp:133
Interface for the COMPTEL instrument direction class.
Definition: GCOMInstDir.hpp:45