|
HIPO4 C++ Library 4.4.1
Columnar I/O library for CLAS12 physics data
|
#include <reader.h>
Public Member Functions | |
| reader () | |
| The constructor for reader, printWarning routine will printout a warning message if the library was not compiled with compression libraries LZ4 or GZIP. | |
| reader (const char *file) | |
| reader (const char *file, std::vector< int > tags) | |
| reader (const reader &r) | |
| ~reader () | |
| Default destructor. | |
| void | about () |
| void | rewind () |
| void | readDictionary (hipo::dictionary &dict) |
| Reads the dictionary for the file. | |
| void | getStructure (hipo::structure &structure, int group, int item) |
| Reads the structure from the current event without copying the event buffer. | |
| void | getStructureNoCopy (hipo::structure &structure, int group, int item) |
| Reads the structure from the current event without copying the event buffer and without copying the structure buffer. | |
| void | readUserConfig (std::map< std::string, std::string > &mapConfig) |
| void | open (const char *filename) |
| Open file, if file stream is open, it is closed first. | |
| bool | is_open () |
| void | setTags (int tag) |
| void | setTags (std::vector< long > tags) |
| void | setVerbose (short level=1) |
| bool | hasNext () |
| Checks if there are more events in the file to advance to. | |
| bool | next () |
| Advances the event pointer to the next event. | |
| bool | gotoEvent (int eventNumber) |
| Moves the pointer of the event to the event number provided. | |
| bool | gotoRecord (int irec) |
| Moves the current event pointer to the new record # irec. | |
| bool | next (hipo::event &dataevent) |
| Reads next event from the file, the event pointer is automatically advanced to the next event. | |
| bool | next (std::vector< hipo::bank > &list) |
| std::vector< hipo::bank > | getBanks (std::vector< std::string > names) |
| void | read (hipo::event &dataevent) |
| Reads current event from the record without advancing the current event position. | |
| void | printWarning () |
| Prints out warning if the LZ4 library was not linked to the compiled library. | |
| int | getNRecords () const |
| bool | nextInRecord () |
| bool | loadRecord (int irec) |
| bool | loadRecord (hipo::record &record, int irec) |
| int | getEntries () |
| std::vector< int > | getInt (const char *bank, const char *column, int max=-1) |
| std::vector< float > | getFloat (const char *bank, const char *column, int max=-1) |
| hipo::reader::reader | ( | ) |
The constructor for reader, printWarning routine will printout a warning message if the library was not compiled with compression libraries LZ4 or GZIP.
|
inline |
|
inline |
|
inline |
| hipo::reader::~reader | ( | ) |
Default destructor.
Does nothing
| void hipo::reader::about | ( | ) |
|
inline |
| void hipo::reader::readDictionary | ( | hipo::dictionary & | dict | ) |
Reads the dictionary for the file.
C++ API is reading packed dictionary format from node (120,2), parses each schema and creates schema dictionary.
| dict | - reference to dictionary object. |
| void hipo::reader::getStructure | ( | hipo::structure & | structure, |
| int | group, | ||
| int | item | ||
| ) |
Reads the structure from the current event without copying the event buffer.
| structure | - reference to the stucture object |
| group | - the group is for the structure. |
| item | - item id for the structure. |
| void hipo::reader::getStructureNoCopy | ( | hipo::structure & | structure, |
| int | group, | ||
| int | item | ||
| ) |
Reads the structure from the current event without copying the event buffer and without copying the structure buffer.
This should be used very carefully, since it sets the pointer of the structure directly to the buffer owned by the record. If new record is loaded this structure will be pointing to the wrong part of the buffer.
| structure | - reference to the stucture object |
| group | - the group is for the structure. |
| item | - item id for the structure. |
| void hipo::reader::readUserConfig | ( | std::map< std::string, std::string > & | mapConfig | ) |
| void hipo::reader::open | ( | const char * | filename | ) |
Open file, if file stream is open, it is closed first.
At open time verification of file structure is performed. If the signature does not match EVIO/HIPO template, the file will be closed and warning message is printed.
| filename | - name of the file to open |
|
inline |
|
inline |
|
inline |
|
inline |
| bool hipo::reader::hasNext | ( | ) |
Checks if there are more events in the file to advance to.
| bool hipo::reader::next | ( | ) |
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.
| bool hipo::reader::gotoEvent | ( | int | eventNumber | ) |
Moves the pointer of the event to the event number provided.
If the event number is within the same record no reading is done, otherwise the appropriate record is loaded and event indicies are updated.
| eventNumber | - number of event to jump to |
| bool hipo::reader::gotoRecord | ( | int | irec | ) |
Moves the current event pointer to the new record # irec.
The readerIndex is updated so current event is the first event in loaded record.
| irec | - record number to jump to |
| bool hipo::reader::next | ( | hipo::event & | dataevent | ) |
Reads next event from the file, the event pointer is automatically advanced to the next event.
| reference | to the event object to be filled from the record. |
| bool hipo::reader::next | ( | std::vector< hipo::bank > & | list | ) |
| std::vector< hipo::bank > hipo::reader::getBanks | ( | std::vector< std::string > | names | ) |
| void hipo::reader::read | ( | hipo::event & | dataevent | ) |
Reads current event from the record without advancing the current event position.
Multiple reads can be performed on the same event.
| reference | to the event object to be read |
| void hipo::reader::printWarning | ( | ) |
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.
|
inline |
| bool hipo::reader::nextInRecord | ( | ) |
| bool hipo::reader::loadRecord | ( | int | irec | ) |
| bool hipo::reader::loadRecord | ( | hipo::record & | record, |
| int | irec | ||
| ) |
|
inline |
| std::vector< int > hipo::reader::getInt | ( | const char * | bank, |
| const char * | column, | ||
| int | max = -1 |
||
| ) |
| std::vector< float > hipo::reader::getFloat | ( | const char * | bank, |
| const char * | column, | ||
| int | max = -1 |
||
| ) |