Luiza
v03-01
|
Processor to select data rows from the table. More...
#include <SelectTableData.h>
Public Member Functions | |
virtual Processor * | newProcessor () |
Return a new instance of the processor. More... | |
virtual void | init () |
virtual void | startAnalysis (GloriaDataContainer *data) |
Called before first data loop. More... | |
virtual void | processData (GloriaDataContainer *data) |
virtual void | check (GloriaDataContainer *data) |
Called for every loop - right after processData() call. More... | |
virtual void | concludeAnalysis (GloriaDataContainer *data) |
Called after all data processing loops to finalize the analysis. | |
virtual void | end () |
![]() | |
Processor (const std::string &typeName) | |
Default constructor. More... | |
virtual | ~Processor () |
Destructor. | |
virtual const std::string & | type () const |
Return type name for the processor (as set in constructor). | |
virtual const std::string & | name () const |
Return name of this processor. | |
virtual const std::string & | logLevelName () const |
Return name of the local verbosity level of this processor - "" if not set. | |
virtual StringParameters * | parameters () |
Return parameters defined for this Processor. | |
virtual void | printDescription () |
Print information about this processor in ASCII steering file format. | |
virtual void | printDescriptionXML (std::ostream &stream=std::cout) |
Print information about this processor in XML steering file format. | |
template<class T > | |
void | printParameters () |
Print the parameters and their values depending on the given verbosity level. | |
void | printParameters () |
Print the parameters and their values with verbosity level MESSAGE. | |
const std::string & | description () |
Description of processor. | |
bool | isFirstEvent () |
True if first event in processEvent(evt) - use this e.g. to initialize histograms etc. | |
GloriaCollectionType | getGloriaInType (const std::string &colName) |
Return the input type for the collection colName. More... | |
GloriaCollectionType | getGloriaOutType (const std::string &colName) |
Return the output type for the collection colName. More... | |
bool | isInputCollectionName (const std::string ¶meterName) |
Check if parameter defines collection. More... | |
bool | isOutputCollectionName (const std::string ¶meterName) |
True if the given parameter defines an LCIO output collection */. | |
Protected Member Functions | |
void | printEndMessage () const |
Print end message. | |
![]() | |
void | setReturnValue (bool val) |
Set the return value for this processor - typically at end of processEvent(). More... | |
void | setReturnValue (const std::string &name, bool val) |
Set a named return value for this processor - typically at end of processEvent() More... | |
template<class T > | |
void | registerProcessorParameter (const std::string &name, const std::string &description, T ¶meter, const T &defaultVal, int setSize=0) |
Register a steering variable for this processor - call in constructor of processor. More... | |
void | registerInputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string ¶meter, const std::string &defaultVal, int setSize=0) |
Register parameter describing input collection. More... | |
void | registerOutputCollection (const GloriaCollectionType &type, const std::string &name, const std::string &description, std::string ¶meter, const std::string &defaultVal, int setSize=0) |
Register parameter describing output collection. More... | |
void | registerInputCollections (const GloriaCollectionType &type, const std::string &name, const std::string &description, StringVec ¶meter, const StringVec &defaultVal, int setSize=0) |
Register parameter describing input collections. More... | |
template<class T > | |
void | registerOptionalParameter (const std::string &name, const std::string &description, T ¶meter, const T &defaultVal, int setSize=0) |
Same as registerProcessorParameter except that the parameter is optional. More... | |
bool | parameterSet (const std::string &name) |
Tests whether the parameter has been set in the steering file. | |
template<class T > | |
void | message (const std::string &message) const |
Print message according to verbosity level. More... | |
template<class T > | |
void | message (const std::basic_ostream< char, std::char_traits< char > > &m) const |
Similar to message(const std::string& message) More... | |
std::stringstream & | log () const |
Returns an empty stringstream that is used by the message method. | |
virtual void | setProcessorParameters (StringParameters *parameters) |
Allow friend class CCProcessor to change/reset processor parameters. | |
virtual void | updateParameters () |
Allow friend class CCProcessor to update processor parameters. | |
virtual void | updateTelescopeParameters (std::string name) |
Allow to update processor parameters for given telescope name. More... | |
virtual void | updateTelescopeParameters (GloriaFitsHeader *header) |
Update processor parameters based on FITS header. More... | |
Protected Attributes | |
string | _inputCollectionName |
Name of the collection containing input table. | |
string | _outputCollectionName |
Name of the output table collection (for selected rows) | |
bool | _permanentCollection |
Flag the output collection to be permanent. | |
string | _sortColumn |
Name of the column which should be used for table sorting. | |
bool | _reverseSort |
Flag to indicate that output table should be sorted in reverse order. | |
std::vector< std::string > | _columnValueRange |
Names of table columns with allowed value ranges. | |
std::vector< std::string > | _outputColumns |
Names of table columns to be stored to output file. | |
bool | _acceptIfAny |
int | _minCount |
Minimum number of selected rows for processor returning true value. | |
![]() | |
std::string | _description |
Describes what the processor does. Set in constructor. | |
Processor to select data rows from the table.
This processor can be used to select rows of the table (eg. reconstricted objects in the object list) by specifying simple cuts on values stored in table columns. Cuts can be applied on integer or float columns only (no string nor vector columns can be used for selection). Additional flag allows for sorting the output table by selected column value.
InputCollectionName | - Name of the collection containing input tables. |
OutputCollectionName | Name of the collection where the resulting table should be stored. If missing, input collection table will be modified. |
PermanentCollection | Flag output collection, as permanent, not deleted after loop is finished (default is false) |
SortColumn | Name of the column which should be used for sorting the output table. |
ReverseSort | Flag to indicate that output table should be sorted in reverse order. |
ColumnValueRange | Name of the column and two numbers specifying the allowed range for the column value. If the higher value is given first, values outside specified range will be selected. More that one cut can be specified by giving many sets of name plus two numbers. |
AcceptIfAny | Flag indicating if given row should be selected when any selection criteria is fulfilled (i.e. OR of cuts is used). Default is false i.e. all cuts have to be fulfilled to select the data row. |
OutputColumns | Names of columns, which should be stored in output table. By default (if not given) all columns are stored. This option can also be used to change column order in the output table. |
MinCount | Minimum number of rows in the output table, for which the processor return value will be set to true. |
|
virtual |
Called for every loop - right after processData() call.
Can be used to check processing and/or produce check plots.
Reimplemented from luiza::Processor.
|
virtual |
Called after data processing for clean up.
Reimplemented from luiza::Processor.
References printEndMessage().
|
virtual |
Called at the begin of the job before anything is read. Use to initialize the processor, e.g. book histograms.
Reimplemented from luiza::Processor.
References _columnValueRange, _inputCollectionName, _outputCollectionName, _outputColumns, _sortColumn, luiza::Processor::name(), luiza::Processor::parameters(), and luiza::Processor::setReturnValue().
|
inlinevirtual |
Return a new instance of the processor.
Has to be implemented by subclasses.
Implements luiza::Processor.
|
virtual |
Called for every data loop
Reimplemented from luiza::Processor.
References _acceptIfAny, _columnValueRange, _inputCollectionName, _minCount, _outputCollectionName, _outputColumns, _permanentCollection, _reverseSort, _sortColumn, gloria::GloriaFitsTable::AdjustColumns(), gloria::GloriaFitsTable::CopyTableRow(), gloria::GloriaDataContainer::CreateTableCollection(), gloria::GloriaFitsTable::DeleteColumn(), gloria::GloriaFitsTable::DeleteRow(), gloria::GloriaFitsTable::EmptyClone(), gloria::GloriaFitsTable::GetColumnName(), gloria::GloriaFitsTable::GetColumnNumber(), gloria::GloriaFitsTable::GetColumnType(), gloria::GloriaFitsTable::GetRowNumber(), gloria::GloriaDataContainer::GetTableCollection(), gloria::GloriaFitsTable::GetVectorOf(), gloria::GloriaFitsTable::InsertColumn(), gloria::GloriaFitsTable::RemoveColumn(), luiza::Processor::setReturnValue(), gloria::GloriaFitsTable::SortTable(), and gloria::GloriaDataContainer::TableCollectionExists().
|
virtual |
Called before first data loop.
Can be used to create permanent data structures, if needed.
Reimplemented from luiza::Processor.
|
protected |
Flag indicating if row should be selected by OR of cuts (when true) or by AND of cuts (when false)
Referenced by processData().