Commit e634e79ae4e557544a7910dd5b767d4bc67732ba
1 parent
4819414f
Only set observation boundaries if CTA observation has events.
Showing
1 changed file
with
3 additions
and
4 deletions
src/support/ctool.cpp
| ... | ... | @@ -811,7 +811,6 @@ void ctool::set_obs_response(GCTAObservation* obs) |
| 811 | 811 | * @brief Set observation boundaries |
| 812 | 812 | * |
| 813 | 813 | * @param[in,out] obs Observation container |
| 814 | - * | |
| 815 | 814 | ***************************************************************************/ |
| 816 | 815 | void ctool::set_obs_bounds(GObservations& obs) |
| 817 | 816 | { |
| ... | ... | @@ -821,8 +820,8 @@ void ctool::set_obs_bounds(GObservations& obs) |
| 821 | 820 | // Is this observation a CTA observation? |
| 822 | 821 | GCTAObservation* cta = dynamic_cast<GCTAObservation*>(obs[i]); |
| 823 | 822 | |
| 824 | - // Yes ... | |
| 825 | - if (cta != NULL) { | |
| 823 | + // Continue only if observation is CTA and has events | |
| 824 | + if ((cta != NULL) && (cta->has_events())) { | |
| 826 | 825 | |
| 827 | 826 | // Get pointer on event list |
| 828 | 827 | GCTAEventList* list = const_cast<GCTAEventList*>(dynamic_cast<const GCTAEventList*>(cta->events())); |
| ... | ... | @@ -850,7 +849,7 @@ void ctool::set_obs_bounds(GObservations& obs) |
| 850 | 849 | |
| 851 | 850 | // If there is a "rad" parameter then use it |
| 852 | 851 | if (has_par("rad")) { |
| 853 | - double rad = (*this)["rad"].real(); | |
| 852 | + double rad = (*this)["rad"].real(); | |
| 854 | 853 | GCTARoi roi(GCTAInstDir(cta->pointing().dir()), rad); |
| 855 | 854 | list->roi(roi); |
| 856 | 855 | } | ... | ... |