Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the likelihood to be unbiased, the signal and background spatial PDFs need
to be normalized on the sphere. Setting S/B to zero outside the spatial box
explicitly breaks this normalization if any of the probability mass is outside
this area. The KDE PSF, this can be on the order of 2-5% depending on energy,
which appears to be enough to produce ~50% biases in n_s for a few hundred
events injected over 1000 sources. The same problem exists for the circular
Gaussian (Rayleigh) PSF, though on a much smaller scale.
This appears also be responsible for commonly-observed biases in gamma, since more of the PSF mass is outside the selected area for low-energy events.
Work around this by explicitly normalizing the signal PDF to a circle whose
radius is given by the configured spatial_box_width. In admittedly limited testing, this appears to significantly reduce bias in n_s as well as gamma for high-background stacking analyses using
StdMatrixKDEEnabledLLH
.This PR depends on some commits in #440