Class SerialUtil

java.lang.Object
org.jlab.detector.serial.SerialUtil

public class SerialUtil extends Object
Static utility methods for postprocessing.
Author:
baltzell
  • 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 reading
      bank - the HEL::scaler bank
      seq - 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 bank
      bank - the HEL::scaler bank
      seq - 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 FADC
      conman -
      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 bank
      rawScaler - a RAW::scaler bank
      Returns:
      rebuilt banks
    • rebuildScalers

      public static void rebuildScalers(ConstantsManager conman, String inputFile, String outputFile)
      Create a new file with all RUN::scaler and HEL::scaler banks rebuilt from RAW::scaler
      Parameters:
      conman -
      inputFile -
      outputFile -
    • getRunNumber

      public static int getRunNumber(List<String> filenames)
      Get the first "good" run number in RUN::config
      Parameters:
      filenames -
      Returns:
      run number
    • getRunNumber

      public static int getRunNumber(String... filenames)
      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)