Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
Loading...
Searching...
No Matches

Cursor over a SOLARIS DAQ .sol file. More...

#include <BinaryUtils.hpp>

Inheritance diagram for SOLReader:
Collaboration diagram for SOLReader:

Public Member Functions

 SOLReader ()
 Construct a reader with no file open and traces enabled.
virtual ~SOLReader ()
void SetSkipTraces (Bool_t skip)
 Skip trace payloads while still parsing every block.
Bool_t GetSkipTraces () const
 Whether trace payloads are being skipped.
Bool_t ReadEvent () override
 Decode the next record into the derived reader's current event.
const SOLDataGetCurrentEvent () const
 The block most recently read.
SOLDataGetCurrentEvent ()
 Mutable access to the block most recently read.
Long64_t GetBlockID () const
 Zero-based index of the block most recently read.
SOLHit ToHit () const
 Copy the current block's header fields into a standalone SOLHit.
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 Bool_t Open (const char *fname)
 Open a binary file for reading.
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.

Static Public Member Functions

static std::vector< TString > SplitSolFileByTime (const char *inputFile, const char *outputDir, Double_t chunkSeconds, Int_t &totalBlocks, Int_t &totalChunks)
 Split a run file into time-bounded chunks.

Additional Inherited Members

Protected Attributes inherited from BinaryReader
std::ifstream file
TString filename
Bool_t file_open
Long64_t bytes_read

Detailed Description

Cursor over a SOLARIS DAQ .sol file.

Definition at line 551 of file BinaryUtils.hpp.

Constructor & Destructor Documentation

◆ SOLReader()

SOLReader::SOLReader ( )
inline

Construct a reader with no file open and traces enabled.

Definition at line 559 of file BinaryUtils.hpp.

◆ ~SOLReader()

virtual SOLReader::~SOLReader ( )
inlinevirtual

Definition at line 561 of file BinaryUtils.hpp.

Member Function Documentation

◆ GetBlockID()

Long64_t SOLReader::GetBlockID ( ) const
inline

Zero-based index of the block most recently read.

Definition at line 582 of file BinaryUtils.hpp.

◆ GetCurrentEvent() [1/2]

SOLData & SOLReader::GetCurrentEvent ( )
inline

Mutable access to the block most recently read.

Returns
A reference valid only until the next ReadEvent().

Definition at line 579 of file BinaryUtils.hpp.

◆ GetCurrentEvent() [2/2]

const SOLData & SOLReader::GetCurrentEvent ( ) const
inline

The block most recently read.

Returns
A reference valid only until the next ReadEvent().

Definition at line 576 of file BinaryUtils.hpp.

Referenced by InitUtils::ConvertSOLBinToHits(), and InitUtils::ConvertSOLBinToROOT().

◆ GetSkipTraces()

Bool_t SOLReader::GetSkipTraces ( ) const
inline

Whether trace payloads are being skipped.

Definition at line 570 of file BinaryUtils.hpp.

◆ ReadEvent()

Bool_t SOLReader::ReadEvent ( )
overridevirtual

Decode the next record into the derived reader's current event.

Returns
kTRUE if a record was read; kFALSE at end of file or on a malformed record.

Implements BinaryReader.

Definition at line 712 of file BinaryUtils.cpp.

Referenced by InitUtils::ConvertSOLBinToHits(), and InitUtils::ConvertSOLBinToROOT().

◆ SetSkipTraces()

void SOLReader::SetSkipTraces ( Bool_t skip)
inline

Skip trace payloads while still parsing every block.

Parameters
skipkTRUE to discard traces as blocks are read. Much faster and far cheaper in memory when only header fields are needed.

Definition at line 568 of file BinaryUtils.hpp.

◆ SplitSolFileByTime()

std::vector< TString > SOLReader::SplitSolFileByTime ( const char * inputFile,
const char * outputDir,
Double_t chunkSeconds,
Int_t & totalBlocks,
Int_t & totalChunks )
static

Split a run file into time-bounded chunks.

Each output file collects blocks whose timestamps fall within chunkSeconds of that chunk's first block. Reads and writes are bulk-buffered at 4 MiB, so splitting runs close to disk speed.

Parameters
inputFilePath to the source .sol file.
outputDirDirectory for the chunk files, which are named <basename>_chunk<NNN>.sol.
chunkSecondsChunk duration in seconds. Compared against the nanosecond block timestamps internally.
totalBlocksSet to the number of blocks processed.
totalChunksSet to the number of chunk files created.
Returns
Paths of the chunk files created, in order.

Definition at line 512 of file BinaryUtils.cpp.

◆ ToHit()

SOLHit SOLReader::ToHit ( ) const

Copy the current block's header fields into a standalone SOLHit.

The way to retain a block past the next ReadEvent(): the result owns its data and carries no traces.

Returns
A SOLHit describing the current block.

Definition at line 975 of file BinaryUtils.cpp.

Referenced by InitUtils::ConvertSOLBinToHits().


The documentation for this class was generated from the following files: