Newer
Older
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTID_DATAHANDLING_LOADPSIMUONBIN_H_
#define MANTID_DATAHANDLING_LOADPSIMUONBIN_H_
#include "MantidAPI/IFileLoader.h"
#include "MantidDataHandling/LoadRawHelper.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/BinaryStreamReader.h"
/** LoadPSIMuonBin : Loads a bin file from the PSI facility for muon
spectroscopy
namespace Mantid {
namespace DataHandling {
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
int16_t tdcResolution;
int16_t tdcOverflow;
int16_t numberOfRuns;
int16_t lengthOfHistograms;
int16_t numberOfHistograms;
int32_t totalEvents;
float histogramBinWidth;
int32_t monNumberOfevents;
int16_t numberOfDataRecordsFile;
int16_t lengthOfDataRecordsBin;
int16_t numberOfDataRecordsHistogram;
int16_t numberOfHistogramsPerRecord;
int32_t periodOfSave;
int32_t periodOfMon;
std::string sample;
std::string temp;
std::string field;
std::string orientation;
std::string comment;
std::string dateStart;
std::string dateEnd;
std::string timeStart;
std::string timeEnd;
std::string monDeviation;
int32_t scalars[18];
std::string labels_scalars[18]; // 18 Strings with 4 max length
int32_t labelsOfHistograms[16];
int16_t integerT0[16];
int16_t firstGood[16];
int16_t lastGood[16];
float realT0[16];
float temperatures[4];
float temperatureDeviation[4];
float monLow[4];
float monHigh[4];
};
class DLLExport LoadPSIMuonBin
: public API::IFileLoader<Kernel::FileDescriptor> {
public:
const std::string name() const override;
const std::string summary() const override;
int version() const override;
const std::string category() const override;
int confidence(Kernel::FileDescriptor &descriptor) const override;
bool loadMutipleAsOne() override;
private:
void init() override;
void exec() override;
std::string getFormattedDateTime(std::string date, std::string time);
void assignOutputWorkspaceParticulars(
DataObjects::Workspace2D_sptr &outputWorkspace);
void readSingleVariables(Mantid::Kernel::BinaryStreamReader &streamReader);
void readStringVariables(Mantid::Kernel::BinaryStreamReader &streamReader);
void readArrayVariables(Mantid::Kernel::BinaryStreamReader &streamReader);
void readInHeader(Mantid::Kernel::BinaryStreamReader &streamReader);
void readInHistograms(Mantid::Kernel::BinaryStreamReader &streamReader);
void generateUnknownAxis();
std::vector<std::vector<double>> m_histograms;
std::vector<double> m_xAxis;
std::vector<std::vector<double>> m_eAxis;
} // namespace DataHandling
} // namespace Mantid
#endif /*MANTID_DATAHANDLING_LOADPSIMUONBIN_H_*/