GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GLATInstDir.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GLATInstDir.hpp - Fermi/LAT instrument direction class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-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 GLATInstDir.hpp
23  * @brief Fermi/LAT instrument direction class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GLATINSTDIR_HPP
28 #define GLATINSTDIR_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 GLATInstDir
42  *
43  * @brief Fermi/LAT instrument direction class
44  *
45  * The LAT instrument direction is an encapsulation of a sky direction
46  * as LAT is an imaging device.
47  ***************************************************************************/
48 class GLATInstDir : public GInstDir {
49 
50 public:
51  // Constructors and destructors
52  GLATInstDir(void);
53  explicit GLATInstDir(const GSkyDir& dir);
54  GLATInstDir(const GLATInstDir& dir);
55  virtual ~GLATInstDir(void);
56 
57  // Operators
58  GLATInstDir& operator=(const GLATInstDir& dir);
59 
60  // Implemented pure virtual base class methods
61  virtual void clear(void);
62  virtual GLATInstDir* clone(void) const;
63  virtual std::string classname(void) const;
64  virtual u_int64_t hash(void) const;
65  virtual std::string print(const GChatter& chatter = NORMAL) const;
66 
67  // Other methods
68  void dir(const GSkyDir& dir);
69  GSkyDir& dir(void);
70  const GSkyDir& dir(void) const;
71 
72 protected:
73  // Protected methods
74  void init_members(void);
75  void copy_members(const GLATInstDir& dir);
76  void free_members(void);
77 
78  // Data members
79  GSkyDir m_dir; //!< Observed incident direction of event
80 };
81 
82 
83 /***********************************************************************//**
84  * @brief Return class name
85  *
86  * @return String containing the class name ("GLATInstDir").
87  ***************************************************************************/
88 inline
89 std::string GLATInstDir::classname(void) const
90 {
91  return ("GLATInstDir");
92 }
93 
94 
95 /***********************************************************************//**
96  * @brief Returns reference to sky direction
97  *
98  * @return Reference to sky direction.
99  *
100  * Returns reference to the sky direction.
101  ***************************************************************************/
102 inline
104 {
105  return (m_dir);
106 }
107 
108 
109 /***********************************************************************//**
110  * @brief Returns reference to sky direction (const version)
111  *
112  * @return Reference to sky direction.
113  *
114  * Returns reference to the sky direction.
115  ***************************************************************************/
116 inline
117 const GSkyDir& GLATInstDir::dir(void) const
118 {
119  return (m_dir);
120 }
121 
122 
123 /***********************************************************************//**
124  * @brief Set sky direction
125  *
126  * @param[in] dir Sky direction.
127  *
128  * Set the sky direction.
129  ***************************************************************************/
130 inline
131 void GLATInstDir::dir(const GSkyDir& dir)
132 {
133  m_dir = dir;
134  return;
135 }
136 
137 #endif /* GLATINSTDIR_HPP */
virtual u_int64_t hash(void) const
Return instrument direction hash value.
Abstract instrument direction base class definition.
GSkyDir & dir(void)
Returns reference to sky direction.
Sky direction class interface definition.
Fermi/LAT instrument direction class.
Definition: GLATInstDir.hpp:48
GSkyDir m_dir
Observed incident direction of event.
Definition: GLATInstDir.hpp:79
GLATInstDir(void)
Void constructor.
Definition: GLATInstDir.cpp:55
Abstract instrument direction base class.
Definition: GInstDir.hpp:51
virtual void clear(void)
Clear Fermi/LAT instrument direction.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
virtual ~GLATInstDir(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print instrument direction information.
GChatter
Definition: GTypemaps.hpp:33
virtual GLATInstDir * clone(void) const
Clone Fermi/LAT instrument direction.
GLATInstDir & operator=(const GLATInstDir &dir)
Assignment operator.
void copy_members(const GLATInstDir &dir)
Copy class members.
Sky direction class.
Definition: GSkyDir.hpp:62
virtual std::string classname(void) const
Return class name.
Definition: GLATInstDir.hpp:89