From d6cfdc25c1ec3016f2c783a18ad2f76ee71ff305 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 7 Jul 2017 21:04:15 +0300 Subject: [PATCH] New numass data structures --- .../main/java/inr/numass/data/NumassData.java | 67 -------------- .../java/inr/numass/data/NumassPoint.java | 68 -------------- .../java/inr/numass/data/NumassPointImpl.java | 1 + .../java/inr/numass/data/PointBuilders.java | 1 + .../numass/data/analyzers/SimpleAnalyzer.java | 64 +++++++++++++ .../inr/numass/data/api/NumassAnalyzer.java | 24 +++++ .../data/{events => api}/NumassBlock.java | 2 +- .../data/{events => api}/NumassEvent.java | 14 ++- .../data/{events => api}/NumassFrame.java | 2 +- .../java/inr/numass/data/api/NumassPoint.java | 82 +++++++++++++++++ .../java/inr/numass/data/api/NumassSet.java | 90 +++++++++++++++++++ .../inr/numass/data/api/SignalProcessor.java | 11 +++ .../numass/data/events/NumassAnalyzer.java | 30 ------- .../inr/numass/data/events/NumassPoint.java | 15 ---- .../data/{ => legacy}/LegacyDataReader.java | 4 +- .../inr/numass/data/{ => legacy}/NMFile.java | 25 ++---- .../numass/data/{ => legacy}/RawNMFile.java | 4 +- .../numass/data/{ => legacy}/RawNMPoint.java | 4 +- .../inr/numass/storage/NumassDataFactory.java | 1 - .../inr/numass/storage/NumassDataLoader.java | 6 +- .../inr/numass/storage/NumassStorage.java | 3 +- .../inr/numass/data/PointAnalyzer.groovy | 3 +- .../DetectorSpectrumSubstraction.groovy | 1 - .../inr/numass/scripts/FindBorder.groovy | 1 - .../inr/numass/scripts/SimulatePileup.groovy | 3 +- .../inr/numass/scripts/Underflow.groovy | 1 - .../scripts/times/MultiPointHistogram.groovy | 2 +- .../scripts/times/TestPointAnalyzer.groovy | 2 +- .../src/main/java/inr/numass/NumassIO.java | 4 +- .../inr/numass/actions/DebunchAction.java | 4 +- .../inr/numass/actions/FindBorderAction.java | 4 +- .../numass/actions/JoinNumassDataAction.java | 2 - .../inr/numass/actions/PrepareDataAction.java | 3 +- .../numass/actions/ReadLegacyDataAction.java | 4 +- .../actions/ShowEnergySpectrumAction.java | 2 - .../java/inr/numass/debunch/DebunchData.java | 4 +- .../java/inr/numass/debunch/DebunchEvent.java | 2 +- .../inr/numass/debunch/DebunchReport.java | 4 +- .../inr/numass/debunch/DebunchReportImpl.java | 4 +- .../java/inr/numass/debunch/Debuncher.java | 2 +- .../main/java/inr/numass/debunch/Frame.java | 2 +- .../inr/numass/debunch/FrameAnalizer.java | 2 +- .../inr/numass/tasks/NumassPrepareTask.java | 1 - .../java/inr/numass/utils/BunchGenerator.java | 4 +- .../inr/numass/utils/NMEventGenerator.java | 5 +- .../utils/NMEventGeneratorWithPulser.java | 2 +- .../inr/numass/utils/PileUpSimulator.java | 5 +- .../java/inr/numass/utils/TritiumUtils.java | 1 - .../inr/numass/utils/UnderflowCorrection.java | 1 - .../numass/server/NumassStorageHandler.java | 1 - .../main/kotlin/inr/numass/viewer/MainView.kt | 1 - .../inr/numass/viewer/NumassDataCache.kt | 4 +- .../inr/numass/viewer/NumassLoaderView.kt | 2 - 53 files changed, 334 insertions(+), 267 deletions(-) delete mode 100644 numass-core/src/main/java/inr/numass/data/NumassData.java delete mode 100644 numass-core/src/main/java/inr/numass/data/NumassPoint.java create mode 100644 numass-core/src/main/java/inr/numass/data/analyzers/SimpleAnalyzer.java create mode 100644 numass-core/src/main/java/inr/numass/data/api/NumassAnalyzer.java rename numass-core/src/main/java/inr/numass/data/{events => api}/NumassBlock.java (91%) rename numass-core/src/main/java/inr/numass/data/{events => api}/NumassEvent.java (74%) rename numass-core/src/main/java/inr/numass/data/{events => api}/NumassFrame.java (92%) create mode 100644 numass-core/src/main/java/inr/numass/data/api/NumassPoint.java create mode 100644 numass-core/src/main/java/inr/numass/data/api/NumassSet.java create mode 100644 numass-core/src/main/java/inr/numass/data/api/SignalProcessor.java delete mode 100644 numass-core/src/main/java/inr/numass/data/events/NumassAnalyzer.java delete mode 100644 numass-core/src/main/java/inr/numass/data/events/NumassPoint.java rename numass-core/src/main/java/inr/numass/data/{ => legacy}/LegacyDataReader.java (95%) rename numass-core/src/main/java/inr/numass/data/{ => legacy}/NMFile.java (83%) rename numass-core/src/main/java/inr/numass/data/{ => legacy}/RawNMFile.java (94%) rename numass-core/src/main/java/inr/numass/data/{ => legacy}/RawNMPoint.java (94%) diff --git a/numass-core/src/main/java/inr/numass/data/NumassData.java b/numass-core/src/main/java/inr/numass/data/NumassData.java deleted file mode 100644 index 93fae312..00000000 --- a/numass-core/src/main/java/inr/numass/data/NumassData.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.data; - -import hep.dataforge.data.Data; -import hep.dataforge.meta.Meta; -import hep.dataforge.meta.Metoid; -import hep.dataforge.names.Named; -import hep.dataforge.tables.Table; -import org.jetbrains.annotations.NotNull; - -import java.time.Instant; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * @author Alexander Nozik - */ -public interface NumassData extends Named, Metoid, Iterable { - - String getDescription(); - - @Override - Meta meta(); - - Stream stream(); - - @NotNull - @Override - default Iterator iterator() { - return stream().iterator(); - } - - default List getNMPoints() { - return stream().collect(Collectors.toList()); - } - - boolean isEmpty(); - - Instant startTime(); - - default Data getHVData() { - return Data.buildStatic(null); - } - - /** - * Find first point with given Uset - * - * @param U - * @return - */ - default NumassPoint getByVoltage(double U) { - for (NumassPoint point : this) { - if (point.getVoltage() == U) { - return point; - } - } - return null; - } - - -} diff --git a/numass-core/src/main/java/inr/numass/data/NumassPoint.java b/numass-core/src/main/java/inr/numass/data/NumassPoint.java deleted file mode 100644 index f0adbc68..00000000 --- a/numass-core/src/main/java/inr/numass/data/NumassPoint.java +++ /dev/null @@ -1,68 +0,0 @@ -package inr.numass.data; - -import hep.dataforge.tables.ValueMap; -import hep.dataforge.values.Values; - -import java.time.Instant; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * A general representation of single voltage measurement. - * Created by darksnake on 13-Apr-17. - */ -public interface NumassPoint { - String[] dataNames = {"chanel", "count"}; - - Instant getStartTime(); - - int getCount(int chanel); - - int getCountInWindow(int from, int to); - - List getData(); - - long getTotalCount(); - - default Map getMap(int binning, boolean normalize) { - Map res = new LinkedHashMap<>(); - - double norm; - if (normalize) { - norm = getLength(); - } else { - norm = 1d; - } - - int i = 0; - - while (i < getMaxChannel() - binning) { - int start = i; - double sum = 0; - while (i < start + binning) { - sum += getCount(i); - i++; - } - res.put(start + Math.floor(binning / 2d), sum / norm); - } - return res; - } - - default List getData(int binning, boolean normalize) { - return getMap(binning, normalize).entrySet().stream() - .map(entry -> new ValueMap(dataNames, entry.getKey(), entry.getValue())) - .collect(Collectors.toList()); - } - - double getLength(); - - double getVoltage(); - - int[] getSpectrum(); - - default int getMaxChannel(){ - return getSpectrum().length - 1; - } -} diff --git a/numass-core/src/main/java/inr/numass/data/NumassPointImpl.java b/numass-core/src/main/java/inr/numass/data/NumassPointImpl.java index 3d97401c..0b04619e 100644 --- a/numass-core/src/main/java/inr/numass/data/NumassPointImpl.java +++ b/numass-core/src/main/java/inr/numass/data/NumassPointImpl.java @@ -17,6 +17,7 @@ package inr.numass.data; import hep.dataforge.tables.ValueMap; import hep.dataforge.values.Values; +import inr.numass.data.legacy.RawNMPoint; import java.time.Instant; import java.util.ArrayList; diff --git a/numass-core/src/main/java/inr/numass/data/PointBuilders.java b/numass-core/src/main/java/inr/numass/data/PointBuilders.java index 3b2b9f4e..cdcfb9d7 100644 --- a/numass-core/src/main/java/inr/numass/data/PointBuilders.java +++ b/numass-core/src/main/java/inr/numass/data/PointBuilders.java @@ -1,5 +1,6 @@ package inr.numass.data; +import inr.numass.data.legacy.RawNMPoint; import org.jetbrains.annotations.NotNull; import java.io.IOException; diff --git a/numass-core/src/main/java/inr/numass/data/analyzers/SimpleAnalyzer.java b/numass-core/src/main/java/inr/numass/data/analyzers/SimpleAnalyzer.java new file mode 100644 index 00000000..55f3d1f4 --- /dev/null +++ b/numass-core/src/main/java/inr/numass/data/analyzers/SimpleAnalyzer.java @@ -0,0 +1,64 @@ +package inr.numass.data.analyzers; + +import hep.dataforge.meta.Meta; +import hep.dataforge.tables.ValueMap; +import hep.dataforge.values.Values; +import inr.numass.data.api.NumassAnalyzer; +import inr.numass.data.api.NumassBlock; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.api.SignalProcessor; +import org.jetbrains.annotations.Nullable; + +import java.util.stream.Stream; + +/** + * A simple event counter + * Created by darksnake on 07.07.2017. + */ +public class SimpleAnalyzer implements NumassAnalyzer { + public static String[] NAME_LIST = {"length", "count", COUNT_RATE_KEY, COUNT_RATE_ERROR_KEY, "window", "timestamp"}; + + @Nullable + private final SignalProcessor processor; + + public SimpleAnalyzer(@Nullable SignalProcessor processor) { + this.processor = processor; + } + + /** + * Return unsorted stream of events including events from frames + * + * @param block + * @return + */ + private Stream getEventStream(NumassBlock block) { + if (processor == null && block.getFrames().count() > 0) { + throw new IllegalArgumentException("Signal processor needed to analyze frames"); + } else { + return Stream.concat(block.getEvents(), block.getFrames().flatMap(processor::analyze)); + } + } + + @Override + public Values analyze(NumassBlock block, Meta config) { + + int loChannel = config.getInt("energy.lo", 0); + int upChannel = config.getInt("energy.up", Integer.MAX_VALUE); + long count = getEventStream(block) + .filter(it -> it.getChanel() >= loChannel && it.getChanel() <= upChannel) + .count(); + double countRate = (double) count / block.getLength().toMillis() * 1000; + double countRateError = Math.sqrt((double) count) / block.getLength().toMillis() * 1000; + + return new ValueMap(NAME_LIST, + new Object[]{ + block.getLength().toNanos(), + count, + countRate, + countRateError, + new int[]{loChannel, upChannel}, + block.getStartTime() + } + ); + } +} diff --git a/numass-core/src/main/java/inr/numass/data/api/NumassAnalyzer.java b/numass-core/src/main/java/inr/numass/data/api/NumassAnalyzer.java new file mode 100644 index 00000000..1d304cb1 --- /dev/null +++ b/numass-core/src/main/java/inr/numass/data/api/NumassAnalyzer.java @@ -0,0 +1,24 @@ +package inr.numass.data.api; + +import hep.dataforge.meta.Meta; +import hep.dataforge.values.Values; + +/** + * A general raw data analysis utility. Could have different implementations + * Created by darksnake on 06-Jul-17. + */ +public interface NumassAnalyzer { + String COUNT_RATE_KEY = "cr"; + String COUNT_RATE_ERROR_KEY = "crErr"; + + /** + * Perform analysis on block. The values for count rate, its error and point length in nanos must + * exist, but occasionally additional values could also be presented. + * + * @param block + * @return + */ + Values analyze(NumassBlock block, Meta config); + + +} diff --git a/numass-core/src/main/java/inr/numass/data/events/NumassBlock.java b/numass-core/src/main/java/inr/numass/data/api/NumassBlock.java similarity index 91% rename from numass-core/src/main/java/inr/numass/data/events/NumassBlock.java rename to numass-core/src/main/java/inr/numass/data/api/NumassBlock.java index a3873ba4..eafc97d6 100644 --- a/numass-core/src/main/java/inr/numass/data/events/NumassBlock.java +++ b/numass-core/src/main/java/inr/numass/data/api/NumassBlock.java @@ -1,4 +1,4 @@ -package inr.numass.data.events; +package inr.numass.data.api; import java.time.Duration; import java.time.Instant; diff --git a/numass-core/src/main/java/inr/numass/data/events/NumassEvent.java b/numass-core/src/main/java/inr/numass/data/api/NumassEvent.java similarity index 74% rename from numass-core/src/main/java/inr/numass/data/events/NumassEvent.java rename to numass-core/src/main/java/inr/numass/data/api/NumassEvent.java index 7837baba..1b1076d8 100644 --- a/numass-core/src/main/java/inr/numass/data/events/NumassEvent.java +++ b/numass-core/src/main/java/inr/numass/data/api/NumassEvent.java @@ -13,13 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package inr.numass.data.events; +package inr.numass.data.api; + +import org.jetbrains.annotations.NotNull; /** * A single numass event with given amplitude ant time. + * * @author Darksnake */ -public class NumassEvent { +public class NumassEvent implements Comparable { protected final short chanel; protected final double time; @@ -38,7 +41,12 @@ public class NumassEvent { /** * @return the time */ - public double getTime(){ + public double getTime() { return time; } + + @Override + public int compareTo(@NotNull NumassEvent o) { + return Double.compare(this.getTime(), o.getTime()); + } } diff --git a/numass-core/src/main/java/inr/numass/data/events/NumassFrame.java b/numass-core/src/main/java/inr/numass/data/api/NumassFrame.java similarity index 92% rename from numass-core/src/main/java/inr/numass/data/events/NumassFrame.java rename to numass-core/src/main/java/inr/numass/data/api/NumassFrame.java index a38959b3..3e77246c 100644 --- a/numass-core/src/main/java/inr/numass/data/events/NumassFrame.java +++ b/numass-core/src/main/java/inr/numass/data/api/NumassFrame.java @@ -1,4 +1,4 @@ -package inr.numass.data.events; +package inr.numass.data.api; import java.nio.ShortBuffer; import java.time.Duration; diff --git a/numass-core/src/main/java/inr/numass/data/api/NumassPoint.java b/numass-core/src/main/java/inr/numass/data/api/NumassPoint.java new file mode 100644 index 00000000..3134839a --- /dev/null +++ b/numass-core/src/main/java/inr/numass/data/api/NumassPoint.java @@ -0,0 +1,82 @@ +package inr.numass.data.api; + +import hep.dataforge.meta.Metoid; +import hep.dataforge.values.Value; + +import java.time.Duration; +import java.time.Instant; +import java.util.stream.Stream; + +/** + * Created by darksnake on 06-Jul-17. + */ +public interface NumassPoint extends Metoid, NumassBlock { + + String START_TIME_KEY = "start"; + String LENGTH_KEY = "length"; + String HV_KEY = "voltage"; + + + Stream getBlocks(); + + /** + * Get the voltage setting for the point + * @return + */ + default double getVoltage() { + return meta().getDouble(HV_KEY, 0); + } + + /** + * Get the first block if it exists. Throw runtime exception otherwise. + * @return + */ + default NumassBlock getFirstBlock() { + return getBlocks().findFirst().orElseThrow(() -> new RuntimeException("The point is empty")); + } + + /** + * Get the starting time from meta or from first block + * @return + */ + @Override + default Instant getStartTime() { + return meta().optValue(START_TIME_KEY).map(Value::timeValue).orElseGet(() -> getFirstBlock().getStartTime()); + } + + /** + * Get the length key of meta or calculate length as a sum of block lengths. The latter could be a bit slow + * + * @return + */ + @Override + default Duration getLength() { + return Duration.ofNanos( + meta().optValue(LENGTH_KEY).map(Value::longValue) + .orElseGet(() -> getBlocks().mapToLong(it -> it.getLength().toNanos()).sum()) + ); + } + + /** + * Get all events it all blocks as a single sequence + *

+ * Some performance analysis of different stream concatenation approaches is given here: https://www.techempower.com/blog/2016/10/19/efficient-multiple-stream-concatenation-in-java/ + *

+ * + * @return + */ + @Override + default Stream getEvents() { + return getBlocks().flatMap(NumassBlock::getEvents); + } + + /** + * Get all frames in all blocks as a single sequence + * + * @return + */ + @Override + default Stream getFrames() { + return getBlocks().flatMap(NumassBlock::getFrames); + } +} diff --git a/numass-core/src/main/java/inr/numass/data/api/NumassSet.java b/numass-core/src/main/java/inr/numass/data/api/NumassSet.java new file mode 100644 index 00000000..b4062db4 --- /dev/null +++ b/numass-core/src/main/java/inr/numass/data/api/NumassSet.java @@ -0,0 +1,90 @@ +/* + * 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.data.api; + +import hep.dataforge.data.Data; +import hep.dataforge.meta.Metoid; +import hep.dataforge.names.Named; +import hep.dataforge.providers.Provider; +import hep.dataforge.providers.Provides; +import hep.dataforge.providers.ProvidesNames; +import hep.dataforge.tables.Table; +import hep.dataforge.values.Value; +import org.jetbrains.annotations.NotNull; + +import java.time.Instant; +import java.util.Iterator; +import java.util.Optional; +import java.util.stream.Stream; + +/** + * A single set of numass points previously called file. + * + * @author Alexander Nozik + */ +public interface NumassSet extends Named, Metoid, Iterable, Provider { + String DESCRIPTION_KEY = "info"; + String NUMASS_POINT_PROVIDER_KEY = "point"; + + Stream getPoints(); + + default String getDescription() { + return meta().getString(DESCRIPTION_KEY, ""); + } + + @NotNull + @Override + default Iterator iterator() { + return getPoints().iterator(); + } + + /** + * Get the first point if it exists. Throw runtime exception otherwise. + * + * @return + */ + default NumassPoint getFirstPoint() { + return getPoints().findFirst().orElseThrow(() -> new RuntimeException("The set is empty")); + } + + /** + * Get the starting time from meta or from first point + * + * @return + */ + default Instant getStartTime() { + return meta().optValue(NumassPoint.START_TIME_KEY).map(Value::timeValue).orElseGet(() -> getFirstPoint().getStartTime()); + } + + /** + * Find first point with given voltage + * + * @param voltage + * @return + */ + default Optional optPoint(double voltage) { + return getPoints().filter(it -> it.getVoltage() == voltage).findFirst(); + } + + @Provides(NUMASS_POINT_PROVIDER_KEY) + default Optional optPoint(String voltage) { + return optPoint(Double.parseDouble(voltage)); + } + + @Override + default String defaultTarget() { + return NUMASS_POINT_PROVIDER_KEY; + } + + @ProvidesNames(NUMASS_POINT_PROVIDER_KEY) + default Stream listPoints() { + return getPoints().map(it -> Double.toString(it.getVoltage())); + } + + default Data
getHvData() { + return Data.buildStatic(null); + } +} diff --git a/numass-core/src/main/java/inr/numass/data/api/SignalProcessor.java b/numass-core/src/main/java/inr/numass/data/api/SignalProcessor.java new file mode 100644 index 00000000..8f2d212c --- /dev/null +++ b/numass-core/src/main/java/inr/numass/data/api/SignalProcessor.java @@ -0,0 +1,11 @@ +package inr.numass.data.api; + +import java.util.stream.Stream; + +/** + * An ancestor to numass frame analyzers + * Created by darksnake on 07.07.2017. + */ +public interface SignalProcessor { + Stream analyze(NumassFrame frame); +} diff --git a/numass-core/src/main/java/inr/numass/data/events/NumassAnalyzer.java b/numass-core/src/main/java/inr/numass/data/events/NumassAnalyzer.java deleted file mode 100644 index 6785d078..00000000 --- a/numass-core/src/main/java/inr/numass/data/events/NumassAnalyzer.java +++ /dev/null @@ -1,30 +0,0 @@ -package inr.numass.data.events; - -import hep.dataforge.meta.Meta; -import hep.dataforge.tables.Table; - -/** - * A general raw data analysis utility. Could have different implementations - * Created by darksnake on 06-Jul-17. - */ -public interface NumassAnalyzer { - /** - * Caclulate the number of events in given window - * - * @param block - * @param from - * @param to - * @return - */ - int getCountInWindow(NumassBlock block, int from, int to); - - default int getMaxChannel() { - return 4096; - } - - default int getCountTotal(NumassBlock block) { - return getCountInWindow(block, 0, getMaxChannel()); - } - - public Table getSpectrum(Meta config); -} diff --git a/numass-core/src/main/java/inr/numass/data/events/NumassPoint.java b/numass-core/src/main/java/inr/numass/data/events/NumassPoint.java deleted file mode 100644 index 19626caa..00000000 --- a/numass-core/src/main/java/inr/numass/data/events/NumassPoint.java +++ /dev/null @@ -1,15 +0,0 @@ -package inr.numass.data.events; - -import hep.dataforge.meta.Metoid; - -import java.util.stream.Stream; - -/** - * Created by darksnake on 06-Jul-17. - */ -public interface NumassPoint extends Metoid { - - - - Stream getBlocks(); -} diff --git a/numass-core/src/main/java/inr/numass/data/LegacyDataReader.java b/numass-core/src/main/java/inr/numass/data/legacy/LegacyDataReader.java similarity index 95% rename from numass-core/src/main/java/inr/numass/data/LegacyDataReader.java rename to numass-core/src/main/java/inr/numass/data/legacy/LegacyDataReader.java index 43abe4c4..27c18f79 100644 --- a/numass-core/src/main/java/inr/numass/data/LegacyDataReader.java +++ b/numass-core/src/main/java/inr/numass/data/legacy/LegacyDataReader.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package inr.numass.data; +package inr.numass.data.legacy; import hep.dataforge.data.FileDataFactory; import hep.dataforge.data.binary.Binary; import hep.dataforge.meta.Meta; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; import java.io.*; import java.time.LocalDateTime; diff --git a/numass-core/src/main/java/inr/numass/data/NMFile.java b/numass-core/src/main/java/inr/numass/data/legacy/NMFile.java similarity index 83% rename from numass-core/src/main/java/inr/numass/data/NMFile.java rename to numass-core/src/main/java/inr/numass/data/legacy/NMFile.java index 6da5c5d1..d65936e0 100644 --- a/numass-core/src/main/java/inr/numass/data/NMFile.java +++ b/numass-core/src/main/java/inr/numass/data/legacy/NMFile.java @@ -13,16 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package inr.numass.data; +package inr.numass.data.legacy; import hep.dataforge.description.ValueDef; import hep.dataforge.meta.Meta; import hep.dataforge.names.NamedMetaHolder; +import inr.numass.data.PointBuilders; +import inr.numass.data.api.NumassPoint; +import inr.numass.data.api.NumassSet; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; @@ -34,7 +36,7 @@ import java.util.stream.Stream; */ @ValueDef(name = "numass.path", info = "Path to this data file in numass repository.") @ValueDef(name = "numass.name", info = "The name of this data file.") -public class NMFile extends NamedMetaHolder implements NumassData { +public class NMFile extends NamedMetaHolder implements NumassSet { private final List points; @@ -55,23 +57,12 @@ public class NMFile extends NamedMetaHolder implements NumassData { } @Override - public String getDescription() { - return ""; - } - - @Override - public Stream stream() { + public Stream getPoints() { return points.stream(); } @Override - public boolean isEmpty() { - return false; + public String getDescription() { + return ""; } - - @Override - public Instant startTime() { - return null; - } - } diff --git a/numass-core/src/main/java/inr/numass/data/RawNMFile.java b/numass-core/src/main/java/inr/numass/data/legacy/RawNMFile.java similarity index 94% rename from numass-core/src/main/java/inr/numass/data/RawNMFile.java rename to numass-core/src/main/java/inr/numass/data/legacy/RawNMFile.java index 0f5ff8fd..3f92caa9 100644 --- a/numass-core/src/main/java/inr/numass/data/RawNMFile.java +++ b/numass-core/src/main/java/inr/numass/data/legacy/RawNMFile.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package inr.numass.data; +package inr.numass.data.legacy; import hep.dataforge.description.ValueDef; import hep.dataforge.meta.Meta; import hep.dataforge.meta.MetaBuilder; import hep.dataforge.names.NamedMetaHolder; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; import java.io.BufferedOutputStream; import java.io.OutputStream; diff --git a/numass-core/src/main/java/inr/numass/data/RawNMPoint.java b/numass-core/src/main/java/inr/numass/data/legacy/RawNMPoint.java similarity index 94% rename from numass-core/src/main/java/inr/numass/data/RawNMPoint.java rename to numass-core/src/main/java/inr/numass/data/legacy/RawNMPoint.java index eb4a149d..d72ad21d 100644 --- a/numass-core/src/main/java/inr/numass/data/RawNMPoint.java +++ b/numass-core/src/main/java/inr/numass/data/legacy/RawNMPoint.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package inr.numass.data; +package inr.numass.data.legacy; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; import java.time.Instant; import java.util.ArrayList; diff --git a/numass-core/src/main/java/inr/numass/storage/NumassDataFactory.java b/numass-core/src/main/java/inr/numass/storage/NumassDataFactory.java index 0fd2e870..adaf7aa3 100644 --- a/numass-core/src/main/java/inr/numass/storage/NumassDataFactory.java +++ b/numass-core/src/main/java/inr/numass/storage/NumassDataFactory.java @@ -6,7 +6,6 @@ import hep.dataforge.data.DataFilter; import hep.dataforge.data.DataTree; import hep.dataforge.meta.Meta; import hep.dataforge.storage.commons.StorageUtils; -import inr.numass.data.NumassData; /** * Created by darksnake on 03-Feb-17. diff --git a/numass-core/src/main/java/inr/numass/storage/NumassDataLoader.java b/numass-core/src/main/java/inr/numass/storage/NumassDataLoader.java index fd6dfe95..dfe220c0 100644 --- a/numass-core/src/main/java/inr/numass/storage/NumassDataLoader.java +++ b/numass-core/src/main/java/inr/numass/storage/NumassDataLoader.java @@ -30,11 +30,9 @@ import hep.dataforge.storage.filestorage.FileEnvelope; import hep.dataforge.storage.filestorage.FileStorage; import hep.dataforge.storage.loaders.AbstractLoader; import hep.dataforge.tables.Table; -import inr.numass.data.NumassData; -import inr.numass.data.NumassPoint; import inr.numass.data.PointBuilders; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import org.slf4j.LoggerFactory; import java.io.IOException; diff --git a/numass-core/src/main/java/inr/numass/storage/NumassStorage.java b/numass-core/src/main/java/inr/numass/storage/NumassStorage.java index e0e04d5a..8ea2837a 100644 --- a/numass-core/src/main/java/inr/numass/storage/NumassStorage.java +++ b/numass-core/src/main/java/inr/numass/storage/NumassStorage.java @@ -21,8 +21,7 @@ import hep.dataforge.events.EventBuilder; import hep.dataforge.exceptions.StorageException; import hep.dataforge.meta.Meta; import hep.dataforge.storage.filestorage.FileStorage; -import inr.numass.data.NMFile; -import inr.numass.data.NumassData; +import inr.numass.data.legacy.NMFile; import org.slf4j.LoggerFactory; import java.io.IOException; diff --git a/numass-main/src/main/groovy/inr/numass/data/PointAnalyzer.groovy b/numass-main/src/main/groovy/inr/numass/data/PointAnalyzer.groovy index f9de1354..75f855c5 100644 --- a/numass-main/src/main/groovy/inr/numass/data/PointAnalyzer.groovy +++ b/numass-main/src/main/groovy/inr/numass/data/PointAnalyzer.groovy @@ -3,7 +3,8 @@ package inr.numass.data import groovy.transform.CompileStatic import hep.dataforge.maths.histogram.Histogram import hep.dataforge.maths.histogram.UnivariateHistogram -import inr.numass.data.events.NumassEvent +import inr.numass.data.api.NumassEvent +import inr.numass.data.legacy.RawNMPoint import java.util.stream.DoubleStream diff --git a/numass-main/src/main/groovy/inr/numass/scripts/DetectorSpectrumSubstraction.groovy b/numass-main/src/main/groovy/inr/numass/scripts/DetectorSpectrumSubstraction.groovy index 5bb948bb..a1d96d8e 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/DetectorSpectrumSubstraction.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/DetectorSpectrumSubstraction.groovy @@ -10,7 +10,6 @@ import hep.dataforge.io.ColumnedDataWriter import hep.dataforge.tables.ListTable import hep.dataforge.tables.TableFormatBuilder import hep.dataforge.tables.ValueMap -import inr.numass.data.NumassData NumassData.metaClass.findPoint{double u -> delegate.getNMPoints().getWork { it.getVoltage() == u }.getMap(20, true) diff --git a/numass-main/src/main/groovy/inr/numass/scripts/FindBorder.groovy b/numass-main/src/main/groovy/inr/numass/scripts/FindBorder.groovy index 5a8db3e5..d07d2cbb 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/FindBorder.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/FindBorder.groovy @@ -9,7 +9,6 @@ package inr.numass.scripts import hep.dataforge.grind.GrindMetaBuilder import hep.dataforge.meta.Meta import inr.numass.actions.FindBorderAction -import inr.numass.data.NumassData import inr.numass.storage.NumassDataLoader File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_2_2\\set_6_e26d123e54010000") 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 58043af0..5951bc1d 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/SimulatePileup.groovy @@ -8,9 +8,8 @@ package inr.numass.scripts import hep.dataforge.grind.Grind import hep.dataforge.values.Values -import inr.numass.data.NumassPoint import inr.numass.data.NumassPointImpl -import inr.numass.data.RawNMPoint +import inr.numass.data.legacy.RawNMPoint import inr.numass.storage.NumassDataLoader import inr.numass.utils.NMEventGeneratorWithPulser import inr.numass.utils.PileUpSimulator 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 238f5e9c..27e85234 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/Underflow.groovy @@ -9,7 +9,6 @@ package inr.numass.scripts import hep.dataforge.io.ColumnedDataWriter import hep.dataforge.storage.commons.StorageUtils import hep.dataforge.tables.Table -import inr.numass.data.NumassData import inr.numass.data.NumassDataUtils import inr.numass.data.NumassPointImpl import inr.numass.storage.NumassStorage diff --git a/numass-main/src/main/groovy/inr/numass/scripts/times/MultiPointHistogram.groovy b/numass-main/src/main/groovy/inr/numass/scripts/times/MultiPointHistogram.groovy index 13ed15d4..f6394842 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/times/MultiPointHistogram.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/times/MultiPointHistogram.groovy @@ -7,7 +7,7 @@ import hep.dataforge.grind.helpers.PlotHelper import hep.dataforge.plots.fx.FXPlotManager import inr.numass.NumassPlugin import inr.numass.data.PointAnalyzer -import inr.numass.data.RawNMPoint +import inr.numass.data.legacy.RawNMPoint import inr.numass.storage.NumassDataLoader import inr.numass.storage.NumassStorage import inr.numass.storage.NumassStorageFactory diff --git a/numass-main/src/main/groovy/inr/numass/scripts/times/TestPointAnalyzer.groovy b/numass-main/src/main/groovy/inr/numass/scripts/times/TestPointAnalyzer.groovy index fa09b111..9db80ded 100644 --- a/numass-main/src/main/groovy/inr/numass/scripts/times/TestPointAnalyzer.groovy +++ b/numass-main/src/main/groovy/inr/numass/scripts/times/TestPointAnalyzer.groovy @@ -8,7 +8,7 @@ import hep.dataforge.plots.fx.FXPlotManager import hep.dataforge.tables.ValueMap import inr.numass.NumassPlugin import inr.numass.data.PointAnalyzer -import inr.numass.data.RawNMPoint +import inr.numass.data.legacy.RawNMPoint import inr.numass.storage.NumassStorage import inr.numass.storage.NumassStorageFactory diff --git a/numass-main/src/main/java/inr/numass/NumassIO.java b/numass-main/src/main/java/inr/numass/NumassIO.java index cd417da2..76a9ad14 100644 --- a/numass-main/src/main/java/inr/numass/NumassIO.java +++ b/numass-main/src/main/java/inr/numass/NumassIO.java @@ -20,8 +20,8 @@ import hep.dataforge.data.binary.Binary; import hep.dataforge.io.BasicIOManager; import hep.dataforge.meta.Meta; import hep.dataforge.names.Name; -import inr.numass.data.LegacyDataReader; -import inr.numass.data.RawNMFile; +import inr.numass.data.legacy.LegacyDataReader; +import inr.numass.data.legacy.RawNMFile; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.output.TeeOutputStream; diff --git a/numass-main/src/main/java/inr/numass/actions/DebunchAction.java b/numass-main/src/main/java/inr/numass/actions/DebunchAction.java index 42f261e7..3c0695f1 100644 --- a/numass-main/src/main/java/inr/numass/actions/DebunchAction.java +++ b/numass-main/src/main/java/inr/numass/actions/DebunchAction.java @@ -21,8 +21,8 @@ import hep.dataforge.description.TypedActionDef; import hep.dataforge.description.ValueDef; import hep.dataforge.exceptions.ContentException; import hep.dataforge.meta.Laminate; -import inr.numass.data.RawNMFile; -import inr.numass.data.RawNMPoint; +import inr.numass.data.legacy.RawNMFile; +import inr.numass.data.legacy.RawNMPoint; import inr.numass.debunch.DebunchReport; import inr.numass.debunch.FrameAnalizer; diff --git a/numass-main/src/main/java/inr/numass/actions/FindBorderAction.java b/numass-main/src/main/java/inr/numass/actions/FindBorderAction.java index 71f05e41..5743e7a1 100644 --- a/numass-main/src/main/java/inr/numass/actions/FindBorderAction.java +++ b/numass-main/src/main/java/inr/numass/actions/FindBorderAction.java @@ -25,9 +25,7 @@ import hep.dataforge.tables.ListTable; import hep.dataforge.tables.Table; import hep.dataforge.tables.ValueMap; import hep.dataforge.values.Value; -import inr.numass.data.NMFile; -import inr.numass.data.NumassData; -import inr.numass.data.NumassPoint; +import inr.numass.data.legacy.NMFile; import org.apache.commons.math3.analysis.UnivariateFunction; import java.io.OutputStream; diff --git a/numass-main/src/main/java/inr/numass/actions/JoinNumassDataAction.java b/numass-main/src/main/java/inr/numass/actions/JoinNumassDataAction.java index fb3b810e..68702cc1 100644 --- a/numass-main/src/main/java/inr/numass/actions/JoinNumassDataAction.java +++ b/numass-main/src/main/java/inr/numass/actions/JoinNumassDataAction.java @@ -4,8 +4,6 @@ import hep.dataforge.actions.ManyToOneAction; import hep.dataforge.context.Context; import hep.dataforge.description.TypedActionDef; import hep.dataforge.meta.Laminate; -import inr.numass.data.NumassData; -import inr.numass.data.NumassPoint; import inr.numass.data.NumassPointImpl; import java.util.Collection; diff --git a/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java b/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java index dec25cfd..2e451322 100644 --- a/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java +++ b/numass-main/src/main/java/inr/numass/actions/PrepareDataAction.java @@ -30,10 +30,9 @@ import hep.dataforge.tables.Table; import hep.dataforge.tables.TableFormat; import hep.dataforge.tables.ValueMap; import hep.dataforge.values.Values; -import inr.numass.data.NumassData; import inr.numass.data.NumassPoint; import inr.numass.data.PointBuilders; -import inr.numass.data.RawNMPoint; +import inr.numass.data.legacy.RawNMPoint; import inr.numass.debunch.DebunchReport; import inr.numass.debunch.FrameAnalizer; import inr.numass.storage.NumassDataLoader; diff --git a/numass-main/src/main/java/inr/numass/actions/ReadLegacyDataAction.java b/numass-main/src/main/java/inr/numass/actions/ReadLegacyDataAction.java index c9e294c9..cd66019f 100644 --- a/numass-main/src/main/java/inr/numass/actions/ReadLegacyDataAction.java +++ b/numass-main/src/main/java/inr/numass/actions/ReadLegacyDataAction.java @@ -23,8 +23,8 @@ import hep.dataforge.description.TypedActionDef; import hep.dataforge.description.ValueDef; import hep.dataforge.exceptions.ContentException; import hep.dataforge.meta.Laminate; -import inr.numass.data.NMFile; -import inr.numass.data.RawNMFile; +import inr.numass.data.legacy.NMFile; +import inr.numass.data.legacy.RawNMFile; import static hep.dataforge.values.ValueType.NUMBER; import static inr.numass.NumassIO.getNumassData; diff --git a/numass-main/src/main/java/inr/numass/actions/ShowEnergySpectrumAction.java b/numass-main/src/main/java/inr/numass/actions/ShowEnergySpectrumAction.java index 9efbb570..ef84e6ee 100644 --- a/numass-main/src/main/java/inr/numass/actions/ShowEnergySpectrumAction.java +++ b/numass-main/src/main/java/inr/numass/actions/ShowEnergySpectrumAction.java @@ -19,8 +19,6 @@ import hep.dataforge.plots.data.XYPlottable; import hep.dataforge.tables.*; import hep.dataforge.values.ValueType; import hep.dataforge.values.Values; -import inr.numass.data.NumassData; -import inr.numass.data.NumassPoint; import java.io.OutputStream; import java.util.*; diff --git a/numass-main/src/main/java/inr/numass/debunch/DebunchData.java b/numass-main/src/main/java/inr/numass/debunch/DebunchData.java index 45afea90..98d2122b 100644 --- a/numass-main/src/main/java/inr/numass/debunch/DebunchData.java +++ b/numass-main/src/main/java/inr/numass/debunch/DebunchData.java @@ -15,8 +15,8 @@ */ package inr.numass.debunch; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import java.util.ArrayList; import java.util.Collections; diff --git a/numass-main/src/main/java/inr/numass/debunch/DebunchEvent.java b/numass-main/src/main/java/inr/numass/debunch/DebunchEvent.java index 12c40bd9..e6de869f 100644 --- a/numass-main/src/main/java/inr/numass/debunch/DebunchEvent.java +++ b/numass-main/src/main/java/inr/numass/debunch/DebunchEvent.java @@ -15,7 +15,7 @@ */ package inr.numass.debunch; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; /** * diff --git a/numass-main/src/main/java/inr/numass/debunch/DebunchReport.java b/numass-main/src/main/java/inr/numass/debunch/DebunchReport.java index 1f93e85e..5ca165c5 100644 --- a/numass-main/src/main/java/inr/numass/debunch/DebunchReport.java +++ b/numass-main/src/main/java/inr/numass/debunch/DebunchReport.java @@ -15,8 +15,8 @@ */ package inr.numass.debunch; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import java.util.List; diff --git a/numass-main/src/main/java/inr/numass/debunch/DebunchReportImpl.java b/numass-main/src/main/java/inr/numass/debunch/DebunchReportImpl.java index 759f1fa7..a11a6147 100644 --- a/numass-main/src/main/java/inr/numass/debunch/DebunchReportImpl.java +++ b/numass-main/src/main/java/inr/numass/debunch/DebunchReportImpl.java @@ -15,8 +15,8 @@ */ package inr.numass.debunch; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import java.util.ArrayList; import java.util.List; diff --git a/numass-main/src/main/java/inr/numass/debunch/Debuncher.java b/numass-main/src/main/java/inr/numass/debunch/Debuncher.java index 27ff0578..bbdd1fbd 100644 --- a/numass-main/src/main/java/inr/numass/debunch/Debuncher.java +++ b/numass-main/src/main/java/inr/numass/debunch/Debuncher.java @@ -15,7 +15,7 @@ */ package inr.numass.debunch; -import inr.numass.data.RawNMPoint; +import inr.numass.data.legacy.RawNMPoint; /** * diff --git a/numass-main/src/main/java/inr/numass/debunch/Frame.java b/numass-main/src/main/java/inr/numass/debunch/Frame.java index 42eb7776..18f13d5b 100644 --- a/numass-main/src/main/java/inr/numass/debunch/Frame.java +++ b/numass-main/src/main/java/inr/numass/debunch/Frame.java @@ -15,7 +15,7 @@ */ package inr.numass.debunch; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; import org.apache.commons.math3.distribution.PoissonDistribution; import java.util.ArrayList; diff --git a/numass-main/src/main/java/inr/numass/debunch/FrameAnalizer.java b/numass-main/src/main/java/inr/numass/debunch/FrameAnalizer.java index 57b99859..ad05fc0b 100644 --- a/numass-main/src/main/java/inr/numass/debunch/FrameAnalizer.java +++ b/numass-main/src/main/java/inr/numass/debunch/FrameAnalizer.java @@ -15,7 +15,7 @@ */ package inr.numass.debunch; -import inr.numass.data.RawNMPoint; +import inr.numass.data.legacy.RawNMPoint; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.interpolation.LinearInterpolator; import org.apache.commons.math3.util.FastMath; diff --git a/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java b/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java index ab2951f6..6f4787cc 100644 --- a/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java +++ b/numass-main/src/main/java/inr/numass/tasks/NumassPrepareTask.java @@ -19,7 +19,6 @@ import hep.dataforge.workspace.TaskModel; import inr.numass.actions.MergeDataAction; import inr.numass.actions.MonitorCorrectAction; import inr.numass.actions.PrepareDataAction; -import inr.numass.data.NumassData; /** * Prepare data task diff --git a/numass-main/src/main/java/inr/numass/utils/BunchGenerator.java b/numass-main/src/main/java/inr/numass/utils/BunchGenerator.java index bfae8442..ad3f9765 100644 --- a/numass-main/src/main/java/inr/numass/utils/BunchGenerator.java +++ b/numass-main/src/main/java/inr/numass/utils/BunchGenerator.java @@ -15,8 +15,8 @@ */ package inr.numass.utils; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import org.apache.commons.math3.random.MersenneTwister; import org.apache.commons.math3.random.RandomGenerator; import org.apache.commons.math3.random.SynchronizedRandomGenerator; diff --git a/numass-main/src/main/java/inr/numass/utils/NMEventGenerator.java b/numass-main/src/main/java/inr/numass/utils/NMEventGenerator.java index 9ac835ec..1ecdb114 100644 --- a/numass-main/src/main/java/inr/numass/utils/NMEventGenerator.java +++ b/numass-main/src/main/java/inr/numass/utils/NMEventGenerator.java @@ -16,9 +16,8 @@ package inr.numass.utils; import hep.dataforge.meta.Meta; -import inr.numass.data.NumassPoint; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import org.apache.commons.math3.distribution.EnumeratedRealDistribution; import org.apache.commons.math3.distribution.RealDistribution; import org.apache.commons.math3.random.EmpiricalDistribution; diff --git a/numass-main/src/main/java/inr/numass/utils/NMEventGeneratorWithPulser.java b/numass-main/src/main/java/inr/numass/utils/NMEventGeneratorWithPulser.java index afd347bb..492ac054 100644 --- a/numass-main/src/main/java/inr/numass/utils/NMEventGeneratorWithPulser.java +++ b/numass-main/src/main/java/inr/numass/utils/NMEventGeneratorWithPulser.java @@ -1,7 +1,7 @@ package inr.numass.utils; import hep.dataforge.meta.Meta; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; import org.apache.commons.math3.distribution.NormalDistribution; import org.apache.commons.math3.distribution.RealDistribution; import org.apache.commons.math3.random.RandomGenerator; diff --git a/numass-main/src/main/java/inr/numass/utils/PileUpSimulator.java b/numass-main/src/main/java/inr/numass/utils/PileUpSimulator.java index 64beabba..c372e8bd 100644 --- a/numass-main/src/main/java/inr/numass/utils/PileUpSimulator.java +++ b/numass-main/src/main/java/inr/numass/utils/PileUpSimulator.java @@ -5,10 +5,9 @@ */ package inr.numass.utils; -import inr.numass.data.NumassPoint; import inr.numass.data.PointBuilders; -import inr.numass.data.RawNMPoint; -import inr.numass.data.events.NumassEvent; +import inr.numass.data.api.NumassEvent; +import inr.numass.data.legacy.RawNMPoint; import org.apache.commons.math3.random.RandomGenerator; import java.util.ArrayList; diff --git a/numass-main/src/main/java/inr/numass/utils/TritiumUtils.java b/numass-main/src/main/java/inr/numass/utils/TritiumUtils.java index 484b4481..22b07f4c 100644 --- a/numass-main/src/main/java/inr/numass/utils/TritiumUtils.java +++ b/numass-main/src/main/java/inr/numass/utils/TritiumUtils.java @@ -15,7 +15,6 @@ */ package inr.numass.utils; -import inr.numass.data.NumassPoint; import org.apache.commons.math3.analysis.UnivariateFunction; import java.util.HashMap; diff --git a/numass-main/src/main/java/inr/numass/utils/UnderflowCorrection.java b/numass-main/src/main/java/inr/numass/utils/UnderflowCorrection.java index 8fc56d7d..1cc33df9 100644 --- a/numass-main/src/main/java/inr/numass/utils/UnderflowCorrection.java +++ b/numass-main/src/main/java/inr/numass/utils/UnderflowCorrection.java @@ -9,7 +9,6 @@ import hep.dataforge.tables.ListTable; import hep.dataforge.tables.Table; import hep.dataforge.tables.ValueMap; import hep.dataforge.values.Values; -import inr.numass.data.NumassPoint; import org.apache.commons.math3.analysis.ParametricUnivariateFunction; import org.apache.commons.math3.exception.DimensionMismatchException; import org.apache.commons.math3.fitting.SimpleCurveFitter; diff --git a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java index da2622bc..73649b82 100644 --- a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java +++ b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java @@ -13,7 +13,6 @@ import hep.dataforge.server.storage.StorageRatpackHandler; import hep.dataforge.storage.api.ObjectLoader; import hep.dataforge.storage.api.PointLoader; import hep.dataforge.storage.api.Storage; -import inr.numass.data.NumassData; import org.slf4j.LoggerFactory; import ratpack.handling.Context; diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt index 788c0415..faa50cff 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/MainView.kt @@ -15,7 +15,6 @@ import hep.dataforge.storage.api.PointLoader import hep.dataforge.storage.api.Storage import hep.dataforge.storage.filestorage.FileStorageFactory import inr.numass.NumassProperties -import inr.numass.data.NumassData import inr.numass.storage.NumassStorage import javafx.application.Platform import javafx.beans.property.SimpleObjectProperty diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassDataCache.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassDataCache.kt index e87d9b74..239ad8a9 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassDataCache.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassDataCache.kt @@ -3,8 +3,6 @@ package inr.numass.viewer import hep.dataforge.data.Data import hep.dataforge.meta.Meta import hep.dataforge.tables.Table -import inr.numass.data.NumassData -import inr.numass.data.NumassPoint import java.time.Instant import java.util.stream.Collectors import java.util.stream.Stream @@ -13,7 +11,7 @@ import java.util.stream.Stream * Cached numass data * Created by darksnake on 23-Jun-17. */ -class NumassDataCache(val data: NumassData) : NumassData { +class NumassDataCache(val data: NumassData) { private val cachedDescription: String by lazy { data.description } private val cachedMeta: Meta by lazy { data.meta } private val cachedPoints: List by lazy { data.stream().collect(Collectors.toList()) } diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt index 2cbc3c6f..b20b25bc 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/NumassLoaderView.kt @@ -17,9 +17,7 @@ import hep.dataforge.tables.ListTable import hep.dataforge.tables.ValueMap import hep.dataforge.tables.XYAdapter import hep.dataforge.values.Values -import inr.numass.data.NumassData import inr.numass.data.NumassDataUtils -import inr.numass.data.NumassPoint import javafx.beans.property.SimpleObjectProperty import javafx.beans.value.ObservableValue import javafx.collections.FXCollections