hep.aida.ref.tuple
Class TupleFactory
- java.lang.Object
-
- hep.aida.ref.tuple.TupleFactory
-
- All Implemented Interfaces:
- ITupleFactory
public class TupleFactory extends java.lang.Object implements ITupleFactory
-
-
Constructor Summary
Constructors Constructor and Description TupleFactory(ITree tree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ITuplecreate(java.lang.String path, java.lang.String title, java.lang.String columns)Creates an NTupleITuplecreate(java.lang.String path, java.lang.String title, java.lang.String[] columnName, java.lang.Class[] columnType)Creates an NTupleITuplecreate(java.lang.String path, java.lang.String title, java.lang.String[] columnName, java.lang.Class[] columnType, java.lang.String options)Create an NTupleITuplecreate(java.lang.String path, java.lang.String title, java.lang.String columns, java.lang.String options)Create an NTupleITuplecreateChained(java.lang.String path, java.lang.String title, ITuple[] set)Create a logical chain of ITuples.ITuplecreateChained(java.lang.String path, java.lang.String title, java.lang.String[] setName)Creates a logical chain of ITuples.ITuplecreateCopy(java.lang.String path, ITuple tuple)Create a copy of an ITuple.IEvaluatorcreateEvaluator(java.lang.String expression)Create IEvaluator.IFiltercreateFilter(java.lang.String expression)Create IFilter.IFiltercreateFilter(java.lang.String expression, int rowsToProcess)Creates a filter object given a string defining the "cut" expression.IFiltercreateFilter(java.lang.String expression, int rowsToProcess, int startingRow)Creates a filter object given a string defining the "cut" expression.ITuplecreateFiltered(java.lang.String path, ITuple tuple, IFilter filter)Creates a new reduced tuple (less rows) from an existing one by applying a filter.ITuplecreateFiltered(java.lang.String path, ITuple tuple, IFilter filter, java.lang.String[] columns)Creates a new reduced tuple (less rows) from an existing one by applying a filter.
-
-
-
Constructor Detail
-
TupleFactory
public TupleFactory(ITree tree)
-
-
Method Detail
-
create
public ITuple create(java.lang.String path, java.lang.String title, java.lang.String[] columnName, java.lang.Class[] columnType, java.lang.String options)
Create an NTuple- Specified by:
createin interfaceITupleFactory- Parameters:
path- The persistency path of the n-tupletitle- The title of the n-tuplecolumnName- The names of the columnscolumnType- The types of the columnsoptions- NTuple options (currently undefined)
-
create
public ITuple create(java.lang.String path, java.lang.String title, java.lang.String[] columnName, java.lang.Class[] columnType)
Description copied from interface:ITupleFactoryCreates an NTuple- Specified by:
createin interfaceITupleFactory- Parameters:
path- The path of the created ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.title- The title of the n-tuplecolumnName- The names of the columnscolumnType- The types of the columns Options string must consist of series of parameters or key-value pairs that are separated by comma or semicolon ( "," or ";" ), white spaces are disregarded and will be trimmed away during parsing. Key-value pairs must be in a form: key=value, or key="value" (for values that contain spaces, commas, or other special characters). Single parameters may be converted to a parameter=true pair during parsing, like "verbose" -> "verbose=true". Any key that starts with "annotation." will be stripped of this prefix and put into annotation of newly created AIDA object.
-
create
public ITuple create(java.lang.String path, java.lang.String title, java.lang.String columns, java.lang.String options)
Create an NTuple- Specified by:
createin interfaceITupleFactory- Parameters:
path- The persistency path of the n-tupletitle- The title of the n-tuplecolumns- The names and types of the columns e.g. "float px, py, pz, float energy, int charge"options- NTuple options (currently undefined)
-
create
public ITuple create(java.lang.String path, java.lang.String title, java.lang.String columns)
Description copied from interface:ITupleFactoryCreates an NTuple- Specified by:
createin interfaceITupleFactory- Parameters:
path- The path of the created ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.title- The title of the n-tuplecolumns- The names and types of the columns e.g. "float px, py, pz, float energy, int charge" Options string must consist of series of parameters or key-value pairs that are separated by comma or semicolon ( "," or ";" ), white spaces are disregarded and will be trimmed away during parsing. Key-value pairs must be in a form: key=value, or key="value" (for values that contain spaces, commas, or other special characters). Single parameters may be converted to a parameter=true pair during parsing, like "verbose" -> "verbose=true". Any key that starts with "annotation." will be stripped of this prefix and put into annotation of newly created AIDA object.
-
createChained
public ITuple createChained(java.lang.String path, java.lang.String title, ITuple[] set)
Create a logical chain of ITuples. All ITuples in the set must have the same structure. Chained ITuple can not be filled.- Specified by:
createChainedin interfaceITupleFactory- Parameters:
path- The persistency name of the new n-tupletitle- The title of the new n-tupleset- The array of ITuples to chain
-
createChained
public ITuple createChained(java.lang.String path, java.lang.String title, java.lang.String[] setName)
Description copied from interface:ITupleFactoryCreates a logical chain of ITuples. All ITuples in the set must have the same structure. Chained ITuple can not be filled. Original n-tuple data is not copied.- Specified by:
createChainedin interfaceITupleFactory- Parameters:
path- The path of the chained ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.title- The title of the new n-tuplesetName- The array of the names of the ITuples to chain
-
createFiltered
public ITuple createFiltered(java.lang.String path, ITuple tuple, IFilter filter)
Description copied from interface:ITupleFactoryCreates a new reduced tuple (less rows) from an existing one by applying a filter. Data is explicitly copied to a new n-tuple.- Specified by:
createFilteredin interfaceITupleFactory- Parameters:
path- The path of the filtered ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.tuple- Original n-tuplefilter- IFilter to be used
-
createFiltered
public ITuple createFiltered(java.lang.String path, ITuple tuple, IFilter filter, java.lang.String[] columns)
Description copied from interface:ITupleFactoryCreates a new reduced tuple (less rows) from an existing one by applying a filter. Only subset of the variables (columns) is copied. Data is explicitly copied to a new n-tuple.- Specified by:
createFilteredin interfaceITupleFactory- Parameters:
path- The path of the filtered ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.tuple- Original n-tuplefilter- IFilter to be usedcolumns- Names of columns to for a new n-tuple
-
createCopy
public ITuple createCopy(java.lang.String path, ITuple tuple) throws java.lang.IllegalArgumentException
Create a copy of an ITuple.- Specified by:
createCopyin interfaceITupleFactory- Parameters:
path- The path of the resulting ITuple. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther `/` cannot be used in names; it is only used to delimit directories within paths.tuple- The ITuple to be copied.- Returns:
- The copy of the ITuple.
- Throws:
java.lang.IllegalArgumentException
-
createFilter
public IFilter createFilter(java.lang.String expression)
Create IFilter.- Specified by:
createFilterin interfaceITupleFactory- Parameters:
expression- String defining of the "cut" expression.
-
createFilter
public IFilter createFilter(java.lang.String expression, int rowsToProcess, int startingRow)
Description copied from interface:ITupleFactoryCreates a filter object given a string defining the "cut" expression. Filter processes only subset of data.- Specified by:
createFilterin interfaceITupleFactory- Parameters:
expression- String defining of the "cut" expression.rowsToProcess- How many rows to processstartingRow- Row number where to start
-
createFilter
public IFilter createFilter(java.lang.String expression, int rowsToProcess)
Description copied from interface:ITupleFactoryCreates a filter object given a string defining the "cut" expression. Filter processes only subset of data.- Specified by:
createFilterin interfaceITupleFactory- Parameters:
expression- String defining of the "cut" expression.rowsToProcess- How many rows to process
-
createEvaluator
public IEvaluator createEvaluator(java.lang.String expression)
Create IEvaluator.- Specified by:
createEvaluatorin interfaceITupleFactory- Parameters:
expression- String defining of the evaluator expression. This expression is composed by matematical functions and column names. If the tuple has a folder like structure, inner columns are specified by using the dot "." to represent the folder. For example let's consider a tuple with the following structure: "{float a; f1={double px,py,pz; ff1={E}}; f2={double x,y,z} }". Inner columns are represented as: - "f1.px" - "f1.ff1.E" - "f2.x" Operations among columns are allowed only in the following two cases: - the columns are at the same level: "f1.px + f1.py" - the columns are nested in each other. In this case the loop is done on the innermost column: "a + f1.px" (loop done over "f1.px") Operations among other types of columns are not allowed. For example "f1.px + f2.x" is not a valid expression as it is not garanteed that the two folders have the same number of entries. If the user desires to perform such an operation it will be necessary to loop over the tuple by hand.
-
-
DMelt 3.0 © DataMelt by jWork.ORG