Mantid
Loading...
Searching...
No Matches
CreateCalFileByNames.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12
13// To be compatible with MSVC++ Express Edition that does not have TR1 headers
14#include "MantidAPI/Algorithm.h"
15#include "MantidAlgorithms/DllConfig.h"
16#include <map>
17
18namespace Mantid {
19namespace Algorithms {
48class MANTID_ALGORITHMS_DLL CreateCalFileByNames final : public API::Algorithm {
49public:
51 const std::string name() const override { return "CreateCalFileByNames"; }
53 const std::string summary() const override {
54 return "Create a calibration file (extension .cal) for diffraction "
55 "focusing based on the names of the components in the instrument "
56 "tree.";
57 }
58
60 int version() const override { return (1); }
61 const std::vector<std::string> seeAlso() const override {
62 return {"ReadGroupsFromFile", "CreateDummyCalFile", "AlignDetectors", "DiffractionFocussing",
63 "LoadCalFile", "SaveCalFile", "MergeCalFiles"};
64 }
66 const std::string category() const override { return "Diffraction\\DataHandling\\CalFiles"; }
67
68private:
70 using instrcalmap = std::map<int, std::pair<int, int>>;
72 void init() override;
74 void exec() override;
76 std::string m_filename;
80 bool groupingFileDoesExist(const std::string &filename) const;
81 void saveGroupingFile(const std::string &, bool overwrite) const;
82 static void writeCalEntry(std::ostream &os, int number, int udet, double offset, int select, int group);
83 void writeHeaders(std::ostream &os, const std::string &filename, bool overwrite) const;
85 std::string groups;
90};
91
92} // namespace Algorithms
93} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Create a calibration file for diffraction focussing (*.cal old Ariel format) based on list of names o...
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
std::string m_filename
The name and path of the input file.
std::string groups
The names of the groups.
std::map< int, std::pair< int, int > > instrcalmap
Calibration entries map.
const std::string summary() const override
Summary of algorithms purpose.
instrcalmap instrcalib
Calibration map used if the *.cal file exist.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string name() const override
Algorithm's name.
Helper class which provides the Collimation Length for SANS instruments.