GammaLib  1.7.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-2017 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 "GInstDir.hpp"
33 #include "GSkyDir.hpp"
34 
35 
36 /***********************************************************************//**
37  * @class GCOMInstDir
38  *
39  * @brief Interface for the COMPTEL instrument direction class
40  ***************************************************************************/
41 class GCOMInstDir : public GInstDir {
42 
43 public:
44  // Constructors and destructors
45  GCOMInstDir(void);
46  GCOMInstDir(const GCOMInstDir& dir);
47  GCOMInstDir(const GSkyDir& dir, const double& phibar);
48  virtual ~GCOMInstDir(void);
49 
50  // Operators
51  GCOMInstDir& operator=(const GCOMInstDir& dir);
52 
53  // Methods
54  virtual void clear(void);
55  virtual GCOMInstDir* clone(void) const;
56  virtual std::string classname(void) const;
57  virtual std::string print(const GChatter& chatter = NORMAL) const;
58 
59  // Other methods
60  void dir(const GSkyDir& dir);
61  const GSkyDir& dir(void) const;
62  void phibar(const double& phibar);
63  const double& phibar(void) const;
64 
65 protected:
66  // Protected methods
67  void init_members(void);
68  void copy_members(const GCOMInstDir& dir);
69  void free_members(void);
70 
71  // Protected members
72  GSkyDir m_dir; //!< Observed scatter direction of event
73  double m_phibar; //!< Observed scatter angle of event
74 };
75 
76 
77 /***********************************************************************//**
78  * @brief Return class name
79  *
80  * @return String containing the class name ("GCOMInstDir").
81  ***************************************************************************/
82 inline
83 std::string GCOMInstDir::classname(void) const
84 {
85  return ("GCOMInstDir");
86 }
87 
88 
89 /***********************************************************************//**
90  * @brief Return event scatter direction
91  *
92  * @return Event scatter direction.
93  *
94  * Returns the event scatter direction.
95  ***************************************************************************/
96 inline
97 const GSkyDir& GCOMInstDir::dir(void) const
98 {
99  return m_dir;
100 }
101 
102 
103 /***********************************************************************//**
104  * @brief Set event scatter direction
105  *
106  * @param[in] dir Event scatter direction.
107  *
108  * Set the event scatter direction.
109  ***************************************************************************/
110 inline
111 void GCOMInstDir::dir(const GSkyDir& dir)
112 {
113  m_dir = dir;
114  return;
115 }
116 
117 
118 /***********************************************************************//**
119  * @brief Return event Compton scatter angle
120  *
121  * @return Event Compton scatter angle.
122  *
123  * Returns the event Compton scatter angle.
124  ***************************************************************************/
125 inline
126 const double& GCOMInstDir::phibar(void) const
127 {
128  return m_phibar;
129 }
130 
131 
132 /***********************************************************************//**
133  * @brief Set event Compton scatter angle
134  *
135  * @param[in] phibar Event Compton scatter angle.
136  *
137  * Set the event Compton scatter angle.
138  ***************************************************************************/
139 inline
140 void GCOMInstDir::phibar(const double& phibar)
141 {
142  m_phibar = phibar;
143  return;
144 }
145 
146 #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:47
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:83
const GSkyDir & dir(void) const
Return event scatter direction.
Definition: GCOMInstDir.hpp:97
virtual void clear(void)
Clear instance.
GSkyDir m_dir
Observed scatter direction of event.
Definition: GCOMInstDir.hpp:72
virtual ~GCOMInstDir(void)
Destructor.
double m_phibar
Observed scatter angle of event.
Definition: GCOMInstDir.hpp:73
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:53
void free_members(void)
Delete class members.
Interface for the COMPTEL instrument direction class.
Definition: GCOMInstDir.hpp:41