GammaLib  2.0.0
 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-2021 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 x_d2(const float& x_d2);
87  const float& x_d2(void) const;
88  void y_d2(const float& y_d2);
89  const float& y_d2(void) const;
90  void modcom(const int& modcom);
91  const int& modcom(void) const;
92  void reflag(const int& reflag);
93  const int& reflag(void) const;
94  void veto(const int& veto);
95  const int& veto(void) const;
96 
97 protected:
98  // Protected methods
99  void init_members(void);
100  void copy_members(const GCOMEventAtom& atom);
101  void free_members(void);
102 
103  // Protected members
104  GCOMInstDir m_dir; //!< Event direction
105  GEnergy m_energy; //!< Event energy
106  GTime m_time; //!< Event time
107  float m_e1; //!< D1 energy deposit (MeV)
108  float m_e2; //!< D2 energy deposit (MeV)
109  float m_phibar; //!< Compton scatter angle (deg)
110  float m_theta; //!< Zenith angle of scatter direction (deg)
111  float m_phi; //!< Azimuth angle of scatter direction (deg)
112  float m_eha; //!< Earth horizon angle (deg)
113  float m_psd; //!< PSD value (channel)
114  float m_tof; //!< Time of flight value (channel)
115  float m_x_d2; //!< D2 model X position (mm)
116  float m_y_d2; //!< D2 model X position (mm)
117  int m_modcom; //!< Mini telescope number
118  int m_reflag; //!< Rejection flag
119  int m_veto; //!< Veto flag
120 };
121 
122 
123 /***********************************************************************//**
124  * @brief Return class name
125  *
126  * @return String containing the class name ("GCOMEventAtom").
127  ***************************************************************************/
128 inline
129 std::string GCOMEventAtom::classname(void) const
130 {
131  return ("GCOMEventAtom");
132 }
133 
134 
135 /***********************************************************************//**
136  * @brief Return event instrument direction
137  *
138  * @return Event instrument direction.
139  *
140  * Returns the direction of the event.
141  ***************************************************************************/
142 inline
143 const GCOMInstDir& GCOMEventAtom::dir(void) const
144 {
145  return m_dir;
146 }
147 
148 
149 /***********************************************************************//**
150  * @brief Set event instrument direction
151  *
152  * @param[in] dir Event instrument direction.
153  *
154  * Sets the event instrument direction.
155  ***************************************************************************/
156 inline
158 {
159  m_dir = dir;
160  return;
161 }
162 
163 
164 /***********************************************************************//**
165  * @brief Return event energy
166  *
167  * @return Event energy.
168  *
169  * Returns the reconstructed energy of the photon on the sky.
170  ***************************************************************************/
171 inline
172 const GEnergy& GCOMEventAtom::energy(void) const
173 {
174  return m_energy;
175 }
176 
177 
178 /***********************************************************************//**
179  * @brief Set event energy
180  *
181  * @param[in] energy Event energy.
182  *
183  * Sets the event energy.
184  ***************************************************************************/
185 inline
186 void GCOMEventAtom::energy(const GEnergy& energy)
187 {
188  m_energy = energy;
189  return;
190 }
191 
192 
193 /***********************************************************************//**
194  * @brief Return event time
195  *
196  * @return Event time.
197  *
198  * Returns the event triggering time.
199  ***************************************************************************/
200 inline
201 const GTime& GCOMEventAtom::time(void) const
202 {
203  return m_time;
204 }
205 
206 
207 /***********************************************************************//**
208  * @brief Set event time
209  *
210  * @param[in] time Event time.
211  *
212  * Sets the event time.
213  ***************************************************************************/
214 inline
215 void GCOMEventAtom::time(const GTime& time)
216 {
217  m_time = time;
218  return;
219 }
220 
221 
222 /***********************************************************************//**
223  * @brief Set Compton scatter angle
224  *
225  * @param[in] phibar Compton scatter angle (deg).
226  *
227  * Sets Compton scatter angle.
228  ***************************************************************************/
229 inline
230 void GCOMEventAtom::phibar(const float& phibar)
231 {
232  m_phibar = phibar;
233  return;
234 }
235 
236 
237 /***********************************************************************//**
238  * @brief Return Compton scatter angle
239  *
240  * @return Compton scatter angle (deg).
241  *
242  * Returns Compton scatter angle.
243  ***************************************************************************/
244 inline
245 const float& GCOMEventAtom::phibar(void) const
246 {
247  return m_phibar;
248 }
249 
250 
251 /***********************************************************************//**
252  * @brief Set scatter azimuth angle
253  *
254  * @param[in] phi Scatter azimuth angle (deg).
255  *
256  * Sets scatter azimuth angle.
257  ***************************************************************************/
258 inline
259 void GCOMEventAtom::phi(const float& phi)
260 {
261  m_phi = phi;
262  return;
263 }
264 
265 
266 /***********************************************************************//**
267  * @brief Return scatter azimuth angle
268  *
269  * @return Scatter azimuth angle (deg).
270  *
271  * Returns scatter azimuth angle.
272  ***************************************************************************/
273 inline
274 const float& GCOMEventAtom::phi(void) const
275 {
276  return m_phi;
277 }
278 
279 
280 /***********************************************************************//**
281  * @brief Set scatter zenith angle
282  *
283  * @param[in] theta Scatter zenith angle (deg).
284  *
285  * Sets scatter zenith angle.
286  ***************************************************************************/
287 inline
288 void GCOMEventAtom::theta(const float& theta)
289 {
290  m_theta = theta;
291  return;
292 }
293 
294 
295 /***********************************************************************//**
296  * @brief Return scatter zenith angle
297  *
298  * @return Scatter zenith angle (deg).
299  *
300  * Returns scatter zenith angle.
301  ***************************************************************************/
302 inline
303 const float& GCOMEventAtom::theta(void) const
304 {
305  return m_theta;
306 }
307 
308 
309 /***********************************************************************//**
310  * @brief Set Earth horizon angle
311  *
312  * @param[in] eha Earth horizon angle (deg).
313  *
314  * Sets Earth horizon angle.
315  ***************************************************************************/
316 inline
317 void GCOMEventAtom::eha(const float& eha)
318 {
319  m_eha = eha;
320  return;
321 }
322 
323 
324 /***********************************************************************//**
325  * @brief Return Earth horizon angle
326  *
327  * @return Earth horizon angle (deg).
328  *
329  * Returns Earth horizon angle.
330  ***************************************************************************/
331 inline
332 const float& GCOMEventAtom::eha(void) const
333 {
334  return m_eha;
335 }
336 
337 
338 /***********************************************************************//**
339  * @brief Set D1 module energy deposit
340  *
341  * @param[in] e1 D1 module energy deposit (MeV).
342  *
343  * Sets D1 module energy deposit.
344  ***************************************************************************/
345 inline
346 void GCOMEventAtom::e1(const float& e1)
347 {
348  m_e1 = e1;
349  return;
350 }
351 
352 
353 /***********************************************************************//**
354  * @brief Return D1 module energy deposit
355  *
356  * @return D1 module energy deposit (MeV).
357  *
358  * Returns D1 module energy deposit.
359  ***************************************************************************/
360 inline
361 const float& GCOMEventAtom::e1(void) const
362 {
363  return m_e1;
364 }
365 
366 
367 /***********************************************************************//**
368  * @brief Set D2 module energy deposit
369  *
370  * @param[in] e2 D2 module energy deposit (MeV).
371  *
372  * Sets D2 module energy deposit.
373  ***************************************************************************/
374 inline
375 void GCOMEventAtom::e2(const float& e2)
376 {
377  m_e2 = e2;
378  return;
379 }
380 
381 
382 /***********************************************************************//**
383  * @brief Return D2 module energy deposit
384  *
385  * @return D2 module energy deposit (MeV).
386  *
387  * Returns D2 module energy deposit.
388  ***************************************************************************/
389 inline
390 const float& GCOMEventAtom::e2(void) const
391 {
392  return m_e2;
393 }
394 
395 
396 /***********************************************************************//**
397  * @brief Set PSD value
398  *
399  * @param[in] psd PSD value (channel).
400  *
401  * Sets PSD value.
402  ***************************************************************************/
403 inline
404 void GCOMEventAtom::psd(const float& psd)
405 {
406  m_psd = psd;
407  return;
408 }
409 
410 /***********************************************************************//**
411  * @brief Return PSD value
412  *
413  * @return PSD value (channel).
414  *
415  * Returns the Pulse Shape Discriminator (PSD) channel value of the event.
416  * The PSD value is used for the distinction between gammas and neutrons.
417  ***************************************************************************/
418 inline
419 const float& GCOMEventAtom::psd(void) const
420 {
421  return m_psd;
422 }
423 
424 /***********************************************************************//**
425  * @brief Set TOF value
426  *
427  * @param[in] tof TOF value (channel).
428  *
429  * Sets TOF value.
430  ***************************************************************************/
431 inline
432 void GCOMEventAtom::tof(const float& tof)
433 {
434  m_tof = tof;
435  return;
436 }
437 
438 
439 /***********************************************************************//**
440  * @brief Return TOF value
441  *
442  * @return TOF value (channel).
443  *
444  * Returns the Time Of Flight (TOF) channel value of the event. The TOF
445  * value is used for the distinction between forward and backward scattering
446  * events.
447  ***************************************************************************/
448 inline
449 const float& GCOMEventAtom::tof(void) const
450 {
451  return m_tof;
452 }
453 
454 
455 /***********************************************************************//**
456  * @brief Set D2 module X value
457  *
458  * @param[in] x_d2 D2 module X value (mm).
459  *
460  * Sets D2 module X value.
461  ***************************************************************************/
462 inline
463 void GCOMEventAtom::x_d2(const float& x_d2)
464 {
465  m_x_d2 = x_d2;
466  return;
467 }
468 
469 
470 /***********************************************************************//**
471  * @brief Return D2 module X value
472  *
473  * @return D2 module X value (mm).
474  *
475  * Returns the D2 module X value of the event.
476  ***************************************************************************/
477 inline
478 const float& GCOMEventAtom::x_d2(void) const
479 {
480  return m_x_d2;
481 }
482 
483 
484 /***********************************************************************//**
485  * @brief Set D2 module Y value
486  *
487  * @param[in] y_d2 D2 module Y value (mm).
488  *
489  * Sets D2 module Y value.
490  ***************************************************************************/
491 inline
492 void GCOMEventAtom::y_d2(const float& y_d2)
493 {
494  m_y_d2 = y_d2;
495  return;
496 }
497 
498 
499 /***********************************************************************//**
500  * @brief Return D2 module Y value
501  *
502  * @return D2 module Y value (mm).
503  *
504  * Returns the D2 module Y value of the event.
505  ***************************************************************************/
506 inline
507 const float& GCOMEventAtom::y_d2(void) const
508 {
509  return m_y_d2;
510 }
511 
512 
513 /***********************************************************************//**
514  * @brief Set mini telescope
515  *
516  * @param[in] modcom Mini telescope.
517  *
518  * Sets the mini telescope of the event.
519  ***************************************************************************/
520 inline
521 void GCOMEventAtom::modcom(const int& modcom)
522 {
523  m_modcom = modcom;
524  return;
525 }
526 
527 
528 /***********************************************************************//**
529  * @brief Return mini telescope
530  *
531  * @return Mini telescope.
532  *
533  * Returns the mini telescope of the event.
534  ***************************************************************************/
535 inline
536 const int& GCOMEventAtom::modcom(void) const
537 {
538  return m_modcom;
539 }
540 
541 
542 /***********************************************************************//**
543  * @brief Set rejection flag
544  *
545  * @param[in] reflag Rejection flag.
546  *
547  * Sets the rejection flag of the event.
548  ***************************************************************************/
549 inline
550 void GCOMEventAtom::reflag(const int& reflag)
551 {
552  m_reflag = reflag;
553  return;
554 }
555 
556 
557 /***********************************************************************//**
558  * @brief Return rejection flag
559  *
560  * @return Rejection flag.
561  *
562  * Returns the rejection flag of the event.
563  ***************************************************************************/
564 inline
565 const int& GCOMEventAtom::reflag(void) const
566 {
567  return m_reflag;
568 }
569 
570 
571 /***********************************************************************//**
572  * @brief Set veto flag
573  *
574  * @param[in] veto Veto flag.
575  *
576  * Sets the veto flag of the event.
577  ***************************************************************************/
578 inline
579 void GCOMEventAtom::veto(const int& veto)
580 {
581  m_veto = veto;
582  return;
583 }
584 
585 
586 /***********************************************************************//**
587  * @brief Return veto flag
588  *
589  * @return Veto flag.
590  *
591  * Returns the veto flag of the event.
592  ***************************************************************************/
593 inline
594 const int& GCOMEventAtom::veto(void) const
595 {
596  return m_veto;
597 }
598 
599 #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.
float m_x_d2
D2 model X position (mm)
Energy value class definition.
const float & psd(void) const
Return PSD value.
GCOMEventAtom(void)
Void constructor.
const float & y_d2(void) const
Return D2 module Y value.
Time class.
Definition: GTime.hpp:55
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 float & x_d2(void) const
Return D2 module X value.
const int & modcom(void) const
Return mini telescope.
float m_y_d2
D2 model X position (mm)
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:45
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.