GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMEventAtom.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCOMEventAtom.hpp - COMPTEL event atom class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 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 GCOMEventAtom.hpp
23  * @brief COMPTEL event atom class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCOMEVENTATOM_HPP
28 #define GCOMEVENTATOM_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <iostream>
32 #include "GEnergy.hpp"
33 #include "GTime.hpp"
34 #include "GEventAtom.hpp"
35 #include "GCOMInstDir.hpp"
36 
37 /* __ Forward declarations _______________________________________________ */
38 
39 
40 /***********************************************************************//**
41  * @class GCOMEventAtom
42  *
43  * @brief COMPTEL event atom class
44  ***************************************************************************/
45 class GCOMEventAtom : public GEventAtom {
46 
47 public:
48  // Constructors and destructors
49  GCOMEventAtom(void);
50  GCOMEventAtom(const GCOMEventAtom& atom);
51  virtual ~GCOMEventAtom(void);
52 
53  // Operators
55 
56  // Implemented pure virtual base class methods
57  void clear(void);
58  GCOMEventAtom* clone(void) const;
59  std::string classname(void) const;
60  const GCOMInstDir& dir(void) const;
61  const GEnergy& energy(void) const;
62  const GTime& time(void) const;
63  std::string print(const GChatter& chatter = NORMAL) const;
64 
65  // Other methods
66  void dir(const GCOMInstDir& dir);
67  void energy(const GEnergy& energy);
68  void time(const GTime& time);
69  void time(const int& tjd, const int& tics);
70  void phibar(const float& phibar);
71  const float& phibar(void) const;
72  void phi(const float& phi);
73  const float& phi(void) const;
74  void theta(const float& theta);
75  const float& theta(void) const;
76  void eha(const float& eha);
77  const float& eha(void) const;
78  void e1(const float& e1);
79  const float& e1(void) const;
80  void e2(const float& e2);
81  const float& e2(void) const;
82  void psd(const float& psd);
83  const float& psd(void) const;
84  void tof(const float& tof);
85  const float& tof(void) const;
86  void modcom(const int& modcom);
87  const int& modcom(void) const;
88  void reflag(const int& reflag);
89  const int& reflag(void) const;
90  void veto(const int& veto);
91  const int& veto(void) const;
92 
93 protected:
94  // Protected methods
95  void init_members(void);
96  void copy_members(const GCOMEventAtom& atom);
97  void free_members(void);
98 
99  // Protected members
100  GCOMInstDir m_dir; //!< Event direction
101  GEnergy m_energy; //!< Event energy
102  GTime m_time; //!< Event time
103  float m_e1; //!< D1 energy deposit (MeV)
104  float m_e2; //!< D2 energy deposit (MeV)
105  float m_phibar; //!< Compton scatter angle (deg)
106  float m_theta; //!< Zenith angle of scatter direction (deg)
107  float m_phi; //!< Azimuth angle of scatter direction (deg)
108  float m_eha; //!< Earth horizon angle (deg)
109  float m_psd; //!< PSD value (channel)
110  float m_tof; //!< Time of flight value (channel)
111  int m_modcom; //!< Mini telescope number
112  int m_reflag; //!< Rejection flag
113  int m_veto; //!< Veto flag
114 };
115 
116 
117 /***********************************************************************//**
118  * @brief Return class name
119  *
120  * @return String containing the class name ("GCOMEventAtom").
121  ***************************************************************************/
122 inline
123 std::string GCOMEventAtom::classname(void) const
124 {
125  return ("GCOMEventAtom");
126 }
127 
128 
129 /***********************************************************************//**
130  * @brief Return event instrument direction
131  *
132  * @return Event instrument direction.
133  *
134  * Returns the direction of the event.
135  ***************************************************************************/
136 inline
137 const GCOMInstDir& GCOMEventAtom::dir(void) const
138 {
139  return m_dir;
140 }
141 
142 
143 /***********************************************************************//**
144  * @brief Set event instrument direction
145  *
146  * @param[in] dir Event instrument direction.
147  *
148  * Sets the event instrument direction.
149  ***************************************************************************/
150 inline
152 {
153  m_dir = dir;
154  return;
155 }
156 
157 
158 /***********************************************************************//**
159  * @brief Return event energy
160  *
161  * @return Event energy.
162  *
163  * Returns the reconstructed energy of the photon on the sky.
164  ***************************************************************************/
165 inline
166 const GEnergy& GCOMEventAtom::energy(void) const
167 {
168  return m_energy;
169 }
170 
171 
172 /***********************************************************************//**
173  * @brief Set event energy
174  *
175  * @param[in] energy Event energy.
176  *
177  * Sets the event energy.
178  ***************************************************************************/
179 inline
180 void GCOMEventAtom::energy(const GEnergy& energy)
181 {
182  m_energy = energy;
183  return;
184 }
185 
186 
187 /***********************************************************************//**
188  * @brief Return event time
189  *
190  * @return Event time.
191  *
192  * Returns the event triggering time.
193  ***************************************************************************/
194 inline
195 const GTime& GCOMEventAtom::time(void) const
196 {
197  return m_time;
198 }
199 
200 
201 /***********************************************************************//**
202  * @brief Set event time
203  *
204  * @param[in] time Event time.
205  *
206  * Sets the event time.
207  ***************************************************************************/
208 inline
209 void GCOMEventAtom::time(const GTime& time)
210 {
211  m_time = time;
212  return;
213 }
214 
215 
216 /***********************************************************************//**
217  * @brief Set Compton scatter angle
218  *
219  * @param[in] phibar Compton scatter angle (deg).
220  *
221  * Sets Compton scatter angle.
222  ***************************************************************************/
223 inline
224 void GCOMEventAtom::phibar(const float& phibar)
225 {
226  m_phibar = phibar;
227  return;
228 }
229 
230 
231 /***********************************************************************//**
232  * @brief Return Compton scatter angle
233  *
234  * @return Compton scatter angle (deg).
235  *
236  * Returns Compton scatter angle.
237  ***************************************************************************/
238 inline
239 const float& GCOMEventAtom::phibar(void) const
240 {
241  return m_phibar;
242 }
243 
244 
245 /***********************************************************************//**
246  * @brief Set scatter azimuth angle
247  *
248  * @param[in] phi Scatter azimuth angle (deg).
249  *
250  * Sets scatter azimuth angle.
251  ***************************************************************************/
252 inline
253 void GCOMEventAtom::phi(const float& phi)
254 {
255  m_phi = phi;
256  return;
257 }
258 
259 
260 /***********************************************************************//**
261  * @brief Return scatter azimuth angle
262  *
263  * @return Scatter azimuth angle (deg).
264  *
265  * Returns scatter azimuth angle.
266  ***************************************************************************/
267 inline
268 const float& GCOMEventAtom::phi(void) const
269 {
270  return m_phi;
271 }
272 
273 
274 /***********************************************************************//**
275  * @brief Set scatter zenith angle
276  *
277  * @param[in] theta Scatter zenith angle (deg).
278  *
279  * Sets scatter zenith angle.
280  ***************************************************************************/
281 inline
282 void GCOMEventAtom::theta(const float& theta)
283 {
284  m_theta = theta;
285  return;
286 }
287 
288 
289 /***********************************************************************//**
290  * @brief Return scatter zenith angle
291  *
292  * @return Scatter zenith angle (deg).
293  *
294  * Returns scatter zenith angle.
295  ***************************************************************************/
296 inline
297 const float& GCOMEventAtom::theta(void) const
298 {
299  return m_theta;
300 }
301 
302 
303 /***********************************************************************//**
304  * @brief Set Earth horizon angle
305  *
306  * @param[in] eha Earth horizon angle (deg).
307  *
308  * Sets Earth horizon angle.
309  ***************************************************************************/
310 inline
311 void GCOMEventAtom::eha(const float& eha)
312 {
313  m_eha = eha;
314  return;
315 }
316 
317 
318 /***********************************************************************//**
319  * @brief Return Earth horizon angle
320  *
321  * @return Earth horizon angle (deg).
322  *
323  * Returns Earth horizon angle.
324  ***************************************************************************/
325 inline
326 const float& GCOMEventAtom::eha(void) const
327 {
328  return m_eha;
329 }
330 
331 
332 /***********************************************************************//**
333  * @brief Set D1 module energy deposit
334  *
335  * @param[in] e1 D1 module energy deposit (MeV).
336  *
337  * Sets D1 module energy deposit.
338  ***************************************************************************/
339 inline
340 void GCOMEventAtom::e1(const float& e1)
341 {
342  m_e1 = e1;
343  return;
344 }
345 
346 
347 /***********************************************************************//**
348  * @brief Return D1 module energy deposit
349  *
350  * @return D1 module energy deposit (MeV).
351  *
352  * Returns D1 module energy deposit.
353  ***************************************************************************/
354 inline
355 const float& GCOMEventAtom::e1(void) const
356 {
357  return m_e1;
358 }
359 
360 
361 /***********************************************************************//**
362  * @brief Set D2 module energy deposit
363  *
364  * @param[in] e2 D2 module energy deposit (MeV).
365  *
366  * Sets D2 module energy deposit.
367  ***************************************************************************/
368 inline
369 void GCOMEventAtom::e2(const float& e2)
370 {
371  m_e2 = e2;
372  return;
373 }
374 
375 
376 /***********************************************************************//**
377  * @brief Return D2 module energy deposit
378  *
379  * @return D2 module energy deposit (MeV).
380  *
381  * Returns D2 module energy deposit.
382  ***************************************************************************/
383 inline
384 const float& GCOMEventAtom::e2(void) const
385 {
386  return m_e2;
387 }
388 
389 
390 /***********************************************************************//**
391  * @brief Set PSD value
392  *
393  * @param[in] psd PSD value (channel).
394  *
395  * Sets PSD value.
396  ***************************************************************************/
397 /*
398 inline
399 void GCOMEventAtom::psd(const int& psd)
400 {
401  m_psd = psd;
402  return;
403 }
404 */
405 inline
406 void GCOMEventAtom::psd(const float& psd)
407 {
408  m_psd = psd;
409  return;
410 }
411 
412 /***********************************************************************//**
413  * @brief Return PSD value
414  *
415  * @return PSD value (channel).
416  *
417  * Returns the Pulse Shape Discriminator (PSD) channel value of the event.
418  * The PSD value is used for the distinction between gammas and neutrons.
419  ***************************************************************************/
420 /*
421 inline
422 const int& GCOMEventAtom::psd(void) const
423 {
424  return m_psd;
425 }
426 */
427 inline
428 const float& GCOMEventAtom::psd(void) const
429 {
430  return m_psd;
431 }
432 
433 /***********************************************************************//**
434  * @brief Set TOF value
435  *
436  * @param[in] tof TOF value (channel).
437  *
438  * Sets TOF value.
439  ***************************************************************************/
440 /*
441 inline
442 void GCOMEventAtom::tof(const int& tof)
443 {
444  m_tof = tof;
445  return;
446 }
447 */
448 inline
449 void GCOMEventAtom::tof(const float& tof)
450 {
451  m_tof = tof;
452  return;
453 }
454 
455 
456 /***********************************************************************//**
457  * @brief Return TOF value
458  *
459  * @return TOF value (channel).
460  *
461  * Returns the Time Of Flight (TOF) channel value of the event. The TOF
462  * value is used for the distinction between forward and backward scattering
463  * events.
464  ***************************************************************************/
465 /*
466 inline
467 const int& GCOMEventAtom::tof(void) const
468 {
469  return m_tof;
470 }
471 */
472 inline
473 const float& GCOMEventAtom::tof(void) const
474 {
475  return m_tof;
476 }
477 
478 
479 /***********************************************************************//**
480  * @brief Set mini telescope
481  *
482  * @param[in] modcom Mini telescope.
483  *
484  * Sets the mini telescope of the event.
485  ***************************************************************************/
486 inline
487 void GCOMEventAtom::modcom(const int& modcom)
488 {
489  m_modcom = modcom;
490  return;
491 }
492 
493 
494 /***********************************************************************//**
495  * @brief Return mini telescope
496  *
497  * @return Mini telescope.
498  *
499  * Returns the mini telescope of the event.
500  ***************************************************************************/
501 inline
502 const int& GCOMEventAtom::modcom(void) const
503 {
504  return m_modcom;
505 }
506 
507 
508 /***********************************************************************//**
509  * @brief Set rejection flag
510  *
511  * @param[in] reflag Rejection flag.
512  *
513  * Sets the rejection flag of the event.
514  ***************************************************************************/
515 inline
516 void GCOMEventAtom::reflag(const int& reflag)
517 {
518  m_reflag = reflag;
519  return;
520 }
521 
522 
523 /***********************************************************************//**
524  * @brief Return rejection flag
525  *
526  * @return Rejection flag.
527  *
528  * Returns the rejection flag of the event.
529  ***************************************************************************/
530 inline
531 const int& GCOMEventAtom::reflag(void) const
532 {
533  return m_reflag;
534 }
535 
536 
537 /***********************************************************************//**
538  * @brief Set veto flag
539  *
540  * @param[in] veto Veto flag.
541  *
542  * Sets the veto flag of the event.
543  ***************************************************************************/
544 inline
545 void GCOMEventAtom::veto(const int& veto)
546 {
547  m_veto = veto;
548  return;
549 }
550 
551 
552 /***********************************************************************//**
553  * @brief Return veto flag
554  *
555  * @return Veto flag.
556  *
557  * Returns the veto flag of the event.
558  ***************************************************************************/
559 inline
560 const int& GCOMEventAtom::veto(void) const
561 {
562  return m_veto;
563 }
564 
565 #endif /* GCOMEVENTATOM_HPP */
GCOMEventAtom & operator=(const GCOMEventAtom &atom)
Assignment operator.
GCOMInstDir m_dir
Event direction.
void init_members(void)
Initialise class members.
GEnergy m_energy
Event energy.
const float & phibar(void) const
Return Compton scatter angle.
void free_members(void)
Delete class members.
Energy value class definition.
const float & psd(void) const
Return PSD value.
GCOMEventAtom(void)
Void constructor.
Time class.
Definition: GTime.hpp:54
float m_phi
Azimuth angle of scatter direction (deg)
float m_tof
Time of flight value (channel)
const float & theta(void) const
Return scatter zenith angle.
virtual ~GCOMEventAtom(void)
Destructor.
float m_e1
D1 energy deposit (MeV)
float m_e2
D2 energy deposit (MeV)
float m_eha
Earth horizon angle (deg)
const int & reflag(void) const
Return rejection flag.
const float & e1(void) const
Return D1 module energy deposit.
float m_psd
PSD value (channel)
int m_veto
Veto flag.
const GCOMInstDir & dir(void) const
Return event instrument direction.
const float & e2(void) const
Return D2 module energy deposit.
const float & tof(void) const
Return TOF value.
Abstract event atom base class definition.
GChatter
Definition: GTypemaps.hpp:33
const float & eha(void) const
Return Earth horizon angle.
float m_theta
Zenith angle of scatter direction (deg)
void clear(void)
Clear event atom.
const GTime & time(void) const
Return event time.
int m_modcom
Mini telescope number.
std::string classname(void) const
Return class name.
GCOMEventAtom * clone(void) const
Clone event atom.
const GEnergy & energy(void) const
Return event energy.
const float & phi(void) const
Return scatter azimuth angle.
std::string print(const GChatter &chatter=NORMAL) const
Print event information.
const int & modcom(void) const
Return mini telescope.
float m_phibar
Compton scatter angle (deg)
COMPTEL instrument direction class definition.
int m_reflag
Rejection flag.
void copy_members(const GCOMEventAtom &atom)
Copy class members.
Time class interface definition.
const int & veto(void) const
Return veto flag.
Interface for the COMPTEL instrument direction class.
Definition: GCOMInstDir.hpp:41
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48
GTime m_time
Event time.
Abstract interface for the event atom class.
Definition: GEventAtom.hpp:62
COMPTEL event atom class.