-
Notifications
You must be signed in to change notification settings - Fork 122
/
LoadInstrument.h
88 lines (75 loc) · 2.78 KB
/
LoadInstrument.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/DistributedAlgorithm.h"
/// @cond Exclude from doxygen documentation
namespace Poco {
namespace XML {
class Element;
}
} // namespace Poco
/// @endcond
namespace Mantid {
namespace Kernel {
class V3D;
}
namespace API {
class MatrixWorkspace;
}
namespace Geometry {
class CompAssembly;
class Component;
class CSGObject;
class ObjComponent;
class Instrument;
} // namespace Geometry
namespace DataHandling {
/** @class LoadInstrument LoadInstrument.h DataHandling/LoadInstrument.h
Loads instrument data from an XML or Nexus instrument description file and adds
it to a workspace.
LoadInstrument is an algorithm and as such inherits
from the Algorithm class and overrides the init() & exec() methods.
Required Properties:
<UL>
<LI> Workspace - The name of the workspace </LI>
<LI> Filename - The name of the instrument file <b>OR</b> InstrumentName - The
name of the instrument</LI>
</UL>
@author Nick Draper, Tessella Support Services plc
@date 19/11/2007
@author Anders Markvardsen, ISIS, RAL
@date 7/3/2008
*/
class DLLExport LoadInstrument : public API::DistributedAlgorithm {
public:
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadInstrument"; };
/// Summary of algorithms purpose
const std::string summary() const override {
return "Loads an Instrument Definition File (IDF) into a workspace. After "
"the IDF has been read this algorithm will attempt to run the Child "
"Algorithm LoadParameterFile; where if IDF filename is of the form "
"IDENTIFIER_Definition.xml then the instrument parameters in the "
"file named IDENTIFIER_Parameters.xml would be loaded.";
}
/// Algorithm's version for identification overriding a virtual method
int version() const override { return 1; };
const std::vector<std::string> seeAlso() const override {
return {"LoadInstrumentFromNexus", "LoadInstrumentFromRaw", "ExportGeometry", "Load"};
}
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override { return "DataHandling\\Instrument"; }
private:
void init() override;
void exec() override;
/// Run the Child Algorithm LoadParameters
void runLoadParameterFile(const std::shared_ptr<API::MatrixWorkspace> &ws, const std::string &filename);
/// Mutex to avoid simultaneous access
static std::recursive_mutex m_mutex;
};
} // namespace DataHandling
} // namespace Mantid