GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMInstChars.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCOMInstChars.hpp - COMPTEL Instrument Characteristics 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 GCOMInstChars.hpp
23  * @brief COMPTEL Instrument Characteristics interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCOMINSTCHARS_HPP
28 #define GCOMINSTCHARS_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <vector>
32 #include <string>
33 #include "GCaldb.hpp"
34 #include "GNodeArray.hpp"
35 
36 /* __ Type definitions ___________________________________________________ */
37 
38 /* __ Forward declarations _______________________________________________ */
39 class GFitsTable;
40 
41 
42 /***********************************************************************//**
43  * @class GCOMInstChars
44  *
45  * @brief Interface for the COMPTEL Instrument Characteristics class
46  ***************************************************************************/
47 class GCOMInstChars : public GBase {
48 
49 public:
50  // Constructors and destructors
51  GCOMInstChars(void);
52  GCOMInstChars(const GCOMInstChars& ict);
53  GCOMInstChars(const GCaldb& caldb, const std::string& ictname);
54  ~GCOMInstChars(void);
55 
56  // Operators
58 
59  // Methods
60  void clear(void);
61  GCOMInstChars* clone(void) const;
62  std::string classname(void) const;
63  void caldb(const GCaldb& caldb);
64  const GCaldb& caldb(void) const;
65  void load(const std::string& ictname);
66  double prob_D1inter(const double& energy) const;
67  double prob_no_multihit(const double& energy) const;
68  double trans_D1(const double& energy) const;
69  double trans_V1(const double& energy) const;
70  double prob_D2inter(const double& energy, const double& phigeo) const;
71  double trans_D2(const double& energy, const double& phigeo) const;
72  double trans_V23(const double& energy, const double& phigeo) const;
73  double prob_no_selfveto(const double& energy, const double& zenith) const;
74  double multi_scatter(const double& energy, const double& phigeo) const;
75  double psd_correction(const double& energy, const double& phigeo) const;
76  std::string print(const GChatter& chatter = NORMAL) const;
77 
78 private:
79  // Private methods
80  void init_members(void);
81  void copy_members(const GCOMInstChars& ict);
82  void free_members(void);
83  void read_coeffs(const GFitsTable& table, GNodeArray& energies,
84  std::vector<double>& coeffs);
85  void read_pos(const GFitsTable& table, std::vector<double>& x,
86  std::vector<double>& y);
87  void read_selfveto(const GFitsTable& table);
88  double ne213a_mfpath(const double& energy) const;
89  double kn_cross_section(const double& k) const;
90  double min_coeff(const std::vector<double>& coeffs) const;
91  double max_coeff(const std::vector<double>& coeffs) const;
92 
93  // Private data members
94  GCaldb m_caldb; //!< Calibration database
95  GNodeArray m_d1inter_energies; //!< D1 interaction coefficient energies (MeV)
96  std::vector<double> m_d1inter_coeffs; //!< D1 interaction coefficients
97  GNodeArray m_d2inter_energies; //!< D2 interaction coefficient energies (MeV)
98  std::vector<double> m_d2inter_coeffs; //!< D2 interaction coefficients
99  GNodeArray m_alu_energies; //!< Al interaction coefficient energies (MeV)
100  std::vector<double> m_alu_coeffs; //!< Al interaction coefficients
101  GNodeArray m_aboved1_energies; //!< Above D1 attenuation coefficient energies (MeV)
102  std::vector<double> m_aboved1_coeffs; //!< Above D1 attenuation coefficients
103  GNodeArray m_veto_energies; //!< Veto dome attenuation coefficient energies (MeV)
104  std::vector<double> m_veto_coeffs; //!< Veto dome attenuation coefficients
105  GNodeArray m_selfveto_energies; //!< Selfveto energies (MeV)
106  GNodeArray m_selfveto_zeniths; //!< Selfveto zenith angle (deg)
107  std::vector<double> m_selfveto_coeffs; //!< Selfveto coefficients (probability)
108  GNodeArray m_d1multi_energies; //!< D1 multihit attenuation coefficient energies (MeV)
109  std::vector<double> m_d1multi_coeffs; //!< D1 multihit attenuation coefficients (probability)
110  GNodeArray m_d2multi_energies; //!< D2 multihit attenuation coefficient energies (MeV)
111  std::vector<double> m_d2multi_coeffs; //!< D2 multihit attenuation coefficients (probability)
112  std::vector<double> m_d1pos_x; //!< D1 x-position (cm)
113  std::vector<double> m_d1pos_y; //!< D1 y-position (cm)
114  std::vector<double> m_d2pos_x; //!< D2 x-position (cm)
115  std::vector<double> m_d2pos_y; //!< D2 y-position (cm)
116  GNodeArray m_mfpath_energies; //!< NE213A mean free path energies (MeV)
117  std::vector<double> m_mfpath_coeffs; //!< NE213A mean free path values
118  double m_d1dens; //!< D1 density (g/cm^-3)
119  double m_d1rad; //!< D1 radius (cm)
120  double m_d1thick; //!< D1 thickness (cm)
121  double m_d2dens; //!< D2 density (g/cm^-3)
122  double m_d2rad; //!< D2 radius (cm)
123  double m_d2thick; //!< D2 thickness (cm)
124  double m_thbar; //!< Average D2 incident angle (deg)
125  double m_delz; //!< Distance between D1 and D2 levels (cm)
126  double m_aldens; //!< Density of aluminium plate above D2 (g/cm^-3)
127  double m_althick; //!< Thickness of aluminium plate above D2 (cm)
128  double m_abdens; //!< Density above D1 (g/cm^-3)
129  double m_abthick; //!< Thickness above D1 (cm)
130  double m_vetodens; //!< Density of veto domes (g/cm^-3)
131  double m_v1thick; //!< Thickness of V1 veto dome (cm)
132  double m_vthick; //!< Thickness of V2 and V3 veto domes together (cm)
133 };
134 
135 
136 /***********************************************************************//**
137  * @brief Return class name
138  *
139  * @return String containing the class name ("GCOMInstChars").
140  ***************************************************************************/
141 inline
142 std::string GCOMInstChars::classname(void) const
143 {
144  return ("GCOMInstChars");
145 }
146 
147 
148 /***********************************************************************//**
149  * @brief Return calibration database
150  *
151  * @return Calibration database.
152  ***************************************************************************/
153 inline
154 const GCaldb& GCOMInstChars::caldb(void) const
155 {
156  return m_caldb;
157 }
158 
159 
160 /***********************************************************************//**
161  * @brief Set calibration database
162  *
163  * @param[in] caldb Calibration database.
164  *
165  * Sets the calibration database containing the COMPTEL D1 module response.
166  ***************************************************************************/
167 inline
168 void GCOMInstChars::caldb(const GCaldb& caldb)
169 {
170  m_caldb = caldb;
171  return;
172 }
173 
174 #endif /* GCOMINSTCHARS_HPP */
double m_delz
Distance between D1 and D2 levels (cm)
std::vector< double > m_d2pos_x
D2 x-position (cm)
Node array class.
Definition: GNodeArray.hpp:60
void read_selfveto(const GFitsTable &table)
Read selfveto coefficients.
double prob_no_multihit(const double &energy) const
Return probability that no multihit occured.
std::vector< double > m_d2inter_coeffs
D2 interaction coefficients.
GNodeArray m_d2inter_energies
D2 interaction coefficient energies (MeV)
double trans_D2(const double &energy, const double &phigeo) const
Return transmission of material between D1 and D2.
double prob_D2inter(const double &energy, const double &phigeo) const
Return D2 interaction probability.
double trans_D1(const double &energy) const
Return transmission above D1.
double max_coeff(const std::vector< double > &coeffs) const
Return maximum coefficient.
double m_abdens
Density above D1 (g/cm^-3)
double prob_D1inter(const double &energy) const
Return D1 interaction probability.
std::vector< double > m_d2multi_coeffs
D2 multihit attenuation coefficients (probability)
GNodeArray m_alu_energies
Al interaction coefficient energies (MeV)
double m_vetodens
Density of veto domes (g/cm^-3)
GCaldb m_caldb
Calibration database.
std::string classname(void) const
Return class name.
void free_members(void)
Delete class members.
void read_pos(const GFitsTable &table, std::vector< double > &x, std::vector< double > &y)
Read module positions.
Interface for the COMPTEL Instrument Characteristics class.
GNodeArray m_aboved1_energies
Above D1 attenuation coefficient energies (MeV)
GNodeArray m_d1multi_energies
D1 multihit attenuation coefficient energies (MeV)
double m_aldens
Density of aluminium plate above D2 (g/cm^-3)
double m_d2dens
D2 density (g/cm^-3)
void copy_members(const GCOMInstChars &ict)
Copy class members.
double m_vthick
Thickness of V2 and V3 veto domes together (cm)
GNodeArray m_mfpath_energies
NE213A mean free path energies (MeV)
GCOMInstChars * clone(void) const
Clone instance.
double psd_correction(const double &energy, const double &phigeo) const
Return PSD correction.
std::vector< double > m_d1pos_y
D1 y-position (cm)
double ne213a_mfpath(const double &energy) const
Return NE213A mean free path.
Node array class interface definition.
Calibration database class.
Definition: GCaldb.hpp:66
std::vector< double > m_d2pos_y
D2 y-position (cm)
double m_abthick
Thickness above D1 (cm)
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
double m_v1thick
Thickness of V1 veto dome (cm)
void load(const std::string &ictname)
Load COMPTEL instrument characteristics.
void read_coeffs(const GFitsTable &table, GNodeArray &energies, std::vector< double > &coeffs)
Read energy dependent coefficients.
std::vector< double > m_d1pos_x
D1 x-position (cm)
double m_d1dens
D1 density (g/cm^-3)
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL instrument characteristics.
Abstract interface for FITS table.
Definition: GFitsTable.hpp:44
void init_members(void)
Initialise class members.
GNodeArray m_selfveto_energies
Selfveto energies (MeV)
GNodeArray m_d2multi_energies
D2 multihit attenuation coefficient energies (MeV)
GChatter
Definition: GTypemaps.hpp:33
const GCaldb & caldb(void) const
Return calibration database.
double m_d2thick
D2 thickness (cm)
std::vector< double > m_d1multi_coeffs
D1 multihit attenuation coefficients (probability)
Calibration database class interface definition.
std::vector< double > m_aboved1_coeffs
Above D1 attenuation coefficients.
GNodeArray m_selfveto_zeniths
Selfveto zenith angle (deg)
double prob_no_selfveto(const double &energy, const double &zenith) const
Return probability that photon was not self vetoed.
GCOMInstChars(void)
Void constructor.
double m_d1thick
D1 thickness (cm)
void clear(void)
Clear instance.
double m_d1rad
D1 radius (cm)
double kn_cross_section(const double &k) const
Return integrated Klein-Nishina cross section.
std::vector< double > m_selfveto_coeffs
Selfveto coefficients (probability)
double m_althick
Thickness of aluminium plate above D2 (cm)
std::vector< double > m_mfpath_coeffs
NE213A mean free path values.
double trans_V1(const double &energy) const
Return V1 veto dome transmission.
double m_thbar
Average D2 incident angle (deg)
double m_d2rad
D2 radius (cm)
GNodeArray m_d1inter_energies
D1 interaction coefficient energies (MeV)
double trans_V23(const double &energy, const double &phigeo) const
Return V2+V3 veto dome transmission.
std::vector< double > m_alu_coeffs
Al interaction coefficients.
GCOMInstChars & operator=(const GCOMInstChars &ict)
Assignment operator.
std::vector< double > m_d1inter_coeffs
D1 interaction coefficients.
std::vector< double > m_veto_coeffs
Veto dome attenuation coefficients.
double min_coeff(const std::vector< double > &coeffs) const
Return minimum coefficient.
GNodeArray m_veto_energies
Veto dome attenuation coefficient energies (MeV)
double multi_scatter(const double &energy, const double &phigeo) const
Return multi-scatter correction.
~GCOMInstChars(void)
Destructor.