1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 08:55:37 +00:00

XYSampleData: more stable fit initialisation strategy

This commit is contained in:
Antonin Portelli 2016-05-27 13:40:57 +01:00
parent 67c4119859
commit fe0f32e42c

View File

@ -277,12 +277,12 @@ SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
if (s == central) if (s == central)
{ {
sampleResult = data_.fit(minimizer, initCopy, v); sampleResult = data_.fit(minimizer, initCopy, v);
initCopy = sampleResult.segment(0, initCopy.size());
} }
else else
{ {
sampleResult = data_.fit(*(minimizer.back()), initCopy, v); sampleResult = data_.fit(*(minimizer.back()), initCopy, v);
} }
initCopy = sampleResult.segment(0, initCopy.size());
result[s] = sampleResult; result[s] = sampleResult;
result.chi2_[s] = sampleResult.getChi2(); result.chi2_[s] = sampleResult.getChi2();
for (unsigned int j = 0; j < v.size(); ++j) for (unsigned int j = 0; j < v.size(); ++j)