GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  ***************************************************************************/
45 class GCOMInstDir : public GInstDir {
46 
47 public:
48  // Constructors and destructors
49  GCOMInstDir(void);
50  GCOMInstDir(const GCOMInstDir& dir);
51  GCOMInstDir(const GSkyDir& dir, const double& phibar);
52  virtual ~GCOMInstDir(void);
53 
54  // Operators
55  GCOMInstDir& operator=(const GCOMInstDir& dir);
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 
70 protected:
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  ***************************************************************************/
87 inline
88 std::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  ***************************************************************************/
101 inline
102 const 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  ***************************************************************************/
115 inline
116 void 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  ***************************************************************************/
130 inline
131 const 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  ***************************************************************************/
144 inline
145 void GCOMInstDir::phibar(const double& phibar)
146 {
147  m_phibar = phibar;
148  return;
149 }
150 
151 #endif /* GCOMINSTDIR_HPP */
Abstract instrument direction base class definition.
Sky direction class interface definition.
void init_members(void)
Initialise class members.
Abstract instrument direction base class.
Definition: GInstDir.hpp:51
virtual std::string print(const GChatter &chatter=NORMAL) const
Print instrument direction information.
GChatter
Definition: GTypemaps.hpp:33
virtual GCOMInstDir * clone(void) const
Clone instance.
const double & phibar(void) const
Return event Compton scatter angle.
virtual std::string classname(void) const
Return class name.
Definition: GCOMInstDir.hpp:88
const GSkyDir & dir(void) const
Return event scatter direction.
virtual void clear(void)
Clear instance.
virtual u_int64_t hash(void) const
Return instrument direction hash value.
GSkyDir m_dir
Observed scatter direction of event.
Definition: GCOMInstDir.hpp:77
virtual ~GCOMInstDir(void)
Destructor.
double m_phibar
Observed scatter angle of event.
Definition: GCOMInstDir.hpp:78
void copy_members(const GCOMInstDir &dir)
Copy class members.
GCOMInstDir & operator=(const GCOMInstDir &dir)
Assignment operator.
Sky direction class.
Definition: GSkyDir.hpp:62
GCOMInstDir(void)
Void constructor.
Definition: GCOMInstDir.cpp:54
void free_members(void)
Delete class members.
Interface for the COMPTEL instrument direction class.
Definition: GCOMInstDir.hpp:45