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 HeaderFileName (Int_t run)
 Header filename for a run.
static void WriteHeaderFile (Int_t run, UShort_t header)
 Write a run's global header to its file.
static Bool_t ReadHeaderFile (Int_t run, UShort_t &header)
 Read a run's global header back from its file.

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 additional file and read back when needed.

Definition at line 22 of file BinaryToRoot.hpp.

Member Function Documentation

◆ HeaderFileName()

TString BinaryToRoot::HeaderFileName ( Int_t run)
static

Header 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 ReadHeaderFile(), and WriteHeaderFile().

◆ ReadHeaderFile()

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

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

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 file exists and held a value; kFALSE if it is missing or empty.

Definition at line 14 of file BinaryToRoot.cpp.

Referenced by EnsureRunHeaderFused().

◆ WriteHeaderFile()

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

Write a run's global header to its file.

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 file is just a copy of what was in the binary; 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: