Package org.jlab.detector.helicity
Class HelicitySequenceDelayed
java.lang.Object
org.jlab.detector.helicity.HelicitySequence
org.jlab.detector.helicity.HelicitySequenceDelayed
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
- 
Field SummaryFields inherited from class org.jlab.detector.helicity.HelicitySequenceanalyzed, generator, generators, halfWavePlate, helicityClock, pattern, states, TIMESTAMP_CLOCK
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected HelicityBitget(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.protected HelicityBitgetGenerated(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.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.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.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.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.booleansetRunNumber(int runNumber) Initialize helicity configuration from the CCDB table /runcontrol/helicityvoidshow()Methods inherited from class org.jlab.detector.helicity.HelicitySequenceaddState, addStream, addStream, analyze, getBanks, getBitInQuartet, getHalfWavePlate, getState, getStates, getTimestamp, initialize, initialize, initialize, initialized, integrityCheck, predictIndex, searchIndex, searchState, size, writeFlips, writeFlips
- 
Constructor Details- 
HelicitySequenceDelayedpublic HelicitySequenceDelayed(int delay) 
- 
HelicitySequenceDelayed
 
- 
- 
Method Details- 
setRunNumberpublic 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
 
- 
getGet 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:
- getin class- HelicitySequence
- Parameters:
- n- the index of the state, where 0 corresponds to the first state
- Returns:
- the helicity state
 
- 
searchGet 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:
- searchin class- HelicitySequence
- Parameters:
- timestamp- TI-timestamp (i.e. RUN::config.timestamp)
- Returns:
- the helicity bit
 
- 
searchGet 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:
- searchin class- HelicitySequence
- Parameters:
- timestamp- TI-timestamp (i.e. RUN::config.timestamp)
- offset- number of states offset
- Returns:
- the helicity bit
 
- 
getGeneratedGet 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:
- getGeneratedin class- HelicitySequence
- Parameters:
- n- the index of the state
- Returns:
- the helicity bit
 
- 
predictGeneratedGet 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:
- predictGeneratedin class- HelicitySequence
- Parameters:
- timestamp- TI-timestamp (i.e. RUN::config.timestamp)
- Returns:
- the helicity bit
 
- 
searchGeneratedGet 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
 
- 
showpublic void show()- Overrides:
- showin class- HelicitySequence
 
 
-