Mantid
Loading...
Searching...
No Matches
LoadDetectorInfo.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidDataHandling/DllConfig.h"
13
14namespace Mantid {
15namespace DataHandling {
16
17class MANTID_DATAHANDLING_DLL LoadDetectorInfo final : public API::Algorithm {
18public:
20
22 const std::string name() const override { return "LoadDetectorInfo"; }
24 const std::string summary() const override {
25 return "Loads delay times, tube pressures, tube wall thicknesses and, if "
26 "necessary, the detectors positions from a given special format "
27 "file";
28 }
29
31 int version() const override { return 1; }
32 const std::vector<std::string> seeAlso() const override { return {"LoadRaw", "LoadNexus"}; }
34 const std::string category() const override { return "DataHandling\\Raw"; }
35
36private:
39 struct DetectorInfo {
40 std::vector<detid_t> ids;
41 std::vector<int32_t> codes;
42 std::vector<double> delays;
43 std::vector<double> l2, theta, phi;
44 std::vector<double> pressures, thicknesses;
45 };
46
47 void init() override;
48 void exec() override;
49
51 void cacheInputs();
53 void loadFromDAT(const std::string &filename);
55 void loadFromRAW(const std::string &filename);
57 void loadFromIsisNXS(const std::string &filename);
59 void readLibisisNxs(::NeXus::File &nxsFile, DetectorInfo &detInfo) const;
61 void readNXSDotDat(::NeXus::File &nxsFile, DetectorInfo &detInfo) const;
62
64 void updateParameterMap(Geometry::DetectorInfo &detectorInfo, const size_t detIndex, Geometry::ParameterMap &pmap,
65 const double l2, const double theta, const double phi, const double delay,
66 const double pressure, const double thickness) const;
67
77
84};
85
86} // namespace DataHandling
87} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
double m_instThickness
Wall thickness value set on the instrument level.
double m_instDelta
Delta value that has been set on the instrument.
Geometry::Instrument_const_sptr m_baseInstrument
Cached instrument for this workspace.
int version() const override
Algorithm's version for identification overriding a virtual method.
bool m_moveDets
If set to true then update the detector positions base on the information in the given file.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Kernel::V3D m_samplePos
Cached sample position for this workspace.
const std::string summary() const override
Summary of algorithms purpose.
API::MatrixWorkspace_sptr m_workspace
store a pointer to the user selected workspace
double m_instPressure
Pressure value set on the instrument level.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
Definition: DetectorInfo.h:49
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
Helper class which provides the Collimation Length for SANS instruments.
Generate a tableworkspace to store the calibration results.
Simple data holder for passing the detector info around when dealing with the NeXus data.