Mantid
Loading...
Searching...
No Matches
Framework
Geometry
inc
MantidGeometry
Instrument
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
12
using
Mantid::Kernel::Quat
;
13
using
Mantid::Kernel::V3D
;
14
15
namespace
Mantid
{
16
namespace
Geometry {
17
32
template
<
typename
T>
class
DetectorInfoItem
{
33
34
public
:
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.
59
T *
m_detectorInfo
;
60
size_t
m_index
;
61
};
62
63
}
// namespace Geometry
64
}
// namespace Mantid
Quat.h
V3D.h
Mantid::Geometry::DetectorInfoItem
DetectorInfoItem.
Definition:
DetectorInfoItem.h:32
Mantid::Geometry::DetectorInfoItem::index
size_t index() const
Definition:
DetectorInfoItem.h:53
Mantid::Geometry::DetectorInfoItem::m_index
size_t m_index
Definition:
DetectorInfoItem.h:60
Mantid::Geometry::DetectorInfoItem::l2
double l2() const
Definition:
DetectorInfoItem.h:51
Mantid::Geometry::DetectorInfoItem::isMonitor
bool isMonitor() const
Definition:
DetectorInfoItem.h:36
Mantid::Geometry::DetectorInfoItem::twoTheta
double twoTheta() const
Definition:
DetectorInfoItem.h:45
Mantid::Geometry::DetectorInfoItem::isMasked
bool isMasked() const
Definition:
DetectorInfoItem.h:38
Mantid::Geometry::DetectorInfoItem::rotation
Mantid::Kernel::Quat rotation() const
Definition:
DetectorInfoItem.h:49
Mantid::Geometry::DetectorInfoItem::m_detectorInfo
T * m_detectorInfo
Definition:
DetectorInfoItem.h:59
Mantid::Geometry::DetectorInfoItem::setMasked
void setMasked(bool masked)
Definition:
DetectorInfoItem.h:40
Mantid::Geometry::DetectorInfoItem::DetectorInfoItem
DetectorInfoItem(T &detectorInfo, const size_t index)
Definition:
DetectorInfoItem.h:55
Mantid::Geometry::DetectorInfoItem::position
Mantid::Kernel::V3D position() const
Definition:
DetectorInfoItem.h:47
Mantid::Kernel::Quat
Class for quaternions.
Definition:
Quat.h:39
Mantid::Kernel::V3D
Class for 3D vectors.
Definition:
V3D.h:34
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition:
AbsorptionCorrection.h:18
Generated on Tue Jan 3 2023 11:57:47 for Mantid by
1.9.5