Mantid
Loading...
Searching...
No Matches
CreateDummyCalFile.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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// To be compatible with MSVC++ Express Edition that does not have TR1 headers
10#include "MantidAPI/Algorithm.h"
11#include "MantidAlgorithms/DllConfig.h"
12#include <map>
13
14namespace Mantid {
15namespace Algorithms {
44class MANTID_ALGORITHMS_DLL CreateDummyCalFile final : public API::Algorithm {
45public:
47 const std::string name() const override { return "CreateDummyCalFile"; }
49 const std::string summary() const override {
50 return "Create a calibration file (extension .cal) from a workspace by "
51 "harvesting the detector ids from the instrument. All of the "
52 "offsets will be zero, and the pixels will be all grouped into "
53 "group one and the final column should be one. This will allow "
54 "generating powder patterns from instruments that have not done a "
55 "proper calibration.";
56 }
57
59 int version() const override { return (1); }
60 const std::vector<std::string> seeAlso() const override {
61 return {"ReadGroupsFromFile", "CreateCalFileByNames", "AlignDetectors", "DiffractionFocussing",
62 "LoadCalFile", "SaveCalFile", "MergeCalFiles"};
63 }
65 const std::string category() const override { return "Diffraction\\DataHandling\\CalFiles"; }
66
67private:
69 using instrcalmap = std::map<int, std::pair<int, int>>;
71 void init() override;
73 void exec() override;
75 std::string m_filename;
79 bool groupingFileDoesExist(const std::string &filename) const;
80 void saveGroupingFile(const std::string &, bool overwrite) const;
81 static void writeCalEntry(std::ostream &os, int number, int udet, double offset, int select, int group);
82 void writeHeaders(std::ostream &os, const std::string &filename, bool overwrite) const;
84 std::string groups;
89};
90
91} // namespace Algorithms
92} // 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::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.
instrcalmap instrcalib
Calibration map used if the *.cal file exist.
std::string m_filename
The name and path of the input file.
const std::string category() const override
Algorithm's category for identification.
std::map< int, std::pair< int, int > > instrcalmap
Calibration entries map.
std::string groups
The names of the groups.
int version() const override
Algorithm's version.
const std::string summary() const override
Summary of algorithms purpose.
Helper class which provides the Collimation Length for SANS instruments.