GammaLib 2.0.0
Loading...
Searching...
No Matches
GCOMInstDir.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOMInstDir.hpp - COMPTEL instrument direction class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2012-2020 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 GCOMInstDir.hpp
23 * @brief COMPTEL instrument direction class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOMINSTDIR_HPP
28#define GCOMINSTDIR_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
40/***********************************************************************//**
41 * @class GCOMInstDir
42 *
43 * @brief Interface for the COMPTEL instrument direction class
44 ***************************************************************************/
45class GCOMInstDir : public GInstDir {
46
47public:
48 // Constructors and destructors
49 GCOMInstDir(void);
51 GCOMInstDir(const GSkyDir& dir, const double& phibar);
52 virtual ~GCOMInstDir(void);
53
54 // Operators
56
57 // Methods
58 virtual void clear(void);
59 virtual GCOMInstDir* clone(void) const;
60 virtual std::string classname(void) const;
61 virtual u_int64_t hash(void) const;
62 virtual std::string print(const GChatter& chatter = NORMAL) const;
63
64 // Other methods
65 void dir(const GSkyDir& dir);
66 const GSkyDir& dir(void) const;
67 void phibar(const double& phibar);
68 const double& phibar(void) const;
69
70protected:
71 // Protected methods
72 void init_members(void);
73 void copy_members(const GCOMInstDir& dir);
74 void free_members(void);
75
76 // Protected members
77 GSkyDir m_dir; //!< Observed scatter direction of event
78 double m_phibar; //!< Observed scatter angle of event
79};
80
81
82/***********************************************************************//**
83 * @brief Return class name
84 *
85 * @return String containing the class name ("GCOMInstDir").
86 ***************************************************************************/
87inline
88std::string GCOMInstDir::classname(void) const
89{
90 return ("GCOMInstDir");
91}
92
93
94/***********************************************************************//**
95 * @brief Return event scatter direction
96 *
97 * @return Event scatter direction.
98 *
99 * Returns the event scatter direction.
100 ***************************************************************************/
101inline
102const GSkyDir& GCOMInstDir::dir(void) const
103{
104 return m_dir;
105}
106
107
108/***********************************************************************//**
109 * @brief Set event scatter direction
110 *
111 * @param[in] dir Event scatter direction.
112 *
113 * Set the event scatter direction.
114 ***************************************************************************/
115inline
116void GCOMInstDir::dir(const GSkyDir& dir)
117{
118 m_dir = dir;
119 return;
120}
121
122
123/***********************************************************************//**
124 * @brief Return event Compton scatter angle
125 *
126 * @return Event Compton scatter angle (deg).
127 *
128 * Returns the event Compton scatter angle.
129 ***************************************************************************/
130inline
131const double& GCOMInstDir::phibar(void) const
132{
133 return m_phibar;
134}
135
136
137/***********************************************************************//**
138 * @brief Set event Compton scatter angle
139 *
140 * @param[in] phibar Event Compton scatter angle (deg).
141 *
142 * Set the event Compton scatter angle.
143 ***************************************************************************/
144inline
145void GCOMInstDir::phibar(const double& phibar)
146{
148 return;
149}
150
151#endif /* GCOMINSTDIR_HPP */
Abstract instrument direction base class definition.
Sky direction class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface for the COMPTEL instrument direction class.
const GSkyDir & dir(void) const
Return event scatter direction.
virtual ~GCOMInstDir(void)
Destructor.
GSkyDir m_dir
Observed scatter direction of event.
const double & phibar(void) const
Return event Compton scatter angle.
void copy_members(const GCOMInstDir &dir)
Copy class members.
virtual u_int64_t hash(void) const
Return instrument direction hash value.
virtual std::string classname(void) const
Return class name.
virtual void clear(void)
Clear instance.
virtual GCOMInstDir * clone(void) const
Clone instance.
GCOMInstDir & operator=(const GCOMInstDir &dir)
Assignment operator.
double m_phibar
Observed scatter angle of event.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
GCOMInstDir(void)
Void constructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print instrument direction information.
Abstract instrument direction base class.
Definition GInstDir.hpp:51
Sky direction class.
Definition GSkyDir.hpp:62