Class SwapManager

java.lang.Object
org.jlab.detector.swaps.SwapManager

public final class SwapManager extends Object
Cache manager for cable swaps across multiple run numbers and CCDB tables, interpreted from two ConstantsManager instances, implemented to enable transforming a decoded HIPO file's sector/layer/component/order from the translation tables used at decoding time into a different one.
Author:
baltzell
  • Field Details

    • DEF_CURRENT_CCDB_VARIATION

      public static final String DEF_CURRENT_CCDB_VARIATION
      See Also:
    • DEF_PREVIOUS_CCDB_VARIATION

      public static final String DEF_PREVIOUS_CCDB_VARIATION
      See Also:
    • DEF_DETECTOR_NAMES

      public static final String[] DEF_DETECTOR_NAMES
  • Constructor Details

    • SwapManager

      public SwapManager(List<String> detectorNames, String prevTimestamp, String currTimestamp)
      Parameters:
      detectorNames -
      prevTimestamp - in CCDB format: MM/DD/YYYY
      currTimestamp - in CCDB format: MM/DD/YYYY
    • SwapManager

      public SwapManager(List<String> detectorNames, ConstantsManager previous, ConstantsManager current)
      Parameters:
      detectorNames -
      previous - timestamp/variation used for translation tables during decoding
      current - timestamp/variation with correct translation tables
  • Method Details

    • getDetectors

      public Set<String> getDetectors()
    • getTable

      public String getTable(String detectorName)
    • getBanks

      public List<String> getBanks(String detectorName)
    • getInstance

      public static SwapManager getInstance()
    • initialize

      public void initialize(List<String> detectorNames, String prevTimestamp, String currTimestamp)
      Parameters:
      detectorNames -
      prevTimestamp - in CCDB format: MM/DD/YYYY
      currTimestamp - in CCDB format: MM/DD/YYYY
    • initialize

      public void initialize(List<String> detectorNames, ConstantsManager previous, ConstantsManager current)
      Parameters:
      detectorNames -
      previous - timestamp/variation used for translation tables during decoding
      current - timestamp/variation with correct translation tables
    • get

      public int[] get(int run, String tableName, int... slco)
      Parameters:
      run - run number
      tableName - CCDB translation table name, e.g. "/dat/tt/ecal"
      slco - array of old indices (sector,layer,component,order)
      Returns:
      array of new table indices (sector/layer/component/order)
    • get

      public int get(int run, String tableName, String varName, int... slco)
      Parameters:
      run - run number
      tableName - CCDB translation table name, e.g. "/daq/tt/ecal"
      varName - name of new index to retrieve (sector/layer/component/order)
      slco - array of old indices (sector/layer/component/order)
      Returns:
      new value of the requested index (sector/layer/component/order)
    • get

      public int[] get(int run, DataBank bank, int row)
      Parameters:
      run - run number
      bank - ADC/TDC bank
      row - row index in bank
      Returns:
      array of new table indices (sector/layer/component/order)
    • get

      public int[] get(DataEvent event, String bankName, int row)
      Parameters:
      event - the HIPO event
      bankName - name of ADC/TDC bank
      row - row index in bank
      Returns:
      array of new table indices (sector/layer/component/order)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • main

      public static void main(String[] args)