Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::API::FileBackedExperimentInfo Class Reference

Implements a lazy-loading mechanism for the experimental information stored in a NeXus file. More...

#include <FileBackedExperimentInfo.h>

Inheritance diagram for Mantid::API::FileBackedExperimentInfo:
Mantid::API::ExperimentInfo

Public Member Functions

ExperimentInfocloneExperimentInfo () const override
 This clones the FileBackedExperimentInfo and will not cause a load of the information. More...
 
 FileBackedExperimentInfo (std::string filename, std::string nxpath)
 Create an object based on a NeXus file and path. More...
 
- Public Member Functions inherited from Mantid::API::ExperimentInfo
virtual ExperimentInfocloneExperimentInfo () const
 Clone us. More...
 
const Geometry::ComponentInfocomponentInfo () const
 
const Geometry::ParameterMapconstInstrumentParameters () const
 Const version. More...
 
void copyExperimentInfoFrom (const ExperimentInfo *other)
 Copy everything from the given experiment object. More...
 
const Geometry::DetectorInfodetectorInfo () const
 Return a const reference to the DetectorInfo object. More...
 
 ExperimentInfo ()
 Default constructor. More...
 
 ExperimentInfo (const ExperimentInfo &)
 Copy constructor. More...
 
std::string getAvailableWorkspaceEndDate () const
 Return workspace end date as a formatted string (strftime style, as returned by Kernel::DateAdnTime) string, if available. More...
 
std::string getAvailableWorkspaceStartDate () const
 Return workspace start date as a formatted string (strftime, as returned by Types::Core::DateAndTime) string, if available. More...
 
double getEFixed (const detid_t detID) const
 Easy access to the efixed value for this run & detector ID. More...
 
double getEFixed (const std::shared_ptr< const Geometry::IDetector > &detector=std::shared_ptr< const Geometry::IDetector >{nullptr}) const
 Easy access to the efixed value for this run & optional detector. More...
 
double getEFixedForIndirect (const std::shared_ptr< const Geometry::IDetector > &detector, const std::vector< std::string > &parameterNames) const
 
double getEFixedGivenEMode (const std::shared_ptr< const Geometry::IDetector > &detector, const Kernel::DeltaEMode::Type emode) const
 Easy access to the efixed value for this run & detector. More...
 
Kernel::DeltaEMode::Type getEMode () const
 Returns the emode for this run. More...
 
Geometry::Instrument_const_sptr getInstrument () const
 Returns the parameterized instrument. More...
 
Kernel::PropertygetLog (const std::string &log) const
 Access a log for this experiment. More...
 
double getLogAsSingleValue (const std::string &log) const
 Access a single value from a log for this experiment. More...
 
int getRunNumber () const
 Utility method to get the run number. More...
 
std::string getWorkspaceStartDate () const
 Returns the start date for this experiment (or current time if no info available) More...
 
Geometry::ParameterMapinstrumentParameters ()
 Returns a modifiable set of instrument parameters. More...
 
const Geometry::ParameterMapinstrumentParameters () const
 Returns the set of parameters modifying the base instrument (const-version) More...
 
void invalidateSpectrumDefinition (const size_t index)
 Notifies the ExperimentInfo that a spectrum definition has changed. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Loads an experiment description from the open NeXus file. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file)
 Load the instrument from an open NeXus file without reading any parameters. More...
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Load the instrument from an open NeXus file. More...
 
void loadInstrumentParametersNexus (::NeXus::File *file, std::string &parameterStr)
 Load instrument parameters from an open Nexus file in Instument group if found there. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file)
 Load the sample and log info from an open NeXus file. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 Load the sample and log info from an open NeXus file. More...
 
Geometry::ComponentInfomutableComponentInfo ()
 
Geometry::DetectorInfomutableDetectorInfo ()
 Return a non-const reference to the DetectorInfo object. More...
 
RunmutableRun ()
 Writable version of the run object. More...
 
SamplemutableSample ()
 Writable version of the sample object. More...
 
SpectrumInfomutableSpectrumInfo ()
 Return a non-const reference to the SpectrumInfo object. More...
 
ExperimentInfooperator= (const ExperimentInfo &)
 Implements the copy assignment operator. More...
 
void populateInstrumentParameters ()
 Add parameters to the instrument parameter map that are defined in instrument definition file or parameter file, which may contain parameters that require logfile data to be available. More...
 
void readParameterMap (const std::string &parameterStr)
 Populate the parameter map given a string. More...
 
const Runrun () const
 Run details object access. More...
 
const Samplesample () const
 Sample accessors. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveInstrument, bool saveSample, bool saveLogs) const
 Saves this experiment description to the open NeXus file. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveLegacyInstrument=true) const
 Saves this experiment description to the open NeXus file. More...
 
void setDetectorGrouping (const size_t index, const std::set< detid_t > &detIDs) const
 Sets the detector grouping for the spectrum with the given index. More...
 
void setEFixed (const detid_t detID, const double value)
 Set the efixed value for a given detector ID. More...
 
void setInstrument (const Geometry::Instrument_const_sptr &instr)
 Instrument accessors. More...
 
void setNumberOfDetectorGroups (const size_t count) const
 Sets the number of detector groups. More...
 
void setSharedRun (Kernel::cow_ptr< Run > run)
 Set the run object. Use in particular to clear run without copying old run. More...
 
Kernel::cow_ptr< RunsharedRun ()
 Return the cow ptr of the run. More...
 
const SpectrumInfospectrumInfo () const
 Return a reference to the SpectrumInfo object. More...
 
const std::string toString () const
 Returns a string description of the object. More...
 
void updateSpectrumDefinitionIfNecessary (const size_t index) const
 
virtual ~ExperimentInfo ()
 Virtual destructor. More...
 

Private Member Functions

void populateFromFile () const
 Populate this object with the data from the file. More...
 
void populateIfNotLoaded () const override
 Check if the object has been populated and load the information if it has not. More...
 

Private Attributes

std::string m_filename
 
bool m_loaded
 
std::string m_nxpath
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::ExperimentInfo
size_t numberOfDetectorGroups () const
 Returns the number of detector groups. More...
 
virtual void populateIfNotLoaded () const
 Called as the first operation of most public methods. More...
 
void setSpectrumDefinitions (Kernel::cow_ptr< std::vector< SpectrumDefinition > > spectrumDefinitions)
 Sets the SpectrumDefinition for all spectra. More...
 
virtual void updateCachedDetectorGrouping (const size_t index) const
 Update detector grouping for spectrum with given index. More...
 
- Protected Attributes inherited from Mantid::API::ExperimentInfo
std::shared_ptr< Geometry::ParameterMapm_parmap
 Parameters modifying the base instrument. More...
 
Geometry::Instrument_const_sptr sptr_instrument
 The base (unparametrized) instrument. More...
 

Detailed Description

Implements a lazy-loading mechanism for the experimental information stored in a NeXus file.

Definition at line 19 of file FileBackedExperimentInfo.h.

Constructor & Destructor Documentation

◆ FileBackedExperimentInfo()

Mantid::API::FileBackedExperimentInfo::FileBackedExperimentInfo ( std::string  filename,
std::string  nxpath 
)

Create an object based on a NeXus file and path.

Parameters
filenameThe full path to the file
nxpathPath to the location of the experiment information

Definition at line 30 of file FileBackedExperimentInfo.cpp.

Member Function Documentation

◆ cloneExperimentInfo()

ExperimentInfo * Mantid::API::FileBackedExperimentInfo::cloneExperimentInfo ( ) const
overridevirtual

This clones the FileBackedExperimentInfo and will not cause a load of the information.

Returns
A clone of the object.

Reimplemented from Mantid::API::ExperimentInfo.

Definition at line 38 of file FileBackedExperimentInfo.cpp.

◆ populateFromFile()

void Mantid::API::FileBackedExperimentInfo::populateFromFile ( ) const
private

Populate this object with the data from the file.

Definition at line 53 of file FileBackedExperimentInfo.cpp.

References Mantid::API::ExperimentInfo::loadExperimentInfoNexus(), m_filename, m_loaded, m_nxpath, and Mantid::API::ExperimentInfo::readParameterMap().

Referenced by populateIfNotLoaded().

◆ populateIfNotLoaded()

void Mantid::API::FileBackedExperimentInfo::populateIfNotLoaded ( ) const
overrideprivatevirtual

Check if the object has been populated and load the information if it has not.

Reimplemented from Mantid::API::ExperimentInfo.

Definition at line 44 of file FileBackedExperimentInfo.cpp.

References m_loaded, and populateFromFile().

Member Data Documentation

◆ m_filename

std::string Mantid::API::FileBackedExperimentInfo::m_filename
private

Definition at line 29 of file FileBackedExperimentInfo.h.

Referenced by populateFromFile().

◆ m_loaded

bool Mantid::API::FileBackedExperimentInfo::m_loaded
mutableprivate

Definition at line 28 of file FileBackedExperimentInfo.h.

Referenced by populateFromFile(), and populateIfNotLoaded().

◆ m_nxpath

std::string Mantid::API::FileBackedExperimentInfo::m_nxpath
private

Definition at line 30 of file FileBackedExperimentInfo.h.

Referenced by populateFromFile().


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