Mantid
Loading...
Searching...
No Matches
MaskDetectorsIf.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#include "MantidAPI/Algorithm.h"
13#include "MantidAlgorithms/DllConfig.h"
15#include <boost/function.hpp>
16
17// To be compatible with VSC Express edition that does not have tr1
18
19#include <unordered_map>
20
21namespace Mantid {
22namespace Algorithms {
32class MANTID_ALGORITHMS_DLL MaskDetectorsIf final : public API::Algorithm {
33public:
35 const std::string name() const override { return "MaskDetectorsIf"; }
37 const std::string summary() const override {
38 return "Masks detectors depending on the values in the input workspace.";
39 }
40
42 int version() const override { return 1; }
43 const std::vector<std::string> seeAlso() const override { return {"MaskDetectors"}; }
45 const std::string category() const override { return "Diffraction\\Masking;Transforms\\Masking"; }
46
47private:
49 using udet2valuem = std::unordered_map<detid_t, bool>;
53 bool m_select_on = false;
55 double m_value = 0.0;
59 boost::function<bool(double, double)> m_compar_f;
60 void outputToWorkspace();
61 void retrieveProperties();
62 void createNewCalFile();
63 void init() override;
64 void exec() override;
65 std::map<std::string, std::string> validateInputs() override;
66};
67
68} // namespace Algorithms
69} // namespace Mantid
const std::string & m_value
Definition: Algorithm.cpp:71
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This algorithm is used to select/deselect detectors in a *.cal file.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
boost::function< bool(double, double)> m_compar_f
A comparator function.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
int version() const override
Algorithm's version for identification overriding a virtual method.
API::MatrixWorkspace_const_sptr m_inputW
The input workspace.
std::unordered_map< detid_t, bool > udet2valuem
Typedef for det to value map.
const std::string summary() const override
Summary of algorithms purpose.
udet2valuem m_umap
A map from detid to selection.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.