Finished refactoring

This commit is contained in:
Alexander Nozik 2016-03-21 17:51:54 +03:00
parent cca98f4fab
commit 42890d81c9
9 changed files with 19 additions and 20 deletions

View File

@ -15,7 +15,7 @@
*/ */
package inr.numass.scripts package inr.numass.scripts
import hep.dataforge.actions.Pack import hep.dataforge.data.DataNode
import hep.dataforge.datafitter.FitTaskResult import hep.dataforge.datafitter.FitTaskResult
import inr.numass.Main import inr.numass.Main
import inr.numass.NumassContext import inr.numass.NumassContext
@ -24,6 +24,6 @@ import inr.numass.NumassContext
//Main.main("-lc") //Main.main("-lc")
NumassContext context = new NumassContext(); NumassContext context = new NumassContext();
context.putValue("integralThreshold", 15d); context.putValue("integralThreshold", 15d);
Pack resultPack = Main.run(context, "-c","D:\\sterile-new\\loss2014-11\\d2_19_1.xml") DataNode resultPack = Main.run(context, "-c","D:\\sterile-new\\loss2014-11\\d2_19_1.xml")
FitTaskResult result = resultPack.getData().value() FitTaskResult result = resultPack.getData().get()
result.print(new PrintWriter(System.out)) result.print(new PrintWriter(System.out))

View File

@ -16,7 +16,7 @@
package inr.numass.scripts; package inr.numass.scripts;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import hep.dataforge.data.ListDataSet; import hep.dataforge.points.ListPointSet;
import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitManager;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.MINUITPlugin import hep.dataforge.datafitter.MINUITPlugin
@ -85,7 +85,7 @@ allPars.setParValue("trap", 1d);
allPars.setParError("trap", 0.2d); allPars.setParError("trap", 0.2d);
allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY); 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); FitState state = fm.buildState(data, model, allPars);

View File

@ -17,7 +17,7 @@ package inr.numass.scripts;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import static hep.dataforge.context.GlobalContext.out; 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.FitManager;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.FitTask; 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); // PrintNamed.printSpectrum(GlobalContext.out(), spectrum, allPars, 0.0, 18700.0, 600);
//String fileName = "d:\\PlayGround\\merge\\scans.out"; //String fileName = "d:\\PlayGround\\merge\\scans.out";
// String configName = "d:\\PlayGround\\SCAN.CFG"; // String configName = "d:\\PlayGround\\SCAN.CFG";
// ListDataSet config = OldDataReader.readConfig(configName); // ListPointSet config = OldDataReader.readConfig(configName);
SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); 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)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0));
// allPars.setParValue("X", 0.4); // allPars.setParValue("X", 0.4);

View File

@ -17,7 +17,7 @@ package inr.numass.scripts;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import static hep.dataforge.context.GlobalContext.out; 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.FitManager;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.FitTask; 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); // PrintNamed.printSpectrum(GlobalContext.out(), spectrum, allPars, 0.0, 18700.0, 600);
//String fileName = "d:\\PlayGround\\merge\\scans.out"; //String fileName = "d:\\PlayGround\\merge\\scans.out";
// String configName = "d:\\PlayGround\\SCAN.CFG"; // String configName = "d:\\PlayGround\\SCAN.CFG";
// ListDataSet config = OldDataReader.readConfig(configName); // ListPointSet config = OldDataReader.readConfig(configName);
SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); 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)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0));
// allPars.setParValue("X", 0.4); // allPars.setParValue("X", 0.4);

View File

@ -56,10 +56,10 @@ PrintNamed.printSpectrum(new PrintWriter(System.out), spectrum, allPars, 18495,
// //String fileName = "d:\\PlayGround\\merge\\scans.out"; // //String fileName = "d:\\PlayGround\\merge\\scans.out";
//// String configName = "d:\\PlayGround\\SCAN.CFG"; //// String configName = "d:\\PlayGround\\SCAN.CFG";
//// ListDataSet config = OldDataReader.readConfig(configName); //// ListPointSet config = OldDataReader.readConfig(configName);
// SpectrumGenerator generator = new SpectrumGenerator(model, allPars, 12316); // 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)); //// data = data.filter("X", Value.of(15510.0), Value.of(18610.0));
//// allPars.setParValue("X", 0.4); //// allPars.setParValue("X", 0.4);

View File

@ -17,7 +17,7 @@ package inr.numass.scripts;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import static hep.dataforge.context.GlobalContext.out; 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.FitManager;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.FitTask; 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); 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)); // data = data.filter("X", Value.of(15510.0), Value.of(18610.0));
allPars.setParValue("U2", 0); allPars.setParValue("U2", 0);

View File

@ -17,7 +17,7 @@ package inr.numass.scripts;
import hep.dataforge.context.GlobalContext; import hep.dataforge.context.GlobalContext;
import hep.dataforge.data.DataSet; import hep.dataforge.data.DataSet;
import hep.dataforge.data.ListDataSet; import hep.dataforge.points.ListPointSet;
import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitManager;
import hep.dataforge.datafitter.FitState; import hep.dataforge.datafitter.FitState;
import hep.dataforge.datafitter.ParamSet; import hep.dataforge.datafitter.ParamSet;
@ -78,7 +78,7 @@ allPars.setParDomain("trap", 0d, Double.POSITIVE_INFINITY);
SpectrumGenerator generator = new SpectrumGenerator(model, allPars); SpectrumGenerator generator = new SpectrumGenerator(model, allPars);
// ColumnedDataFile file = new ColumnedDataFile("d:\\PlayGround\\RUN36.cfg"); // ColumnedDataFile file = new ColumnedDataFile("d:\\PlayGround\\RUN36.cfg");
// ListDataSet config = file.getDataSet("time","X"); // ListPointSet config = file.getDataSet("time","X");
double Elow = 14000d; double Elow = 14000d;
double Eup = 18600d; double Eup = 18600d;
int numpoints = (int) ((Eup - Elow) / 50); int numpoints = (int) ((Eup - Elow) / 50);
@ -86,7 +86,7 @@ double time = 1e6 / numpoints; // 3600 / numpoints;
DataSet config = getUniformSpectrumConfiguration(Elow, Eup, time, numpoints); DataSet config = getUniformSpectrumConfiguration(Elow, Eup, time, numpoints);
// config.addAll(DataModelUtils.getUniformSpectrumConfiguration(Eup, Elow, 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"; // plotTitle = "Generated tritium spectrum data";
// pm.plotXYScatter(data, "X", "Y",plotTitle, null); // pm.plotXYScatter(data, "X", "Y",plotTitle, null);
// bareBeta.setFSS("D:\\PlayGround\\FSS.dat"); // bareBeta.setFSS("D:\\PlayGround\\FSS.dat");

View File

@ -22,7 +22,6 @@ import hep.dataforge.context.PluginDef;
import hep.dataforge.points.XYAdapter; import hep.dataforge.points.XYAdapter;
import hep.dataforge.datafitter.FitManager; import hep.dataforge.datafitter.FitManager;
import hep.dataforge.datafitter.FitPlugin; import hep.dataforge.datafitter.FitPlugin;
import hep.dataforge.datafitter.models.Model;
import hep.dataforge.datafitter.models.ModelManager; import hep.dataforge.datafitter.models.ModelManager;
import hep.dataforge.datafitter.models.WeightedXYModel; import hep.dataforge.datafitter.models.WeightedXYModel;
import hep.dataforge.datafitter.models.XYModel; import hep.dataforge.datafitter.models.XYModel;

View File

@ -207,7 +207,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
} }
dataEditor = MetaEditor.build(dataConfig, dataEditor = MetaEditor.build(dataConfig,
DescriptorUtils.buildDescriptor( DescriptorUtils.buildDescriptor(
DescriptorUtils.findAnnotatedElement("method::hep.dataforge.data.DataManager.read") DescriptorUtils.findAnnotatedElement("class::hep.dataforge.data.FileDataFactory")
)); ));
dataEditor.geTable().setShowRoot(false); dataEditor.geTable().setShowRoot(false);
dataPane.setContent(dataEditor); dataPane.setContent(dataEditor);