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 7bb45bf0..99b56e8d 100644 --- a/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java +++ b/numass-main/src/main/java/inr/numass/workspace/NumassFitScanTask.java @@ -47,8 +47,12 @@ public class NumassFitScanTask extends GenericTask { MetaBuilder overrideMeta = new MetaBuilder(fitConfig); overrideMeta.setValue("@resultName", String.format("%s[%s=%s]", data.getName(), scanParameter, val.stringValue())); - overrideMeta.getNodes("params.param").stream() - .filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val)); + if (overrideMeta.hasNode("params." + scanParameter)) { + overrideMeta.setValue("params." + scanParameter + ".value", val); + } else { + overrideMeta.getNodes("params.param").stream() + .filter(par -> par.getString("name") == scanParameter).forEach(par -> par.setValue("value", val)); + } // Data newData = new Data
(data.getGoal(),data.type(),overrideMeta); DataNode node = action.run(DataNode.of("fit_" + i, data, Meta.empty()), overrideMeta); resultBuilder.putData(data.getName() + ".fit_" + i, node.getData()); diff --git a/numass-main/src/main/java/inr/numass/workspace/NumassGrindLauncher.java b/numass-main/src/main/java/inr/numass/workspace/NumassGrindLauncher.java index 6133ffc6..ad8bb9f5 100644 --- a/numass-main/src/main/java/inr/numass/workspace/NumassGrindLauncher.java +++ b/numass-main/src/main/java/inr/numass/workspace/NumassGrindLauncher.java @@ -1,5 +1,6 @@ package inr.numass.workspace; +import hep.dataforge.context.GlobalContext; import hep.dataforge.data.DataNode; import hep.dataforge.grind.JavaGrindLauncher; import hep.dataforge.meta.Meta; @@ -50,6 +51,7 @@ public class NumassGrindLauncher { } node.computeAll(); + GlobalContext.instance().close(); } // // JavaGrindLauncher.buildWorkspace(new File(cfgPath), NumassWorkspaceSpec.class)