Fit fixed

This commit is contained in:
Alexander Nozik 2018-07-05 11:47:54 +03:00
parent 0e7600359d
commit 60bddaa50c
2 changed files with 4 additions and 3 deletions

View File

@ -84,7 +84,7 @@ class SpectrumAdapter : BasicAdapter {
y < 0 -> Optional.empty() y < 0 -> Optional.empty()
y == 0.0 -> //avoid infinite weights y == 0.0 -> //avoid infinite weights
Optional.of(Value.of(1.0 / getTime(values))) Optional.of(Value.of(1.0 / getTime(values)))
else -> Optional.of(Value.of(Math.sqrt(y) / getTime(values))) else -> Optional.of(Value.of(Math.sqrt(y / getTime(values))))
} }
} }
} }

View File

@ -16,6 +16,7 @@
package inr.numass.scripts package inr.numass.scripts
import hep.dataforge.context.Global import hep.dataforge.context.Global
import hep.dataforge.io.ColumnedDataWriter
import hep.dataforge.meta.Meta import hep.dataforge.meta.Meta
import hep.dataforge.stat.fit.FitHelper import hep.dataforge.stat.fit.FitHelper
import hep.dataforge.stat.fit.FitResult import hep.dataforge.stat.fit.FitResult
@ -82,7 +83,7 @@ def data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration
// allPars.setParValue("X", 0.4); // allPars.setParValue("X", 0.4);
//ColumnedDataWriter.writeTable(System.out, data, "--- DATA ---"); ColumnedDataWriter.writeTable(System.out, data, "--- DATA ---");
//FitState state = new FitState(data, model, allPars); //FitState state = new FitState(data, model, allPars);
////new PlotFitResultAction().eval(state); ////new PlotFitResultAction().eval(state);
// //
@ -92,7 +93,7 @@ def data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration
FitResult res = new FitHelper(Global.INSTANCE).fit(data) FitResult res = new FitHelper(Global.INSTANCE).fit(data)
.model(model) .model(model)
.params(allPars) .params(allPars)
.stage("MINUIT", FitStage.TASK_RUN, "N") .stage("QOW", FitStage.TASK_RUN, "N", "E0")
.run(); .run();
// //
// //