Package org.jlab.detector.helicity
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancheck(int pairs, int patterns, int helicities, byte patternLength) static booleancheckHelicities(int patterns, int helicities, byte patternLength) static booleancheckPairs(int pairs) static booleancheckPatterns(int patterns, byte patternLength) static bytegetPatternHelicity(int helicities, byte patternDelay) Pattern delay correction, as specified by JLab's injector group.static bytegetWindowHelicity(byte firstWindow, byte windowIndex) Get the expected helicity for one window in a pattern, based on the first window in that pattern.static StringtoString(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- 
SequenceUtilpublic SequenceUtil()
 
- 
- 
Method Details- 
toStringJust 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:
 
- 
getPatternHelicitypublic 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 patterns
- patternDelay- number of patterns
- Returns:
- delay-corrected helicity of the first window in the pattern
 
- 
getWindowHelicitypublic 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 pattern
- windowIndex- index of the window of interest
- Returns:
- helicity for the given window
 
- 
checkHelicitiespublic static boolean checkHelicities(int patterns, int helicities, byte patternLength) - Parameters:
- patterns- the previous SEQUENCE_LENGTH windows of the pattern signal
- helicities- the previous SEQUENCE_LENGTH windows of the helicity signal
- patternLength- number of windows per pattern
- Returns:
- whether the helicities are consistent with a good pattern sequence
 
- 
checkPairspublic 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
 
- 
checkPatternspublic static boolean checkPatterns(int patterns, byte patternLength) - Parameters:
- patterns- the previous SEQUENCE_LENGTH windows of the pattern signal
- patternLength- number of windows per pattern
- Returns:
- whether they're consistent with a good pattern sequence
 
- 
checkpublic static boolean check(int pairs, int patterns, int helicities, byte patternLength) - Parameters:
- pairs- the previous SEQUENCE_LENGTH windows of the pair signal
- patterns- the previous SEQUENCE_LENGTH windows of the pattern signal
- helicities- the previous SEQUENCE_LENGTH windows of the helicity signal
- patternLength- number of windows per pattern
- Returns:
- whether everything looks good
 
 
-