diff --git a/numass-main/src/main/java/inr/numass/actions/MergeDataAction.java b/numass-main/src/main/java/inr/numass/actions/MergeDataAction.java index 3f885149..0b4c0d18 100644 --- a/numass-main/src/main/java/inr/numass/actions/MergeDataAction.java +++ b/numass-main/src/main/java/inr/numass/actions/MergeDataAction.java @@ -22,7 +22,6 @@ import hep.dataforge.description.NodeDef; import hep.dataforge.description.TypedActionDef; import hep.dataforge.io.ColumnedDataWriter; import hep.dataforge.meta.Meta; -import hep.dataforge.meta.MetaBuilder; import hep.dataforge.tables.*; import java.io.OutputStream; @@ -63,31 +62,31 @@ public class MergeDataAction extends ManyToOneAction { ColumnedDataWriter.writeDataSet(stream, output, outputMeta.toString()); } - @Override - protected MetaBuilder outputMeta(DataNode input) { - - String numassPath = input.dataStream().map(data -> data.meta().getString("numass.path", "")) - .reduce("", (String path, String newPath) -> { - if (path.isEmpty()) { - return null; - } else if (path.isEmpty()) { - return newPath; - } else if (!path.equals(newPath)) { - return null; - } else { - return newPath; - } - }); - - MetaBuilder builder = super.outputMeta(input); - /* - * Указываем путь только есл0и он одинаковый для всех входных файлов - */ - if (numassPath != null) { - builder.putValue("numass.path", numassPath); - } - return builder; - } +// @Override +// protected MetaBuilder outputMeta(DataNode
input) { +// +// String numassPath = input.dataStream().map(data -> data.meta().getString("numass.path", "")) +// .reduce("", (String path, String newPath) -> { +// if (path.isEmpty()) { +// return null; +// } else if (path.isEmpty()) { +// return newPath; +// } else if (!path.equals(newPath)) { +// return null; +// } else { +// return newPath; +// } +// }); +// +// MetaBuilder builder = super.outputMeta(input); +// /* +// * Указываем путь только есл0и он одинаковый для всех входных файлов +// */ +// if (numassPath != null) { +// builder.putValue("numass.path", numassPath); +// } +// return builder; +// } private DataPoint mergeDataPoints(DataPoint dp1, DataPoint dp2) { if (dp1 == null) { diff --git a/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java b/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java index 61a8989c..b9553acd 100644 --- a/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java +++ b/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java @@ -18,6 +18,8 @@ import hep.dataforge.values.Value; import hep.dataforge.workspace.AbstractTask; import hep.dataforge.workspace.TaskModel; +import java.util.stream.Collectors; + /** * @author Alexander Nozik */ @@ -27,8 +29,18 @@ public class NumassFitScanTask extends AbstractTask { @Override protected DataNode run(TaskModel model, ProgressCallback callback, DataNode data) { Meta config = model.meta(); - String scanParameter = config.getString("scanPar", "msterile2"); - Value scanValues = config.getValue("scanValues", Value.of("[2.5e5, 1e6, 2.25e6, 4e6, 6.25e6, 9e6]")); + String scanParameter = config.getString("scan.parameter", "msterile2"); + + Value scanValues; + if (config.hasValue("scan.masses")) { + scanValues = Value.of(config.getValue("scan.masses") + .listValue().stream() + .map(it -> Math.pow(it.doubleValue() * 1000, 2.0)) + .collect(Collectors.toList()) + ); + } else { + scanValues = config.getValue("scan.values", Value.of("[2.5e5, 1e6, 2.25e6, 4e6, 6.25e6, 9e6]")); + } Action action = new FitAction().withContext(model.getContext()).withParentProcess(callback.workName()); DataTree.Builder resultBuilder = DataTree.builder(FitState.class); DataNode
sourceNode = data.getCheckedNode("prepare", Table.class); @@ -66,7 +78,7 @@ public class NumassFitScanTask extends AbstractTask { @Override protected TaskModel transformModel(TaskModel model) { //Transmit meta as-is - MetaBuilder metaBuilder = new MetaBuilder(model.meta()).removeNode("fit"); + MetaBuilder metaBuilder = new MetaBuilder(model.meta()).removeNode("fit").removeNode("scan"); if (model.meta().hasMeta("filter")) { model.dependsOn("numass.filter", metaBuilder.build(), "prepare"); } else {