Contents
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 Summary
Fields inherited from class org.jlab.detector.helicity.HelicitySequence
analyzed, generator, generators, halfWavePlate, helicityClock, pattern, states, TIMESTAMP_CLOCK
-
Constructor Summary
ConstructorsConstructorDescriptionHelicitySequenceDelayed
(int delay) HelicitySequenceDelayed
(org.jlab.utils.groups.IndexedTable t) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.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.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.boolean
setRunNumber
(int runNumber) Initialize helicity configuration from the CCDB table /runcontrol/helicityvoid
show()
Methods inherited from class org.jlab.detector.helicity.HelicitySequence
addState, addStream, addStream, analyze, getBanks, getBitInQuartet, getHalfWavePlate, getState, getStates, getTimestamp, initialize, initialize, initialize, initialized, integrityCheck, predictIndex, searchIndex, searchState, size, writeFlips, writeFlips
-
Constructor Details
-
Method Details
-
setRunNumber
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
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 classHelicitySequence
- Parameters:
n
- the index of the state, where 0 corresponds to the first state- Returns:
- the helicity state
-
search
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 classHelicitySequence
- Parameters:
timestamp
- TI-timestamp (i.e. RUN::config.timestamp)- Returns:
- the helicity bit
-
search
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 classHelicitySequence
- Parameters:
timestamp
- TI-timestamp (i.e. RUN::config.timestamp)offset
- number of states offset- Returns:
- the helicity bit
-
getGenerated
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 classHelicitySequence
- Parameters:
n
- the index of the state- Returns:
- the helicity bit
-
predictGenerated
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 classHelicitySequence
- Parameters:
timestamp
- TI-timestamp (i.e. RUN::config.timestamp)- Returns:
- the helicity bit
-
searchGenerated
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
public void show()- Overrides:
show
in classHelicitySequence
-