diff --git a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt index b0d7e8b4..5bc2567a 100644 --- a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt +++ b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt @@ -114,6 +114,7 @@ class NumassPlugin : BasicPlugin() { } } + /** * Load all numass model factories * diff --git a/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt index e82de07c..79e958c4 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/MergeDataAction.kt @@ -29,7 +29,6 @@ import hep.dataforge.tables.Table import hep.dataforge.tables.Tables import hep.dataforge.values.ValueMap import hep.dataforge.values.Values -import inr.numass.NumassUtils import inr.numass.data.analyzers.NumassAnalyzer import inr.numass.data.api.NumassPoint import java.util.* @@ -60,7 +59,7 @@ object MergeDataAction : ManyToOneAction("numass.merge", Table::cl } override fun afterGroup(context: Context, groupName: String, outputMeta: Meta, output: Table) { - context.output.get(name, groupName).render(NumassUtils.wrap(output, outputMeta)) + context.output[name, groupName].render(output,outputMeta) super.afterGroup(context, groupName, outputMeta, output) } diff --git a/numass-main/src/main/kotlin/inr/numass/actions/TransformDataAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/TransformDataAction.kt index eed58097..3cdefa25 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TransformDataAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TransformDataAction.kt @@ -11,7 +11,6 @@ import hep.dataforge.isAnonymous import hep.dataforge.meta.Laminate import hep.dataforge.meta.Meta import hep.dataforge.meta.MetaUtils - import hep.dataforge.tables.ColumnFormat import hep.dataforge.tables.ColumnTable import hep.dataforge.tables.ListColumn @@ -19,7 +18,6 @@ import hep.dataforge.tables.Table import hep.dataforge.values.ValueType.NUMBER import hep.dataforge.values.ValueType.STRING import hep.dataforge.values.Values -import inr.numass.NumassUtils import inr.numass.data.analyzers.NumassAnalyzer.Companion.COUNT_RATE_ERROR_KEY import inr.numass.data.analyzers.NumassAnalyzer.Companion.COUNT_RATE_KEY import inr.numass.pointExpression @@ -103,7 +101,7 @@ object TransformDataAction : OneToOneAction("numass.transform", Ta val res = table.addColumn(ListColumn.build(table.getColumn(COUNT_RATE_KEY).format, cr.stream())) .addColumn(ListColumn.build(table.getColumn(COUNT_RATE_ERROR_KEY).format, crErr.stream())) - context.output["", name].render(NumassUtils.wrap(res, meta)) + context.output[this@TransformDataAction.name, name].render(res, meta) return res } diff --git a/numass-main/src/test/kotlin/inr/numass/NumassPluginTest.kt b/numass-main/src/test/kotlin/inr/numass/NumassPluginTest.kt new file mode 100644 index 00000000..52390eec --- /dev/null +++ b/numass-main/src/test/kotlin/inr/numass/NumassPluginTest.kt @@ -0,0 +1,30 @@ +package inr.numass + +import hep.dataforge.context.Global +import hep.dataforge.meta.buildMeta +import hep.dataforge.stat.fit.FitManager +import org.junit.Before +import org.junit.Test + +class NumassPluginTest { + @Before + fun setup() { + NumassPlugin().startGlobal() + } + + @Test + fun testModels() { + val meta = buildMeta("model") { + "modelName" to "sterile" + "resolution" to { + "width" to 8.3e-5 + "tail" to "function::numass.resolutionTail.2017.mod" + } + "transmission" to { + "trapping" to "function::numass.trap.nominal" + } + } + val model = Global.load().buildModel(meta) + } +} +