Contents
Class SequenceUtil
java.lang.Object
org.jlab.detector.helicity.SequenceUtil
- Direct Known Subclasses:
DecoderBoardUtil
Low-level, static methods for delay-correcting and integrity-checking the bit
sequences of the JLab helicity signals, based only on basic pattern properties
and the pseudorandom generator.
NOTE: These methods require time-ordered bit sequence integers as inputs and
are independent of pattern type.
- Author:
- baltzell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
check
(int pairs, int patterns, int helicities, byte patternLength) static boolean
checkHelicities
(int patterns, int helicities, byte patternLength) static boolean
checkPairs
(int pairs) static boolean
checkPatterns
(int patterns, byte patternLength) static byte
getPatternHelicity
(int helicities, byte patternDelay) Pattern delay correction, as specified by JLab's injector group.static byte
getWindowHelicity
(byte firstWindow, byte windowIndex) Get the expected helicity for one window in a pattern, based on the first window in that pattern.static String
toString
(int bits) Just convert bits to string, fixed-width, left-buffered with zeroes, since that doesn't seem to be included in the standard Java library.
-
Constructor Details
-
Method Details
-
toString
Just convert bits to string, fixed-width, left-buffered with zeroes, since that doesn't seem to be included in the standard Java library.- Parameters:
bits
-- Returns:
-
getPatternHelicity
public static byte getPatternHelicity(int helicities, byte patternDelay) Pattern delay correction, as specified by JLab's injector group.- Parameters:
helicities
- the first helicity of the previous SEQUENCE_LENGTH patternspatternDelay
- number of patterns- Returns:
- delay-corrected helicity of the first window in the pattern
-
getWindowHelicity
public static byte getWindowHelicity(byte firstWindow, byte windowIndex) Get the expected helicity for one window in a pattern, based on the first window in that pattern.- Parameters:
firstWindow
- helicity of the first window in the patternwindowIndex
- index of the window of interest- Returns:
- helicity for the given window
-
checkHelicities
public static boolean checkHelicities(int patterns, int helicities, byte patternLength) - Parameters:
patterns
- the previous SEQUENCE_LENGTH windows of the pattern signalhelicities
- the previous SEQUENCE_LENGTH windows of the helicity signalpatternLength
- number of windows per pattern- Returns:
- whether the helicities are consistent with a good pattern sequence
-
checkPairs
public static boolean checkPairs(int pairs) - Parameters:
pairs
- the previous SEQUENCE_LENGTH windows of the pair signal- Returns:
- whether they're consistent with a good sequence
-
checkPatterns
public static boolean checkPatterns(int patterns, byte patternLength) - Parameters:
patterns
- the previous SEQUENCE_LENGTH windows of the pattern signalpatternLength
- number of windows per pattern- Returns:
- whether they're consistent with a good pattern sequence
-
check
public static boolean check(int pairs, int patterns, int helicities, byte patternLength) - Parameters:
pairs
- the previous SEQUENCE_LENGTH windows of the pair signalpatterns
- the previous SEQUENCE_LENGTH windows of the pattern signalhelicities
- the previous SEQUENCE_LENGTH windows of the helicity signalpatternLength
- number of windows per pattern- Returns:
- whether everything looks good
-