Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peakwise fit function for calibration peak fits #72

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

LisaSchlueter
Copy link
Contributor

We want to have different peakshapes for the escape peaks and maybe for other low-statistics peaks. That's why I made the following changes:

  1. Peakwise fit function: Calibration peak fit function of th228 lines fit_peaks() now also accepts a vector of fit_func.
  2. Fit function stored in fit result
  3. I renamed the fit functions, to avoid confusion (too many f_fit , fit_func , ...). If you feel creative and have better suggestions, feel free to write them below.
    Available fit functions:
  • gamma_def: "default" gamma peakshape with gaussian signal, low-energy tail, and background (flat + step)
  • gamma_tails: default gamma peakshape + high-energy tail
  • gamma_bckSlope: default gamma peakshape + linear background slope
  • gamma_bckExp: default gamma peakshape + exponential background
  • gamma_bckFlat: default gamma peakshape - step background (only flat component!)
  • gamma_tails_bckFlat: default gamma peakshape + high-energy tail - step background (only flat component!)

Example: with escape peaks with high-energy tail but w/o Compton step

myfuncs = [fill(:gamma_def, 3)..., :gamma_tails_bckFlat, :gamma_def, :gamma_tails_bckFlat, :gamma_def]
result_fit, report_fit = fit_peaks(result_simple.peakhists, result_simple.peakstats, th228_names; 
                         e_unit=result_simple.unit, calib_type=:th228, fit_func = myfuncs)

@theHenks we could write the fit_func for the th228_names in jldataprod config, as we discussed. Any additional suggestions?
@fhagemann, @verenaaur I don't think that the A/E functions have to be adapted to this change, right?

@theHenks
Copy link
Collaborator

From my side this looks fine. I let @verenaaur check again then we can merge!
But before I will quickly add the bug fixes for the fitting!

@theHenks theHenks self-assigned this Sep 25, 2024
@theHenks theHenks added bug Something isn't working enhancement New feature or request labels Sep 25, 2024
This was linked to issues Sep 25, 2024
@verenaaur
Copy link
Collaborator

I don't think it should have an impact on the A/E functions

@fhagemann
Copy link
Contributor

Do we care about the tests failing or should this be merged now?

@theHenks
Copy link
Collaborator

Problem with tests is still the open bug tackled in the other PR

@fhagemann
Copy link
Contributor

So all open PRs are to be postponed until #73 fixes the failing tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A/E fit peakshapes Revise Energy calibration and peakshape
4 participants