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

Added the one-dimensional background estimator from the ROOT TSpectrum #14

Merged
merged 1 commit into from
Nov 24, 2016
Merged

Added the one-dimensional background estimator from the ROOT TSpectrum #14

merged 1 commit into from
Nov 24, 2016

Conversation

cl-fontana
Copy link
Contributor

Here is the "distilled" function to estimate the background from a one-dimensional spectrum.
It was extracted from the TSpectrum [https://root.cern.ch/doc/master/classTSpectrum.html] source from ROOT [https://root.cern.ch/].
It now depends only on standard C++ libraries.

@wojdyr wojdyr merged commit 90cb193 into wojdyr:master Nov 24, 2016
@wojdyr
Copy link
Owner

wojdyr commented Nov 24, 2016

Thanks!
Now I'm thinking about the command line interface. For Shirley background we have:

@0 = @0 - shirley_bg(@0)

I'd do something similar for this background. Can you suggest a name for it?
I suppose there is no way to get in touch with Miroslav Morhac and ask him for opinion?

And how to handle all these parameters?

                               int numberIterations,
                               int direction,
                               int filterOrder,
                               bool smoothing,
                               int smoothWindow,
                               bool compton

Which of them should be exposed to the user? What are sensible default values?

@cl-fontana
Copy link
Contributor Author

We have been using that algorithm for spectra that look like the attached picture (which was fitted with the manual background). For this experiment we have rather broad peaks with a FWHM/centroid from 5% to 12%.
For that data I have been using this set of values:

  1. number of iterations: ~15
  2. direction: decreasing window
  3. filter order: 2
  4. no smoothing
  5. no Compton estimation

You could try to use that set of values for some data of yours and see if you get reasonable results. If so we can call this our set of defaults.

spectrum_example

wojdyr added a commit that referenced this pull request Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants