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

Fit error for straighline #80

Closed
misalvat opened this issue May 29, 2015 · 4 comments
Closed

Fit error for straighline #80

misalvat opened this issue May 29, 2015 · 4 comments

Comments

@misalvat
Copy link

Hi all,

during the analysis of the following folder:

https://www.dropbox.com/s/kgeswgiekv7zcfd/M3501_VcalCalibration_2015-05-29_10h59m_1432889945.tar.gz?dl=0

the moreweb doesn't fit the straigh lines (see the attached screenshot). Can you check please? I'm using the latest version (commit c9afdb9).

screenshot from 2015-05-29 11 40 48

@piberger
Copy link
Contributor

For me this seems to be related to #9, our straight line fit is unconstrained and is unstable on this data when only taking the statistical error of the spectrum fit into account.
I'm currently working on improving the fit errors and including also and estimate of the error that comes from PH<->Vcal conversion, to get a meaningful Chi2 in the end.

Just to make the fit stable (and don't care about Chi2 for the moment) including constraints on the slope and offset should work too I guess and I will try this.

For comparison with a constant peak position error of 1.8 Vcal units:
m3501_constant_error

I have seen that for some ROCs there is a problem with the spectrum fit itself which results in the left shoulder being detected as the peak and vice-versa. this happens eg. on ROC0:
peak_shoulder_fit
(note dashed peak right instead of left)
This should also be dealt with by adjusting the constraints for the fit.

@piberger
Copy link
Contributor

@misalvat if you want you could try the "improveSpectrumAndSlopeFit" branch
https://github.com/piberger/MoReWeb/tree/improveSpectrumAndSlopeFit
for some of your data, but It's still in a very early experimental stage.
This just adds some constraints to the linear fit and improves the initial guess for the spectrum fit for cases with 2 clearly separated peaks as the one shown above.

@piberger
Copy link
Contributor

Michele reported that this branch fixed the problem with the fit so we will probably merge it into the master branch. For our data the adjusted procedure still works fine, but I didn't test all of our available modules yet.

As changing fit procedures is a quite critical change, i would be happy if other test centers also test this branch and report if any problems/deviations occur.

@piberger
Copy link
Contributor

Hi Michele,
i merged the new fit procedure into the master branch. It's disabled by default, you can activate it by changing in global.cfg config file:

SpectrumFitImproveInitialGuess: True
SpectrumFitAdditionalConstraints: True
LinearFitAdditionalConstraints: True

cheers,
Pirmin

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

No branches or pull requests

2 participants