-
Notifications
You must be signed in to change notification settings - Fork 122
/
LoadCalFile.h
65 lines (49 loc) · 2.08 KB
/
LoadCalFile.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
#ifndef MANTID_DATAHANDLING_LOADCALFILE_H_
#define MANTID_DATAHANDLING_LOADCALFILE_H_
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IAlgorithm.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidDataObjects/GroupingWorkspace.h"
#include "MantidDataObjects/MaskWorkspace.h"
#include "MantidDataObjects/OffsetsWorkspace.h"
#include "MantidGeometry/Instrument.h"
#include "MantidKernel/System.h"
namespace Mantid
{
namespace DataHandling
{
/** Algorithm to load a 5-column ascii .cal file into up to 3 workspaces:
* a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
*
* @author Janik Zikovsky
* @date 2011-05-09
*/
class DLLExport LoadCalFile : public API::Algorithm
{
public:
LoadCalFile();
~LoadCalFile();
/// Algorithm's name for identification
virtual const std::string name() const { return "LoadCalFile";};
///Summary of algorithms purpose
virtual const std::string summary() const {return "Loads a 5-column ASCII .cal file into up to 3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.";}
/// Algorithm's version for identification
virtual int version() const { return 1;};
/// Algorithm's category for identification
virtual const std::string category() const { return "DataHandling\\Text;Diffraction";}
static void getInstrument3WaysInit(Mantid::API::Algorithm * alg);
static Geometry::Instrument_const_sptr getInstrument3Ways(API::Algorithm * alg);
static void readCalFile(const std::string& calFileName,
Mantid::DataObjects::GroupingWorkspace_sptr groupWS, Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
Mantid::DataObjects::MaskWorkspace_sptr maskWS);
private:
/// Initialise the properties
void init();
/// Run the algorithm
void exec();
/// Checks if a detector ID is for a monitor on a given instrument
static bool idIsMonitor(Mantid::Geometry::Instrument_const_sptr inst, int detID);
};
} // namespace Mantid
} // namespace DataHandling
#endif /* MANTID_DATAHANDLING_LOADCALFILE_H_ */