diff --git a/ChangeLog b/ChangeLog index 0e89b33..da4d2b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ -2014-01-21 Juergen Knoedlseder +2014-01-24 Juergen Knoedlseder * Bug fix Version 0.7.1 released ================================ Added missing hyphens in pfiles synchronisation section (#1091) Add configuration test script (#1091) + Correctly filter instrument and id attributes in ctobssim 2014-01-18 Juergen Knoedlseder diff --git a/NEWS b/NEWS index a6e0c6d..8dd3246 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 00-07-01 Author(s) : Juergen Knoedlseder -21 January 2014 +24 January 2014 1. Introduction @@ -29,7 +29,10 @@ None 4. ctobssim - CTA observation simulation ---------------------------------------- -None +The instrument and id attributes provided by an observation were not +considering when simulating source and background events. This has been +changed now that only events will be simulated when the instrument +and id are valid for a given model. 5. ctselect - CTA event selection diff --git a/src/ctobssim/ctobssim.cpp b/src/ctobssim/ctobssim.cpp index 9c1a0f7..6163a60 100644 --- a/src/ctobssim/ctobssim.cpp +++ b/src/ctobssim/ctobssim.cpp @@ -689,8 +689,10 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, const GModelSky* model = dynamic_cast(models[i]); - // If we have a sky model then simulate photons - if (model != NULL) { + // If we have a sky model that applies to the present + // observation then simulate events + if (model != NULL && + model->is_valid(obs->instrument(), obs->id())) { // Determine duration of a time slice by limiting the // number of simulated photons to m_max_photons. @@ -896,9 +898,10 @@ void ctobssim::simulate_background(GCTAObservation* obs, const GModelData* model = dynamic_cast(models[i]); - // If we have a data model that applies to CTA then simulate - // events - if (model != NULL && model->is_valid("CTA", "")) { + // If we have a data model that applies to the present observation + // then simulate events + if (model != NULL && + model->is_valid(obs->instrument(), obs->id())) { // Get simulated CTA event list. Note that this method // includes the deadtime correction.