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

Please see the .cpp file for more information. More...

#include <ORNLDataArchive.h>

Inheritance diagram for Mantid::DataHandling::ORNLDataArchive:
Mantid::API::IArchiveSearch

Public Member Functions

std::string getArchivePath (const std::set< std::string > &basenames, const std::vector< std::string > &suffixes) const override
 
void setONCat (ONCat_uptr oncat)
 
- Public Member Functions inherited from Mantid::API::IArchiveSearch
virtual std::string getArchivePath (const std::set< std::string > &filenames, const std::vector< std::string > &exts) const =0
 Return the full path to a data file in an archive. More...
 
virtual ~IArchiveSearch ()=default
 Virtual destructor. More...
 

Private Attributes

ONCat_uptr m_oncat = nullptr
 

Detailed Description

Please see the .cpp file for more information.

Definition at line 26 of file ORNLDataArchive.h.

Member Function Documentation

◆ getArchivePath()

std::string Mantid::DataHandling::ORNLDataArchive::getArchivePath ( const std::set< std::string > &  basenames,
const std::vector< std::string > &  suffixes 
) const
overridevirtual

PLEASE READ THIS


This archive searcher retrieves SNS / HFIR run locations from ONCat.

Something to bear in mind here, however, is that the signature of IArchiveSearch's getArchivePath is quite counter-intuitive, and so probably shouldn't be used as an aid to understanding. This is because:

1) It claims to deal in "filenames" and "exts", but in reality "basenames" and "suffixes" would be more accurate terms. (In general, "[INST]_[RUN]" is the format of expected "filenames", and "_event.nxs" is one example of a possible "extension".) I've just gone ahead and started using the more accurate terms here.

2) It accepts a collection of basenames, but can only ever output a single file path. An inspection of the surrounding code in FileFinder will show that this has been done as a workaround to accomodate caseless- searching of directories on platforms where case make a difference.

(So, when it says "getArchivePath", it really does mean path – if you want to search for a range of runs then you will either have to extend the interface, or make multiple calls to the existing one.)

3) The implementation for SNS / ORNL has never (and will never) require all the basenames passed to it – it just discards all but the first and then uses that.

4) In the cases where multiple versions of a raw run file exist in the archive, we will have only ever ingested one of them into ONCat. (Where, for example, "*_event.nxs" takes precedence over "*_histo.nxs".) For this reason, a collection of suffixes is not exactly necessary, either.

What we're actually doing here then is a best-effort with the information we're given', and returning only the location of the files we know about. We'll parse the run number and the instrument, and then make sure the location ends in one of the expected suffixes.

Parameters
basenames: A set of basenames to check against. Only the first will be used.
suffixes: List of extensions to check against.
Returns
The first matching location of an archived raw datafile, else an empty string.

Implements Mantid::API::IArchiveSearch.

Definition at line 99 of file ORNLDataArchive.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, and Mantid::Kernel::SingletonHolder< T >::Instance().

◆ setONCat()

void Mantid::DataHandling::ORNLDataArchive::setONCat ( ONCat_uptr  oncat)

Definition at line 198 of file ORNLDataArchive.cpp.

References m_oncat.

Member Data Documentation

◆ m_oncat

ONCat_uptr Mantid::DataHandling::ORNLDataArchive::m_oncat = nullptr
private

Definition at line 38 of file ORNLDataArchive.h.

Referenced by setONCat().


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