Commit 7080931b4306c56d6e1c2d1503c18a5e9c2d1b1a
1 parent
8e8249d3
Add Doxygen documentation of energy dispersion classes
Showing
6 changed files
with
103 additions
and
24 deletions
inst/cta/include/GCTAEdisp2D.hpp
| ... | ... | @@ -51,7 +51,15 @@ namespace gammalib { |
| 51 | 51 | * |
| 52 | 52 | * @brief CTA 2D energy dispersion class |
| 53 | 53 | * |
| 54 | - * This class implements the energy dispersion for the CTA 2D response. | |
| 54 | + * This class implements the energy dispersion for the CTA 2D response. The | |
| 55 | + * energy dispersion is defined as | |
| 56 | + * | |
| 57 | + * \f[ | |
| 58 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}, \theta) = | |
| 59 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 60 | + * \f] | |
| 61 | + * | |
| 62 | + * and given in units of \f$(\log_{10} MeV)^{-1}\f$. | |
| 55 | 63 | ***************************************************************************/ |
| 56 | 64 | class GCTAEdisp2D : public GCTAEdisp { |
| 57 | 65 | ... | ... |
inst/cta/include/GCTAEdispPerfTable.hpp
| ... | ... | @@ -47,6 +47,15 @@ class GRan; |
| 47 | 47 | * of energy as determined from a performance table. The performance table is |
| 48 | 48 | * an ASCII file that specifies the CTA performance parameters in a simple |
| 49 | 49 | * way. |
| 50 | + * | |
| 51 | + * The energy dispersion is defined as | |
| 52 | + * | |
| 53 | + * \f[ | |
| 54 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}) = | |
| 55 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 56 | + * \f] | |
| 57 | + * | |
| 58 | + * and given in units of \f$(\log_{10} MeV)^{-1}\f$. | |
| 50 | 59 | ***************************************************************************/ |
| 51 | 60 | class GCTAEdispPerfTable : public GCTAEdisp { |
| 52 | 61 | ... | ... |
inst/cta/include/GCTAEdispRmf.hpp
| ... | ... | @@ -46,6 +46,15 @@ class GEbounds; |
| 46 | 46 | * @class GCTAEdispRmf |
| 47 | 47 | * |
| 48 | 48 | * @brief CTA Redistribution Matrix File (RMF) energy dispersion class |
| 49 | + * | |
| 50 | + * The energy dispersion is defined as | |
| 51 | + * | |
| 52 | + * \f[ | |
| 53 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}) = | |
| 54 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 55 | + * \f] | |
| 56 | + * | |
| 57 | + * and given in units of \f$(\log_{10} MeV)^{-1}\f$. | |
| 49 | 58 | ***************************************************************************/ |
| 50 | 59 | class GCTAEdispRmf : public GCTAEdisp { |
| 51 | 60 | ... | ... |
inst/cta/src/GCTAEdisp2D.cpp
| ... | ... | @@ -176,18 +176,27 @@ GCTAEdisp2D& GCTAEdisp2D::operator=(const GCTAEdisp2D& edisp) |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | /***********************************************************************//** |
| 179 | - * @brief Return energy dispersion in units of s^-1 MeV^-1 | |
| 179 | + * @brief Return energy dispersion in units of \f$(\log_{10} MeV)^{-1}\f$ | |
| 180 | 180 | * |
| 181 | 181 | * @param[in] logEobs Log10 of the measured energy (TeV). |
| 182 | 182 | * @param[in] logEsrc Log10 of the true photon energy (TeV). |
| 183 | - * @param[in] theta Offset angle in camera system (rad). Defaults to 0.0. | |
| 183 | + * @param[in] theta Offset angle in camera system (rad). | |
| 184 | 184 | * @param[in] phi Azimuth angle in camera system (rad). Not used in this method. |
| 185 | 185 | * @param[in] zenith Zenith angle in Earth system (rad). Not used in this method. |
| 186 | 186 | * @param[in] azimuth Azimuth angle in Earth system (rad). Not used in this method. |
| 187 | 187 | * |
| 188 | - * Returns the energy dispersion in units of s^-1 MeV^-1 for a given observed | |
| 189 | - * energy @p logEobs, true photon energy @p logEsrc and offset angle | |
| 190 | - * @p theta. | |
| 188 | + * Returns the energy dispersion | |
| 189 | + * | |
| 190 | + * \f[ | |
| 191 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}, \theta) = | |
| 192 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 193 | + * \f] | |
| 194 | + * | |
| 195 | + * in units of \f$(\log_{10} MeV)^{-1}\f$ where | |
| 196 | + * \f$\log_{10} E_{\rm reco}\f$ is the logarithm of the reconstructed energy | |
| 197 | + * in TeV, | |
| 198 | + * \f$\log_{10} E_{\rm true}\f$ is the logarithm of the true energy in TeV and | |
| 199 | + * \f$\theta\f$ is the offset angle in radians. | |
| 191 | 200 | ***************************************************************************/ |
| 192 | 201 | double GCTAEdisp2D::operator()(const double& logEobs, |
| 193 | 202 | const double& logEsrc, |
| ... | ... | @@ -761,9 +770,9 @@ void GCTAEdisp2D::fetch(void) const |
| 761 | 770 | } |
| 762 | 771 | |
| 763 | 772 | } // endif: filename was not empty |
| 764 | - | |
| 773 | + | |
| 765 | 774 | } // endif: energy dispersion had not yet been fetched |
| 766 | - | |
| 775 | + | |
| 767 | 776 | // Return |
| 768 | 777 | return; |
| 769 | 778 | } |
| ... | ... | @@ -1338,9 +1347,11 @@ void GCTAEdisp2D::set_table(void) |
| 1338 | 1347 | // Set table boundaries |
| 1339 | 1348 | set_boundaries(); |
| 1340 | 1349 | |
| 1341 | - // Smooth energy dispersion table | |
| 1350 | + // Smooth energy dispersion table (kludge only for CTA) | |
| 1342 | 1351 | #if defined(G_SMOOTH_EDISP_KLUDGE) |
| 1343 | - smooth_table(); | |
| 1352 | + if (gammalib::strip_whitespace(m_edisp.telescope()) == "CTA") { | |
| 1353 | + smooth_table(); | |
| 1354 | + } | |
| 1344 | 1355 | #endif |
| 1345 | 1356 | |
| 1346 | 1357 | // Normalize energy dispersion table |
| ... | ... | @@ -1413,6 +1424,31 @@ void GCTAEdisp2D::set_max_edisp(void) const |
| 1413 | 1424 | |
| 1414 | 1425 | /***********************************************************************//** |
| 1415 | 1426 | * @brief Normalize energy dispersion table |
| 1427 | + * | |
| 1428 | + * Normalize the energy dispersion table using | |
| 1429 | + * | |
| 1430 | + * \f[ | |
| 1431 | + * \int_{\log_{10} E_{\rm reco}^{\rm min}}^{\log_{10} E_{\rm reco}^{\rm max}} | |
| 1432 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}, \theta) | |
| 1433 | + * \, d(\log_{10} E_{\rm reco}) = 1 | |
| 1434 | + * \f] | |
| 1435 | + * | |
| 1436 | + * where | |
| 1437 | + * \f$E_{\rm reco}^{\rm min}\f$ is the minimum and | |
| 1438 | + * \f$E_{\rm reco}^{\rm max}\f$ the maximum reconstructed energy for a given | |
| 1439 | + * true energy, returned by the method ebounds_obs(), | |
| 1440 | + * \f$E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}, \theta)\f$ | |
| 1441 | + * is the energy dispersion returned by the GCTAEdisp2D::operator(), given in | |
| 1442 | + * units of \f$(\log_{10} MeV)^{-1}\f$, | |
| 1443 | + * \f$\log_{10} E_{\rm reco}\f$ is the logarithm of the reconstructued energy | |
| 1444 | + * in TeV, and | |
| 1445 | + * \f$\log_{10} E_{\rm true}\f$ is the logarithm of the true energy in TeV. | |
| 1446 | + * | |
| 1447 | + * The normalisation is performed for each \f$E_{\rm true}\f$ and | |
| 1448 | + * \f$\theta\f$ bin using a Romberg integration method. Since the | |
| 1449 | + * normalisation may affect the energy boundaries | |
| 1450 | + * \f$E_{\rm reco}^{\rm min}\f$ and \f$E_{\rm reco}^{\rm max}\f$, two | |
| 1451 | + * normalisation passes are performed to stabilize the result. | |
| 1416 | 1452 | ***************************************************************************/ |
| 1417 | 1453 | void GCTAEdisp2D::normalize_table(void) |
| 1418 | 1454 | { |
| ... | ... | @@ -1681,7 +1717,7 @@ void GCTAEdisp2D::smooth_table(void) |
| 1681 | 1717 | total(ietrue) = 0.0; |
| 1682 | 1718 | } |
| 1683 | 1719 | } |
| 1684 | - | |
| 1720 | + | |
| 1685 | 1721 | // Replace matrix by Gaussians |
| 1686 | 1722 | for (int ietrue = 0; ietrue < netrue; ++ietrue) { |
| 1687 | 1723 | |
| ... | ... | @@ -1703,7 +1739,7 @@ void GCTAEdisp2D::smooth_table(void) |
| 1703 | 1739 | m_edisp(m_inx_matrix, i) = 0.0; |
| 1704 | 1740 | } |
| 1705 | 1741 | } |
| 1706 | - | |
| 1742 | + | |
| 1707 | 1743 | } // endif: there was information |
| 1708 | 1744 | |
| 1709 | 1745 | // ... otherwise reset the matrix to zero | ... | ... |
inst/cta/src/GCTAEdispPerfTable.cpp
| ... | ... | @@ -158,7 +158,7 @@ GCTAEdispPerfTable& GCTAEdispPerfTable::operator=(const GCTAEdispPerfTable& edis |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | /***********************************************************************//** |
| 161 | - * @brief Return energy dispersion. | |
| 161 | + * @brief Return energy dispersion in units of \f$(\log_{10} MeV)^{-1}\f$ | |
| 162 | 162 | * |
| 163 | 163 | * @param[in] logEobs log10 of the observed photon energy (TeV). |
| 164 | 164 | * @param[in] logEsrc log10 of the true photon energy (TeV). |
| ... | ... | @@ -167,15 +167,24 @@ GCTAEdispPerfTable& GCTAEdispPerfTable::operator=(const GCTAEdispPerfTable& edis |
| 167 | 167 | * @param[in] zenith Zenith angle in Earth system (rad). Not used. |
| 168 | 168 | * @param[in] azimuth Azimuth angle in Earth system (rad). Not used. |
| 169 | 169 | * |
| 170 | - * Returns the energy resolution, i.e. the probability density in observed | |
| 171 | - * photon energy at a given (log10(E_src), log10(E_obs)). | |
| 172 | - * To be precise: energy dispersion = dP / d(log10(E_obs)). | |
| 173 | - * | |
| 174 | - * Evaluates | |
| 170 | + * Returns the energy dispersion | |
| 175 | 171 | * |
| 176 | 172 | * \f[ |
| 177 | - * S(E) = \frac{1}{\sqrt{2\pi}m\_sigma} | |
| 178 | - * \exp(\frac{-(logEobs-logEsrc)^2}{2 m\_sigma^2}) | |
| 173 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}) = | |
| 174 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 175 | + * \f] | |
| 176 | + * | |
| 177 | + * in units of \f$(\log_{10} MeV)^{-1}\f$ where | |
| 178 | + * \f$\log_{10} E_{\rm reco}\f$ is the logarithm of the reconstructed energy | |
| 179 | + * in TeV, and | |
| 180 | + * \f$\log_{10} E_{\rm true}\f$ is the logarithm of the true energy in TeV. | |
| 181 | + * | |
| 182 | + * The operator evaluates | |
| 183 | + * | |
| 184 | + * \f[ | |
| 185 | + * E_{\rm disp} = \frac{1}{\sqrt{2\pi}m\_sigma} | |
| 186 | + * \exp(\frac{-(\log_{10} E_{\rm reco} - | |
| 187 | + * \log_{10} E_{\rm true})^2}{2 m\_sigma^2}) | |
| 179 | 188 | * \f] |
| 180 | 189 | ***************************************************************************/ |
| 181 | 190 | double GCTAEdispPerfTable::operator()(const double& logEobs, | ... | ... |
inst/cta/src/GCTAEdispRmf.cpp
| ... | ... | @@ -160,7 +160,7 @@ GCTAEdispRmf& GCTAEdispRmf::operator=(const GCTAEdispRmf& edisp) |
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | /***********************************************************************//** |
| 163 | - * @brief Return energy dispersion. | |
| 163 | + * @brief Return energy dispersion in units of \f$(\log_{10} MeV)^{-1}\f$ | |
| 164 | 164 | * |
| 165 | 165 | * @param[in] logEobs log10 of the observed photon energy (TeV). |
| 166 | 166 | * @param[in] logEsrc log10 of the true photon energy (TeV). |
| ... | ... | @@ -170,9 +170,17 @@ GCTAEdispRmf& GCTAEdispRmf::operator=(const GCTAEdispRmf& edisp) |
| 170 | 170 | * @param[in] azimuth Azimuth angle in Earth system (rad). Not used. |
| 171 | 171 | * @return Energy dispersion |
| 172 | 172 | * |
| 173 | - * Returns the energy resolution, i.e. the probability density in observed | |
| 174 | - * photon energy at a given (log10(E_src), log10(E_obs)). | |
| 175 | - * To be precise: energy dispersion = dP / d(log10(E_obs)). | |
| 173 | + * Returns the energy dispersion | |
| 174 | + * | |
| 175 | + * \f[ | |
| 176 | + * E_{\rm disp}(\log_{10} E_{\rm reco} | \log_{10} E_{\rm true}) = | |
| 177 | + * \frac{dP}{d\log_{10} E_{\rm reco}} | |
| 178 | + * \f] | |
| 179 | + * | |
| 180 | + * in units of \f$(\log_{10} MeV)^{-1}\f$ where | |
| 181 | + * \f$\log_{10} E_{\rm reco}\f$ is the logarithm of the reconstructed energy | |
| 182 | + * in TeV, and | |
| 183 | + * \f$\log_{10} E_{\rm true}\f$ is the logarithm of the true energy in TeV. | |
| 176 | 184 | ***************************************************************************/ |
| 177 | 185 | double GCTAEdispRmf::operator()(const double& logEobs, |
| 178 | 186 | const double& logEsrc, | ... | ... |