Change request #1513

Updated by Mayer Michael almost 9 years ago

When comparing @csspec@ for binned and unbinned analysis I stumbled upon an issue which needs to be fixed. Please see attached plot.

!spectrum.jpg! !spectrum!

It turns out that @ctexpcube@, @ctpsfcube@ and @ctbkgcube@ don't check if the energy bin to be filled is actually inside the observation energy boundaries. When combining lots of observations with different energy thresholds, this leads to an overestimation in exposure at low energies (where only parts of the runs contribute). Accordingly, the flux in the low energy bins is underestimated quite significantly. Therefore a check should be implemented in these tools and only fill cubes if the bin is contained in the energy boundaries.

In addition, I realised that the procedure how @ctbin@ fills the cube is a bit different how @ctmodel@ does it. Therefore, one might expect residual maps which do not perfectly fluctuate around zero.
* @ctbin@ fills an event into the cube if the event is inside the cube range (which makes sense)
* @ctmodel@ only fills the cube if the @GCTAEventBin@ is contained within the observation energy boundaries. It asks for @obs_ebounds.contains(bin->energy())@.

So in the worst case, @ctbin@ fills a bin with some events, while @ctmodel@ doesn't since @obs_ebounds.contains(bin->energy())@ evaluates to @false@. Accordingly, the residual map is slightly wrong.

To summarise:
In my view, and as we discussed during the coding sprint, bins that are not completely contained inside the observation energy boundaries should not be considered in the binning ctools: @ctbin@, @ctmodel@, @ctexpcube@, @ctpsfcube@, @ctbkgcube@.

Back