musrfit 1.10.0
PRunDataHandler Class Reference

Raw data file reader and format converter for μSR data. More...

#include <PRunDataHandler.h>

Collaboration diagram for PRunDataHandler:

Public Member Functions

 PRunDataHandler ()
 Default constructor creating an uninitialized handler.
 
 PRunDataHandler (TString fileName, const TString fileFormat)
 Constructor for reading a single file with explicit format.
 
 PRunDataHandler (TString fileName, const TString fileFormat, const PStringVector dataPath)
 Constructor for single file with search paths.
 
 PRunDataHandler (TString fileName, const TString fileFormat, const TString dataPath, PRawRunData &runData)
 Constructor for reading single file into pre-allocated structure.
 
 PRunDataHandler (PAny2ManyInfo *any2ManyInfo)
 Constructor for format conversion (any2many utility).
 
 PRunDataHandler (PAny2ManyInfo *any2ManyInfo, const PStringVector dataPath)
 Constructor for format conversion with custom search paths.
 
 PRunDataHandler (PMsrHandler *msrInfo)
 Constructor for MSR-based data loading (standard fitting workflow).
 
 PRunDataHandler (PMsrHandler *msrInfo, const PStringVector dataPath)
 Constructor for MSR-based loading with custom search paths.
 
virtual ~PRunDataHandler ()
 Virtual destructor that frees all loaded data.
 
virtual void ReadData ()
 Reads all data files specified in MSR file or configuration.
 
virtual void ConvertData ()
 Performs format conversion (for any2many utility).
 
virtual Bool_t WriteData (TString fileName="")
 Writes data to file in the specified format.
 
virtual Bool_t IsAllDataAvailable () const
 Checks if all required data files were successfully loaded.
 
virtual PRawRunDataGetRunData (const TString &runName)
 Retrieves run data by run name.
 
virtual PRawRunDataGetRunData (const UInt_t idx=0)
 Retrieves run data by index.
 
virtual Int_t GetNoOfRunData ()
 Returns the number of loaded run data sets.
 
virtual Bool_t SetRunData (PRawRunData *data, UInt_t idx=0)
 Sets or replaces run data at specified index.
 

Private Member Functions

virtual void Init (const Int_t tag=0)
 
virtual Bool_t ReadFilesMsr ()
 
virtual Bool_t ReadWriteFilesList ()
 
virtual Bool_t FileAlreadyRead (TString runName)
 
virtual void TestFileName (TString &runName, const TString &ext)
 
virtual Bool_t FileExistsCheck (PMsrRunBlock &runInfo, const UInt_t idx)
 
virtual Bool_t FileExistsCheck (const Bool_t fileName, const Int_t idx)
 
virtual Bool_t FileExistsCheck (const TString fileName)
 
virtual Bool_t ReadRootFile ()
 
template<typename T>
Bool_t ReadNexusFileIdf1 (T &nxs_file)
 
template<typename T>
Bool_t ReadNexusFileIdf2 (T &nxs_file)
 
virtual Bool_t ReadNexusFile ()
 
virtual Bool_t ReadWkmFile ()
 
virtual Bool_t ReadPsiBinFile ()
 
virtual Bool_t ReadMudFile ()
 
virtual Bool_t ReadMduAsciiFile ()
 
virtual Bool_t ReadAsciiFile ()
 
virtual Bool_t ReadDBFile ()
 
virtual Bool_t ReadDatFile ()
 
virtual Bool_t WriteMusrRootFile (Int_t tag=A2M_MUSR_ROOT_DIR, TString fln="")
 
virtual Bool_t WriteRootFile (TString fln="")
 
virtual Bool_t WriteNexusFile (TString format, TString fln="")
 
virtual Bool_t WriteWkmFile (TString fln="")
 
virtual Bool_t WritePsiBinFile (TString fln="")
 
virtual Bool_t WriteMudFile (TString fln="")
 
virtual Bool_t WriteAsciiFile (TString fln="")
 
virtual Bool_t StripWhitespace (TString &str)
 
virtual Bool_t IsWhitespace (const Char_t *str)
 
virtual Double_t ToDouble (TString &str, Bool_t &ok)
 
virtual Int_t ToInt (TString &str, Bool_t &ok)
 
virtual Int_t GetDataTagIndex (TString &str, const PStringVector *fLabels)
 
virtual TString GenerateOutputFileName (const TString fileName, const TString extension, Bool_t &ok)
 
virtual TString GetFileName (const TString extension, Bool_t &ok)
 
virtual TString FileNameFromTemplate (TString &fileNameTemplate, Int_t run, TString &year, Bool_t &ok)
 
virtual bool DateToISO8601 (std::string inDate, std::string &iso8601Date)
 
virtual void SplitTimeDate (TString timeDate, TString &time, TString &date, Bool_t &ok)
 
virtual TString GetMonth (Int_t month)
 
virtual TString GetYear (Int_t month)
 

Private Attributes

PMsrHandlerfMsrInfo
 Pointer to MSR file handler (not owned, don't delete)
 
PAny2ManyInfofAny2ManyInfo
 Pointer to any2many conversion configuration (not owned, don't delete)
 
PStringVector fDataPath
 Search paths for data files (checked sequentially until file found)
 
Bool_t fAllDataAvailable
 Flag: true if all requested data files loaded successfully, false if any failed.
 
TString fFileFormat
 Explicitly specified file format (overrides auto-detection)
 
TString fRunName
 Current run name being processed (used during file reading)
 
TString fRunPathName
 Full path to current data file being read.
 
PRawRunDataList fData
 List of all loaded raw run data (histograms + metadata)
 

Detailed Description

Raw data file reader and format converter for μSR data.

PRunDataHandler is the comprehensive I/O layer for musrfit, serving as the gateway between raw experimental data files and the fitting framework. It provides unified access to data from different μSR facilities worldwide, handling the complexity of various file formats transparently.

Core Responsibilities

  • Data Loading: Reading raw histogram data from multiple file formats
  • Format Conversion: Converting between different μSR data formats (any2many utility)
  • Path Management: Searching multiple directories for data files
  • Metadata Extraction: Reading experimental parameters (field, temperature, beam energy, time)
  • Template Expansion: Resolving run name templates (e.g., "%r" → run number)
  • Run Management: Managing collections of runs for global/simultaneous fits
  • Data Validation: Verifying data integrity and consistency

Supported File Formats

ROOT-based formats:

  • MusrRoot: PSI standard format with complete metadata, run info, and histograms
  • Generic ROOT: Basic ROOT files with minimal structure

HDF5-based formats:

  • NeXus: International standard (ISIS, JPARC) - self-describing, hierarchical

Binary formats:

  • MUD: TRIUMF Muon Data format (binary, platform-specific)
  • PSI-BIN: Legacy PSI binary format
  • WKM: Older PSI format (deprecated, read-only support)

Text formats:

  • MDU ASCII: PSI ASCII format with metadata
  • ASCII: Generic two-column data (time, counts)
  • DB/DAT: Database and data table formats for x-y data

Key Features

Intelligent file searching:

  • Multi-path search (environment variables, default paths)
  • Run name template expansion: r (run), y (year), p (path)
  • Automatic format detection based on file extension
  • Year-based subdirectory organization (e.g., 2024/run2425.root)

Data management:

  • Caching: Avoid re-reading identical runs in global fits
  • Validation: Check file existence before attempting reads
  • Error handling: Graceful failure with informative messages
  • Batch processing: Handle multiple runs efficiently

Metadata extraction:

  • Magnetic field (from data file or MSR file)
  • Sample temperature
  • Beam energy
  • Run date/time (ISO 8601 format)
  • Detector configuration
  • Time resolution
  • Time-zero (t0) estimates

Usage Examples

Reading data for fitting:

// Constructor reads MSR file and searches default paths
PRunDataHandler handler(msrInfo);
handler.ReadData(); // Loads all runs from MSR RUN blocks
// Access individual run data
PRawRunData *run0 = handler.GetRunData(0);
PDoubleVector *histogram = run0->GetDataBin(0); // First detector
std::vector< Double_t > PDoubleVector
Definition PMusr.h:385
virtual const PDoubleVector * GetDataBin(const UInt_t histoNo)
Definition PMusr.h:880
PRunDataHandler()
Default constructor creating an uninitialized handler.

Reading data with custom search paths:

paths.push_back("/data/musr/2024");
paths.push_back("/archive/musr");
PRunDataHandler handler(msrInfo, paths);
handler.ReadData();
std::vector< TString > PStringVector
Definition PMusr.h:403

Converting data formats (any2many):

PAny2ManyInfo convInfo;
convInfo.inputFormat = "nexus";
convInfo.outputFormat = "root";
// ... configure convInfo ...
PRunDataHandler handler(&convInfo);
handler.ReadData(); // Read from NeXus
handler.ConvertData(); // Convert to ROOT
handler.WriteData(); // Write ROOT file

Run Name Templates

Template placeholders in run names are expanded automatically:

  • r → Run number (e.g., 2425)
  • y → 4-digit year (e.g., 2024)
  • Y → 2-digit year (e.g., 24)
  • p → Data path from search list

Example: "run%r.root" with run 2425 → "run2425.root"

Thread Safety

PRunDataHandler objects are NOT thread-safe. Each thread should create its own instance or use external synchronization.

See also
PRawRunData for the raw data structure
PMsrHandler for MSR file parsing
PAny2ManyInfo for format conversion configuration

Definition at line 192 of file PRunDataHandler.h.

Constructor & Destructor Documentation

◆ PRunDataHandler() [1/8]

PRunDataHandler::PRunDataHandler ( )

Default constructor creating an uninitialized handler.

Creates an empty handler with no data loaded. Not typically used directly; prefer constructors that specify data source (MSR file or conversion config).

Empty Constructor

Definition at line 85 of file PRunDataHandler.cpp.

References Init().

◆ PRunDataHandler() [2/8]

PRunDataHandler::PRunDataHandler ( TString fileName,
const TString fileFormat )

Constructor for reading a single file with explicit format.

Reads one data file in the specified format. Use this when the format cannot be auto-detected or when you want to override detection.

Parameters
fileNamePath to data file (absolute or relative)
fileFormatFormat identifier ("root", "nexus", "mud", "wkm", "psibin", "ascii")

Example: PRunDataHandler("run2425.root", "root")

Constructor which just reads a single muSR data file.

Parameters
fileName
fileFormat

Definition at line 99 of file PRunDataHandler.cpp.

References fFileFormat, FileExistsCheck(), and Init().

◆ PRunDataHandler() [3/8]

PRunDataHandler::PRunDataHandler ( TString fileName,
const TString fileFormat,
const PStringVector dataPath )

Constructor for single file with search paths.

Searches multiple directories for the specified file. Useful when data files may be in various locations (current dir, archive, network mount).

Parameters
fileNameFile name or template (e.g., "run%r.root")
fileFormatFormat identifier string
dataPathVector of directory paths to search sequentially

The handler searches paths in order and uses the first match found.

Constructor which just reads a single muSR data file.

Parameters
fileName
fileFormat
dataPath

Definition at line 116 of file PRunDataHandler.cpp.

References fDataPath, fFileFormat, FileExistsCheck(), and Init().

◆ PRunDataHandler() [4/8]

PRunDataHandler::PRunDataHandler ( TString fileName,
const TString fileFormat,
const TString dataPath,
PRawRunData & runData )

Constructor for reading single file into pre-allocated structure.

Reads a data file directly into a provided PRawRunData object. Useful for reading auxiliary data or when you want to manage memory explicitly.

Parameters
fileNameName of file to read
fileFormatFormat identifier
dataPathSingle directory path to search (not a vector)
runDataReference to PRawRunData object to fill with data

Constructor which just writes a single muSR data file.

Parameters
fileName
fileFormat
dataPath
runData

Definition at line 134 of file PRunDataHandler.cpp.

References Init().

◆ PRunDataHandler() [5/8]

PRunDataHandler::PRunDataHandler ( PAny2ManyInfo * any2ManyInfo)

Constructor for format conversion (any2many utility).

Initializes handler for converting between data formats. The any2ManyInfo structure specifies input/output formats, file lists, and conversion options.

Parameters
any2ManyInfoPointer to conversion configuration structure

Usage: Create PAny2ManyInfo, set input/output formats and file lists, then call ReadData()ConvertData()WriteData()

Constructor, reading the data histogramm files.

Parameters
msrInfopointer to the msr-file handler

Definition at line 147 of file PRunDataHandler.cpp.

References fAny2ManyInfo, Init(), and PHR_INIT_ANY2MANY.

◆ PRunDataHandler() [6/8]

PRunDataHandler::PRunDataHandler ( PAny2ManyInfo * any2ManyInfo,
const PStringVector dataPath )

Constructor for format conversion with custom search paths.

Like the any2many constructor, but allows specifying additional directories to search for input files.

Parameters
any2ManyInfoPointer to conversion configuration
dataPathVector of directories to search for input files

Constructor, reading the data histogramm files.

Parameters
any2ManyInfopointer to the PAny2ManyInfo structure needed to convert data
dataPathcontains all data search paths.

Definition at line 161 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fDataPath, Init(), and PHR_INIT_ANY2MANY.

◆ PRunDataHandler() [7/8]

PRunDataHandler::PRunDataHandler ( PMsrHandler * msrInfo)

Constructor for MSR-based data loading (standard fitting workflow).

Primary constructor used by musrfit for loading data specified in an MSR file. Reads the RUN blocks from the MSR file and loads all referenced data files. Uses default search paths from environment or MSR file settings.

Parameters
msrInfoPointer to MSR file handler containing run specifications

After construction, call ReadData() to actually load the histogram data.

Constructor, reading the data histogramm files.

Parameters
msrInfopointer to the msr-file handler

Definition at line 175 of file PRunDataHandler.cpp.

References fMsrInfo, Init(), and PHR_INIT_MSR.

◆ PRunDataHandler() [8/8]

PRunDataHandler::PRunDataHandler ( PMsrHandler * msrInfo,
const PStringVector dataPath )

Constructor for MSR-based loading with custom search paths.

Like the MSR constructor, but allows overriding the default search paths. Useful for accessing data in non-standard locations or network mounts.

Parameters
msrInfoPointer to MSR file handler
dataPathVector of directory paths to search for data files

Paths are searched in order; the first matching file is used.

Constructor, reading the data histogramm files, and keeping a copy of potential search paths.

Parameters
msrInfopointer to the msr-file handler
dataPathvector containing search paths where to find raw data files.

Definition at line 190 of file PRunDataHandler.cpp.

References fDataPath, fMsrInfo, Init(), and PHR_INIT_MSR.

◆ ~PRunDataHandler()

PRunDataHandler::~PRunDataHandler ( )
virtual

Virtual destructor that frees all loaded data.

Cleans up:

  • All PRawRunData objects in fData
  • File path vectors
  • Temporary buffers

Pointers to fMsrInfo and fAny2ManyInfo are NOT deleted (owned externally).

Destructor.

Definition at line 202 of file PRunDataHandler.cpp.

References fData, and fDataPath.

Member Function Documentation

◆ ConvertData()

void PRunDataHandler::ConvertData ( )
virtual

Performs format conversion (for any2many utility).

Converts data already loaded by ReadData() to the output format specified in fAny2ManyInfo. This is an internal preprocessing step before WriteData().

Conversion operations may include:

  • Data structure reorganization
  • Metadata format translation
  • Histogram rebinning or resampling
  • Endianness conversion (for binary formats)
Precondition
ReadData() must have been called to load source data
fAny2ManyInfo must specify valid output format

Read data and convert it. This routine is used by any2many.

Definition at line 313 of file PRunDataHandler.cpp.

References fAllDataAvailable, and ReadWriteFilesList().

◆ DateToISO8601()

bool PRunDataHandler::DateToISO8601 ( std::string inDate,
std::string & iso8601Date )
privatevirtual

If possible converts a inDate, into a ISO8601 standard date.

return: true if conversion was successfull otherwise false.

Parameters
inDateinput date which should be converted to an ISO 8601 date.
iso8601Dateon success the converted iso8601Date, otherwise an empty string

Definition at line 6724 of file PRunDataHandler.cpp.

Referenced by ReadPsiBinFile().

◆ FileAlreadyRead()

Bool_t PRunDataHandler::FileAlreadyRead ( TString runName)
privatevirtual

Checks if a file has been already read in order to prevent multiple reading of data files.

return:

  • true if the file has been read before,
  • otherwise false.
Parameters
runNamerun name to be check if the corresponding file is already read.

Definition at line 921 of file PRunDataHandler.cpp.

References fData.

Referenced by ReadFilesMsr().

◆ FileExistsCheck() [1/3]

Bool_t PRunDataHandler::FileExistsCheck ( const Bool_t fileName,
const Int_t idx )
privatevirtual

Checks if a given data file exists. Used for the any2many program.

return:

  • true if data file exists,
  • otherwise false.
Parameters
fileNameflag showing if a file name shall be handled or a run number
idxindex of the run. idx == -1 means that a single input data file name is given.

Definition at line 1257 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fDataPath, FileNameFromTemplate(), and fRunPathName.

◆ FileExistsCheck() [2/3]

Bool_t PRunDataHandler::FileExistsCheck ( const TString fileName)
privatevirtual

Checks if a given data file exists. Used for the any2many program.

return:

  • true if data file exists,
  • otherwise false.
Parameters
fileNamefile name

Definition at line 1353 of file PRunDataHandler.cpp.

References fDataPath, and fRunPathName.

◆ FileExistsCheck() [3/3]

Bool_t PRunDataHandler::FileExistsCheck ( PMsrRunBlock & runInfo,
const UInt_t idx )
privatevirtual

Checks if a given data file exists.

return:

  • true if data file exists,
  • otherwise false.
Parameters
runInforeference to the msr-run-structure
idxindex of the run (needed for ADDRUN feature).

Definition at line 1048 of file PRunDataHandler.cpp.

References fDataPath, fMsrInfo, fRunPathName, PMsrRunBlock::GetBeamline(), PMsrRunBlock::GetFileFormat(), PMsrRunBlock::GetInstitute(), PMsrRunBlock::GetRunName(), PMsrRunBlock::SetBeamline(), PMsrRunBlock::SetFileFormat(), PMsrRunBlock::SetInstitute(), and TestFileName().

Referenced by PRunDataHandler(), PRunDataHandler(), ReadFilesMsr(), and ReadWriteFilesList().

◆ FileNameFromTemplate()

TString PRunDataHandler::FileNameFromTemplate ( TString & fileNameTemplate,
Int_t run,
TString & year,
Bool_t & ok )
privatevirtual

Will, based on the fileNameTemplate construct a file name. The file name template has a run tag and a year tag. The run tag has the form [rrrr], whereas the number of 'r' defines the length of this string part. If the run number is shorter, leading zeros will be filled, e.g. [rrrrrr] and run==123 will lead to '000123'. The same is true for the year tag [yy], except that the length must agree. For example: fileNameTemplate = d[yyyy]/deltat_tdc_gps_[rrrr].bin, run = 123, year = 2009 will result in 'd2009/deltat_tdc_gps_0123.bin'.

return:

  • constructed file name from template, run number, and year
  • empty string
Parameters
templatetemplate string
runrun number
yearyear
oktrue if operation went smooth, otherwise false

Definition at line 6635 of file PRunDataHandler.cpp.

Referenced by FileExistsCheck(), and ReadWriteFilesList().

◆ GenerateOutputFileName()

TString PRunDataHandler::GenerateOutputFileName ( const TString fileName,
const TString extension,
Bool_t & ok )
privatevirtual

Generates the output file name (any2many). It also makes sure that the generated output file name does not coincidentally is identical to an already existing file.

return:

  • constructed file name
  • empty string
Parameters
fileName
extensionif the file name to be constructed
okflag which is 'true' if the file name could be constructed, 'false' otherwise

Definition at line 6528 of file PRunDataHandler.cpp.

References fAny2ManyInfo, and GetFileName().

Referenced by WriteAsciiFile(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), and WriteWkmFile().

◆ GetDataTagIndex()

Int_t PRunDataHandler::GetDataTagIndex ( TString & str,
const PStringVector * dataTags )
privatevirtual

Checks if str is in a list of data tags

return:

  • if found returns the data tag index (from the dataTags vector),
  • otherwise -1
Parameters
strdata tag string (see description of nonMusr db-data)
dataTagsvector of all data tags

Definition at line 6496 of file PRunDataHandler.cpp.

Referenced by ReadDBFile().

◆ GetFileName()

TString PRunDataHandler::GetFileName ( const TString extension,
Bool_t & ok )
privatevirtual

Construct the file name based on the any2many request.

return:

  • constructed file name
  • empty string
Parameters
extensionif the file name to be constructed
okflag which is 'true' if the file name could be constructed, 'false' otherwise

Definition at line 6584 of file PRunDataHandler.cpp.

References fAny2ManyInfo, and fRunPathName.

Referenced by GenerateOutputFileName().

◆ GetMonth()

TString PRunDataHandler::GetMonth ( Int_t month)
privatevirtual

given the month as number, convert it to a 3 character month. If month is out of range (i.e. not between 1 and 12) a '???' will be returned.

Parameters
monthas number

Definition at line 6781 of file PRunDataHandler.cpp.

Referenced by WritePsiBinFile().

◆ GetNoOfRunData()

virtual Int_t PRunDataHandler::GetNoOfRunData ( )
inlinevirtual

Returns the number of loaded run data sets.

Returns
Number of runs currently loaded in fData

Definition at line 403 of file PRunDataHandler.h.

References fData.

◆ GetRunData() [1/2]

PRawRunData * PRunDataHandler::GetRunData ( const TString & runName)
virtual

Retrieves run data by run name.

Searches fData for a run with matching name. Run names are extracted from data files or MSR RUN blocks.

Parameters
runNameName of run to retrieve (e.g., "2425", "run2425")
Returns
Pointer to PRawRunData if found, nullptr otherwise
Note
Pointer is valid until handler destruction or data reload

Checks if runName is found, and if so return these data. runName is as given in the msr-file.

return:

  • if data are found: pointer to the data.
  • otherwise the null pointer will be returned.
Parameters
runNamerun name, e.g. 2009/lem09_his_1234

Definition at line 221 of file PRunDataHandler.cpp.

References fData.

Referenced by musrFT_groupHistos().

◆ GetRunData() [2/2]

PRawRunData * PRunDataHandler::GetRunData ( const UInt_t idx = 0)
virtual

Retrieves run data by index.

Returns run data from the internal list by position. Index corresponds to the order in the MSR file RUN blocks or any2many file list.

Parameters
idxRun index (0-based, default=0 for first run)
Returns
Pointer to PRawRunData if index valid, nullptr if out of range
Note
Pointer is valid until handler destruction or data reload

return data-set with index idx.

return:

  • if data are found: pointer to the data.
  • otherwise the null pointer will be returned.
Parameters
idxindex of the raw data set.

Definition at line 248 of file PRunDataHandler.cpp.

References fData.

◆ GetYear()

TString PRunDataHandler::GetYear ( Int_t year)
privatevirtual

given the year as number, convert it to a 2 character year. If year is out of range '??' will be returned. This routine will break in the year 2100 or later ;-)

Parameters
yearas number

Definition at line 6839 of file PRunDataHandler.cpp.

Referenced by WritePsiBinFile().

◆ Init()

void PRunDataHandler::Init ( const Int_t tag = 0)
privatevirtual

◆ IsAllDataAvailable()

virtual Bool_t PRunDataHandler::IsAllDataAvailable ( ) const
inlinevirtual

Checks if all required data files were successfully loaded.

Returns false if any file specified in the MSR file or configuration could not be found or loaded. Useful for validating data availability before starting a fit.

Returns
True if all data loaded successfully, false if any file missing or failed

Definition at line 370 of file PRunDataHandler.h.

References fAllDataAvailable.

◆ IsWhitespace()

Bool_t PRunDataHandler::IsWhitespace ( const Char_t * str)
privatevirtual

Check if a string consists only of white spaces, i.e. spaces and/or ctrl-characters.

return:

  • true at successful reading,
  • otherwise false.
Parameters
strstring to be checked

Definition at line 6367 of file PRunDataHandler.cpp.

Referenced by ReadWkmFile().

◆ ReadAsciiFile()

Bool_t PRunDataHandler::ReadAsciiFile ( )
privatevirtual

Reads ascii files. Intended for the nonMuSR data.

The file format definition is: Comment lines start with a '#' or '' character. The file can start with some header info. The header is optional, as all its tags, but if present it has the following format:

* HEADER
* TITLE:  title
* X-AXIS-TITLE: x-axis title
* Y-AXIS-TITLE: y-axis title
* SETUP:  setup
* FIELD:  field
* TEMP:   temperature
* ENERGY: energy
* 

field is assumed to be given in (G), the temperature in (K), the energy in (keV)

The data are read column like and start with the data tag DATA, followed by the data columns, i.e.:

* DATA
* x, y [, error y]
* 

where spaces, column, are a tab are possible separations. If no error in y is present, the weighting in the fit will be equal.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 3532 of file PRunDataHandler.cpp.

References PNonMusrRawRunData::AppendData(), PNonMusrRawRunData::AppendErrData(), PNonMusrRawRunData::AppendLabel(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PMUSR_UNDEFINED, PRawRunData::SetEnergy(), PRawRunData::SetField(), PNonMusrRawRunData::SetFromAscii(), PNonMusrRawRunData::SetLabel(), PRawRunData::SetRunName(), PRawRunData::SetRunTitle(), PRawRunData::SetSetup(), PRawRunData::SetTemperature(), and PRawRunData::SetTransport().

Referenced by ReadFilesMsr().

◆ ReadData()

void PRunDataHandler::ReadData ( )
virtual

Reads all data files specified in MSR file or configuration.

Main data loading method that:

  1. Iterates through run specifications (from MSR or any2many config)
  2. Searches data paths for each file using template expansion
  3. Detects file format (from extension or explicit specification)
  4. Calls appropriate format-specific reader (ReadRootFile, ReadNexusFile, etc.)
  5. Extracts metadata (field, temperature, time resolution)
  6. Validates histogram data integrity
  7. Caches data to avoid re-reading in global fits

Must be called after construction and before accessing data via GetRunData(). Sets fAllDataAvailable flag based on success/failure.

Postcondition
fData contains loaded run data, fAllDataAvailable indicates success

Read data. Used to read data, either msr-file triggered, or a single explicit data file should be read.

Definition at line 263 of file PRunDataHandler.cpp.

References fAllDataAvailable, fFileFormat, fMsrInfo, fRunPathName, ReadFilesMsr(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().

◆ ReadDatFile()

Bool_t PRunDataHandler::ReadDatFile ( )
privatevirtual

Reads column like data sets as generated by msr2data with the option 'data'. This can be used for the 'non muSR fit' type.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 4196 of file PRunDataHandler.cpp.

References PNonMusrRawRunData::AppendDataTag(), PNonMusrRawRunData::AppendLabel(), PNonMusrRawRunData::AppendSubData(), PNonMusrRawRunData::AppendSubErrData(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PNonMusrRawRunData::GetData(), PNonMusrRawRunData::GetErrData(), PNonMusrRawRunData::SetFromAscii(), PRawRunData::SetRunName(), and PNonMusrRawRunData::SetSize().

Referenced by ReadFilesMsr().

◆ ReadDBFile()

Bool_t PRunDataHandler::ReadDBFile ( )
privatevirtual

Reads triumf db-files. Intended for the nonMuSR data.

The file format definition is: The following is a description of the features of the TRIUMF .db file format that are currently recognized by musrfit/musrview. The available commands include: title, abstract, comments, labels, and data.

* TITLE
*  The following line must contain the title.
*
*
* ABSTRACT
*  The abstract is read in starting with the following line until an empty line is reached.
*
* COMMENTS
*  The comments are read in starting with the following line until an empty line is reached.
*
*
* LABELS
*  One label must occupy each subsequent line until an empty line is reached. The number 
*  of labels should preferably match the number of variables in the data.
*
* DATA
*  On the same line as the DATA command, there must appear a comma-delimited list of variable 
*  names. These names should be kept short (some applications truncate to 4 characters). The 
*  numerical data is read in beginning with the following line until an empty line is reached.
*
*  In every line, there must appear exactly 3 comma-delimited fields for each specified name. 
*  The first field is the value, the second is the positive error, and the third is the negative 
*  error. If you leave the last field blank (the comma is still required), then the positive error 
*  will be interpreted as a symmetric error. If you include only the value, then the errors will be 
*  set to zero.
*
* To reiterate, if you provide a DATA command with 2 names, e.g. "DATA 1st, 2nd", then every subsequent 
* line must contain 2*3 - 1 = 5 commas. If you give 3 names, then there must be 3*3 - 1 = 8 commas.
* 
* Example 
* TITLE
*  Most Excellent Fake Data
*
* ABSTRACT
*  This data was collected over
*  many minutes of light work
*  that was required to make it up.
*
* COMMENTS
*  This data was generated using C++.
*  The file was formatted with Emacs.
*
* LABEL
*  Randomized Linear
*  Randomized Gaussian
*  Randomized Lorentzian
*  Run
*
* DATA line, gauss, lrntz, run
* -1.966, -0.168, -0.106,  0.048, 0.002, 0.005,  0.184, 0.010, 0.017, 1001, , , run 1001 title
* -1.895, -0.151, -0.128,  0.014, 0.001, 0.001,  0.259, 0.017, 0.015, 1002, , , run 1002 title
* -1.836, -0.127, -0.184,  0.013, 0.001, 0.001,  0.202, 0.017, 0.020, 1003, , , run 1003 title
* -1.739, -0.064, -0.166,  0.057, 0.003, 0.004,  0.237, 0.016, 0.018, 1004, , , run 1004 title
* -1.601, -0.062, -0.147,  0.104, 0.008, 0.006,  0.271, 0.012, 0.025, 1005, , , run 1005 title
*  .        .        .          .        .        .          .        .        .
*  .        .        .          .        .        .          .        .        .
*  .        .        .          .        .        .          .        .        .
* Alternatively, the data often utilizes the continuation character ('\') and is labelled like
* DATA line, gauss, lrntz
* linear = -1.966,  -0.168,  -0.106, \
* gaussn =  0.048,   0.002,   0.005, \
* lorntz =  0.184,   0.010,   0.017, \
* 1001,,, run 1001 title
* linear = -1.895,  -0.151,  -0.128, \
* gaussn =  0.014,   0.001,   0.001, \
* lorntz =  0.259,   0.017,   0.015, |
* 1002,,, run 1002 title
* linear = -1.836,  -0.127,  -0.184, \
* gaussn =  0.013,   0.001,   0.001, \
* lorntz =  0.202,   0.017,   0.020, |
* 1003,,, run 1003 title
*   .        .        .        .
*   .        .        .        .
*   .        .        .        .
* If there is a run line as in the above examples, it must be at the end of the data and given
* in this just slight odd manner (do not blame me, I haven't invented this format ;-) ).
* 

WARNING:For the row like data representation (the top DATA representation shown) it is essential that there are always at least one space inbetween commas (the reason is that I am too lazy to write my own tokenizer), e.g.

* -1.966, -0.168, ,  0.048, , ,  0.184, 0.010, 0.017, 1001, , , run 1001 title
* 

which is ok, but

* -1.966, -0.168,,  0.048,,,  0.184, 0.010, 0.017, 1001,,, run 1001 title
* 

will not work!

Some db-files do have a '\-e' or '\e' label just between the DATA tag line and the real data. This tag will just be ignored.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 3850 of file PRunDataHandler.cpp.

References PNonMusrRawRunData::AppendData(), PNonMusrRawRunData::AppendDataTag(), PNonMusrRawRunData::AppendErrData(), PNonMusrRawRunData::AppendLabel(), PNonMusrRawRunData::AppendSubData(), PNonMusrRawRunData::AppendSubErrData(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PNonMusrRawRunData::GetData(), GetDataTagIndex(), PNonMusrRawRunData::GetDataTags(), PNonMusrRawRunData::GetErrData(), PNonMusrRawRunData::GetLabels(), PNonMusrRawRunData::SetFromAscii(), PRawRunData::SetRunName(), and PRawRunData::SetRunTitle().

Referenced by ReadFilesMsr().

◆ ReadFilesMsr()

Bool_t PRunDataHandler::ReadFilesMsr ( )
privatevirtual

The main read file routine which is filtering what read sub-routine needs to be called. Called when the input is a msr-file.

return:

  • true if reading was successful,
  • false if reading failed.

Definition at line 452 of file PRunDataHandler.cpp.

References FileAlreadyRead(), FileExistsCheck(), fMsrInfo, fRunName, PRH_PPC_OFFSET, ReadAsciiFile(), ReadDatFile(), ReadDBFile(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().

Referenced by ReadData().

◆ ReadMduAsciiFile()

Bool_t PRunDataHandler::ReadMduAsciiFile ( )
privatevirtual

Reads the mdu ascii files (PSI). Needed to work around PSI-BIN limitations.

Lines starting with '#' or '' are considered as comment lines. The file has the following structure:

* HEADER
* TITLE: title-string
* SETUP: setup-string
* FIELD: val-string (G) or (T) (e.g. 123456 (G))
* TEMP: val-string (K)
* GROUPS: # of histograms written
* CHANNELS: # of bins per histogram written
* RESOLUTION: timeresolution (fs) or (ps) or (ns) or (us)
* 

followed by the data, which are written in column format, starting with the DATA tag, i.e.

* DATA
* 
* 

return:

  • true at successful reading,
  • otherwise false.

Definition at line 3219 of file PRunDataHandler.cpp.

References PRawRunDataSet::Clear(), fData, fRunName, fRunPathName, PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetField(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetRunName(), PRawRunData::SetRunTitle(), PRawRunData::SetSetup(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), and PRawRunDataSet::SetTimeZeroBinEstimated().

Referenced by ReadFilesMsr().

◆ ReadMudFile()

◆ ReadNexusFile()

Bool_t PRunDataHandler::ReadNexusFile ( )
privatevirtual

Will read the NeXuS File Format as soon as PSI will have an implementation.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 2193 of file PRunDataHandler.cpp.

References nxs::checkHDFType(), fRunPathName, nxs::HDF4, nxs::HDF5, ReadNexusFileIdf1(), ReadNexusFileIdf2(), and nxs::Unknown.

Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().

◆ ReadNexusFileIdf1()

template<typename T>
Bool_t PRunDataHandler::ReadNexusFileIdf1 ( T & nxs_file)
private

Reads a NeXus file with IDF version 1 format.

Extracts run metadata (laboratory, beamline, instrument, run title, run number, temperature, field, sample info, time resolution, start/stop times) and histogram data from the NeXus file structure.

Template Parameters
TNeXus file handler type (std::unique_ptr<nxH4::PNeXus> and std::unique_ptr<nxH5::PNeXus>)
Parameters
nxs_filereference to the NeXus file handler

return:

  • true at successful reading,
  • otherwise false.

Definition at line 491 of file PRunDataHandler.h.

References PRawRunDataSet::Clear(), fData, fRunName, PMUSR_UNDEFINED, PRawRunData::SetBeamline(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetDeadTimeParam(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunDataSet::SetFirstGoodBin(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetNumberOfGoodFrames(), PRawRunData::SetOrientation(), PRawRunData::SetRingAnode(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetStartDate(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunData::SetTransport(), and SplitTimeDate().

Referenced by ReadNexusFile().

◆ ReadNexusFileIdf2()

◆ ReadPsiBinFile()

Bool_t PRunDataHandler::ReadPsiBinFile ( )
privatevirtual

Reads the old-fashioned PSI-BIN data-files. The MuSR_td_PSI_bin class of Alex Amato is used. In case of problems, please contact alex..nosp@m.amat.nosp@m.o@psi.nosp@m..ch.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 2611 of file PRunDataHandler.cpp.

References PRawRunDataSet::Clear(), DateToISO8601(), fData, fRunName, fRunPathName, MuSR_td_PSI_bin::GetBinWidthNanoSec(), MuSR_td_PSI_bin::GetComment(), MuSR_td_PSI_bin::GetDevTemperaturesVector(), MuSR_td_PSI_bin::GetField(), MuSR_td_PSI_bin::GetFirstGoodVector(), MuSR_td_PSI_bin::GetHistoArrayInt(), MuSR_td_PSI_bin::GetHistoLengthBin(), MuSR_td_PSI_bin::GetLastGoodVector(), MuSR_td_PSI_bin::GetNameHisto(), MuSR_td_PSI_bin::GetNumberHistoInt(), MuSR_td_PSI_bin::GetOrient(), MuSR_td_PSI_bin::GetRunNumberInt(), MuSR_td_PSI_bin::GetSample(), MuSR_td_PSI_bin::GetT0Vector(), MuSR_td_PSI_bin::GetTemp(), MuSR_td_PSI_bin::GetTemperaturesVector(), MuSR_td_PSI_bin::GetTimeStartVector(), MuSR_td_PSI_bin::GetTimeStopVector(), PMUSR_UNDEFINED, MuSR_td_PSI_bin::Read(), PRawRunData::SetBeamline(), PRawRunData::SetComment(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunData::SetFileName(), PRawRunDataSet::SetFirstGoodBin(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetMuonSource(), PRawRunData::SetMuonSpecies(), PRawRunDataSet::SetName(), PRawRunData::SetOrientation(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetStartDate(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), PRawRunData::SetTransport(), and status.

Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().

◆ ReadRootFile()

Bool_t PRunDataHandler::ReadRootFile ( )
privatevirtual

Reads both, the "old" LEM-data ROOT-files with TLemRunHeader, and the more general new MusrRoot file.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 1419 of file PRunDataHandler.cpp.

References PRawRunDataSet::Clear(), PRawRunData::ClearTemperature(), fAny2ManyInfo, fData, fRunName, fRunPathName, TMusrRunPhysicalQuantity::GetError(), TMusrRunPhysicalQuantity::GetUnit(), TMusrRunPhysicalQuantity::GetValue(), MRH_UNDEFINED, POST_PILEUP_HISTO_OFFSET, PRH_LEM_ROOT, PRH_MUSR_ROOT, PRH_MUSR_ROOT_DIR, PRawRunData::SetBeamline(), PRawRunData::SetComment(), PRawRunData::SetCryoName(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunData::SetFileName(), PRawRunDataSet::SetFirstGoodBin(), PRawRunData::SetGenerator(), PRawRunData::SetGenericValidatorUrl(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetMagnetName(), PRawRunData::SetMuonBeamMomentum(), PRawRunData::SetMuonSource(), PRawRunData::SetMuonSpecies(), PRawRunData::SetMuonSpinAngle(), PRawRunDataSet::SetName(), PRawRunData::SetOrientation(), PRawRunData::SetRedGreenOffset(), PRawRunData::SetRingAnode(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetSpecificValidatorUrl(), PRawRunData::SetStartDate(), PRawRunData::SetStartDateTime(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopDateTime(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), PRawRunDataSet::SetTitle(), PRawRunData::SetTransport(), and PRawRunData::SetVersion().

Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().

◆ ReadWkmFile()

◆ ReadWriteFilesList()

Bool_t PRunDataHandler::ReadWriteFilesList ( )
privatevirtual

The main read file routine which is filtering what read sub-routine needs to be called. Called when the input is a list of runs. Used with any2many. If the input data file is successfully read, it will write the converted data file.

return:

  • true if reading was successful,
  • false if reading failed.

Definition at line 561 of file PRunDataHandler.cpp.

References A2M_ASCII, A2M_MUD, A2M_MUSR_ROOT, A2M_MUSR_ROOT_DIR, A2M_NEXUS, A2M_PSIBIN, A2M_PSIMDU, A2M_ROOT, A2M_UNDEFINED, A2M_WKM, fAny2ManyInfo, fData, FileExistsCheck(), FileNameFromTemplate(), fRunPathName, ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), ReadWkmFile(), WriteAsciiFile(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), and WriteWkmFile().

Referenced by ConvertData().

◆ SetRunData()

Bool_t PRunDataHandler::SetRunData ( PRawRunData * data,
UInt_t idx = 0 )
virtual

Sets or replaces run data at specified index.

Allows external modification or replacement of run data. Used in special cases like manual data manipulation or run merging.

Parameters
dataPointer to PRawRunData to store (handler takes ownership)
idxIndex where to store data (default=0)
Returns
True on success, false if index out of range or data invalid
Warning
Handler takes ownership and will delete data on destruction

Set a raw run data set.

Parameters
datapointer to the raw run data set
idxindex to where to write it.
Returns
true in case of success, false otherwise.

Definition at line 332 of file PRunDataHandler.cpp.

References fData.

◆ SplitTimeDate()

void PRunDataHandler::SplitTimeDate ( TString timeData,
TString & time,
TString & date,
Bool_t & ok )
privatevirtual

splits an ISO 8601 timeDate into seperate time and data. The flag ok shows if it was successfull.

Parameters
timeDataISO 8601 timeData
timepart of timeData
datepart of timeData
okflag showing if the splitting was successfull

Definition at line 6754 of file PRunDataHandler.cpp.

Referenced by ReadNexusFileIdf1(), and ReadNexusFileIdf2().

◆ StripWhitespace()

Bool_t PRunDataHandler::StripWhitespace ( TString & str)
privatevirtual

Strip white spaces from a string. The hope is that future TString implementations of ROOT will make this routine obsolate.

Parameters
strstring to be stripped. It will be modified directly on success.

return:

  • true at successful reading,
  • otherwise false.

Definition at line 6295 of file PRunDataHandler.cpp.

Referenced by ReadWkmFile().

◆ TestFileName()

void PRunDataHandler::TestFileName ( TString & runName,
const TString & ext )
privatevirtual

Tests if a file exists (with or without given extension). The given file-name string will be modified to show the found file name or an empty string if no file is found.

Parameters
runNamerun name with full path to be checked
extextension to be checked

Definition at line 942 of file PRunDataHandler.cpp.

Referenced by FileExistsCheck().

◆ ToDouble()

Double_t PRunDataHandler::ToDouble ( TString & str,
Bool_t & ok )
privatevirtual

Convert a string to a Double_t.

return:

  • returns the converted string
  • otherwise 0.0 with ok==false
Parameters
strstring to be converted
oktrue on success, otherwise false.

Definition at line 6396 of file PRunDataHandler.cpp.

References status.

Referenced by ReadWkmFile().

◆ ToInt()

Int_t PRunDataHandler::ToInt ( TString & str,
Bool_t & ok )
privatevirtual

Convert a string to an Int_t.

return:

  • returns the converted string
  • otherwise 0.0 with ok==false
Parameters
strstring to be converted
oktrue on success, otherwise false.

Definition at line 6446 of file PRunDataHandler.cpp.

References status.

Referenced by ReadWkmFile().

◆ WriteAsciiFile()

Bool_t PRunDataHandler::WriteAsciiFile ( TString fln = "")
privatevirtual

Write the ascii-file format.

return:

  • true on successful writting,
  • otherwise false.
Parameters
flnfile name. If empty, the routine will try to construct one

Definition at line 6154 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetTimeZeroBin(), and PMUSR_UNDEFINED.

Referenced by ReadWriteFilesList().

◆ WriteData()

Bool_t PRunDataHandler::WriteData ( TString fileName = "")
virtual

Writes data to file in the specified format.

Writes loaded and (optionally) converted data to an output file. The format is determined by fAny2ManyInfo (for any2many) or fFileFormat.

Supported output formats:

  • ROOT (generic or MusrRoot structure)
  • NeXus (HDF5)
  • WKM, PSI-BIN (legacy formats)
  • MUD (TRIUMF)
  • ASCII (text export)
Parameters
fileNameOutput file name (empty string = auto-generate from input name)
Returns
True on successful write, false on error
Precondition
Data must be loaded (ReadData called)

Write data. This routine is used to write a single file.

Definition at line 353 of file PRunDataHandler.cpp.

References A2M_MUD, A2M_MUSR_ROOT, A2M_MUSR_ROOT_DIR, A2M_NEXUS, A2M_PSIBIN, A2M_PSIMDU, A2M_UNDEFINED, fAny2ManyInfo, WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), and WritePsiBinFile().

◆ WriteMudFile()

Bool_t PRunDataHandler::WriteMudFile ( TString fln = "")
privatevirtual

◆ WriteMusrRootFile()

Bool_t PRunDataHandler::WriteMusrRootFile ( Int_t tag = A2M_MUSR_ROOT_DIR,
TString fln = "" )
privatevirtual

Write the MusrRoot file format. Only the required entries will be handled.

Parameters
tag= A2M_MUSR_ROOT (TFolder MusrRoot, deprecated), = A2M_MUSR_ROOT_DIR (TDirectory MusrRoot).
flnfile name. If empty, the routine will try to construct one
Returns
true on successful writting, false otherwise.

Definition at line 4350 of file PRunDataHandler.cpp.

References A2M_MUSR_ROOT, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetFirstGoodBin(), PRawRunDataSet::GetHistoNo(), PRawRunDataSet::GetLastGoodBin(), PRawRunDataSet::GetName(), PRawRunDataSet::GetTimeZeroBin(), MRH_UNDEFINED, and TMusrRunPhysicalQuantity::Set().

Referenced by ReadWriteFilesList(), and WriteData().

◆ WriteNexusFile()

Bool_t PRunDataHandler::WriteNexusFile ( TString format,
TString fln = "" )
privatevirtual

Write the nexus-file format.

Parameters
flnfile name. If empty, the routine will try to construct one
Returns
true on successful writting, otherwise false.

Definition at line 4807 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), nxs::getIso8601TimestampLocal(), nxH4::kCHAR8, nxH4::kFLOAT32, and nxH4::kINT32.

Referenced by ReadWriteFilesList(), and WriteData().

◆ WritePsiBinFile()

◆ WriteRootFile()

Bool_t PRunDataHandler::WriteRootFile ( TString fln = "")
privatevirtual

Write the PSI LEM root-file format.

return:

  • true on successful writting,
  • otherwise false.
Parameters
flnfile name. If empty, the routine will try to construct one

Definition at line 4619 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), and PRawRunDataSet::GetTimeZeroBin().

Referenced by ReadWriteFilesList().

◆ WriteWkmFile()

Bool_t PRunDataHandler::WriteWkmFile ( TString fln = "")
privatevirtual

Write the wkm-file format.

return:

  • true on successful writting,
  • otherwise false.
Parameters
flnfile name. If empty, the routine will try to construct one

Definition at line 5588 of file PRunDataHandler.cpp.

References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), and PMUSR_UNDEFINED.

Referenced by ReadWriteFilesList().

Member Data Documentation

◆ fAllDataAvailable

Bool_t PRunDataHandler::fAllDataAvailable
private

Flag: true if all requested data files loaded successfully, false if any failed.

Definition at line 424 of file PRunDataHandler.h.

Referenced by ConvertData(), Init(), IsAllDataAvailable(), and ReadData().

◆ fAny2ManyInfo

PAny2ManyInfo* PRunDataHandler::fAny2ManyInfo
private

◆ fData

◆ fDataPath

PStringVector PRunDataHandler::fDataPath
private

Search paths for data files (checked sequentially until file found)

Definition at line 422 of file PRunDataHandler.h.

Referenced by FileExistsCheck(), FileExistsCheck(), FileExistsCheck(), PRunDataHandler(), PRunDataHandler(), PRunDataHandler(), and ~PRunDataHandler().

◆ fFileFormat

TString PRunDataHandler::fFileFormat
private

Explicitly specified file format (overrides auto-detection)

Definition at line 425 of file PRunDataHandler.h.

Referenced by Init(), PRunDataHandler(), PRunDataHandler(), and ReadData().

◆ fMsrInfo

PMsrHandler* PRunDataHandler::fMsrInfo
private

Pointer to MSR file handler (not owned, don't delete)

Definition at line 420 of file PRunDataHandler.h.

Referenced by FileExistsCheck(), Init(), PRunDataHandler(), PRunDataHandler(), ReadData(), and ReadFilesMsr().

◆ fRunName

TString PRunDataHandler::fRunName
private

Current run name being processed (used during file reading)

Definition at line 426 of file PRunDataHandler.h.

Referenced by Init(), ReadAsciiFile(), ReadDatFile(), ReadDBFile(), ReadFilesMsr(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFileIdf1(), ReadNexusFileIdf2(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().

◆ fRunPathName

TString PRunDataHandler::fRunPathName
private

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