Package org.jlab.detector.epics
Class EpicsSequence
java.lang.Object
org.jlab.detector.epics.EpicsSequence
- All Implemented Interfaces:
Comparator<Epics>
For easy access to most recent epics readout for any given event.
See the main() method for example use case, where only the 2 lines
marked with "!!!" are specific to accessing epics information.
- Author:
- baltzell, devita
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintprotected intfindIndex(int unixTime) get(int unixTime) get(org.jlab.jnp.hipo4.data.Event event) getElement(int index) doublegetIntegral(String name, double defaultvalue) doublegetIntegral(String name, double defaultvalue, int t1, int t2) doublegetMinimum(String name, double defaultvalue, int unixtime) doublegetMinimum(String name, double defaultvalue, int t1, int t2) getSubList(int t1, int t2) static voidvoidstatic EpicsSequencereadSequence(List<String> filenames) This reads tag=1 events for RAW::epics banks, and initializes and returns aEpicsSequencethat can be used to access the most recent epics readout for any given event.intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
epics
-
-
Constructor Details
-
EpicsSequence
public EpicsSequence()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<Epics>
-
findIndex
protected int findIndex(int unixTime) -
add
-
getElement
- Parameters:
index-- Returns:
- the Epics for the given index
-
get
- Parameters:
unixTime- (i.e. RUN::config.timestamp)- Returns:
- the most recent Epics for the given timestamp
-
get
- Parameters:
event-- Returns:
- the most recent Epics for the given event
-
getSubList
- Parameters:
t1- lower limit of a Unix time intervalt2- upper limit of a Unix time interval- Returns:
- subset of sequence entries in the interval
-
getIntegral
- Parameters:
name- Epics variable namedefaultvalue- Epics variable default valuet1- lower limit of a Unix time intervalt2- upper limit of a Unix time interval- Returns:
- integral of the chosen variable in the time interval
-
getIntegral
- Parameters:
name- Epics variable namedefaultvalue- Epics variable default value- Returns:
- integral of the chosen variable
-
getMinimum
- Parameters:
name- Epics variable namedefaultvalue- Epics variable default valuet1- lower limit of a Unix time intervalt2- upper limit of a Unix time interval- Returns:
- minimum of the chosen variable in the time interval
-
getMinimum
- Parameters:
name- Epics variable namedefaultvalue- Epics variable default valueunixtime- Unix time- Returns:
- minimum of the chosen variable in -2s:+4s around the input time
-
print
-
readSequence
This reads tag=1 events for RAW::epics banks, and initializes and returns aEpicsSequencethat can be used to access the most recent epics readout for any given event.- Parameters:
filenames- list of names of HIPO files to read- Returns:
- sequence
-
size
public int size() -
main
-