-
Notifications
You must be signed in to change notification settings - Fork 122
/
LoadMuonNexus2.h
105 lines (87 loc) · 3.93 KB
/
LoadMuonNexus2.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef MANTID_DATAHANDLING_LOADMUONNEXUS2_H_
#define MANTID_DATAHANDLING_LOADMUONNEXUS2_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidNexus/NexusClasses.h"
namespace Mantid {
namespace DataHandling {
/**
Loads an file in NeXus Muon format version 1 and 2 and stores it in a 2D
workspace
(Workspace2D class). LoadMuonNexus is an algorithm and as such inherits
from the Algorithm class, via DataHandlingCommand, and overrides
the init() & exec() methods.
Required Properties:
<UL>
<LI> Filename - The name of and path to the input NeXus file </LI>
<LI> OutputWorkspace - The name of the workspace in which to store the imported
data
(a multiperiod file will store higher periods in workspaces called
OutputWorkspace_PeriodNo)
[ not yet implemented for NeXus ]</LI>
</UL>
Optional Properties: (note that these options are not available if reading a
multiperiod file)
<UL>
<LI> spectrum_min - The spectrum to start loading from</LI>
<LI> spectrum_max - The spectrum to load to</LI>
<LI> spectrum_list - An ArrayProperty of spectra to load</LI>
<LI> auto_group - Determines whether the spectra are automatically grouped
together based on the groupings in the NeXus file. </LI>
</UL>
Copyright © 2007-2010 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LoadMuonNexus2 : public LoadMuonNexus {
public:
/// Default constructor
LoadMuonNexus2();
/// Algorithm's name for identification overriding a virtual method
const std::string name() const override { return "LoadMuonNexus"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
"file Version 2 and use the results to populate the named "
"workspace. LoadMuonNexus may be invoked by LoadNexus if it is "
"given a NeXus file of this type.";
}
/// Algorithm's version for identification overriding a virtual method
int version() const override { return 2; }
/// Algorithm's category for identification overriding a virtual method
const std::string category() const override {
return "DataHandling\\Nexus;Muon\\DataHandling";
}
/// Returns a confidence value that this algorithm can load a file
int confidence(Kernel::NexusDescriptor &descriptor) const override;
private:
/// Overwrites Algorithm method
void exec() override;
/// Execute this version of the algorithm
void doExec();
void loadData(const Mantid::NeXus::NXInt &counts,
const std::vector<double> &timeBins, int wsIndex, int period,
int spec, API::MatrixWorkspace_sptr localWorkspace);
void loadLogs(API::MatrixWorkspace_sptr ws, Mantid::NeXus::NXEntry &entry,
int period);
void loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace);
std::map<int, std::set<int>>
loadDetectorMapping(const Mantid::NeXus::NXInt &spectrumIndex);
};
} // namespace DataHandling
} // namespace Mantid
#endif /*MANTID_DATAHANDLING_LOADMUONNEXUS2_H_*/