diff --git a/numass-main/build.gradle b/numass-main/build.gradle index 72cc1e80..85cd8f04 100644 --- a/numass-main/build.gradle +++ b/numass-main/build.gradle @@ -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') diff --git a/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java b/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java index 62225897..ec0a519b 100644 --- a/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java +++ b/numass-main/src/main/java/hep/dataforge/plotfit/PlotFitResultAction.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/Main.java b/numass-main/src/main/java/inr/numass/Main.java index 480c2fd1..f5de0b93 100644 --- a/numass-main/src/main/java/inr/numass/Main.java +++ b/numass-main/src/main/java/inr/numass/Main.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/NumassPlugin.java b/numass-main/src/main/java/inr/numass/NumassPlugin.java index f1a281e6..4b72c4d8 100644 --- a/numass-main/src/main/java/inr/numass/NumassPlugin.java +++ b/numass-main/src/main/java/inr/numass/NumassPlugin.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java b/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java index 1979a1c2..21dd6564 100644 --- a/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java +++ b/numass-main/src/main/java/inr/numass/actions/ShowLossSpectrumAction.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/actions/SummaryAction.java b/numass-main/src/main/java/inr/numass/actions/SummaryAction.java index 5cbe0892..77667bda 100644 --- a/numass-main/src/main/java/inr/numass/actions/SummaryAction.java +++ b/numass-main/src/main/java/inr/numass/actions/SummaryAction.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/data/SpectrumGenerator.java b/numass-main/src/main/java/inr/numass/data/SpectrumGenerator.java index 3df4e6a5..91e7dabc 100644 --- a/numass-main/src/main/java/inr/numass/data/SpectrumGenerator.java +++ b/numass-main/src/main/java/inr/numass/data/SpectrumGenerator.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/data/SpectrumInformation.java b/numass-main/src/main/java/inr/numass/data/SpectrumInformation.java index edbfec42..cd01b1a5 100644 --- a/numass-main/src/main/java/inr/numass/data/SpectrumInformation.java +++ b/numass-main/src/main/java/inr/numass/data/SpectrumInformation.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/BetaSpectrum.java b/numass-main/src/main/java/inr/numass/models/BetaSpectrum.java index dd325ad3..13d90d34 100644 --- a/numass-main/src/main/java/inr/numass/models/BetaSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/BetaSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/CustomNBkgSpectrum.java b/numass-main/src/main/java/inr/numass/models/CustomNBkgSpectrum.java index 698e1be2..5a09050f 100644 --- a/numass-main/src/main/java/inr/numass/models/CustomNBkgSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/CustomNBkgSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/EmpiricalLossSpectrum.java b/numass-main/src/main/java/inr/numass/models/EmpiricalLossSpectrum.java index 210c6fc2..d420a6a0 100644 --- a/numass-main/src/main/java/inr/numass/models/EmpiricalLossSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/EmpiricalLossSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/ExperimentalVariableLossSpectrum.java b/numass-main/src/main/java/inr/numass/models/ExperimentalVariableLossSpectrum.java index 818bb129..4dcaea17 100644 --- a/numass-main/src/main/java/inr/numass/models/ExperimentalVariableLossSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/ExperimentalVariableLossSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/GaussResolution.java b/numass-main/src/main/java/inr/numass/models/GaussResolution.java index e3fff71a..1dd98b88 100644 --- a/numass-main/src/main/java/inr/numass/models/GaussResolution.java +++ b/numass-main/src/main/java/inr/numass/models/GaussResolution.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/GaussSourceSpectrum.java b/numass-main/src/main/java/inr/numass/models/GaussSourceSpectrum.java index 81f3aff4..d9309dd9 100644 --- a/numass-main/src/main/java/inr/numass/models/GaussSourceSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/GaussSourceSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/GunSpectrum.java b/numass-main/src/main/java/inr/numass/models/GunSpectrum.java index f9ea9a17..d0767af3 100644 --- a/numass-main/src/main/java/inr/numass/models/GunSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/GunSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/LossCalculator.java b/numass-main/src/main/java/inr/numass/models/LossCalculator.java index 5cf211b6..bbbe0cd9 100644 --- a/numass-main/src/main/java/inr/numass/models/LossCalculator.java +++ b/numass-main/src/main/java/inr/numass/models/LossCalculator.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/ModularSpectrum.java b/numass-main/src/main/java/inr/numass/models/ModularSpectrum.java index 9b0c0dc1..df37b0e7 100644 --- a/numass-main/src/main/java/inr/numass/models/ModularSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/ModularSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/NBkgSpectrum.java b/numass-main/src/main/java/inr/numass/models/NBkgSpectrum.java index b9934f53..3e125b21 100644 --- a/numass-main/src/main/java/inr/numass/models/NBkgSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/NBkgSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/NamedSpectrumCaching.java b/numass-main/src/main/java/inr/numass/models/NamedSpectrumCaching.java index ff84921a..128ee84a 100644 --- a/numass-main/src/main/java/inr/numass/models/NamedSpectrumCaching.java +++ b/numass-main/src/main/java/inr/numass/models/NamedSpectrumCaching.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/RangedNamedSetSpectrum.java b/numass-main/src/main/java/inr/numass/models/RangedNamedSetSpectrum.java index e4083c32..54721a67 100644 --- a/numass-main/src/main/java/inr/numass/models/RangedNamedSetSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/RangedNamedSetSpectrum.java @@ -15,7 +15,7 @@ */ package inr.numass.models; -import hep.dataforge.fitting.parametric.ParametricFunction; +import hep.dataforge.stat.parametric.ParametricFunction; /** * diff --git a/numass-main/src/main/java/inr/numass/models/Transmission.java b/numass-main/src/main/java/inr/numass/models/Transmission.java index a78bb90f..ded0d1b1 100644 --- a/numass-main/src/main/java/inr/numass/models/Transmission.java +++ b/numass-main/src/main/java/inr/numass/models/Transmission.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/TransmissionConvolution.java b/numass-main/src/main/java/inr/numass/models/TransmissionConvolution.java index 98f287f9..00abd9d9 100644 --- a/numass-main/src/main/java/inr/numass/models/TransmissionConvolution.java +++ b/numass-main/src/main/java/inr/numass/models/TransmissionConvolution.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/TritiumSpectrumCaching.java b/numass-main/src/main/java/inr/numass/models/TritiumSpectrumCaching.java index 199b2e59..2215bdda 100644 --- a/numass-main/src/main/java/inr/numass/models/TritiumSpectrumCaching.java +++ b/numass-main/src/main/java/inr/numass/models/TritiumSpectrumCaching.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/VariableLossSpectrum.java b/numass-main/src/main/java/inr/numass/models/VariableLossSpectrum.java index 2b92e73c..888cb7ac 100644 --- a/numass-main/src/main/java/inr/numass/models/VariableLossSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/VariableLossSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/sterile/NumassBeta.java b/numass-main/src/main/java/inr/numass/models/sterile/NumassBeta.java index 6e04375e..58aaa745 100644 --- a/numass-main/src/main/java/inr/numass/models/sterile/NumassBeta.java +++ b/numass-main/src/main/java/inr/numass/models/sterile/NumassBeta.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/sterile/NumassResolution.java b/numass-main/src/main/java/inr/numass/models/sterile/NumassResolution.java index 32e27934..3d3ec8d0 100644 --- a/numass-main/src/main/java/inr/numass/models/sterile/NumassResolution.java +++ b/numass-main/src/main/java/inr/numass/models/sterile/NumassResolution.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/sterile/NumassTransmission.java b/numass-main/src/main/java/inr/numass/models/sterile/NumassTransmission.java index 9e463521..f59543e5 100644 --- a/numass-main/src/main/java/inr/numass/models/sterile/NumassTransmission.java +++ b/numass-main/src/main/java/inr/numass/models/sterile/NumassTransmission.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/sterile/SterileNeutrinoSpectrum.java b/numass-main/src/main/java/inr/numass/models/sterile/SterileNeutrinoSpectrum.java index c3c094b3..c5d4976b 100644 --- a/numass-main/src/main/java/inr/numass/models/sterile/SterileNeutrinoSpectrum.java +++ b/numass-main/src/main/java/inr/numass/models/sterile/SterileNeutrinoSpectrum.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/models/sterile/TestModels.java b/numass-main/src/main/java/inr/numass/models/sterile/TestModels.java index 3f049862..561a5755 100644 --- a/numass-main/src/main/java/inr/numass/models/sterile/TestModels.java +++ b/numass-main/src/main/java/inr/numass/models/sterile/TestModels.java @@ -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; diff --git a/numass-main/src/main/java/inr/numass/tasks/NumassFitScanTask.java b/numass-main/src/main/java/inr/numass/tasks/NumassFitScanTask.java new file mode 100644 index 00000000..9f50296d --- /dev/null +++ b/numass-main/src/main/java/inr/numass/tasks/NumassFitScanTask.java @@ -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"; + } + +} diff --git a/numass-main/src/main/java/inr/numass/tasks/PrepareTask.java b/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java similarity index 95% rename from numass-main/src/main/java/inr/numass/tasks/PrepareTask.java rename to numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java index df933fa6..a7737de4 100644 --- a/numass-main/src/main/java/inr/numass/tasks/PrepareTask.java +++ b/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java @@ -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 { /* diff --git a/numass-main/src/main/java/inr/numass/workbench/Workbench.java b/numass-main/src/main/java/inr/numass/workbench/Workbench.java index 3ac34c62..46e6bab9 100644 --- a/numass-main/src/main/java/inr/numass/workbench/Workbench.java +++ b/numass-main/src/main/java/inr/numass/workbench/Workbench.java @@ -37,7 +37,11 @@ public class Workbench extends Application { primaryStage.show(); scene.getWindow().setOnCloseRequest((WindowEvent event) -> { - controller.getContext().workManager().getRoot().cancel(true); + try { + controller.getContext().workManager().getRoot().cancel(true); + } catch (Exception e) { + + } }); } @@ -46,9 +50,7 @@ public class Workbench extends Application { GlobalContext.instance().close(); super.stop(); } - - - + /** * @param args the command line arguments */ diff --git a/numass-main/src/test/java/inr/numass/models/PlotScatter.java b/numass-main/src/test/java/inr/numass/models/PlotScatter.java index 08ab4e89..69826cad 100644 --- a/numass-main/src/test/java/inr/numass/models/PlotScatter.java +++ b/numass-main/src/test/java/inr/numass/models/PlotScatter.java @@ -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; /** diff --git a/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java b/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java index 6a3e3362..f131b7ca 100644 --- a/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java +++ b/numass-main/src/test/java/inr/numass/run/NumassSpectrumTest.java @@ -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;