Package org.jlab.detector.helicity
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 SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionHelicityState(HelicityBit helicity, HelicityBit pairSync, HelicityBit patternSync) 
- 
Method SummaryModifier 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 java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Constructor Details- 
HelicityStatepublic HelicityState()
- 
HelicityState
 
- 
- 
Method Details- 
compareCompare based on timestamp for sorting and List insertion.- Specified by:
- comparein interface- Comparator<HelicityState>
- Parameters:
- o1-
- o2-
- Returns:
- negative/positive if o1 is before/after o2, else zero.
 
- 
compareToCompare based on timestamp for sorting and List insertion.- Specified by:
- compareToin interface- Comparable<HelicityState>
- Parameters:
- other-
- Returns:
- negative/positive if this is before/after other, else zero.
 
- 
addSwStatusMaskpublic void addSwStatusMask(int mask) 
- 
getSwStatuspublic int getSwStatus()
- 
getHwStatuspublic int getHwStatus()
- 
createFromFadcBank
- 
createFromFadcBankpublic static HelicityState createFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig) 
- 
createFromFadcBankpublic static HelicityState createFromFadcBank(org.jlab.jnp.hipo4.data.Bank adcBank, org.jlab.jnp.hipo4.data.Bank runConfig, ConstantsManager c) 
- 
createFromFadcBankpublic static HelicityState createFromFadcBank(DataBank adcBank, DataBank runConfig, ConstantsManager c) 
- 
createFromFadcBankCreate a state from a HEL::adc org.jlab.jnp.hipo4.data.Bank- Parameters:
- adcBank- HEL::adc
- Returns:
- state extracted from the bank
 
- 
createFromFadcBank
- 
createFromFlipBankCreate a state from a HEL::flip org.jlab.jnp.hipo4.data.Bank- Parameters:
- flipBank- HEL::flip
- Returns:
- state extracted from the bank
 
- 
createFromFlipBankCreate 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
- 
getFlipBankpublic org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schemaFactory) 
- 
getFlipBankpublic org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, DataEvent event) 
- 
getFlipBankpublic org.jlab.jnp.hipo4.data.Bank getFlipBank(org.jlab.jnp.hipo4.data.SchemaFactory schema, org.jlab.jnp.hipo4.data.Event event) 
- 
isValidpublic final boolean isValid()- Returns:
- whether any raw values are undefined
 
- 
equals- Parameters:
- other-
- Returns:
- whether the other state has equal raw values
 
- 
setHalfWavePlatepublic 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
- 
setTimestamppublic void setTimestamp(long timestamp) 
- 
setEventpublic void setEvent(int event) 
- 
setRunpublic void setRun(int run) 
- 
getRunpublic int getRun()
- 
getEventpublic int getEvent()
- 
getTimestamppublic long getTimestamp()
- 
getHelicityRaw
- 
getHelicity
- 
getPairSync
- 
getPatternSync
- 
invertInverts the helicity/helicityRaw components of this state- Returns:
- this state after inversion
 
 
-