From 42890d81c960a16ea3ef2a8188d5981bae05bc80 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Mon, 21 Mar 2016 17:51:54 +0300 Subject: [PATCH] Finished refactoring --- .../src/main/groovy/inr/numass/scripts/Loss2014.groovy | 6 +++--- .../src/main/groovy/inr/numass/scripts/OldTest.groovy | 4 ++-- .../main/groovy/inr/numass/scripts/ResolutionTest.groovy | 6 +++--- .../src/main/groovy/inr/numass/scripts/Simulate.groovy | 6 +++--- .../src/main/groovy/inr/numass/scripts/SimulateGun.groovy | 4 ++-- .../src/main/groovy/inr/numass/scripts/Systematics.groovy | 4 ++-- .../src/main/groovy/inr/numass/scripts/TritiumTest.groovy | 6 +++--- numass-main/src/main/java/inr/numass/NumassPlugin.java | 1 - .../inr/numass/workbench/NumassWorkbenchController.java | 2 +- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/Loss2014.groovy b/numass-main/src/main/groovy/inr/numass/scripts/Loss2014.groovy index 119d4c23..792f006c 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Loss2014.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Loss2014.groovy @@ -15,7 +15,7 @@ */ package inr.numass.scripts -import hep.dataforge.actions.Pack +import hep.dataforge.data.DataNode import hep.dataforge.datafitter.FitTaskResult import inr.numass.Main import inr.numass.NumassContext @@ -24,6 +24,6 @@ import inr.numass.NumassContext //Main.main("-lc") NumassContext context = new NumassContext(); context.putValue("integralThreshold", 15d); -Pack resultPack = Main.run(context, "-c","D:\\sterile-new\\loss2014-11\\d2_19_1.xml") -FitTaskResult result = resultPack.getData().value() +DataNode resultPack = Main.run(context, "-c","D:\\sterile-new\\loss2014-11\\d2_19_1.xml") +FitTaskResult result = resultPack.getData().get() result.print(new PrintWriter(System.out)) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/OldTest.groovy b/numass-main/src/main/groovy/inr/numass/scripts/OldTest.groovy index b3869515..d4021b0c 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/OldTest.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/OldTest.groovy @@ -16,7 +16,7 @@ package inr.numass.scripts; import hep.dataforge.context.GlobalContext; -import hep.dataforge.data.ListDataSet; +import hep.dataforge.points.ListPointSet; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.MINUITPlugin @@ -85,7 +85,7 @@ allPars.setParValue("trap", 1d); allPars.setParError("trap", 0.2d); allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY); -ListDataSet data = readData("c:\\Users\\Darksnake\\Dropbox\\PlayGround\\RUN23.DAT", 18400d); +ListPointSet data = readData("c:\\Users\\Darksnake\\Dropbox\\PlayGround\\RUN23.DAT", 18400d); FitState state = fm.buildState(data, model, allPars); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/ResolutionTest.groovy b/numass-main/src/main/groovy/inr/numass/scripts/ResolutionTest.groovy index 1d4125b3..ddd839d2 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/ResolutionTest.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/ResolutionTest.groovy @@ -17,7 +17,7 @@ package inr.numass.scripts; import hep.dataforge.context.GlobalContext; import static hep.dataforge.context.GlobalContext.out; -import hep.dataforge.data.ListDataSet; +import hep.dataforge.points.ListPointSet; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitTask; @@ -77,10 +77,10 @@ allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY); // PrintNamed.printSpectrum(GlobalContext.out(), spectrum, allPars, 0.0, 18700.0, 600); //String fileName = "d:\\PlayGround\\merge\\scans.out"; // String configName = "d:\\PlayGround\\SCAN.CFG"; -// ListDataSet config = OldDataReader.readConfig(configName); +// ListPointSet config = OldDataReader.readConfig(configName); SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); -ListDataSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(13500d, 18200, 1e6, 60)); +ListPointSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(13500d, 18200, 1e6, 60)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0)); // allPars.setParValue("X", 0.4); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy b/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy index f6a43af2..0a0003eb 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Simulate.groovy @@ -17,7 +17,7 @@ package inr.numass.scripts; import hep.dataforge.context.GlobalContext; import static hep.dataforge.context.GlobalContext.out; -import hep.dataforge.data.ListDataSet; +import hep.dataforge.points.ListPointSet; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitTask; @@ -81,10 +81,10 @@ allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY); // PrintNamed.printSpectrum(GlobalContext.out(), spectrum, allPars, 0.0, 18700.0, 600); //String fileName = "d:\\PlayGround\\merge\\scans.out"; // String configName = "d:\\PlayGround\\SCAN.CFG"; -// ListDataSet config = OldDataReader.readConfig(configName); +// ListPointSet config = OldDataReader.readConfig(configName); SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); -ListDataSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(13500d, 18200, 1e6, 60)); +ListPointSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(13500d, 18200, 1e6, 60)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0)); // allPars.setParValue("X", 0.4); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/SimulateGun.groovy b/numass-main/src/main/groovy/inr/numass/scripts/SimulateGun.groovy index 3162a74c..8d8e82b4 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/SimulateGun.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/SimulateGun.groovy @@ -56,10 +56,10 @@ PrintNamed.printSpectrum(new PrintWriter(System.out), spectrum, allPars, 18495, // //String fileName = "d:\\PlayGround\\merge\\scans.out"; //// String configName = "d:\\PlayGround\\SCAN.CFG"; -//// ListDataSet config = OldDataReader.readConfig(configName); +//// ListPointSet config = OldDataReader.readConfig(configName); // SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); // -// ListDataSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(18495, 18505, 20, 20)); +// ListPointSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(18495, 18505, 20, 20)); // //// data = data.filter("X", Value.of(15510.0), Value.of(18610.0)); //// allPars.setParValue("X", 0.4); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/Systematics.groovy b/numass-main/src/main/groovy/inr/numass/scripts/Systematics.groovy index 1a3ff502..3e9d794b 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Systematics.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Systematics.groovy @@ -17,7 +17,7 @@ package inr.numass.scripts; import hep.dataforge.context.GlobalContext; import static hep.dataforge.context.GlobalContext.out; -import hep.dataforge.data.ListDataSet; +import hep.dataforge.points.ListPointSet; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitTask; @@ -84,7 +84,7 @@ allPars.setPar("trap", 0, 0.01, 0d, Double.POSITIVE_INFINITY); SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); -ListDataSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(14000d, 18200, 1e6, 60)); +ListPointSet data = generator.generateData(DataModelUtils.getUniformSpectrumConfiguration(14000d, 18200, 1e6, 60)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0)); allPars.setParValue("U2", 0); diff --git a/numass-main/src/main/groovy/inr/numass/scripts/TritiumTest.groovy b/numass-main/src/main/groovy/inr/numass/scripts/TritiumTest.groovy index f7525051..74791180 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/TritiumTest.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/TritiumTest.groovy @@ -17,7 +17,7 @@ package inr.numass.scripts; import hep.dataforge.context.GlobalContext; import hep.dataforge.data.DataSet; -import hep.dataforge.data.ListDataSet; +import hep.dataforge.points.ListPointSet; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.ParamSet; @@ -78,7 +78,7 @@ allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY); SpectrumGenerator generator = new SpectrumGenerator(model, allPars); // ColumnedDataFile file = new ColumnedDataFile("d:\\PlayGround\\RUN36.cfg"); -// ListDataSet config = file.getDataSet("time","X"); +// ListPointSet config = file.getDataSet("time","X"); double Elow = 14000d; double Eup = 18600d; int numpoints = (int) ((Eup - Elow) / 50); @@ -86,7 +86,7 @@ double time = 1e6 / numpoints; // 3600 / numpoints; DataSet config = getUniformSpectrumConfiguration(Elow, Eup, time, numpoints); // config.addAll(DataModelUtils.getUniformSpectrumConfiguration(Eup, Elow, time, numpoints));// в обратную сторону -ListDataSet data = generator.generateData(config); +ListPointSet data = generator.generateData(config); // plotTitle = "Generated tritium spectrum data"; // pm.plotXYScatter(data, "X", "Y",plotTitle, null); // bareBeta.setFSS("D:\\PlayGround\\FSS.dat"); diff --git a/numass-main/src/main/java/inr/numass/NumassPlugin.java b/numass-main/src/main/java/inr/numass/NumassPlugin.java index 5f33b3c5..1e3d1cdf 100644 --- a/numass-main/src/main/java/inr/numass/NumassPlugin.java +++ b/numass-main/src/main/java/inr/numass/NumassPlugin.java @@ -22,7 +22,6 @@ import hep.dataforge.context.PluginDef; import hep.dataforge.points.XYAdapter; import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitPlugin; -import hep.dataforge.datafitter.models.Model; import hep.dataforge.datafitter.models.ModelManager; import hep.dataforge.datafitter.models.WeightedXYModel; import hep.dataforge.datafitter.models.XYModel; diff --git a/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java b/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java index 74432c6c..efdacb64 100644 --- a/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java +++ b/numass-main/src/main/java/inr/numass/workbench/NumassWorkbenchController.java @@ -207,7 +207,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder } dataEditor = MetaEditor.build(dataConfig, DescriptorUtils.buildDescriptor( - DescriptorUtils.findAnnotatedElement("method::hep.dataforge.data.DataManager.read") + DescriptorUtils.findAnnotatedElement("class::hep.dataforge.data.FileDataFactory") )); dataEditor.geTable().setShowRoot(false); dataPane.setContent(dataEditor);