GammaLib  1.7.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-2014 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 "GInstDir.hpp"
33 #include "GSkyDir.hpp"
34 
35 
36 /***********************************************************************//**
37  * @class GLATInstDir
38  *
39  * @brief Fermi/LAT instrument direction class
40  *
41  * The LAT instrument direction is an encapsulation of a sky direction
42  * as LAT is an imaging device.
43  ***************************************************************************/
44 class GLATInstDir : public GInstDir {
45 
46 public:
47  // Constructors and destructors
48  GLATInstDir(void);
49  explicit GLATInstDir(const GSkyDir& dir);
50  GLATInstDir(const GLATInstDir& dir);
51  virtual ~GLATInstDir(void);
52 
53  // Operators
54  GLATInstDir& operator=(const GLATInstDir& dir);
55 
56  // Implemented pure virtual base class methods
57  virtual void clear(void);
58  virtual GLATInstDir* clone(void) const;
59  virtual std::string classname(void) const;
60  virtual std::string print(const GChatter& chatter = NORMAL) const;
61 
62  // Other methods
63  void dir(const GSkyDir& dir);
64  GSkyDir& dir(void);
65  const GSkyDir& dir(void) const;
66 
67 protected:
68  // Protected methods
69  void init_members(void);
70  void copy_members(const GLATInstDir& dir);
71  void free_members(void);
72 
73  // Data members
74  GSkyDir m_dir; //!< Observed incident direction of event
75 };
76 
77 
78 /***********************************************************************//**
79  * @brief Return class name
80  *
81  * @return String containing the class name ("GLATInstDir").
82  ***************************************************************************/
83 inline
84 std::string GLATInstDir::classname(void) const
85 {
86  return ("GLATInstDir");
87 }
88 
89 
90 /***********************************************************************//**
91  * @brief Returns reference to sky direction
92  *
93  * @return Reference to sky direction.
94  *
95  * Returns reference to the sky direction.
96  ***************************************************************************/
97 inline
99 {
100  return (m_dir);
101 }
102 
103 
104 /***********************************************************************//**
105  * @brief Returns reference to sky direction (const version)
106  *
107  * @return Reference to sky direction.
108  *
109  * Returns reference to the sky direction.
110  ***************************************************************************/
111 inline
112 const GSkyDir& GLATInstDir::dir(void) const
113 {
114  return (m_dir);
115 }
116 
117 
118 /***********************************************************************//**
119  * @brief Set sky direction
120  *
121  * @param[in] dir Sky direction.
122  *
123  * Set the sky direction.
124  ***************************************************************************/
125 inline
126 void GLATInstDir::dir(const GSkyDir& dir)
127 {
128  m_dir = dir;
129  return;
130 }
131 
132 #endif /* GLATINSTDIR_HPP */
Abstract instrument direction base class definition.
GSkyDir & dir(void)
Returns reference to sky direction.
Definition: GLATInstDir.hpp:98
Sky direction class interface definition.
Fermi/LAT instrument direction class.
Definition: GLATInstDir.hpp:44
GSkyDir m_dir
Observed incident direction of event.
Definition: GLATInstDir.hpp:74
GLATInstDir(void)
Void constructor.
Definition: GLATInstDir.cpp:54
Abstract instrument direction base class.
Definition: GInstDir.hpp:47
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:84