Mantid
Loading...
Searching...
No Matches
InstrumentVisitor.cpp
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 +
8#include "MantidBeamline/ComponentInfo.h"
9#include "MantidBeamline/DetectorInfo.h"
23
24#include <algorithm>
25#include <memory>
26#include <numeric>
27
28namespace Mantid::Geometry {
29
30namespace {
31std::shared_ptr<const std::unordered_map<detid_t, size_t>> makeDetIdToIndexMap(const std::vector<detid_t> &detIds) {
32
33 const size_t nDetIds = detIds.size();
34 auto detIdToIndex = std::make_shared<std::unordered_map<detid_t, size_t>>();
35 detIdToIndex->reserve(nDetIds);
36 for (size_t i = 0; i < nDetIds; ++i) {
37 (*detIdToIndex)[detIds[i]] = i;
38 }
39 return detIdToIndex;
40}
41
42void clearLegacyParameters(ParameterMap *pmap, const IComponent &comp) {
43 if (!pmap)
44 return;
45 pmap->clearParametersByName(ParameterMap::pos(), &comp);
46 pmap->clearParametersByName(ParameterMap::posx(), &comp);
47 pmap->clearParametersByName(ParameterMap::posy(), &comp);
48 pmap->clearParametersByName(ParameterMap::posz(), &comp);
49 pmap->clearParametersByName(ParameterMap::rot(), &comp);
50 pmap->clearParametersByName(ParameterMap::rotx(), &comp);
51 pmap->clearParametersByName(ParameterMap::roty(), &comp);
52 pmap->clearParametersByName(ParameterMap::rotz(), &comp);
53 pmap->clearParametersByName(ParameterMap::scale(), &comp);
54}
55
56bool hasValidShape(const ObjCompAssembly &obj) {
57 const auto *shape = obj.shape().get();
58 return shape != nullptr && shape->hasValidShape();
59}
60
65Beamline::PixelGridComponent makePixelGridComponent(const GridDetector &grid) {
66 Beamline::PixelGridComponent pixelGrid;
67 pixelGrid.nX = grid.xpixels();
68 pixelGrid.nY = grid.ypixels();
69 pixelGrid.nZ = grid.zpixels();
70 pixelGrid.xStart = grid.xstart();
71 pixelGrid.yStart = grid.ystart();
72 pixelGrid.zStart = grid.zstart();
73 pixelGrid.xStep = grid.xstep();
74 pixelGrid.yStep = grid.ystep();
75 pixelGrid.zStep = grid.zstep();
76 pixelGrid.idStart = grid.idstart();
77 pixelGrid.idStep = grid.idstep();
78 pixelGrid.idStepByRow = grid.idstepbyrow();
79 pixelGrid.idFillOrder = grid.idFillOrder();
80 pixelGrid.minDetectorID = grid.minDetectorID();
81 pixelGrid.maxDetectorID = grid.maxDetectorID();
82 return pixelGrid;
83}
84} // namespace
85
90InstrumentVisitor::InstrumentVisitor(std::shared_ptr<const Instrument> instrument)
91 : m_orderedDetectorIds(
92 std::make_shared<std::vector<detid_t>>(instrument->getDetectorIDs(false /*Do not skip monitors*/))),
93 m_componentIds(std::make_shared<std::vector<ComponentID>>(m_orderedDetectorIds->size(), nullptr)),
94 m_assemblySortedDetectorIndices(std::make_shared<std::vector<size_t>>()),
95 m_assemblySortedComponentIndices(std::make_shared<std::vector<size_t>>()),
96 m_parentComponentIndices(std::make_shared<std::vector<size_t>>(m_orderedDetectorIds->size(), 0)),
97 m_children(std::make_shared<std::vector<std::vector<size_t>>>()),
98 m_detectorRanges(std::make_shared<std::vector<std::pair<size_t, size_t>>>()),
99 m_componentRanges(std::make_shared<std::vector<std::pair<size_t, size_t>>>()),
100 m_componentIdToIndexMap(std::make_shared<std::unordered_map<Mantid::Geometry::IComponent const *, size_t>>()),
101 m_detectorIdToIndexMap(makeDetIdToIndexMap(*m_orderedDetectorIds)),
102 m_positions(std::make_shared<std::vector<Eigen::Vector3d>>()),
103 m_detectorPositions(std::make_shared<std::vector<Eigen::Vector3d>>(m_orderedDetectorIds->size())),
104 m_rotations(std::make_shared<std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eigen::Quaterniond>>>()),
105 m_detectorRotations(
106 std::make_shared<std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eigen::Quaterniond>>>(
107 m_orderedDetectorIds->size())),
108 m_monitorIndices(std::make_shared<std::vector<size_t>>()), m_instrument(std::move(instrument)), m_pmap(nullptr),
109 m_nullShape(std::make_shared<const CSGObject>()),
110 m_shapes(
111 std::make_shared<std::vector<std::shared_ptr<const IObject>>>(m_orderedDetectorIds->size(), m_nullShape)),
112 m_scaleFactors(
113 std::make_shared<std::vector<Eigen::Vector3d>>(m_orderedDetectorIds->size(), Eigen::Vector3d{1, 1, 1})),
114 m_componentType(std::make_shared<std::vector<Beamline::ComponentType>>()),
115 m_names(std::make_shared<std::vector<std::string>>(m_orderedDetectorIds->size())),
116 m_sideBySideViewPositions(std::make_shared<std::map<size_t, Eigen::Vector2d>>()),
117 m_pixelGridComponents(std::make_shared<std::map<size_t, Beamline::PixelGridComponent>>()) {
118 if (m_instrument->isParametrized()) {
119 m_pmap = m_instrument->getParameterMap().get();
120 }
121
122 m_sourceId = nullptr;
123 m_sampleId = nullptr;
124
125 // To prevent warning generation. Do not even try to get the source or sample
126 // id if the instrument is empty.
127 if (!m_instrument->isEmptyInstrument()) {
128
129 m_sourceId = m_instrument->getSource() ? m_instrument->getSource()->getComponentID() : nullptr;
130 m_sampleId = m_instrument->getSample() ? m_instrument->getSample()->getComponentID() : nullptr;
131 }
132
133 const auto nDetectors = m_orderedDetectorIds->size();
134 m_assemblySortedDetectorIndices->reserve(nDetectors); // Exact
135 m_componentIdToIndexMap->reserve(nDetectors); // Approximation
136}
137
139 if (m_pmap && m_pmap->empty()) {
140 // Go through the base instrument for speed.
141 m_instrument->baseInstrument()->registerContents(*this);
142 } else {
143 m_instrument->registerContents(*this);
144 }
145}
146
148 const size_t componentIndex = m_componentIds->size();
149 const ComponentID componentId = component.getComponentID();
150 markAsSourceOrSample(componentId, componentIndex);
151 // Record the ID -> index mapping
152 (*m_componentIdToIndexMap)[componentId] = componentIndex;
153 // For any non-detector we extend the m_componentIds from the back
154 m_componentIds->emplace_back(componentId);
155 m_positions->emplace_back(Kernel::toVector3d(component.getPos()));
156 m_rotations->emplace_back(Kernel::toQuaterniond(component.getRotation()));
157 m_shapes->emplace_back(m_nullShape);
158 m_scaleFactors->emplace_back(Kernel::toVector3d(component.getScaleFactor()));
159 m_names->emplace_back(component.getName());
160 if (const auto &sideBySideViewPos = component.getSideBySideViewPos()) {
161 (*m_sideBySideViewPositions)[componentIndex] = Kernel::toVector2d(*sideBySideViewPos);
162 }
163 clearLegacyParameters(m_pmap, component);
164 return componentIndex;
165}
166
168
169 std::vector<IComponent_const_sptr> assemblyChildren;
170 assembly.getChildren(assemblyChildren, false /*is recursive*/);
171
172 const size_t detectorStart = m_assemblySortedDetectorIndices->size();
173 const size_t componentStart = m_assemblySortedComponentIndices->size();
174 std::vector<size_t> children(assemblyChildren.size());
175 for (size_t i = 0; i < assemblyChildren.size(); ++i) {
176 // register everything under this assembly
177 children[i] = assemblyChildren[i]->registerContents(*this);
178 }
179 const size_t detectorStop = m_assemblySortedDetectorIndices->size();
180 const size_t componentIndex = commonRegistration(assembly);
181 m_componentType->emplace_back(Beamline::ComponentType::Unstructured);
182 m_assemblySortedComponentIndices->emplace_back(componentIndex);
183 // Unless this is the root component this parent is not correct and will be
184 // updated later in the register call of the parent.
185 m_parentComponentIndices->emplace_back(componentIndex);
186 const size_t componentStop = m_assemblySortedComponentIndices->size();
187
188 m_detectorRanges->emplace_back(detectorStart, detectorStop);
189 m_componentRanges->emplace_back(componentStart, componentStop);
190
191 // Now that we know what the index of the parent is we can apply it to the children
192 for (const auto &child : children) {
193 (*m_parentComponentIndices)[child] = componentIndex;
194 }
195 m_children->emplace_back(std::move(children));
196 return componentIndex;
197}
198
205 /*
206 * For a generic leaf component we extend the component ids list, but
207 * the detector indexes entries will of course be empty
208 */
209 m_detectorRanges->emplace_back(std::make_pair(0, 0)); // Represents an empty range
210 // Record the ID -> index mapping
211 const size_t componentIndex = commonRegistration(component);
212 m_componentType->emplace_back(Beamline::ComponentType::Generic);
213
214 const size_t componentStart = m_assemblySortedComponentIndices->size();
215 m_componentRanges->emplace_back(std::make_pair(componentStart, componentStart + 1));
216 m_assemblySortedComponentIndices->emplace_back(componentIndex);
217 // Unless this is the root component this parent is not correct and will be
218 // updated later in the register call of the parent.
219 m_parentComponentIndices->emplace_back(componentIndex);
220 // Generic components are not assemblies and do not therefore have children.
221 m_children->emplace_back();
222 return componentIndex;
223}
224
231 /*
232 * For a generic leaf component we extend the component ids list, but
233 * the detector indexes entries will of course be empty
234 */
235 m_detectorRanges->emplace_back(0, 0); // Represents an empty range
236 // Record the ID -> index mapping
237 const size_t componentIndex = commonRegistration(component);
238 m_componentType->emplace_back(Beamline::ComponentType::Infinite);
239
240 const size_t componentStart = m_assemblySortedComponentIndices->size();
241 m_componentRanges->emplace_back(componentStart, componentStart + 1);
242 m_assemblySortedComponentIndices->emplace_back(componentIndex);
243 // Unless this is the root component this parent is not correct and will be
244 // updated later in the register call of the parent.
245 m_parentComponentIndices->emplace_back(componentIndex);
246 // Generic components are not assemblies and do not therefore have children.
247 m_children->emplace_back();
248 return componentIndex;
249}
250
257 auto index = registerGenericComponent(objComponent);
258 (*m_shapes)[index] = objComponent.shape();
259 return index;
260}
261
268 auto index = registerComponentAssembly(bank);
269 size_t rangesIndex = index - m_orderedDetectorIds->size();
270 (*m_componentType)[rangesIndex] = Beamline::ComponentType::Rectangular;
271 (*m_pixelGridComponents)[index] = makePixelGridComponent(dynamic_cast<const GridDetector &>(bank));
272 return index;
273}
274
281 auto index = registerComponentAssembly(bank);
282 size_t rangesIndex = index - m_orderedDetectorIds->size();
283 (*m_componentType)[rangesIndex] = Beamline::ComponentType::Grid;
284 (*m_pixelGridComponents)[index] = makePixelGridComponent(dynamic_cast<const GridDetector &>(bank));
285 return index;
286}
287
294 auto index = registerInfiniteComponent(objComponent);
295 (*m_shapes)[index] = objComponent.shape();
296 return index;
297}
298
305 auto index = registerComponentAssembly(bank);
306 size_t rangesIndex = index - m_orderedDetectorIds->size();
307 (*m_componentType)[rangesIndex] = Beamline::ComponentType::Structured;
308 return index;
309}
310
313 (*m_shapes)[index] = obj.shape();
314 if (hasValidShape(obj)) {
315 size_t rangesIndex = index - m_orderedDetectorIds->size();
316 (*m_componentType)[rangesIndex] = Beamline::ComponentType::OutlineComposite;
317 }
318 return index;
319}
320
321void InstrumentVisitor::markAsSourceOrSample(ComponentID componentId, const size_t componentIndex) {
322 if (componentId == m_sampleId) {
323 m_sampleIndex = componentIndex;
324 } else if (componentId == m_sourceId) {
325 m_sourceIndex = componentIndex;
326 }
327}
328
335 auto detectorIndex = m_detectorIdToIndexMap->at(detector.getID());
336
337 /* Already allocated we just need to index into the inital front-detector
338 * part of the collection.
339 * 1. Guarantee on grouping detectors by type such that the first n
340 * components
341 * are detectors.
342 * 2. Guarantee on ordering such that the
343 * detectorIndex == componentIndex for all detectors.
344 */
345 // Record the ID -> component index mapping
346 (*m_componentIdToIndexMap)[detector.getComponentID()] = detectorIndex;
347 (*m_componentIds)[detectorIndex] = detector.getComponentID();
349 (*m_detectorPositions)[detectorIndex] = Kernel::toVector3d(detector.getPos());
350 (*m_detectorRotations)[detectorIndex] = Kernel::toQuaterniond(detector.getRotation());
351 (*m_shapes)[detectorIndex] = detector.shape();
352 (*m_scaleFactors)[detectorIndex] = Kernel::toVector3d(detector.getScaleFactor());
353 if (m_instrument->isMonitor(detector.getID())) {
354 m_monitorIndices->emplace_back(detectorIndex);
355 }
356 (*m_names)[detectorIndex] = detector.getName();
357 if (const auto &sideBySideViewPos = detector.getSideBySideViewPos()) {
358 (*m_sideBySideViewPositions)[detectorIndex] = Kernel::toVector2d(*sideBySideViewPos);
359 }
360 clearLegacyParameters(m_pmap, detector);
361
362 /* Note that positions and rotations for detectors are currently
363 NOT stored! These go into DetectorInfo at present. emplace_back works for
364 other Component types because Detectors are always come first in the resultant
365 component list
366 forming a contiguous block.
367 */
369 detectorIndex); // TODO. Optimisation. Cannot have a
370 // detector that is either source or
371 // sample. So delete this.
372 return detectorIndex;
373}
374
382std::shared_ptr<const std::vector<Mantid::Geometry::ComponentID>> InstrumentVisitor::componentIds() const {
383 return m_componentIds;
384}
385
391size_t InstrumentVisitor::size() const { return m_componentIds->size(); }
392
393bool InstrumentVisitor::isEmpty() const { return size() == 0; }
394
395std::shared_ptr<const std::unordered_map<Mantid::Geometry::IComponent const *, size_t>>
399
400std::shared_ptr<const std::unordered_map<detid_t, size_t>> InstrumentVisitor::detectorIdToIndexMap() const {
402}
403
410
411std::unique_ptr<Beamline::DetectorInfo> InstrumentVisitor::detectorInfo() const {
412 return std::make_unique<Mantid::Beamline::DetectorInfo>(*m_detectorPositions, *m_detectorRotations,
414}
415
416std::shared_ptr<std::vector<detid_t>> InstrumentVisitor::detectorIds() const { return m_orderedDetectorIds; }
417
419std::shared_ptr<ParameterInfo> InstrumentVisitor::makeParameterInfo() const {
420 // The ParameterMap does the rekeying itself
421 return m_pmap ? m_pmap->rekey(*m_componentIdToIndexMap) : std::make_shared<ParameterInfo>();
422}
423
424std::pair<std::unique_ptr<ComponentInfo>, std::unique_ptr<DetectorInfo>> InstrumentVisitor::makeWrappers() const {
425 auto compInfo = componentInfo();
426 auto detInfo = detectorInfo();
427 // Cross link Component and Detector info objects
428 compInfo->setDetectorInfo(detInfo.get());
429
430 auto compInfoWrapper = std::make_unique<ComponentInfo>(std::move(compInfo), componentIds(), componentIdToIndexMap(),
432 auto detInfoWrapper =
433 std::make_unique<DetectorInfo>(std::move(detInfo), m_instrument, detectorIds(), detectorIdToIndexMap());
434
435 return {std::move(compInfoWrapper), std::move(detInfoWrapper)};
436}
437
438std::pair<std::unique_ptr<ComponentInfo>, std::unique_ptr<DetectorInfo>>
440 // Visitee instrument is base instrument if no ParameterMap
441 const auto visiteeInstrument =
442 pmap ? ParComponentFactory::createInstrument(std::shared_ptr<const Instrument>(&instrument, NoDeleting()),
443 std::shared_ptr<ParameterMap>(pmap, NoDeleting()))
444 : std::shared_ptr<const Instrument>(&instrument, NoDeleting());
445 InstrumentVisitor visitor(visiteeInstrument);
446 visitor.walkInstrument();
447 return visitor.makeWrappers();
448}
449} // namespace Mantid::Geometry
std::map< DeltaEMode::Type, std::string > index
IntArray detectorIndex
double obj
the value of the quadratic function
Constructive Solid Geometry object.
Definition CSGObject.h:51
GridDetector is a type of CompAssembly, an assembly of components.
Class for Assembly of geometric components.
virtual void getChildren(std::vector< IComponent_const_sptr > &outVector, bool recursive) const =0
Get all children.
base class for Geometric IComponent
Definition IComponent.h:53
virtual size_t registerContents(class ComponentVisitor &component) const =0
virtual Kernel::V3D getPos() const =0
Get the position of the IComponent. Tree structure is traverse through the.
virtual std::optional< Kernel::V2D > getSideBySideViewPos() const =0
Get the position of the IComponent for display on the side by side instrument view.
virtual Kernel::Quat getRotation() const =0
Get the absolute orientation of the IComponent.
virtual Kernel::V3D getScaleFactor() const
Gets the scaling factor of the object for the Object Component.
Definition IComponent.h:124
virtual ComponentID getComponentID() const =0
Returns the ComponentID - a unique identifier of the component.
virtual std::string getName() const =0
Get the IComponent name.
Interface class for detector objects.
Definition IDetector.h:43
virtual detid_t getID() const =0
Get the detector ID.
Object Component class, this class brings together the physical attributes of the component to the po...
virtual const std::shared_ptr< const IObject > shape() const =0
Returns the shape of the Object.
IObject : Interface for geometry objects.
Definition IObject.h:42
InstrumentVisitor : Visitor for components with access to Info wrapping features.
std::shared_ptr< std::vector< std::pair< size_t, size_t > > > m_detectorRanges
Only Assemblies and other NON-detectors yield detector ranges.
std::shared_ptr< const std::unordered_map< detid_t, size_t > > m_detectorIdToIndexMap
Detector ID -> index mappings.
int64_t m_sourceIndex
Source index to set.
std::shared_ptr< std::vector< size_t > > m_assemblySortedComponentIndices
Component indexes sorted by assembly.
std::unique_ptr< Beamline::ComponentInfo > componentInfo() const
Mantid::Geometry::ParameterMap * m_pmap
Parameter map to purge.
InstrumentVisitor(std::shared_ptr< const Instrument > instrument)
Constructor.
virtual size_t registerComponentAssembly(const Mantid::Geometry::ICompAssembly &assembly) override
std::shared_ptr< std::vector< detid_t > > m_orderedDetectorIds
Detector indices.
size_t size() const
InstrumentVisitor::size.
std::shared_ptr< const Mantid::Geometry::IObject > m_nullShape
Null shared (empty shape)
std::shared_ptr< std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > > m_rotations
Rotations for non-detectors.
virtual size_t registerGenericObjComponent(const Mantid::Geometry::IObjComponent &objComponent) override
InstrumentVisitor::registerGenericObjComponent.
std::shared_ptr< std::vector< size_t > > m_assemblySortedDetectorIndices
Detector indexes sorted by assembly.
std::shared_ptr< std::vector< std::pair< size_t, size_t > > > m_componentRanges
Component ranges.
size_t commonRegistration(const Mantid::Geometry::IComponent &component)
Extract the common aspects relevant to all component types.
std::shared_ptr< std::vector< detid_t > > detectorIds() const
virtual size_t registerGridBank(const Mantid::Geometry::ICompAssembly &bank) override
Register a grid bank.
std::shared_ptr< std::vector< Eigen::Vector3d > > m_positions
Positions for non-detectors.
void markAsSourceOrSample(Mantid::Geometry::IComponent *componentId, const size_t componentIndex)
virtual size_t registerRectangularBank(const Mantid::Geometry::ICompAssembly &bank) override
Register a rectangular bank.
virtual size_t registerObjComponentAssembly(const ObjCompAssembly &obj) override
std::shared_ptr< std::vector< std::shared_ptr< const Mantid::Geometry::IObject > > > m_shapes
Shapes stored in fly-weight fashion.
virtual size_t registerDetector(const Mantid::Geometry::IDetector &detector) override
InstrumentVisitor::registerDetector.
std::shared_ptr< std::vector< std::vector< size_t > > > m_children
Stores instrument tree structure by storing children of all Components.
std::shared_ptr< std::map< size_t, Eigen::Vector2d > > m_sideBySideViewPositions
Side-by-side (unwrapped) instrument-view positions when declared in the IDF.
std::shared_ptr< const std::unordered_map< Mantid::Geometry::IComponent const *, size_t > > componentIdToIndexMap() const
std::shared_ptr< std::vector< Eigen::Vector3d > > m_scaleFactors
Scale factors.
std::shared_ptr< std::vector< Mantid::Geometry::IComponent * > > m_componentIds
Detectors components always specified first.
std::shared_ptr< std::vector< Eigen::Vector3d > > m_detectorPositions
Positions for detectors.
std::shared_ptr< std::vector< Beamline::ComponentType > > m_componentType
Structured bank flag.
std::shared_ptr< const std::unordered_map< detid_t, size_t > > detectorIdToIndexMap() const
std::shared_ptr< std::map< size_t, Beamline::PixelGridComponent > > m_pixelGridComponents
Rectangular/Grid bank pixel-grid metadata.
std::pair< std::unique_ptr< ComponentInfo >, std::unique_ptr< DetectorInfo > > makeWrappers() const
Mantid::Geometry::IComponent * m_sourceId
Source id to look for.
std::unique_ptr< Beamline::DetectorInfo > detectorInfo() const
virtual size_t registerStructuredBank(const Mantid::Geometry::ICompAssembly &bank) override
Register a structured bank.
std::shared_ptr< const std::vector< Mantid::Geometry::IComponent * > > componentIds() const
InstrumentVisitor::componentIds.
std::shared_ptr< std::vector< std::string > > m_names
Component names.
virtual size_t registerInfiniteComponent(const Mantid::Geometry::IComponent &component) override
InstrumentVisitor::registerInfiniteComponent.
int64_t m_sampleIndex
Sample index to set.
Mantid::Geometry::IComponent * m_sampleId
Sample id to look for.
std::shared_ptr< const Mantid::Geometry::Instrument > m_instrument
Instrument to build around.
std::shared_ptr< ParameterInfo > makeParameterInfo() const
Rekey the ParameterMap's parameters from legacy component pointers to component indices.
std::shared_ptr< std::vector< size_t > > m_parentComponentIndices
Index of the parent component.
std::shared_ptr< std::unordered_map< Mantid::Geometry::IComponent const *, size_t > > m_componentIdToIndexMap
Component ID -> Component Index map.
std::shared_ptr< std::vector< size_t > > m_monitorIndices
Monitor indexes for detectors.
virtual size_t registerInfiniteObjComponent(const IObjComponent &objComponent) override
InstrumentVisitor::registerInfiniteObjComponent.
virtual size_t registerGenericComponent(const Mantid::Geometry::IComponent &component) override
InstrumentVisitor::registerGenericComponent.
std::shared_ptr< std::vector< Eigen::Quaterniond, Eigen::aligned_allocator< Eigen::Quaterniond > > > m_detectorRotations
Rotations for detectors.
Base Instrument Class.
Definition Instrument.h:49
Class for Assembly of geometric components.
static std::shared_ptr< Instrument > createInstrument(const std::shared_ptr< const Instrument > &base, const std::shared_ptr< ParameterMap > &map)
Create a parameterized instrument from the given base and ParameterMap.
Parameter map iterator typedef.
bool empty() const
Returns true if the map is empty, false otherwise.
std::shared_ptr< ParameterInfo > rekey(const std::unordered_map< Geometry::IComponent const *, size_t > &idToIndex)
Rekey this map's parameters from the synthetic staging indices onto an instrument's real component in...
static const std::string & scale()
static const std::string & rot()
static const std::string & posz()
static const std::string & pos()
Return string to be used in the map.
static const std::string & rotz()
static const std::string & posy()
static const std::string & posx()
static const std::string & rotx()
std::shared_ptr< Parameter > get(const IComponent *comp, const std::string &name, const std::string &type="") const
Get a parameter with a given name and type (std::string version)
static const std::string & roty()
This functor is used as the deleter object of a shared_ptr to effectively erase ownership Raw pointer...
Definition IComponent.h:171
Eigen::Vector3d toVector3d(const Kernel::V3D &vec)
Converts Kernel::V3D to Eigen::Vector3d.
Eigen::Vector2d toVector2d(const Kernel::V2D &vec)
Converts Kernel::V2D to Eigen::Vector2d.
Eigen::Quaterniond toQuaterniond(const Kernel::Quat &quat)
Converts Kernel::Quat to Eigen::Quaterniond.
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.
Generate a tableworkspace to store the calibration results.
STL namespace.