|
HIPO
4.3.0
High Performance Output data format for experimental physics
|
Sequential reader for HIPO files. More...
#include <reader.h>
Public Member Functions | |
| reader () | |
| Default constructor. More... | |
| reader (const char *file) | |
| Construct and open a HIPO file. More... | |
| reader (const char *file, std::vector< int > tags) | |
| Construct and open a HIPO file with event tag filtering. More... | |
| reader (const reader &r) | |
| ~reader () | |
| void | about () |
| Print file information to stdout. More... | |
| void | rewind () |
| Rewind to the beginning of the file. More... | |
| void | readDictionary (hipo::dictionary &dict) |
| Read the schema dictionary from the file header. More... | |
| void | getStructure (hipo::structure &structure, int group, int item) |
| Extract a structure from the current event by group and item. More... | |
| void | getStructureNoCopy (hipo::structure &structure, int group, int item) |
| Extract a structure without copying (zero-copy). More... | |
| void | readUserConfig (std::map< std::string, std::string > &mapConfig) |
| Read user configuration key-value pairs from the file header. More... | |
| void | open (const char *filename) |
| Open a HIPO file for reading. More... | |
| bool | is_open () |
| void | setTags (int tag) |
| Add an event tag to the read filter. More... | |
| void | setTags (std::vector< long > tags) |
| Set the event tag filter list. More... | |
| void | setVerbose (short level=1) |
| Set the verbosity level. More... | |
| bool | hasNext () |
| Check if more events are available without advancing. More... | |
| bool | next () |
| Advance to the next event. More... | |
| bool | gotoEvent (int eventNumber) |
| Jump to a specific event number. More... | |
| bool | gotoRecord (int irec) |
| Jump to a specific record. More... | |
| bool | next (hipo::event &dataevent) |
| Read the next event into the given event object. More... | |
| bool | next (std::vector< hipo::bank > &list) |
| Read the next event and populate a list of banks. More... | |
| std::vector< hipo::bank > | getBanks (std::vector< std::string > names) |
| Create bank objects for the given bank names. More... | |
| void | read (hipo::event &dataevent) |
| Read the current event into the given event object. More... | |
| void | printWarning () |
| Print a warning message (e.g., end of file). More... | |
| int | getNRecords () const |
| bool | nextInRecord () |
| Advance to the next event within the current record. More... | |
| bool | loadRecord (int irec) |
| Load a specific record by index into the internal buffer. More... | |
| bool | loadRecord (hipo::record &record, int irec) |
| Load a specific record into an external record object. More... | |
| int | getEntries () |
| std::vector< int > | getInt (const char *bank, const char *column, int max=-1) |
| Read all integer values from a bank column across events. More... | |
| std::vector< float > | getFloat (const char *bank, const char *column, int max=-1) |
| Read all float values from a bank column across events. More... | |
Sequential reader for HIPO files.
Reads events from a HIPO file one at a time, with support for random access via event/record indices. The dictionary (schema definitions) is read from the file header.
| hipo::reader::reader | ( | ) |
Default constructor.
The constructor for reader, printWarning routine will printout a warning message if the library was not compiled with compression libraries LZ4 or GZIP
Definition at line 58 of file reader.cpp.
|
inline |
|
inline |
| hipo::reader::~reader | ( | ) |
Default destructor. Does nothing
Definition at line 66 of file reader.cpp.
| void hipo::reader::about | ( | ) |
Print file information to stdout.
Definition at line 72 of file reader.cpp.
| std::vector< hipo::bank > hipo::reader::getBanks | ( | std::vector< std::string > | names | ) |
Create bank objects for the given bank names.
| names | List of bank names (e.g., "REC::Particle") |
Definition at line 273 of file reader.cpp.
|
inline |
| std::vector< float > hipo::reader::getFloat | ( | const char * | bank, |
| const char * | column, | ||
| int | max = -1 |
||
| ) |
Read all float values from a bank column across events.
| bank | Bank name |
| column | Column name |
| max | Maximum number of events to read (-1 for all) |
Definition at line 417 of file reader.cpp.
| std::vector< int > hipo::reader::getInt | ( | const char * | bank, |
| const char * | column, | ||
| int | max = -1 |
||
| ) |
Read all integer values from a bank column across events.
| bank | Bank name |
| column | Column name |
| max | Maximum number of events to read (-1 for all) |
Definition at line 402 of file reader.cpp.
|
inline |
| void hipo::reader::getStructure | ( | hipo::structure & | structure, |
| int | group, | ||
| int | item | ||
| ) |
Extract a structure from the current event by group and item.
| structure | Output structure to fill |
| group | Group identifier |
| item | Item identifier |
Definition at line 241 of file reader.cpp.
| void hipo::reader::getStructureNoCopy | ( | hipo::structure & | structure, |
| int | group, | ||
| int | item | ||
| ) |
Extract a structure without copying (zero-copy).
| structure | Output structure (points into internal buffer) |
| group | Group identifier |
| item | Item identifier |
Definition at line 254 of file reader.cpp.
| bool hipo::reader::gotoEvent | ( | int | eventNumber | ) |
Jump to a specific event number.
| eventNumber | Target event number |
Definition at line 353 of file reader.cpp.
| bool hipo::reader::gotoRecord | ( | int | irec | ) |
| bool hipo::reader::hasNext | ( | ) |
Check if more events are available without advancing.
Checks if there are more events in the file to advance to.
Definition at line 207 of file reader.cpp.
|
inline |
| bool hipo::reader::loadRecord | ( | hipo::record & | record, |
| int | irec | ||
| ) |
Load a specific record into an external record object.
| record | Output record object |
| irec | Record index |
Definition at line 396 of file reader.cpp.
| bool hipo::reader::loadRecord | ( | int | irec | ) |
Load a specific record by index into the internal buffer.
| irec | Record index |
Definition at line 390 of file reader.cpp.
| bool hipo::reader::next | ( | ) |
Advance to the next event.
Advances the event pointer to the next event. This does not read an event, but if the event goes beyond boundary of the record the next record is loaded into the memody.
Definition at line 334 of file reader.cpp.
| bool hipo::reader::next | ( | hipo::event & | dataevent | ) |
Read the next event into the given event object.
| dataevent | Output event |
Definition at line 213 of file reader.cpp.
| bool hipo::reader::next | ( | std::vector< hipo::bank > & | list | ) |
Read the next event and populate a list of banks.
| list | Banks to fill from the event |
Definition at line 261 of file reader.cpp.
| bool hipo::reader::nextInRecord | ( | ) |
Advance to the next event within the current record.
Definition at line 433 of file reader.cpp.
| void hipo::reader::open | ( | const char * | filename | ) |
Open a HIPO file for reading.
| filename | Path to the file |
Definition at line 81 of file reader.cpp.
| void hipo::reader::printWarning | ( | ) |
Print a warning message (e.g., end of file).
Prints out warning if the LZ4 library was not linked to the compiled library. In that case only uncompressed files can be read and written.
Definition at line 442 of file reader.cpp.
| void hipo::reader::read | ( | hipo::event & | dataevent | ) |
Read the current event into the given event object.
| dataevent | Output event |
Definition at line 233 of file reader.cpp.
| void hipo::reader::readDictionary | ( | hipo::dictionary & | dict | ) |
Read the schema dictionary from the file header.
| dict | Dictionary to populate |
Definition at line 311 of file reader.cpp.
| void hipo::reader::readUserConfig | ( | std::map< std::string, std::string > & | mapConfig | ) |
Read user configuration key-value pairs from the file header.
| mapConfig | Output map to populate |
Definition at line 283 of file reader.cpp.
|
inline |
|
inline |
|
inline |
|
inline |