[no commit message]

This commit is contained in:
Alexander Nozik 2016-08-04 17:14:42 +03:00
parent 645bf5eea4
commit 9c5116316a
34 changed files with 134 additions and 62 deletions

View File

@ -10,7 +10,7 @@ description = """The main head of all numass projects"""
dependencies {
compile group: 'commons-cli', name: 'commons-cli', version:'1.+'
compile group: 'commons-io', name: 'commons-io', version:'2.+'
compile project(':dataforge-fitting:dataforge-minuit')
compile project(':dataforge-stat:dataforge-minuit')
compile project(':dataforge-fx')
compile project(':dataforge-plots')
compile project(':numass-storage')

View File

@ -17,8 +17,8 @@ package hep.dataforge.plotfit;
import hep.dataforge.actions.OneToOneAction;
import hep.dataforge.context.Context;
import hep.dataforge.fitting.FitState;
import hep.dataforge.fitting.models.XYModel;
import hep.dataforge.stat.fit.FitState;
import hep.dataforge.stat.models.XYModel;
import hep.dataforge.description.NodeDef;
import hep.dataforge.description.TypedActionDef;
import hep.dataforge.description.ValueDef;

View File

@ -20,7 +20,7 @@ import hep.dataforge.context.Context;
import hep.dataforge.context.GlobalContext;
import static hep.dataforge.context.GlobalContext.out;
import hep.dataforge.data.FileDataFactory;
import hep.dataforge.fitting.MINUITPlugin;
import hep.dataforge.stat.fit.MINUITPlugin;
import hep.dataforge.io.IOManager;
import hep.dataforge.io.MetaFileReader;
import hep.dataforge.meta.Meta;

View File

@ -19,11 +19,11 @@ import hep.dataforge.actions.ActionManager;
import hep.dataforge.context.BasicPlugin;
import hep.dataforge.context.Context;
import hep.dataforge.context.PluginDef;
import hep.dataforge.fitting.FitManager;
import hep.dataforge.fitting.FitPlugin;
import hep.dataforge.fitting.models.ModelManager;
import hep.dataforge.fitting.models.WeightedXYModel;
import hep.dataforge.fitting.models.XYModel;
import hep.dataforge.stat.fit.FitManager;
import hep.dataforge.stat.fit.FitPlugin;
import hep.dataforge.stat.models.ModelManager;
import hep.dataforge.stat.models.WeightedXYModel;
import hep.dataforge.stat.models.XYModel;
import hep.dataforge.maths.MathPlugin;
import hep.dataforge.meta.Meta;
import hep.dataforge.plotfit.PlotFitResultAction;

View File

@ -16,11 +16,11 @@
package inr.numass.actions;
import hep.dataforge.actions.OneToOneAction;
import hep.dataforge.fitting.FitState;
import hep.dataforge.fitting.FitTaskResult;
import hep.dataforge.fitting.Param;
import hep.dataforge.fitting.ParamSet;
import hep.dataforge.fitting.models.Histogram;
import hep.dataforge.stat.fit.FitState;
import hep.dataforge.stat.fit.FitTaskResult;
import hep.dataforge.stat.fit.Param;
import hep.dataforge.stat.fit.ParamSet;
import hep.dataforge.stat.models.Histogram;
import hep.dataforge.description.TypedActionDef;
import hep.dataforge.io.ColumnedDataWriter;
import hep.dataforge.io.PrintFunction;
@ -34,7 +34,7 @@ import hep.dataforge.plots.PlotsPlugin;
import hep.dataforge.plots.XYPlotFrame;
import hep.dataforge.plots.data.PlottableData;
import hep.dataforge.plots.data.PlottableXYFunction;
import hep.dataforge.generators.GaussianParameterGenerator;
import hep.dataforge.stat.simulation.GaussianParameterGenerator;
import hep.dataforge.tables.ListTable;
import hep.dataforge.tables.MapPoint;
import hep.dataforge.tables.Table;

View File

@ -19,7 +19,7 @@ import hep.dataforge.actions.GroupBuilder;
import hep.dataforge.actions.ManyToOneAction;
import hep.dataforge.context.Context;
import hep.dataforge.data.DataNode;
import hep.dataforge.fitting.FitState;
import hep.dataforge.stat.fit.FitState;
import hep.dataforge.description.TypedActionDef;
import hep.dataforge.io.ColumnedDataWriter;
import hep.dataforge.io.reports.Reportable;

View File

@ -15,9 +15,9 @@
*/
package inr.numass.data;
import hep.dataforge.fitting.ParamSet;
import hep.dataforge.fitting.models.Generator;
import hep.dataforge.fitting.models.XYModel;
import hep.dataforge.stat.fit.ParamSet;
import hep.dataforge.stat.models.Generator;
import hep.dataforge.stat.models.XYModel;
import static hep.dataforge.maths.RandomUtils.getDefaultRandomGenerator;
import hep.dataforge.tables.DataPoint;
import hep.dataforge.tables.ListTable;

View File

@ -15,7 +15,7 @@
*/
package inr.numass.data;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import static hep.dataforge.maths.MatrixOperations.inverse;
import hep.dataforge.maths.NamedMatrix;
import hep.dataforge.tables.DataPoint;

View File

@ -16,7 +16,7 @@
package inr.numass.models;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;
import java.io.File;

View File

@ -5,7 +5,7 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.values.NamedValueSet;
import inr.numass.NumassIntegrator;
import inr.numass.Numass;

View File

@ -17,7 +17,7 @@ package inr.numass.models;
import hep.dataforge.exceptions.NamingException;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.maths.integration.GaussRuleIntegrator;
import hep.dataforge.maths.integration.UnivariateIntegrator;
import hep.dataforge.values.NamedValueSet;

View File

@ -16,8 +16,8 @@
package inr.numass.models;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;
import org.apache.commons.math3.analysis.BivariateFunction;

View File

@ -17,8 +17,8 @@ package inr.numass.models;
import hep.dataforge.context.GlobalContext;
import hep.dataforge.exceptions.NameNotFoundException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import static hep.dataforge.names.NamedUtils.combineNamesWithEquals;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;

View File

@ -16,7 +16,7 @@
package inr.numass.models;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;
import static java.lang.Math.exp;

View File

@ -16,7 +16,7 @@
package inr.numass.models;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.maths.integration.UnivariateIntegrator;
import hep.dataforge.values.NamedValueSet;
import inr.numass.NumassIntegrator;

View File

@ -15,7 +15,7 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.FunctionCaching;
import hep.dataforge.stat.parametric.FunctionCaching;
import hep.dataforge.maths.integration.GaussRuleIntegrator;
import hep.dataforge.maths.integration.UnivariateIntegrator;
import hep.dataforge.plots.XYPlotFrame;

View File

@ -15,8 +15,8 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.names.NamedUtils;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;

View File

@ -15,8 +15,8 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import static hep.dataforge.names.NamedUtils.combineNamesWithEquals;
import hep.dataforge.utils.MultiCounter;
import hep.dataforge.values.NamedValueSet;

View File

@ -15,10 +15,10 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import static hep.dataforge.fitting.parametric.FunctionUtils.getSpectrumDerivativeFunction;
import static hep.dataforge.fitting.parametric.FunctionUtils.getSpectrumFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import static hep.dataforge.stat.parametric.FunctionUtils.getSpectrumDerivativeFunction;
import static hep.dataforge.stat.parametric.FunctionUtils.getSpectrumFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.maths.MathUtils;
import hep.dataforge.maths.NamedVector;
import hep.dataforge.names.AbstractNamedSet;

View File

@ -15,7 +15,7 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
/**
*

View File

@ -16,7 +16,7 @@
package inr.numass.models;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.names.NameSetContainer;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;

View File

@ -15,8 +15,8 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.values.NamedValueSet;
import inr.numass.NumassIntegrator;
import inr.numass.Numass;

View File

@ -15,7 +15,7 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.maths.NamedVector;
import hep.dataforge.values.NamedValueSet;
import static java.lang.Math.abs;

View File

@ -16,8 +16,8 @@
package inr.numass.models;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.maths.integration.UnivariateIntegrator;
import hep.dataforge.values.NamedValueSet;
import hep.dataforge.values.ValueProvider;

View File

@ -6,7 +6,7 @@
package inr.numass.models.sterile;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricBiFunction;
import hep.dataforge.stat.parametric.AbstractParametricBiFunction;
import hep.dataforge.values.NamedValueSet;
import static java.lang.Math.abs;
import static java.lang.Math.exp;

View File

@ -5,7 +5,7 @@
*/
package inr.numass.models.sterile;
import hep.dataforge.fitting.parametric.AbstractParametricBiFunction;
import hep.dataforge.stat.parametric.AbstractParametricBiFunction;
import hep.dataforge.meta.Meta;
import hep.dataforge.values.NamedValueSet;
import inr.numass.models.ResolutionFunction;

View File

@ -6,7 +6,7 @@
package inr.numass.models.sterile;
import hep.dataforge.context.Context;
import hep.dataforge.fitting.parametric.AbstractParametricBiFunction;
import hep.dataforge.stat.parametric.AbstractParametricBiFunction;
import hep.dataforge.maths.MathPlugin;
import hep.dataforge.meta.Meta;
import hep.dataforge.values.NamedValueSet;

View File

@ -10,9 +10,9 @@ import hep.dataforge.context.GlobalContext;
import hep.dataforge.description.NodeDef;
import hep.dataforge.description.ValueDef;
import hep.dataforge.exceptions.NotDefinedException;
import hep.dataforge.fitting.parametric.AbstractParametricBiFunction;
import hep.dataforge.fitting.parametric.AbstractParametricFunction;
import hep.dataforge.fitting.parametric.ParametricBiFunction;
import hep.dataforge.stat.parametric.AbstractParametricBiFunction;
import hep.dataforge.stat.parametric.AbstractParametricFunction;
import hep.dataforge.stat.parametric.ParametricBiFunction;
import hep.dataforge.maths.integration.UnivariateIntegrator;
import hep.dataforge.meta.Meta;
import hep.dataforge.values.NamedValueSet;

View File

@ -6,8 +6,8 @@
package inr.numass.models.sterile;
import hep.dataforge.context.Context;
import hep.dataforge.fitting.ParamSet;
import hep.dataforge.fitting.parametric.ParametricFunction;
import hep.dataforge.stat.fit.ParamSet;
import hep.dataforge.stat.parametric.ParametricFunction;
import hep.dataforge.maths.MathPlugin;
import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder;

View File

@ -0,0 +1,69 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package inr.numass.tasks;
import hep.dataforge.actions.Action;
import hep.dataforge.computation.WorkManager;
import hep.dataforge.context.Context;
import hep.dataforge.data.DataNode;
import hep.dataforge.data.DataSet;
import hep.dataforge.data.DataTree;
import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.meta.MetaUtils;
import hep.dataforge.stat.fit.FitAction;
import hep.dataforge.stat.fit.FitState;
import hep.dataforge.tables.Table;
import hep.dataforge.values.Value;
import hep.dataforge.workspace.GenericTask;
import hep.dataforge.workspace.TaskModel;
import hep.dataforge.workspace.TaskState;
/**
*
* @author Alexander Nozik
*/
public class NumassFitScanTask extends GenericTask {
@Override
protected TaskState transform(WorkManager.Callback callback, Context context, TaskState state, Meta config) {
String scanParameter = config.getString("scanPar", "msterile2");
Value scanValues = config.getValue("scanValues", Value.of(new String[]{"0.5, 1, 1.5, 2, 2.5, 3"}));
Action action = new FitAction().withContext(context).withParentProcess(callback.workName());
DataTree.Builder resultBuilder = DataTree.builder(FitState.class);
state.getData().forEachWithType(Table.class, (name, data) -> {
DataNode res = scanValues.listValue().stream().parallel().map(val -> {
MetaBuilder overrideMeta = new MetaBuilder("override");
overrideMeta.setValue("@resultName", String.format("%s[%s=%s]", name, scanParameter, val.stringValue()));
MetaBuilder paramMeta = MetaUtils.findNodeByValue(config, "params.param", name, scanParameter).getBuilder()
.setValue("value", val);
overrideMeta.setNode("params.param", paramMeta);
return action.run(DataNode.of(name, data, overrideMeta), config);
}).collect(
() -> DataSet.builder(FitState.class),
(DataSet.Builder builder, DataNode node) -> builder.putData(node.getName(), node.getData()),
(DataSet.Builder builder1, DataSet.Builder builder2) -> builder1.putAll(builder2.getDataMap())
).build();
resultBuilder.putNode(name, res);
});
state.finish(resultBuilder.build());
return state;
}
@Override
protected TaskModel transformModel(TaskModel model) {
//Transmit meta as-is
model.dependsOn("numass.prepare", model.meta());
return model;
}
@Override
public String getName() {
return "numass.fitscan";
}
}

View File

@ -22,10 +22,11 @@ import inr.numass.actions.ReadNumassStorageAction;
import inr.numass.storage.NumassData;
/**
* Prepare data task
*
* @author Alexander Nozik
*/
public class PrepareTask extends GenericTask {
public class NumassPrepareTask extends GenericTask {
/*
<action type="readStorage" uri="file://D:\Work\Numass\data\2016_04\T2_data\">

View File

@ -37,7 +37,11 @@ public class Workbench extends Application {
primaryStage.show();
scene.getWindow().setOnCloseRequest((WindowEvent event) -> {
try {
controller.getContext().workManager().getRoot().cancel(true);
} catch (Exception e) {
}
});
}
@ -47,8 +51,6 @@ public class Workbench extends Application {
super.stop();
}
/**
* @param args the command line arguments
*/

View File

@ -15,7 +15,7 @@
*/
package inr.numass.models;
import hep.dataforge.fitting.ParamSet;
import hep.dataforge.stat.fit.ParamSet;
import hep.dataforge.plots.fx.FXPlotUtils;
/**

View File

@ -16,8 +16,8 @@
package inr.numass.run;
import hep.dataforge.context.GlobalContext;
import hep.dataforge.fitting.MINUITPlugin;
import hep.dataforge.fitting.ParamSet;
import hep.dataforge.stat.fit.MINUITPlugin;
import hep.dataforge.stat.fit.ParamSet;
import hep.dataforge.exceptions.NamingException;
import inr.numass.models.BetaSpectrum;
import inr.numass.models.ModularSpectrum;