GammaLib 2.2.0.dev
Loading...
Searching...
No Matches
GCOSRoi.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOSRoi.hpp - COSI region of interest class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2026 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 GCOSRoi.hpp
23 * @brief COSI region of interest class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOSROI_HPP
28#define GCOSROI_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include "GRoi.hpp"
33
34/* __ Forward declaration ________________________________________________ */
35class GEvent;
36
37/* __ Constants __________________________________________________________ */
38
39
40/***********************************************************************//**
41 * @class GCOSRoi
42 *
43 * @brief COSI region of interest class
44 *
45 * The COSI region of interest class defines the event direction region that
46 * is used for unbinned data analysis. By definition, COSI is always doing
47 * an allsky analysis, hence the class simply sets the radius to 180 deg
48 * once the region is defined.
49 ***************************************************************************/
50class GCOSRoi : public GRoi {
51
52public:
53 // Constructors and destructors
54 GCOSRoi(void);
55 explicit GCOSRoi(const double& radius);
56 GCOSRoi(const GCOSRoi& roi);
57 virtual ~GCOSRoi(void);
58
59 // Operators
60 GCOSRoi& operator=(const GCOSRoi& roi);
61
62 // Implemented pure virtual base class methods
63 virtual void clear(void);
64 virtual GCOSRoi* clone(void) const;
65 virtual std::string classname(void) const;
66 virtual bool contains(const GEvent& event) const;
67 virtual std::string print(const GChatter& chatter = NORMAL) const;
68
69 // Other methods
70 const double& radius(void) const;
71 void radius(const double& radius);
72
73protected:
74 // Protected methods
75 void init_members(void);
76 void copy_members(const GCOSRoi& roi);
77 void free_members(void);
78
79 // Protected members
80 double m_radius; //!< Region of interest radius
81};
82
83
84/***********************************************************************//**
85 * @brief Return class name
86 *
87 * @return String containing the class name ("GCOSRoi").
88 ***************************************************************************/
89inline
90std::string GCOSRoi::classname(void) const
91{
92 return ("GCOSRoi");
93}
94
95
96/***********************************************************************//**
97 * @brief Returns region of interest radius
98 *
99 * @return Region of interest radius (degrees).
100 *
101 * Returns the radius of the region of interest in degrees.
102 ***************************************************************************/
103inline
104const double& GCOSRoi::radius(void) const
105{
106 return (m_radius);
107}
108
109#endif /* GCOSROI_HPP */
Abstract Region of interest base class definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
COSI region of interest class.
Definition GCOSRoi.hpp:50
double m_radius
Region of interest radius.
Definition GCOSRoi.hpp:80
virtual bool contains(const GEvent &event) const
Check if region of interest contains an event.
Definition GCOSRoi.cpp:198
const double & radius(void) const
Returns region of interest radius.
Definition GCOSRoi.hpp:104
GCOSRoi & operator=(const GCOSRoi &roi)
Assignment operator.
Definition GCOSRoi.cpp:126
virtual ~GCOSRoi(void)
Destructor.
Definition GCOSRoi.cpp:104
void copy_members(const GCOSRoi &roi)
Copy class members.
Definition GCOSRoi.cpp:303
virtual GCOSRoi * clone(void) const
Clone region of interest.
Definition GCOSRoi.cpp:179
virtual std::string print(const GChatter &chatter=NORMAL) const
Print region of interest information.
Definition GCOSRoi.cpp:257
virtual std::string classname(void) const
Return class name.
Definition GCOSRoi.hpp:90
virtual void clear(void)
Clear region of interest.
Definition GCOSRoi.cpp:159
GCOSRoi(void)
Void constructor.
Definition GCOSRoi.cpp:55
void free_members(void)
Delete class members.
Definition GCOSRoi.cpp:316
void init_members(void)
Initialise class members.
Definition GCOSRoi.cpp:288
Abstract interface for the event classes.
Definition GEvent.hpp:71
Interface for the region of interest classes.
Definition GRoi.hpp:48