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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHelicityState(HelicityBit helicity, HelicityBit pairSync, HelicityBit patternSync) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSwStatusMask(int mask) intcompare(HelicityState o1, HelicityState o2) Compare based on timestamp for sorting and List insertion.intcompareTo(HelicityState other) Compare based on timestamp for sorting and List insertion.static HelicityStatecreateFromFadcBank(DataBank adcBank) Create a state from a HEL::adc org.jlab.jnp.hipo4.data.Bankstatic HelicityStatecreateFromFadcBank(DataBank adcBank, DataBank runConfig) static HelicityStatecreateFromFadcBank(DataBank adcBank, DataBank runConfig, ConstantsManager c) static HelicityStatecreateFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank) static HelicityStatecreateFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig) static HelicityStatecreateFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig, ConstantsManager c) static HelicityStatecreateFromFlipBank(DataBank flipBank) Create a state from a HEL::flip org.jlab.io.base.DataBank FIXME: can we not cast/convert between DataBank and Bank?static HelicityStatecreateFromFlipBank(org.jlab.jnp.hipo4.data.Bank flipBank) Create a state from a HEL::flip org.jlab.jnp.hipo4.data.Bankbooleanequals(HelicityState other) intgetEvent()intgetEventDelta(HelicityState other) org.jlab.jnp.hipo4.data.BankgetFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schemaFactory) org.jlab.jnp.hipo4.data.BankgetFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, DataEvent event) org.jlab.jnp.hipo4.data.BankgetFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, org.jlab.jnp.hipo4.data.Event event) intgetInfo(HelicityState other, int counter) intgetRun()doublegetSecondsDelta(HelicityState other) intlonginvert()Inverts the helicity/helicityRaw components of this statefinal booleanisValid()voidsetEvent(int event) voidsetHalfWavePlate(byte hwp) Assign the half-wave-plate-corrected helicityvoidvoidsetRun(int run) voidsetTimestamp(long timestamp) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
HelicityState
public HelicityState() -
HelicityState
-
-
Method Details
-
compare
Compare based on timestamp for sorting and List insertion.- Specified by:
comparein interfaceComparator<HelicityState>- Parameters:
o1-o2-- Returns:
- negative/positive if o1 is before/after o2, else zero.
-
compareTo
Compare based on timestamp for sorting and List insertion.- Specified by:
compareToin interfaceComparable<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
-
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(DataBank adcBank, DataBank runConfig, ConstantsManager c) -
createFromFadcBank
Create a state from a HEL::adc org.jlab.jnp.hipo4.data.Bank- Parameters:
adcBank- HEL::adc- Returns:
- state extracted from the bank
-
createFromFadcBank
-
createFromFlipBank
Create a state from a HEL::flip org.jlab.jnp.hipo4.data.Bank- Parameters:
flipBank- HEL::flip- Returns:
- state extracted from the bank
-
createFromFlipBank
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
-
getEventDelta
-
toString
-
getInfo
-
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, 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
- 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
-
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
-
getHelicity
-
getPairSync
-
getPatternSync
-
invert
Inverts the helicity/helicityRaw components of this state- Returns:
- this state after inversion
-