Class SequenceUtil

java.lang.Object
org.jlab.detector.helicity.SequenceUtil
Direct Known Subclasses:
DecoderBoardUtil

public class SequenceUtil extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SequenceUtil

      public SequenceUtil()
  • Method Details

    • toString

      public 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.
      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 patterns
      patternDelay - 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 pattern
      windowIndex - 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 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
    • 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 signal
      patternLength - 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 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