Commit ea44fb11f118feb64439f2b22ff6cc2460c5a72a
1 parent
4103eb89
Definitely remove true energy clipping from stacked response cubes
Showing
3 changed files
with
0 additions
and
58 deletions
inst/cta/src/GCTACubeEdisp.cpp
| @@ -54,7 +54,6 @@ | @@ -54,7 +54,6 @@ | ||
| 54 | /* __ Macros _____________________________________________________________ */ | 54 | /* __ Macros _____________________________________________________________ */ |
| 55 | 55 | ||
| 56 | /* __ Coding definitions _________________________________________________ */ | 56 | /* __ Coding definitions _________________________________________________ */ |
| 57 | -//#define G_CLIP_ETRUES //!< Clip true energies to reconstructed ones | ||
| 58 | 57 | ||
| 59 | /* __ Debug definitions __________________________________________________ */ | 58 | /* __ Debug definitions __________________________________________________ */ |
| 60 | 59 | ||
| @@ -848,9 +847,6 @@ void GCTACubeEdisp::fill_cube(const GCTAObservation& obs, | @@ -848,9 +847,6 @@ void GCTACubeEdisp::fill_cube(const GCTAObservation& obs, | ||
| 848 | GSkyMap* exposure, | 847 | GSkyMap* exposure, |
| 849 | GLog* log) | 848 | GLog* log) |
| 850 | { | 849 | { |
| 851 | - // Set energy margin | ||
| 852 | - static const GEnergy margin(1.0, "MeV"); | ||
| 853 | - | ||
| 854 | // Only continue if we have an event list | 850 | // Only continue if we have an event list |
| 855 | if (obs.eventtype() == "EventList") { | 851 | if (obs.eventtype() == "EventList") { |
| 856 | 852 | ||
| @@ -948,22 +944,6 @@ void GCTACubeEdisp::fill_cube(const GCTAObservation& obs, | @@ -948,22 +944,6 @@ void GCTACubeEdisp::fill_cube(const GCTAObservation& obs, | ||
| 948 | // Loop over all energy bins | 944 | // Loop over all energy bins |
| 949 | for (int iebin = 0; iebin < m_energies.size(); ++iebin) { | 945 | for (int iebin = 0; iebin < m_energies.size(); ++iebin) { |
| 950 | 946 | ||
| 951 | - // Skip energy dispersion cube energy if the energy is | ||
| 952 | - // outside the observation energy. The energy dispersion | ||
| 953 | - // cube energies are true energies while the observation | ||
| 954 | - // energy boundaries are reconstructed energies, hence | ||
| 955 | - // this is only an approximation, but probably the only | ||
| 956 | - // we can really do. | ||
| 957 | - // We allow here for a small margin in case of rounding | ||
| 958 | - // errors in the energy boundaries. | ||
| 959 | - #if defined(G_CLIP_ETRUES) | ||
| 960 | - if (!(obs_ebounds.contains(m_energies[iebin]) || | ||
| 961 | - obs_ebounds.contains(m_energies[iebin]-margin) || | ||
| 962 | - obs_ebounds.contains(m_energies[iebin]+margin))) { | ||
| 963 | - continue; | ||
| 964 | - } | ||
| 965 | - #endif | ||
| 966 | - | ||
| 967 | // Get log10 of true energy in TeV | 947 | // Get log10 of true energy in TeV |
| 968 | double logEsrc = m_energies[iebin].log10TeV(); | 948 | double logEsrc = m_energies[iebin].log10TeV(); |
| 969 | 949 |
inst/cta/src/GCTACubeExposure.cpp
| @@ -41,7 +41,6 @@ | @@ -41,7 +41,6 @@ | ||
| 41 | /* __ Macros _____________________________________________________________ */ | 41 | /* __ Macros _____________________________________________________________ */ |
| 42 | 42 | ||
| 43 | /* __ Coding definitions _________________________________________________ */ | 43 | /* __ Coding definitions _________________________________________________ */ |
| 44 | -//#define G_CLIP_ETRUES //!< Clip true energies to reconstructed ones | ||
| 45 | 44 | ||
| 46 | /* __ Debug definitions __________________________________________________ */ | 45 | /* __ Debug definitions __________________________________________________ */ |
| 47 | 46 | ||
| @@ -639,9 +638,6 @@ void GCTACubeExposure::free_members(void) | @@ -639,9 +638,6 @@ void GCTACubeExposure::free_members(void) | ||
| 639 | ***************************************************************************/ | 638 | ***************************************************************************/ |
| 640 | void GCTACubeExposure::fill_cube(const GCTAObservation& obs, GLog* log) | 639 | void GCTACubeExposure::fill_cube(const GCTAObservation& obs, GLog* log) |
| 641 | { | 640 | { |
| 642 | - // Set energy margin | ||
| 643 | - static const GEnergy margin(1.0, "MeV"); | ||
| 644 | - | ||
| 645 | // Only continue if we have an event list | 641 | // Only continue if we have an event list |
| 646 | if (obs.eventtype() == "EventList") { | 642 | if (obs.eventtype() == "EventList") { |
| 647 | 643 | ||
| @@ -728,21 +724,6 @@ void GCTACubeExposure::fill_cube(const GCTAObservation& obs, GLog* log) | @@ -728,21 +724,6 @@ void GCTACubeExposure::fill_cube(const GCTAObservation& obs, GLog* log) | ||
| 728 | // Loop over all exposure cube energies | 724 | // Loop over all exposure cube energies |
| 729 | for (int iebin = 0; iebin < m_energies.size(); ++iebin){ | 725 | for (int iebin = 0; iebin < m_energies.size(); ++iebin){ |
| 730 | 726 | ||
| 731 | - // Skip exposure cube energy if the energy is outside the | ||
| 732 | - // observation energy. The exposure cube energies are true | ||
| 733 | - // energies while the observation energy boundaries are | ||
| 734 | - // reconstructed energies, hence this is only an | ||
| 735 | - // approximation, but probably the only we can really do. | ||
| 736 | - // We allow here for a small margin in case of rounding | ||
| 737 | - // errors in the energy boundaries. | ||
| 738 | - #if defined(G_CLIP_ETRUES) | ||
| 739 | - if (!(obs_ebounds.contains(m_energies[iebin]) || | ||
| 740 | - obs_ebounds.contains(m_energies[iebin]-margin) || | ||
| 741 | - obs_ebounds.contains(m_energies[iebin]+margin))) { | ||
| 742 | - continue; | ||
| 743 | - } | ||
| 744 | - #endif | ||
| 745 | - | ||
| 746 | // Get logE/TeV | 727 | // Get logE/TeV |
| 747 | double logE = m_energies[iebin].log10TeV(); | 728 | double logE = m_energies[iebin].log10TeV(); |
| 748 | 729 |
inst/cta/src/GCTACubePsf.cpp
| @@ -48,7 +48,6 @@ | @@ -48,7 +48,6 @@ | ||
| 48 | /* __ Macros _____________________________________________________________ */ | 48 | /* __ Macros _____________________________________________________________ */ |
| 49 | 49 | ||
| 50 | /* __ Coding definitions _________________________________________________ */ | 50 | /* __ Coding definitions _________________________________________________ */ |
| 51 | -//#define G_CLIP_ETRUES //!< Clip true energies to reconstructed ones | ||
| 52 | #define G_SMOOTH_PSF //!< Guarantee no singularities | 51 | #define G_SMOOTH_PSF //!< Guarantee no singularities |
| 53 | #define G_QUADRATIC_BINNING //!< Use quadratic delta spacing | 52 | #define G_QUADRATIC_BINNING //!< Use quadratic delta spacing |
| 54 | 53 | ||
| @@ -769,9 +768,6 @@ void GCTACubePsf::fill_cube(const GCTAObservation& obs, | @@ -769,9 +768,6 @@ void GCTACubePsf::fill_cube(const GCTAObservation& obs, | ||
| 769 | GSkyMap* exposure, | 768 | GSkyMap* exposure, |
| 770 | GLog* log) | 769 | GLog* log) |
| 771 | { | 770 | { |
| 772 | - // Set energy margin | ||
| 773 | - static const GEnergy margin(1.0, "MeV"); | ||
| 774 | - | ||
| 775 | // Only continue if we have an event list | 771 | // Only continue if we have an event list |
| 776 | if (obs.eventtype() == "EventList") { | 772 | if (obs.eventtype() == "EventList") { |
| 777 | 773 | ||
| @@ -858,21 +854,6 @@ void GCTACubePsf::fill_cube(const GCTAObservation& obs, | @@ -858,21 +854,6 @@ void GCTACubePsf::fill_cube(const GCTAObservation& obs, | ||
| 858 | // Loop over all energy bins | 854 | // Loop over all energy bins |
| 859 | for (int iebin = 0; iebin < m_energies.size(); ++iebin) { | 855 | for (int iebin = 0; iebin < m_energies.size(); ++iebin) { |
| 860 | 856 | ||
| 861 | - // Skip PSF cube energy if the energy is outside the | ||
| 862 | - // observation energy. The PSF cube energies are true | ||
| 863 | - // energies while the observation energy boundaries are | ||
| 864 | - // reconstructed energies, hence this is only an | ||
| 865 | - // approximation, but probably the only we can really do. | ||
| 866 | - // We allow here for a small margin in case of rounding | ||
| 867 | - // errors in the energy boundaries. | ||
| 868 | - #if defined(G_CLIP_ETRUES) | ||
| 869 | - if (!(obs_ebounds.contains(m_energies[iebin]) || | ||
| 870 | - obs_ebounds.contains(m_energies[iebin]-margin) || | ||
| 871 | - obs_ebounds.contains(m_energies[iebin]+margin))) { | ||
| 872 | - continue; | ||
| 873 | - } | ||
| 874 | - #endif | ||
| 875 | - | ||
| 876 | // Get logE/TeV | 857 | // Get logE/TeV |
| 877 | double logE = m_energies[iebin].log10TeV(); | 858 | double logE = m_energies[iebin].log10TeV(); |
| 878 | 859 |