Package org.jlab.detector.scalers
Class DaqScalersSequence
java.lang.Object
org.jlab.detector.scalers.DaqScalersSequence
- All Implemented Interfaces:
- Comparator<DaqScalers>
For easy access to most recent scaler readout for any given event.
 See the main() method for example use case, where only the 2 lines
 marked with "!!!" are specific to accessing scalers.
- Author:
- baltzell
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanadd(DaqScalers ds) intcompare(DaqScalers o1, DaqScalers o2) protected intfindIndex(long timestamp) get(long timestamp) get(org.jlab.jnp.hipo4.data.Event event) getInterval(long timestamp) getInterval(long t1, long t2) getInterval(org.jlab.jnp.hipo4.data.Event event) getInterval(org.jlab.jnp.hipo4.data.Event event1, org.jlab.jnp.hipo4.data.Event event2) static voidstatic DaqScalersSequencereadSequence(List<String> filenames) This reads tag=1 events for RUN::scaler banks, and initializes and returns aDaqScalersSequencethat can be used to access the most recent scaler readout for any given event.static DaqScalersSequencerebuildSequence(int tags, ConstantsManager conman, List<String> filenames) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Field Details- 
TI_CLOCK_FREQpublic static final double TI_CLOCK_FREQ- See Also:
 
- 
scalers
 
- 
- 
Constructor Details- 
DaqScalersSequencepublic DaqScalersSequence()
 
- 
- 
Method Details- 
compare- Specified by:
- comparein interface- Comparator<DaqScalers>
 
- 
findIndexprotected int findIndex(long timestamp) 
- 
add
- 
get- Parameters:
- timestamp- TI timestamp (i.e. RUN::config.timestamp)
- Returns:
- the most recent DaqScalers for the given timestamp
 
- 
get- Parameters:
- event-
- Returns:
- the most recent DaqScalers for the given event
 
- 
getInterval- Returns:
- largest available interval of scaler readings
 
- 
getInterval- Parameters:
- timestamp- TI timestamp (i.e. RUN::config.timestamp)
- Returns:
- smallest interval of scaler readings around that timestamp
 
- 
getInterval- Parameters:
- event-
- Returns:
- smallest interval of scaler readings around that event
 
- 
getInterval- Parameters:
- t1- first TI timestamp (i.e. RUN::config.timestamp)
- t2- second TI timestamp
- Returns:
- smallest interval of scaler readings around those timestamps
 
- 
getIntervalpublic DaqScalersSequence.Interval getInterval(org.jlab.jnp.hipo4.data.Event event1, org.jlab.jnp.hipo4.data.Event event2) - Parameters:
- event1- first event
- event2- second event
- Returns:
- smallest interval of scaler readings around those events
 
- 
readSequenceThis reads tag=1 events for RUN::scaler banks, and initializes and returns aDaqScalersSequencethat can be used to access the most recent scaler readout for any given event.- Parameters:
- filenames- list of names of HIPO files to read
- Returns:
- sequence
 
- 
rebuildSequencepublic static DaqScalersSequence rebuildSequence(int tags, ConstantsManager conman, List<String> filenames) - Parameters:
- tags-
- conman-
- filenames-
- Returns:
 
- 
main
 
-