Class HelicityState

java.lang.Object
org.jlab.detector.helicity.HelicityState
All Implemented Interfaces:
Comparable<HelicityState>, Comparator<HelicityState>

public class HelicityState extends Object implements Comparable<HelicityState>, Comparator<HelicityState>
See: common-tools/clas-detector/doc https://logbooks.jlab.org/entry/3531353
Author:
baltzell
  • Constructor Details

  • Method Details

    • compare

      public int compare(HelicityState o1, HelicityState o2)
      Compare based on timestamp for sorting and List insertion.
      Specified by:
      compare in interface Comparator<HelicityState>
      Parameters:
      o1 -
      o2 -
      Returns:
      negative/positive if o1 is before/after o2, else zero.
    • compareTo

      public int compareTo(HelicityState other)
      Compare based on timestamp for sorting and List insertion.
      Specified by:
      compareTo in interface Comparable<HelicityState>
      Parameters:
      other -
      Returns:
      negative/positive if this is before/after other, else zero.
    • addSwStatusMask

      public void addSwStatusMask(int mask)
    • getSwStatus

      public int getSwStatus()
    • getHwStatus

      public int getHwStatus()
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.io.base.DataBank adcBank, org.jlab.io.base.DataBank runConfig)
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig)
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig, ConstantsManager c)
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.io.base.DataBank adcBank, org.jlab.io.base.DataBank runConfig, ConstantsManager c)
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.io.base.DataBank adcBank)
      Create a state from a HEL::adc org.jlab.jnp.hipo4.data.Bank
      Parameters:
      adcBank - HEL::adc
      Returns:
      state extracted from the bank
    • createFromFadcBank

      public static HelicityState createFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank)
    • createFromFlipBank

      public static HelicityState createFromFlipBank(org.jlab.jnp.hipo4.data.Bank flipBank)
      Create a state from a HEL::flip org.jlab.jnp.hipo4.data.Bank
      Parameters:
      flipBank - HEL::flip
      Returns:
      state extracted from the bank
    • createFromFlipBank

      public static HelicityState createFromFlipBank(org.jlab.io.base.DataBank flipBank)
      Create a state from a HEL::flip org.jlab.io.base.DataBank FIXME: can we not cast/convert between DataBank and Bank?
      Parameters:
      flipBank - HEL::flip
      Returns:
      state extracted from the bank
    • getSecondsDelta

      public double getSecondsDelta(HelicityState other)
    • getEventDelta

      public int getEventDelta(HelicityState other)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getInfo

      public String getInfo(HelicityState other, int counter)
    • getFlipBank

      public org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schemaFactory)
    • getFlipBank

      public org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, org.jlab.io.base.DataEvent event)
    • getFlipBank

      public org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, org.jlab.jnp.hipo4.data.Event event)
    • isValid

      public final boolean isValid()
      Returns:
      whether any raw values are undefined
    • equals

      public boolean equals(HelicityState other)
      Parameters:
      other -
      Returns:
      whether the other state has equal raw values
    • setHalfWavePlate

      public void setHalfWavePlate(byte hwp)
      Assign the half-wave-plate-corrected helicity
      Parameters:
      hwp - the HWP status (-1/0/1=IN/UDF/OUT, same as CCDB)
    • setHalfWavePlate

      public void setHalfWavePlate(org.jlab.utils.groups.IndexedTable hwp)
    • setTimestamp

      public void setTimestamp(long timestamp)
    • setEvent

      public void setEvent(int event)
    • setRun

      public void setRun(int run)
    • getRun

      public int getRun()
    • getEvent

      public int getEvent()
    • getTimestamp

      public long getTimestamp()
    • getHelicityRaw

      public HelicityBit getHelicityRaw()
    • getHelicity

      public HelicityBit getHelicity()
    • getPairSync

      public HelicityBit getPairSync()
    • getPatternSync

      public HelicityBit getPatternSync()
    • invert

      public HelicityState invert()
      Inverts the helicity/helicityRaw components of this state
      Returns:
      this state after inversion