Class HelicitySequenceDelayed

java.lang.Object
org.jlab.detector.helicity.HelicitySequence
org.jlab.detector.helicity.HelicitySequenceDelayed

public final class HelicitySequenceDelayed extends HelicitySequence
Just adds a delay to HelicitySequence, where delay is the number of "windows". For example, a quartet pattern contains 4 windows, and if the helicity clock is the usual 29.56 Hz, a window lasts 33.829 ms. Stores a sequence of helicity states and provides timestamp- or state-count- based search of helicity state based on the measured sequence or pseudo-random generator sequence, and provides some integrity checking of the sequence, including comparing the measured and generator sequences. ____________________________________________________________________ Getter methods naming convention: Prefixes: "get" - based on state count "search" - based on finding timestamp in the measured sequence "predict" - based on generator seed time and expected periodicity Suffixes: "Generated" - use the psuedo-random generator's sequence ____________________________________________________________________ The generator methods are able to look past the measured range, while the non-generator methods cannot. The inputs to initialize the sequence are HelicityState objects, one per window at the helicity board clock frequency, which contain important information for constructing and validating the sequence (e.g. helicity and sync bits and timestamps). The return values from getters are just HelicityBit objects and represent the HWP-corrected helicity. See HelicityAnalysisSimple for an example on using this class.
Author:
baltzell
  • Constructor Details Link icon

    • HelicitySequenceDelayed Link icon

      public HelicitySequenceDelayed(int delay)
    • HelicitySequenceDelayed Link icon

      public HelicitySequenceDelayed(org.jlab.utils.groups.IndexedTable t)
  • Method Details Link icon

    • setRunNumber Link icon

      public boolean setRunNumber(int runNumber)
      Initialize helicity configuration from the CCDB table /runcontrol/helicity
      Parameters:
      runNumber - run number to access in CCDB
      Returns:
      whether all seems ok
    • get Link icon

      protected HelicityBit get(int n)
      Get the delay-corrected nth state in the measured sequence, by walking forward delay states and returning HelicityBit.UDF if any errors along the way.
      Overrides:
      get in class HelicitySequence
      Parameters:
      n - the index of the state, where 0 corresponds to the first state
      Returns:
      the helicity state
    • search Link icon

      public HelicityBit search(long timestamp)
      Get the delay-corrected state of a TI timestamp by searching the measured sequence and walking forward, returning HelicityBit.UDF if any errors along the way.
      Overrides:
      search in class HelicitySequence
      Parameters:
      timestamp - TI-timestamp (i.e. RUN::config.timestamp)
      Returns:
      the helicity bit
    • search Link icon

      public HelicityBit search(long timestamp, int offset)
      Get the delay-corrected state of a TI timestamp by searching the measured sequence and walking forward, returning HelicityBit.UDF if any errors along the way.
      Overrides:
      search in class HelicitySequence
      Parameters:
      timestamp - TI-timestamp (i.e. RUN::config.timestamp)
      offset - number of states offset
      Returns:
      the helicity bit
    • getGenerated Link icon

      protected HelicityBit getGenerated(int n)
      Get the delay-corrected nth state in the sequence, based on the generator, returning HelicityBit.UDF if generator cannot be initialized or the state index is before the generator was initialized.
      Overrides:
      getGenerated in class HelicitySequence
      Parameters:
      n - the index of the state
      Returns:
      the helicity bit
    • predictGenerated Link icon

      public HelicityBit predictGenerated(long timestamp)
      Get the delay-corrected state of a TI timestamp based on the generator, its seed timestamp, and the expected helicity window frequency, returning HelicityBit.UDF if generator cannot be initialized or timestamp is before the generator was initialized.
      Overrides:
      predictGenerated in class HelicitySequence
      Parameters:
      timestamp - TI-timestamp (i.e. RUN::config.timestamp)
      Returns:
      the helicity bit
    • searchGenerated Link icon

      public HelicityBit searchGenerated(long timestamp)
      Get the delay-corrected state of a TI timestamp by searching the measured sequence to count states and using the generator to calculate the helicity, returning HelicityBit.UDF if generator cannot be initialized or timestamp is before the generator was initialized or after the measured sequence.
      Parameters:
      timestamp - TI-timestamp (i.e. RUN::config.timestamp)
      Returns:
      the helicity bit
    • show Link icon

      public void show()
      Overrides:
      show in class HelicitySequence