legend-exp / LegendSpecFits.jl

LEGEND tools to fit spectra
Other
3 stars 8 forks source link

Improve binning and fitting of A/E histograms #28

Closed fhagemann closed 9 months ago

fhagemann commented 9 months ago

Outliers at high A/E values would shift the A/E maximum-likelihood fits towards higher A/E values. Therefore, the binning of the A/E should be chosen such that these outliers are excluded when fitting Compton bands.

Here, instead of selecting the bin ranges based on quantiles, a first fit to the A/E peak is performed using curve_fit and the upper A/E bin range is set to 4σ above the main peak.

For the fitting, the likelihood is set to zero for A/E values outside of the histogram ranges.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (dd1cf0e) 0.39% compared to head (0e16267) 0.38%. Report is 1 commits behind head on dev.

Files Patch % Lines
src/aoefit.jl 0.00% 13 Missing :warning:
src/aoe_calibration.jl 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #28 +/- ## ======================================== - Coverage 0.39% 0.38% -0.01% ======================================== Files 19 19 Lines 1024 1031 +7 ======================================== Hits 4 4 - Misses 1020 1027 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

oschulz commented 9 months ago

@theHenks ?

theHenks commented 9 months ago

Let's merge that PR and then all the rest of the Vancouver CM presentation for a new release. @oschulz is that ok?

oschulz commented 9 months ago

Sure!

oschulz commented 9 months ago

You need to resolve the merge conflicts first, though. :-)

fhagemann commented 9 months ago

These changes are already on the dev branch of legend-exp/LegendSpecFits.jl, so merging dev into main should be the way to go