Class FilteredBank

java.lang.Object
org.jlab.detector.banks.FilteredBank
Direct Known Subclasses:
RawBank

public class FilteredBank extends Object
Utility to provide access to a bank filtered on a certain variable while maintaining mapping to the true row index in the bank.
Author:
gavalian, baltzell
  • Field Details

    • DEFAULT_ALLOC

      public static final int DEFAULT_ALLOC
      See Also:
    • filterVar

      protected final String filterVar
    • bank

      protected org.jlab.jnp.hipo4.data.Bank bank
    • indexList

      protected final List<Integer> indexList
    • filterList

      protected final Set<Integer> filterList
  • Constructor Details

    • FilteredBank

      public FilteredBank(org.jlab.jnp.hipo4.data.Schema schema, int allocate, String variableName)
      Parameters:
      schema - schema for the bank to filter
      allocate - number of rows to allocate
      variableName - name of the variable to filter on
    • FilteredBank

      public FilteredBank(org.jlab.jnp.hipo4.data.Schema schema, String variableName)
      Parameters:
      schema - schema for the bank to filter
      variableName - name of the variable to filter on
  • Method Details

    • setFilter

      public final void setFilter(int... values)
      Set the filtering criteria
      Parameters:
      values - values to filter for
    • read

      public void read(org.jlab.jnp.hipo4.data.Event evt)
      Read the bank and prepare filtering
      Parameters:
      evt -
    • notifyRead

      protected void notifyRead()
      Prepare filtering for the current bank's values
    • rows

      public int rows()
      Returns:
      number of bank rows that satisfy filtering criteria
    • getRows

      public int getRows()
      Returns:
      number of bank rows that satisfy filtering criteria
    • getByte

      public int getByte(String varName, int index)
      Parameters:
      varName - name of the bank variable
      index - filtered index to retrieve
      Returns:
      value for the filtered index
    • getShort

      public int getShort(String varName, int index)
      Parameters:
      varName - name of the bank variable
      index - filtered index to retrieve
      Returns:
      value for the filtered index
    • getInt

      public int getInt(String varName, int index)
      Parameters:
      varName - name of the bank variable
      index - filtered index to retrieve
      Returns:
      value for the filtered index
    • getLong

      public long getLong(String varName, int index)
      Parameters:
      varName - name of the bank variable
      index - filtered index to retrieve
      Returns:
      value for the filtered index
    • getFloat

      public float getFloat(String varName, int index)
      Parameters:
      varName - name of the bank variable
      index - filtered index to retrieve
      Returns:
      value for the filtered index
    • trueIndex

      public int trueIndex(int index)
      Parameters:
      index - filtered index to retrieve
      Returns:
      true bank row index corresponding to the filtered index
    • main

      public static void main(String[] args)