|
Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
|
Cursor over a CoMPASS binary file. More...
#include <BinaryUtils.hpp>
Public Member Functions | |
| CoMPASSReader () | |
| Construct a reader with no file open. | |
| virtual | ~CoMPASSReader () |
| Bool_t | Open (const char *fname) override |
| Open a file and read its global header. | |
| Bool_t | Open (const char *fname, UShort_t header_override) |
| Open a file, assuming a given global header. | |
| Bool_t | ReadEvent () override |
| Decode the next event into the current-event object. | |
| const CoMPASSData & | GetCurrentEvent () const |
| The event most recently read. | |
| CoMPASSData & | GetCurrentEvent () |
| Mutable access to the event most recently read. | |
| UShort_t | GetGlobalHeader () const |
| The global header in force, read from the file or overridden. | |
| Public Member Functions inherited from BinaryReader | |
| BinaryReader () | |
| Construct a reader with no file open. | |
| virtual | ~BinaryReader () |
| Closes the file if it is still open. | |
| virtual void | Close () |
| Close the file. Safe to call when nothing is open. | |
| Bool_t | IsOpen () const |
| Whether a file is currently open. | |
| TString | GetFileName () const |
| Path most recently passed to Open(). | |
| Long64_t | GetBytesRead () const |
| Bytes consumed so far, for progress reporting. | |
| Bool_t | IsEOF () const |
| Whether the file is exhausted or was never opened. | |
Additional Inherited Members | |
| Protected Attributes inherited from BinaryReader | |
| std::ifstream | file |
| TString | filename |
| Bool_t | file_open |
| Long64_t | bytes_read |
Cursor over a CoMPASS binary file.
Reads the two-byte global header on open, then decodes one event per ReadEvent() into a reused CoMPASSData.
Definition at line 253 of file BinaryUtils.hpp.
|
inline |
Construct a reader with no file open.
Definition at line 260 of file BinaryUtils.hpp.
|
inlinevirtual |
Definition at line 262 of file BinaryUtils.hpp.
|
inline |
Mutable access to the event most recently read.
Definition at line 306 of file BinaryUtils.hpp.
|
inline |
The event most recently read.
Definition at line 303 of file BinaryUtils.hpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), and InitUtils::ConvertCoMPASSBinToROOT().
|
inline |
The global header in force, read from the file or overridden.
Definition at line 309 of file BinaryUtils.hpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), and InitUtils::ConvertCoMPASSBinToROOT().
|
overridevirtual |
Open a file and read its global header.
| fname | Path to the CoMPASS binary file. |
Reimplemented from BinaryReader.
Definition at line 149 of file BinaryUtils.cpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), and InitUtils::ConvertCoMPASSBinToROOT().
| Bool_t CoMPASSReader::Open | ( | const char * | fname, |
| UShort_t | header_override ) |
Open a file, assuming a given global header.
For files whose two-byte header is missing or wrong. Passing an override also suppresses the two-byte header skip, since there is nothing to skip.
| fname | Path to the CoMPASS binary file. |
| header_override | Header word to assume. Must be non-zero. |
Definition at line 167 of file BinaryUtils.cpp.
|
overridevirtual |
Decode the next event into the current-event object.
Decode the next event into the current-event object.
Decode the next block into the current-event object.
Implements BinaryReader.
Definition at line 198 of file BinaryUtils.cpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), and InitUtils::ConvertCoMPASSBinToROOT().