Package org.jlab.detector.serial
Class SerialUtil
java.lang.Object
org.jlab.detector.serial.SerialUtil
Static utility methods for postprocessing.
- Author:
- baltzell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassignScalerHelicity(Long timestamp, org.jlab.jnp.hipo4.data.Bank bank, HelicitySequence seq) Assign the delay-corrected helicity to the HEL::scaler bank's rowsstatic voidassignScalerHelicity(org.jlab.jnp.hipo4.data.Event event, org.jlab.jnp.hipo4.data.Bank bank, HelicitySequenceManager seq) Assign the delay-corrected helicity to the HEL::scaler bank's rowsstatic voidcreateTag1Events(org.jlab.jnp.hipo4.io.HipoWriterSorted writer, org.jlab.jnp.hipo4.data.Event source, org.jlab.jnp.hipo4.data.Event destination, org.jlab.jnp.hipo4.data.Bank... banks) static HelicitySequenceDelayedgetHelicity(List<String> filenames, org.jlab.jnp.hipo4.data.SchemaFactory schema, boolean restream, ConstantsManager conman) static intgetRunNumber(String... filenames) static intgetRunNumber(List<String> filenames) Get the first "good" run number in RUN::configstatic voidrebuildScalers(ConstantsManager conman, String inputFile, String outputFile) Create a new file with all RUN::scaler and HEL::scaler banks rebuilt from RAW::scalerstatic org.jlab.jnp.hipo4.data.Bank[]rebuildScalers(org.jlab.jnp.hipo4.data.SchemaFactory schema, ConstantsManager conman, org.jlab.jnp.hipo4.data.Bank runConfig, org.jlab.jnp.hipo4.data.Bank rawScaler) Rebuild the RUN::scaler and HEL::scaler banks from RAW::scaler
-
Constructor Details
-
SerialUtil
public SerialUtil()
-
-
Method Details
-
assignScalerHelicity
public static void assignScalerHelicity(org.jlab.jnp.hipo4.data.Event event, org.jlab.jnp.hipo4.data.Bank bank, HelicitySequenceManager seq) Assign the delay-corrected helicity to the HEL::scaler bank's rows- Parameters:
event- the event containing the scaler readingbank- the HEL::scaler bankseq- previously initialized helicity sequence
-
assignScalerHelicity
public static void assignScalerHelicity(Long timestamp, org.jlab.jnp.hipo4.data.Bank bank, HelicitySequence seq) Assign the delay-corrected helicity to the HEL::scaler bank's rows- Parameters:
timestamp- event TI timestamp, e.g., from RUN::config bankbank- the HEL::scaler bankseq- previously initialized helicity sequence
-
getHelicity
public static HelicitySequenceDelayed getHelicity(List<String> filenames, org.jlab.jnp.hipo4.data.SchemaFactory schema, boolean restream, ConstantsManager conman) - Parameters:
filenames-schema-restream- whether to ignore tag-1 banks and rebuild the stream of helicity states from FADCconman-- Returns:
- delayd helicity sequnece
-
rebuildScalers
public static org.jlab.jnp.hipo4.data.Bank[] rebuildScalers(org.jlab.jnp.hipo4.data.SchemaFactory schema, ConstantsManager conman, org.jlab.jnp.hipo4.data.Bank runConfig, org.jlab.jnp.hipo4.data.Bank rawScaler) Rebuild the RUN::scaler and HEL::scaler banks from RAW::scaler- Parameters:
schema-conman-runConfig- a RUN::config bankrawScaler- a RAW::scaler bank- Returns:
- rebuilt banks
-
rebuildScalers
Create a new file with all RUN::scaler and HEL::scaler banks rebuilt from RAW::scaler- Parameters:
conman-inputFile-outputFile-
-
getRunNumber
Get the first "good" run number in RUN::config- Parameters:
filenames-- Returns:
- run number
-
getRunNumber
- Parameters:
filenames-- Returns:
- first "good" RUN::config.run found
-
createTag1Events
public static void createTag1Events(org.jlab.jnp.hipo4.io.HipoWriterSorted writer, org.jlab.jnp.hipo4.data.Event source, org.jlab.jnp.hipo4.data.Event destination, org.jlab.jnp.hipo4.data.Bank... banks)
-