Package org.jlab.detector.banks
Class FilteredBank
java.lang.Object
org.jlab.detector.banks.FilteredBank
- Direct Known Subclasses:
RawBank
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 Summary
FieldsModifier and TypeFieldDescriptionprotected org.jlab.jnp.hipo4.data.Bank
static final int
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredBank
(org.jlab.jnp.hipo4.data.Schema schema, int allocate, String variableName) FilteredBank
(org.jlab.jnp.hipo4.data.Schema schema, String variableName) -
Method Summary
Modifier and TypeMethodDescriptionint
float
int
long
int
getRows()
int
static void
protected void
Prepare filtering for the current bank's valuesvoid
read
(org.jlab.jnp.hipo4.data.Event evt) Read the bank and prepare filteringint
rows()
final void
setFilter
(int... values) Set the filtering criteriaint
trueIndex
(int index)
-
Field Details
-
DEFAULT_ALLOC
public static final int DEFAULT_ALLOC- See Also:
-
filterVar
-
bank
protected org.jlab.jnp.hipo4.data.Bank bank -
indexList
-
filterList
-
-
Constructor Details
-
FilteredBank
- Parameters:
schema
- schema for the bank to filterallocate
- number of rows to allocatevariableName
- name of the variable to filter on
-
FilteredBank
- Parameters:
schema
- schema for the bank to filtervariableName
- 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
- Parameters:
varName
- name of the bank variableindex
- filtered index to retrieve- Returns:
- value for the filtered index
-
getShort
- Parameters:
varName
- name of the bank variableindex
- filtered index to retrieve- Returns:
- value for the filtered index
-
getInt
- Parameters:
varName
- name of the bank variableindex
- filtered index to retrieve- Returns:
- value for the filtered index
-
getLong
- Parameters:
varName
- name of the bank variableindex
- filtered index to retrieve- Returns:
- value for the filtered index
-
getFloat
- Parameters:
varName
- name of the bank variableindex
- 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
-