GammaLib 2.2.0.dev
Loading...
Searching...
No Matches
GCOSInstDir.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOSInstDir.hpp - COSI instrument direction 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 GCOSInstDir.hpp
23 * @brief COSI instrument direction class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOSINSTDIR_HPP
28#define GCOSINSTDIR_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <sys/types.h>
33#if defined(__sun) && (defined(__svr4__) || defined(__SVR4)) // SOLARIS
34 typedef uint64_t u_int64_t;
35#endif // SOLARIS
36#include "GInstDir.hpp"
37#include "GSkyDir.hpp"
38
39/* __ Forward declarations _______________________________________________ */
40
41/* __ Constants __________________________________________________________ */
42
43
44/***********************************************************************//**
45 * @class GCOSInstDir
46 *
47 * @brief COSI instrument direction class
48 *
49 * The COSI instrument direction defines the spatial information
50 * associated to an event.
51 ***************************************************************************/
52class GCOSInstDir : public GInstDir {
53
54public:
55 // Constructors and destructors
56 GCOSInstDir(void);
58 GCOSInstDir(const GSkyDir& dir, const GSkyDir& dir_local, const double& phi);
59 virtual ~GCOSInstDir(void);
60
61 // Operators
63
64 // Implemented pure virtual base class methods
65 virtual void clear(void);
66 virtual GCOSInstDir* clone(void) const;
67 virtual std::string classname(void) const;
68 virtual u_int64_t hash(void) const;
69 virtual std::string print(const GChatter& chatter = NORMAL) const;
70
71 // Other methods
72 void dir(const GSkyDir& dir);
73 const GSkyDir& dir(void) const;
74 void dir_local(const GSkyDir& dir);
75 const GSkyDir& dir_local(void) const;
76 void phi(const double& phi);
77 const double& phi(void) const;
78
79protected:
80 // Protected methods
81 void init_members(void);
82 void copy_members(const GCOSInstDir& dir);
83 void free_members(void);
84
85 // Protected members
86 GSkyDir m_dir; //!< Observed scatter direction of event in celestial coordinates
87 GSkyDir m_dir_local; //!< Observed scatter direction of event in local coordinates
88 double m_phi; //!< Observed scatter angle of event (deg)
89};
90
91
92/***********************************************************************//**
93 * @brief Return class name
94 *
95 * @return String containing the class name ("GCOSInstDir").
96 ***************************************************************************/
97inline
98std::string GCOSInstDir::classname(void) const
99{
100 return ("GCOSInstDir");
101}
102
103
104/***********************************************************************//**
105 * @brief Return event scatter direction in celestial coordinates
106 *
107 * @return Event scatter direction in celestial coordinates.
108 *
109 * Returns the event scatter direction in celestial coordinates.
110 ***************************************************************************/
111inline
112const GSkyDir& GCOSInstDir::dir(void) const
113{
114 return (m_dir);
115}
116
117
118/***********************************************************************//**
119 * @brief Set event scatter direction in celestial coordinates
120 *
121 * @param[in] dir Event scatter direction in celestial coordinates.
122 *
123 * Set the event scatter direction in celestial coordinates.
124 ***************************************************************************/
125inline
126void GCOSInstDir::dir(const GSkyDir& dir)
127{
128 m_dir = dir;
129 return;
130}
131
132
133/***********************************************************************//**
134 * @brief Return event scatter direction in spacecraft coordinates
135 *
136 * @return Event scatter direction in spacecraft coordinates.
137 *
138 * Returns the event scatter direction in spacecraft coordinates.
139 ***************************************************************************/
140inline
142{
143 return (m_dir_local);
144}
145
146
147/***********************************************************************//**
148 * @brief Set event scatter direction in spacecraft coordinates
149 *
150 * @param[in] dir Event scatter direction in spacecraft coordinates.
151 *
152 * Set the event scatter direction in spacecraft coordinates.
153 ***************************************************************************/
154inline
156{
158 return;
159}
160
161
162/***********************************************************************//**
163 * @brief Return event Compton scatter angle
164 *
165 * @return Event Compton scatter angle (deg).
166 *
167 * Returns the event Compton scatter angle.
168 ***************************************************************************/
169inline
170const double& GCOSInstDir::phi(void) const
171{
172 return (m_phi);
173}
174
175
176/***********************************************************************//**
177 * @brief Set event Compton scatter angle
178 *
179 * @param[in] phi Event Compton scatter angle (deg).
180 *
181 * Set the event Compton scatter angle.
182 ***************************************************************************/
183inline
184void GCOSInstDir::phi(const double& phi)
185{
186 m_phi = phi;
187 return;
188}
189
190#endif /* GCOSINSTDIR_HPP */
Abstract instrument direction base class definition.
Sky direction class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
COSI instrument direction class.
virtual u_int64_t hash(void) const
Return COSI instrument direction hash value.
double m_phi
Observed scatter angle of event (deg)
GSkyDir m_dir_local
Observed scatter direction of event in local coordinates.
virtual std::string classname(void) const
Return class name.
virtual ~GCOSInstDir(void)
Destructor.
void copy_members(const GCOSInstDir &dir)
Copy class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COSI instrument direction information.
const GSkyDir & dir_local(void) const
Return event scatter direction in spacecraft coordinates.
GCOSInstDir & operator=(const GCOSInstDir &dir)
Assignment operator.
virtual void clear(void)
Clear COSI instrument direction.
void init_members(void)
Initialise class members.
const GSkyDir & dir(void) const
Return event scatter direction in celestial coordinates.
GCOSInstDir(void)
Void constructor.
const double & phi(void) const
Return event Compton scatter angle.
void free_members(void)
Delete class members.
virtual GCOSInstDir * clone(void) const
Clone COSI instrument direction.
GSkyDir m_dir
Observed scatter direction of event in celestial coordinates.
Abstract instrument direction base class.
Definition GInstDir.hpp:51
Sky direction class.
Definition GSkyDir.hpp:62