MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
BinaryToRoot Class Reference

Persistence for a run's CoMPASS global header. More...

#include <BinaryToRoot.hpp>

Static Public Member Functions

static TString HeaderSidecarName (Int_t run)
 Sidecar filename for a run.
static void WriteHeaderSidecar (Int_t run, UShort_t header)
 Write a run's global header to its sidecar.
static Bool_t ReadHeaderSidecar (Int_t run, UShort_t &header)
 Read a run's global header back from its sidecar.

Detailed Description

Persistence for a run's CoMPASS global header.

The global header says which fields each record in a CoMPASS binary carries, and it is read once when the binary is first converted. Later stages work from the ROOT output and no longer have the binary to hand, so the header is written beside the ROOT files as a small sidecar and read back when needed.

Definition at line 21 of file BinaryToRoot.hpp.

Member Function Documentation

◆ HeaderSidecarName()

TString BinaryToRoot::HeaderSidecarName ( Int_t run)
static

Sidecar filename for a run.

Parameters
runRun number.
Returns
The bare filename, DataR_run_<run>.header, with no directory.

Definition at line 3 of file BinaryToRoot.cpp.

Referenced by ReadHeaderSidecar(), and WriteHeaderSidecar().

◆ ReadHeaderSidecar()

Bool_t BinaryToRoot::ReadHeaderSidecar ( Int_t run,
UShort_t & header )
static

Read a run's global header back from its sidecar.

Parameters
runRun number.
[out]headerSet to the stored header on success; untouched otherwise. Parsed with a base of 0, so the 0x prefix is honoured.
Returns
kTRUE if the sidecar exists and held a value; kFALSE if it is missing or empty.

Definition at line 14 of file BinaryToRoot.cpp.

Referenced by EnsureRunHeaderFused().

◆ WriteHeaderSidecar()

void BinaryToRoot::WriteHeaderSidecar ( Int_t run,
UShort_t header )
static

Write a run's global header to its sidecar.

The file lands beside the run's ROOT output, under the ROOT files base directory; parent directories are created as needed. The value is written as 0x-prefixed hexadecimal.

Parameters
runRun number.
headerCoMPASS global header word.
Note
Failures to open the file are silent — the sidecar is a cache, and a missing one is recoverable by re-reading the binary.

Definition at line 7 of file BinaryToRoot.cpp.

Referenced by EnsureRunHeaderFused(), and RunFusedPipelineForFile().


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