Class SwapManager

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

public 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 Link icon

    • DEF_CURRENT_CCDB_VARIATION Link icon

      public static final String DEF_CURRENT_CCDB_VARIATION
      See Also:
    • DEF_PREVIOUS_CCDB_VARIATION Link icon

      public static final String DEF_PREVIOUS_CCDB_VARIATION
      See Also:
    • DEF_DETECTOR_NAMES Link icon

      public static final String[] DEF_DETECTOR_NAMES
  • Constructor Details Link icon

    • SwapManager Link icon

      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 Link icon

      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 Link icon

    • getDetectors Link icon

      public Set<String> getDetectors()
    • getTable Link icon

      public String getTable(String detectorName)
    • getBanks Link icon

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

      public static SwapManager getInstance()
    • initialize Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      public int[] get(int run, org.jlab.io.base.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 Link icon

      public int[] get(org.jlab.io.base.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 Link icon

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

      public static void main(String[] args)