reads raw events from a data file for processing More...
#include <Reader.hh>
Classes | |
| struct | datablock_header |
| struct | event_header |
| struct | event_header_v0 |
| struct | global_header |
Public Member Functions | |
| Reader (const std::string &filename) | |
| Constructor takes a raw data filename. | |
| ~Reader () | |
| Destructor. | |
| bool | IsOk () |
| Check if we're ok to read. | |
| bool | eof () |
| Check if we've reached the end of the file. | |
| RawEventPtr | GetNextEvent (bool read_header=true) |
| Get the next event in the file. | |
| RawEventPtr | GetEventWithIndex (int index) |
| Search for the event located at number <index> in the file. | |
| RawEventPtr | GetEventWithID (uint32_t id) |
| Search for an event with internal id <id>. | |
| RawEventPtr | GetLastEvent () |
| Find the last event in the file. | |
| int | GetCurrentIndex () |
| Return the index of the current event in the file. | |
| bool | GetAssociatedParameter (VParameterNode *par, std::string key="") |
| Load the parameter <par> from the saved config file. | |
Static Public Attributes | |
| static const uint32_t | magic_number = 0xdec0ded1 |
| static const uint32_t | latest_global_version = 1 |
| static const uint32_t | latest_event_version = 1 |
Private Member Functions | |
| bool | ErrorCheck (int bytes_read, int bytes_requested) |
| See if the last read operation completed successfully. | |
| int | Reset () |
| Reset the file to the initial state. | |
| int | ReadNextHeader () |
| Read the next header. | |
| z_off_t | SkipNextEvent (bool skip_header=true) |
| Skip over this event to the next one. | |
| int | OpenNextFile () |
| Open the next file in the series. | |
| int | CloseCurrentFile () |
| Close the current file. | |
Private Attributes | |
| const std::string | _filename |
| raw filename | |
| gzFile | _fin |
| gzip file that we are reading from | |
| bool | _ok |
| status of the reader/file | |
| long | _current_index |
| index of the current event | |
| long | _current_id |
| ID of current event. | |
| global_header | _ghead |
| header for the current file | |
| event_header | _ehead |
| header for the current event | |
| RawEventPtr | _current_event |
| Pointer to the current event. | |
| uint32_t | _current_file_index |
| index of current file | |
| std::string | _current_file_name |
| Name of current file in series. | |
| bool | _end_last_file |
| have we reached the end of the last file? | |
Static Private Attributes | |
| static const uint32_t | _unset_file_index = 0xFFFFFFFF |
reads raw events from a data file for processing
Definition at line 19 of file Reader.hh.
1.6.1