Mantid
Loading...
Searching...
No Matches
DetectorInfoItem.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#include "MantidKernel/Quat.h"
10#include "MantidKernel/V3D.h"
11
14
15namespace Mantid {
16namespace Geometry {
17
32template <typename T> class DetectorInfoItem {
33
34public:
35 // Methods that can be accessed via the iterator
36 bool isMonitor() const { return m_detectorInfo->isMonitor(m_index); }
37
38 bool isMasked() const { return m_detectorInfo->isMasked(m_index); }
39
40 void setMasked(bool masked) {
41 static_assert(!std::is_const<T>::value, "Operation disabled on const T");
42 return m_detectorInfo->setMasked(m_index, masked);
43 }
44
45 double twoTheta() const { return m_detectorInfo->twoTheta(m_index); }
46
47 Mantid::Kernel::V3D position() const { return m_detectorInfo->position(m_index); }
48
49 Mantid::Kernel::Quat rotation() const { return m_detectorInfo->rotation(m_index); }
50
51 double l2() const { return m_detectorInfo->l2(m_index); }
52
53 size_t index() const { return m_index; }
54
55 DetectorInfoItem(T &detectorInfo, const size_t index) : m_detectorInfo(&detectorInfo), m_index(index) {}
56
57 // Non-owning pointer. A reference makes the class unable to define an
58 // assignment operator that we need.
60 size_t m_index;
61};
62
63} // namespace Geometry
64} // namespace Mantid
Mantid::Kernel::Quat rotation() const
DetectorInfoItem(T &detectorInfo, const size_t index)
Mantid::Kernel::V3D position() const
Class for quaternions.
Definition: Quat.h:39
Class for 3D vectors.
Definition: V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.