diff --git a/numass-main/src/main/groovy/inr/numass/scripts/ShowTransmission.groovy b/numass-main/src/main/groovy/inr/numass/scripts/ShowTransmission.groovy index 562e9f41..c551ad8a 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/ShowTransmission.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/ShowTransmission.groovy @@ -10,7 +10,6 @@ import inr.numass.models.sterile.NumassResolution import inr.numass.models.sterile.SterileNeutrinoSpectrum import static hep.dataforge.grind.Grind.buildMeta -import static hep.dataforge.grind.Grind.morph Context ctx = Global.instance() ctx.getPluginManager().load(FXPlotManager) @@ -22,7 +21,7 @@ shell.eval { PlotHelper plot = plots - ParamSet params = morph(ParamSet,[:], "params") { + ParamSet params = new ParamSet(buildMeta { N(value: 2.7e+06, err: 30, lower: 0) bkg(value: 5.0, err: 0.1) E0(value: 18575.0, err: 0.1) @@ -31,7 +30,7 @@ shell.eval { U2(value: 0.0, err: 1e-3) X(value: 0.0, err: 0.01, lower: 0) trap(value: 1.0, err: 0.05) - } + }) def meta1 = buildMeta { resolution(width: 8.3e-5, tail: "(0.99797 - 3.05346E-7*D - 5.45738E-10 * D**2 - 6.36105E-14 * D**3)") diff --git a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt index f91135db..0f016777 100644 --- a/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt +++ b/numass-main/src/main/kotlin/inr/numass/NumassPlugin.kt @@ -16,9 +16,7 @@ package inr.numass import hep.dataforge.actions.ActionManager -import hep.dataforge.context.BasicPlugin -import hep.dataforge.context.Context -import hep.dataforge.context.PluginDef +import hep.dataforge.context.* import hep.dataforge.fx.FXPlugin import hep.dataforge.fx.plots.PlotContainer import hep.dataforge.maths.MathPlugin @@ -267,6 +265,17 @@ class NumassPlugin : BasicPlugin() { Adapters.buildXYAdapter(NumassPoint.HV_KEY, NumassAnalyzer.COUNT_RATE_KEY, NumassAnalyzer.COUNT_RATE_ERROR_KEY) } } + + class Factory : PluginFactory { + + override fun getTag(): PluginTag { + return Plugin.resolveTag(NumassPlugin::class.java) + } + + override fun build(meta: Meta): Plugin { + return NumassPlugin() + } + } } /** diff --git a/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.Plugin b/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.Plugin deleted file mode 100644 index 668b5e99..00000000 --- a/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.Plugin +++ /dev/null @@ -1 +0,0 @@ -inr.numass.NumassPlugin \ No newline at end of file diff --git a/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.PluginFactory b/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.PluginFactory new file mode 100644 index 00000000..a045d442 --- /dev/null +++ b/numass-main/src/main/resources/META-INF/services/hep.dataforge.context.PluginFactory @@ -0,0 +1 @@ +inr.numass.NumassPlugin$Factory \ No newline at end of file