From 91e3c639434911026aa82ff4baad8126ffacd9d7 Mon Sep 17 00:00:00 2001 From: darksnake Date: Thu, 27 Oct 2016 03:11:49 +0300 Subject: [PATCH] jline fix for grind --- .../groovy/inr/numass/LaunchGrindShell.groovy | 1 + .../inr/numass/scripts/SimulatePileup.groovy | 16 +++++++--------- .../groovy/inr/numass/scripts/Underflow.groovy | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy b/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy index c5324a46..2c61c020 100644 --- a/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy +++ b/numass-main/src/main/groovy/inr/numass/LaunchGrindShell.groovy @@ -15,6 +15,7 @@ println cli.usage String cfgPath = cli.parse(args).c; println "Loading config file from $cfgPath" new GrindShell().start { + context.pluginManager().loadPlugin("plots-jfc") GrindWorkspaceBuilder numass = new GrindWorkspaceBuilder() .withSpec(NumassWorkspaceSpec) .from(new File(cfgPath)) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy b/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy index a10f67c1..71af7aa5 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy @@ -6,20 +6,18 @@ package inr.numass.scripts -import inr.numass.storage.NMFile -import inr.numass.storage.NMPoint -import inr.numass.storage.NumassData -import inr.numass.storage.NumassDataLoader +import hep.dataforge.grind.GrindMetaBuilder import hep.dataforge.meta.Meta import inr.numass.actions.PileupSimulationAction -import hep.dataforge.grind.GrindMetaBuilder +import inr.numass.storage.NumassData +import inr.numass.storage.NumassDataLoader -File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_2_2\\set_6_e26d123e54010000") +File dataDir = new File("D:\\Work\\Numass\\data\\2016_10\\Fill_1\\set_10") if(!dataDir.exists()){ println "dataDir directory does not exist" } -Meta config = new GrindMetaBuilder().config(lowerChannel: 400, upperChannel: 1700) +Meta config = new GrindMetaBuilder().config(lowerChannel: 500, upperChannel: 1800) //println config NumassData data = NumassDataLoader.fromLocalDir(null, dataDir) Map res = new PileupSimulationAction().simpleRun(data,config) @@ -27,7 +25,7 @@ Map res = new PileupSimulationAction().simpleRun(data,config def keys = res.keySet(); //print spectra for selected point -double u = 15000d; +double u = 16500d; List points = res.collect{key, value -> value.getByUset(u).getMapWithBinning(20, false)} @@ -51,5 +49,5 @@ for(int i = 0; i < data.getNMPoints().size();i++){ print "${data.getNMPoints().get(i).getUset()}\t" print "${data.getNMPoints().get(i).getLength()}\t" print keys.collect{res[it].getNMPoints().get(i).getEventsCount()}.join("\t") + "\t" - println keys.collect{res[it].getNMPoints().get(i).getCountInWindow(500,1700)}.join("\t") + println keys.collect { res[it].getNMPoints().get(i).getCountInWindow(500, 1800) }.join("\t") } diff --git a/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy b/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy index c2c5cf0c..c1db7221 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy @@ -14,13 +14,13 @@ import inr.numass.utils.UnderflowCorrection //File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_2_2\\set_7_b2a3433e54010000") //File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_2_2\\set_6_e26d123e54010000") -File dataDir = new File("D:\\Work\\Numass\\data\\2016_10\\Fill_1\\set_3") +File dataDir = new File("D:\\Work\\Numass\\data\\2016_10\\Fill_1\\set_10") if(!dataDir.exists()){ println "dataDir directory does not exist" } NumassData data = NumassDataLoader.fromLocalDir(null, dataDir) //NumassData data = NMFile.readFile(new File("D:\\Work\\Numass\\sterilie2013-2014\\dat\\2013\\SCAN06.DAT" )) -Table t = new UnderflowCorrection().fitAllPoints(data, 450, 1000, 1700, 20); +Table t = new UnderflowCorrection().fitAllPoints(data, 500, 1000, 1800, 20); ColumnedDataWriter.writeDataSet(System.out, t, "underflow parameters")