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 Link icon

    Constructors
    Constructor
    Description
     
  • Method Summary Link icon

    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 Link icon

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

    • SequenceUtil Link icon

      public SequenceUtil()
  • Method Details Link icon

    • toString Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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