8#include "MantidBeamline/ComponentInfo.h"
9#include "MantidBeamline/ComponentType.h"
22#include <Eigen/Geometry>
34const Eigen::Vector3d undoRotation(
const Eigen::Vector3d &point,
const Beamline::ComponentInfo &compInfo,
35 const size_t componentIndex) {
36 auto unRotateTransform = Eigen::Affine3d(compInfo.rotation(componentIndex).inverse());
37 return unRotateTransform * point;
46const Kernel::V3D toShapeFrame(
const Kernel::V3D &point,
const Beamline::ComponentInfo &compInfo,
47 const size_t componentIndex) {
49 undoRotation(
Kernel::toVector3d(point) - compInfo.position(componentIndex), compInfo, componentIndex));
64 std::unique_ptr<Beamline::ComponentInfo> componentInfo,
65 std::shared_ptr<
const std::vector<Mantid::Geometry::IComponent *>> componentIds,
66 std::shared_ptr<
const std::unordered_map<Geometry::IComponent const *, size_t>> componentIdToIndexMap,
67 std::shared_ptr<std::vector<std::shared_ptr<const Geometry::IObject>>> shapes,
68 std::shared_ptr<ParameterInfo> parameterInfo, std::shared_ptr<const ReferenceFrame> referenceFrame)
69 : m_componentInfo(
std::move(componentInfo)), m_componentIds(
std::move(componentIds)),
70 m_compIDToIndex(
std::move(componentIdToIndexMap)), m_shapes(
std::move(shapes)),
71 m_parameterInfo(
std::move(parameterInfo)), m_referenceFrame(
std::move(referenceFrame)) {
74 throw std::invalid_argument(
"Inconsistent ID and Mapping input containers "
75 "for Geometry::ComponentInfo");
78 throw std::invalid_argument(
"Inconsistent ID and base "
79 "Beamline::ComponentInfo sizes for "
80 "Geometry::ComponentInfo");
98 : m_componentInfo(other.m_componentInfo->cloneWithoutDetectorInfo()), m_componentIds(other.m_componentIds),
99 m_compIDToIndex(other.m_compIDToIndex), m_shapes(other.m_shapes), m_parameterInfo(other.m_parameterInfo),
100 m_referenceFrame(other.m_referenceFrame) {}
122 if (!(type == Beamline::ComponentType::Structured || type == Beamline::ComponentType::Rectangular ||
123 parentType == Beamline::ComponentType::Grid))
124 throw std::runtime_error(
"ComponentType is not Structured or Rectangular "
125 "in ComponentInfo::quadrilateralComponent.");
128 const auto &innerRangeComp =
m_componentInfo->children(componentIndex);
129 corners.
nX = innerRangeComp.size();
132 corners.
nY = firstCol.size();
135 corners.
topLeft = firstCol.back();
157 const auto *shapeAtIndex = (*m_shapes)[componentIndex].get();
158 return shapeAtIndex !=
nullptr && shapeAtIndex->hasValidShape();
242 const auto range =
m_componentInfo->detectorRangeInSubtree(componentIndex);
243 return range.begin() < range.end();
261 static const auto defaultFrame = std::make_shared<const ReferenceFrame>();
278 std::unordered_map<std::shared_ptr<const IObject>, std::vector<size_t>> result;
280 for (
size_t i = 0; i < shapes.size(); ++i) {
281 const auto ¤tShape = shapes[i];
282 if (currentShape !=
nullptr && currentShape->hasValidShape())
283 result[currentShape].emplace_back(i);
310 throw std::runtime_error(
"ComponentType is not Rectangular or Grid in ComponentInfo::pixelGridComponent.");
321 throw std::runtime_error(
"ComponentType is not Structured in ComponentInfo::structuredGridComponent.");
331std::tuple<int, int, int> xyzFillFirstZ(
const Beamline::PixelGridComponent &grid,
int col,
int id) {
332 if (grid.idFillOrder[1] ==
'y') {
333 int row = (
id / grid.idStepByRow) % grid.nY;
334 int layer = (
id / grid.idStepByRow) / grid.nY;
335 return {layer, row, col};
337 int row = (
id / grid.idStepByRow) % grid.nX;
338 int layer = (
id / grid.idStepByRow) / grid.nX;
339 return {row, layer, col};
342std::tuple<int, int, int> xyzFillFirstY(
const Beamline::PixelGridComponent &grid,
int col,
int id) {
343 if (grid.idFillOrder[1] ==
'z') {
344 int row = (
id / grid.idStepByRow) % grid.nZ;
345 int layer = (
id / grid.idStepByRow) / grid.nZ;
346 return {layer, col, row};
348 int row = (
id / grid.idStepByRow) % grid.nX;
349 int layer = (
id / grid.idStepByRow) / grid.nX;
350 return {row, col, layer};
353std::tuple<int, int, int> xyzFillFirstX(
const Beamline::PixelGridComponent &grid,
int col,
int id) {
354 if (grid.idFillOrder[1] ==
'y') {
355 int row = (
id / grid.idStepByRow) % grid.nY;
356 int layer = (
id / grid.idStepByRow) / grid.nY;
357 return {col, row, layer};
359 int row = (
id / grid.idStepByRow) % grid.nZ;
360 int layer = (
id / grid.idStepByRow) / grid.nZ;
361 return {col, layer, row};
376 const int id = detectorID - grid.idStart;
377 if (grid.idStepByRow == 0 || grid.idStep == 0)
379 const int col = (
id % grid.idStepByRow) / grid.idStep;
381 if (grid.idFillOrder[0] ==
'z')
382 return xyzFillFirstZ(grid, col,
id);
383 if (grid.idFillOrder[0] ==
'y')
384 return xyzFillFirstY(grid, col,
id);
385 return xyzFillFirstX(grid, col,
id);
395 if ((scaleFactorAtIndex -
Kernel::V3D(1.0, 1.0, 1.0)).norm() < 1e-12)
400 return shape(componentIndex).
solidAngle(paramsWithRelativeObserver, scaleFactorAtIndex);
423 const bool excludeMonitors)
const {
443 const bool excludeMonitors)
const {
457 const bool excludeMonitors)
const {
462 if (excludeMonitors) {
476 const auto &s = this->
shape(index);
482 absoluteBB.
xMin() *= scaleFactorAtIndex[0];
483 absoluteBB.
xMax() *= scaleFactorAtIndex[0];
484 absoluteBB.
yMin() *= scaleFactorAtIndex[1];
485 absoluteBB.
yMax() *= scaleFactorAtIndex[1];
486 absoluteBB.
zMin() *= scaleFactorAtIndex[2];
487 absoluteBB.
zMax() *= scaleFactorAtIndex[2];
490 .rotateBB(absoluteBB.
xMin(), absoluteBB.
yMin(), absoluteBB.
zMin(), absoluteBB.
xMax(), absoluteBB.
yMax(),
495 absoluteBB.
xMin() += localPos[0];
496 absoluteBB.
xMax() += localPos[0];
497 absoluteBB.
yMin() += localPos[1];
498 absoluteBB.
yMax() += localPos[1];
499 absoluteBB.
zMin() += localPos[2];
500 absoluteBB.
zMax() += localPos[2];
504 std::vector<Kernel::V3D> coordSystem;
508 absoluteBB.
realign(&coordSystem);
526 const bool excludeMonitors)
const {
534 auto parentFlag = Beamline::ComponentType::Generic;
541 }
else if (compFlag == Beamline::ComponentType::Unstructured) {
542 for (
const auto &childIndex : this->
children(componentIndex)) {
545 }
else if (compFlag == Beamline::ComponentType::Grid) {
546 for (
const auto &childIndex : this->
children(componentIndex)) {
549 }
else if (compFlag == Beamline::ComponentType::Rectangular || compFlag == Beamline::ComponentType::Structured ||
550 parentFlag == Beamline::ComponentType::Grid) {
552 }
else if (compFlag == Beamline::ComponentType::OutlineComposite) {
566 m_componentInfo->setScanInterval({interval.first.totalNanoseconds(), interval.second.totalNanoseconds()});
582 constexpr size_t noBankParent{0};
589 if (indexChildren.empty()) {
593 if (
name(indexChildren[0]).starts_with(bankPart)) {
597 for (
size_t const child : indexChildren) {
599 if (j != noBankParent) {
609 std::vector<size_t> ancestry{componentIndex};
612 ancestry.emplace_back(
index);
615 for (
auto it = ancestry.crbegin(); it != ancestry.crend(); ++it) {
616 if (it != ancestry.crbegin()) {
638 size_t current =
root();
639 size_t segmentStart = 0;
641 while (segmentStart <=
fullName.size()) {
642 const auto separator =
fullName.find(
'/', segmentStart);
644 fullName.substr(segmentStart, separator == std::string::npos ? std::string::npos : separator - segmentStart);
647 if (
name(current) != segment) {
652 auto const &candidates =
children(current);
654 std::find_if(candidates.cbegin(), candidates.cend(), [&](
size_t child) { return name(child) == segment; });
655 if (found == candidates.cend()) {
660 if (separator == std::string::npos) {
663 segmentStart = separator + 1;
678 std::vector<T> result;
680 result.emplace_back(param->value<T>());
689 result = recursive ?
static_cast<bool>(
m_parameterInfo->getRecursive(*
this, componentIndex,
name))
696 std::set<std::string> result;
700 if (recursive &&
hasParent(componentIndex)) {
702 result.insert(parentNames.cbegin(), parentNames.cend());
717 const T &
value,
const std::string *
const pDescription,
718 const std::string &pVisible) {
720 auto typedParameter = std::dynamic_pointer_cast<ParameterType<T>>(param);
721 if (!typedParameter) {
722 throw std::invalid_argument(
"ComponentInfo: parameter type '" + type +
"' does not match the value supplied for '" +
725 typedParameter->setValue(
value);
727 param->setDescription(*pDescription);
733 const std::string &
value,
const std::string *
const pDescription,
734 const std::string &pVisible) {
738 param->fromString(
value);
740 param->setDescription(*pDescription);
746 const std::string *
const pDescription,
const std::string &pVisible) {
751 const std::string *
const pDescription,
const std::string &pVisible) {
756 const std::string *
const pDescription,
const std::string &pVisible) {
761 const std::string *
const pDescription,
const std::string &pVisible) {
766 const std::string *
const pDescription) {
771 const std::string *
const pDescription) {
776 const std::string &fittingFunction,
const std::string &
value,
777 const std::string *
const pDescription,
const std::string &pVisible) {
779 param->fromString(
value);
781 param->setDescription(*pDescription);
792 std::shared_ptr<const XMLInstrumentParameter>
const ¶m) {
815 const std::string &type,
bool recursive)
const {
824 bool recursive)
const {
828 return recursive ?
m_parameterInfo->getRecursiveByType(*
this, componentIndex, type)
833 bool recursive)
const {
834 return getParameter<double>(componentIndex,
name, recursive);
838 bool recursive)
const {
839 return getParameter<int>(componentIndex,
name, recursive);
843 bool recursive)
const {
844 return getParameter<bool>(componentIndex,
name, recursive);
848 bool recursive)
const {
849 return getParameter<std::string>(componentIndex,
name, recursive);
853 bool recursive)
const {
854 return getParameter<Kernel::V3D>(componentIndex,
name, recursive);
858 bool recursive)
const {
859 return getParameter<Kernel::Quat>(componentIndex,
name, recursive);
863 bool recursive)
const {
865 return param ? param->asString() : std::string();
870 return param && param->visible();
874 bool recursive)
const {
876 return param ? std::string(param->type()) : std::string();
880 bool recursive)
const {
882 return param ? param->getDescription() : std::string();
886 bool recursive)
const {
888 return param ? param->getShortDescription() : std::string();
900 auto const &componentName =
name(componentIndex);
901 if (
auto const param =
findParameter(componentIndex, componentName,
true)) {
902 param->setDescription(description);
904 addString(componentIndex, componentName,
"", &description);
910 throw std::runtime_error(
"Parameters are not available in component=" + this->
name(componentIndex));
913 throw std::runtime_error(
"Fitting parameter=" +
name +
914 " could not be extracted from component=" + this->
name(componentIndex));
919 throw std::runtime_error(
"Unable to get lookup table for parameter=" +
name +
920 " from component=" + this->
name(componentIndex));
928 const size_t n =
size();
932 const size_t componentIdsMem =
sizeof(std::vector<Geometry::IComponent *>) +
n *
sizeof(
Geometry::IComponent *);
935 const size_t compIDToIndexMem =
sizeof(std::unordered_map<Geometry::IComponent const *, size_t>) +
939 const size_t shapesMem =
940 m_shapes ?
sizeof(*m_shapes) +
m_shapes->capacity() *
sizeof(std::shared_ptr<const Geometry::IObject>) : 0;
941 return sizeof(*this) + beamlineMem + componentIdsMem + compIDToIndexMem + shapesMem;
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
Mantid::Kernel::Quat(ComponentInfo::* rotation)(const size_t) const
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
double xMax() const
Return the maximum value of X.
double zMin() const
Return the minimum value of Z.
std::vector< Kernel::V3D > const & getCoordSystem() const
returns the coordinate system to which BB is alighned to;
double zMax() const
Return the maximum value of Z.
double yMax() const
Return the maximum value of Y.
bool isAxisAligned() const
Check if it is normal axis aligned bounding box or not.
double xMin() const
Return the minimum value of X.
double yMin() const
Return the minimum value of Y.
void grow(const BoundingBox &other)
Grow the bounding box so that it also encompasses the given box.
void realign(std::vector< Kernel::V3D > const *const pCS=nullptr)
reallign the BB according to new coordinate system, provided earlier or specified as parameter;
ComponentInfo : Provides a component centric view on to the instrument.
std::vector< int > getIntParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
bool hasParent(const size_t componentIndex) const
ParameterInfo & mutableParameterInfo()
The store, created on first write if this ComponentInfo was built without one (a bare,...
const ComponentInfoIterator< const ComponentInfo > cend()
bool hasDetectorInfo() const
BoundingBox componentBoundingBox(const size_t index, const BoundingBox *reference, const bool excludeMonitors=false) const
Calculates the absolute bounding box for the leaf item at index.
size_t findBankParent(size_t index, const std::string &bankPart) const
std::shared_ptr< const Parameter > parameter(const size_t componentIndex, const std::string &name, const std::string &type="", bool recursive=true) const
The named parameter, of the given type if one is given, or null if the component has none.
std::string getShortDescription(const size_t componentIndex) const
The component's own short description: that of the parameter named after the component,...
bool isStructuredDetector(size_t const componentIndex) const
void clearParameter(const size_t componentIndex, const std::string &name)
Remove every parameter of this name from this component.
std::shared_ptr< const ReferenceFrame > m_referenceFrame
The instrument's reference frame (up, along-beam and handedness), or null if none was given.
std::string fullName(const size_t componentIndex) const
The fully-qualified name of a component ("instrument/bank1/pixel3")
std::unordered_map< std::shared_ptr< const Geometry::IObject >, std::vector< size_t > > shapeToComponentIndices() const
Build a map from each unique shape to the list of component indices that share it.
size_t indexOfAny(const std::string &name) const
The first component with this name in a breadth-first search, as Instrument::getComponentByName() fin...
void setRotation(size_t componentIndex, const Kernel::Quat &newRotation)
bool hasDetectors(const size_t componentIndex) const
std::shared_ptr< Parameter > findParameter(size_t componentIndex, std::string const &name, bool recursive) const
The named parameter on this component (or, if recursive, its nearest ancestor), or null.
bool hasEquivalentSource(const ComponentInfo &other) const
void setDescription(const size_t componentIndex, const std::string &description)
Set the component's description, as Component::setDescription() does: on the parameter named after th...
void clearParameters()
Remove every parameter from every component.
std::shared_ptr< const ReferenceFrame > referenceFrame() const
The instrument's reference frame: which axes point up and along the beam, and its handedness.
void addQuat(const size_t componentIndex, const std::string &name, const Kernel::Quat &value, const std::string *const pDescription=nullptr)
Add or replace a named quaternion parameter at a specific component index.
void addFittingParameter(const size_t componentIndex, const std::string &name, const std::string &fittingFunction, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add a fitting parameter.
double solidAngle(const size_t componentIndex, const Geometry::SolidAngleParams ¶ms) const
size_t parent(const size_t componentIndex) const
std::string getParamDescription(const size_t componentIndex, const std::string &name, bool recursive=true) const
The description of the named parameter, or an empty string if it is unset.
Kernel::Quat rotation(const size_t componentIndex) const
bool isGridDetector(size_t const componentIndex) const
void growBoundingBoxAsOutline(size_t index, const Geometry::BoundingBox *reference, Geometry::BoundingBox &mutableBB, const bool excludeMonitors=false) const
Grow the bounding box on the basis that the component described by index has an outline,...
BoundingBox boundingBox(const size_t componentIndex, const BoundingBox *reference=nullptr, const bool excludeMonitors=false) const
Compute the bounding box for the component with componentIndex taking into account all sub components...
std::shared_ptr< std::vector< std::shared_ptr< const Geometry::IObject > > > m_shapes
Shapes for each component.
void scaleComponent(const size_t componentIndex, const Kernel::V3D &newScaling)
std::vector< Kernel::Quat > getRotationParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
std::vector< std::string > getStringParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
std::shared_ptr< const std::unordered_map< Geometry::IComponent const *, size_t > > m_compIDToIndex
Map of component ids to indexes.
Kernel::V3D position(const size_t componentIndex) const
const std::vector< size_t > & children(size_t componentIndex) const
Kernel::V2D sideBySideViewPosition(const size_t componentIndex) const
std::vector< size_t > componentsInSubtree(size_t componentIndex) const
bool hasParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
Returns empty (or false) if the ComponentInfo was built without parameters or the parameter is unset.
void addTypedParameter(const size_t componentIndex, const std::string &type, const std::string &name, const T &value, const std::string *const pDescription, const std::string &pVisible)
Shared implementation of the typed add*() methods.
void merge(const ComponentInfo &other)
bool hasValidShape(const size_t componentIndex) const
std::vector< double > getNumberParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
const Beamline::StructuredGridComponent & structuredGridComponent(const size_t componentIndex) const
The pixel counts, ID numbering and pixel vertices of a Structured bank. Throws if it is not one.
std::vector< Kernel::V3D > getPositionParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
std::shared_ptr< const Parameter > parameterByType(const size_t componentIndex, const std::string &type, bool recursive=true) const
The first parameter of the given type, or null if the component has none.
double getFittingParameter(const size_t componentIndex, const std::string &name, double xvalue) const
void addString(const size_t componentIndex, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named string parameter at a specific component index.
std::vector< bool > getBoolParameter(const size_t componentIndex, const std::string &name, bool recursive=true) const
Beamline::PixelGridComponent pixelGridComponent(const size_t componentIndex) const
const ParameterInfo::LogfileParameters & logfileParameters() const
Parameters whose values are taken from the sample logs by ExperimentInfo::populateInstrumentParameter...
Kernel::V3D sourcePosition() const
size_t indexOfOrInvalid(Geometry::IComponent const *id) const
The index for a component ID, or invalidIndex if it is not part of this instrument.
std::shared_ptr< ParameterInfo > m_parameterInfo
The instrument's named parameters, keyed by component index.
std::vector< T > getParameter(size_t componentIndex, const std::string &name, bool recursive) const
ComponentInfoIterator< ComponentInfo > begin()
bool hasEquivalentSample(const ComponentInfo &other) const
void setScaleFactor(const size_t componentIndex, const Kernel::V3D &scaleFactor)
ComponentInfoIterator< ComponentInfo > end()
std::unique_ptr< Beamline::ComponentInfo > m_componentInfo
Pointer to the actual ComponentInfo object (non-wrapping part).
std::vector< size_t > detectorsInSubtree(size_t componentIndex) const
std::string getParamShortDescription(const size_t componentIndex, const std::string &name, bool recursive=true) const
The short description (tooltip) of the named parameter, or an empty string if it is unset.
bool isDetector(const size_t componentIndex) const
bool uniqueName(const std::string &name) const
std::string getParameterAsString(size_t const componentIndex, std::string const &name, bool const recursive=true) const
The value of the named parameter as a string, whatever its type, or an empty string if it is unset.
void growBoundingBoxAsRectuangularBank(size_t index, const Geometry::BoundingBox *reference, Geometry::BoundingBox &mutableBB, const bool excludeMonitors=false) const
Grow the bounding box on the basis that the component described by index is a regular grid in a trape...
std::set< std::string > getParameterNames(const size_t componentIndex, bool recursive=true) const
std::unique_ptr< ComponentInfo > cloneWithoutDetectorInfo() const
Clone current instance but not the DetectorInfo non-owned parts.
const ComponentInfoIterator< const ComponentInfo > cbegin()
std::shared_ptr< const std::vector< Geometry::IComponent * > > m_componentIds
Collection of component ids.
bool getParameterVisible(const size_t componentIndex, const std::string &name, bool recursive=true) const
The named parameter's visibility attribute, or false if it is unset.
void addInt(const size_t componentIndex, const std::string &name, int value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named integer parameter at a specific component index.
size_t detectorIndexAtXYZ(const size_t componentIndex, const int x, const int y, const int z) const
std::string getDescription(const size_t componentIndex) const
The component's own description: that of the parameter named after the component, not inherited.
Kernel::V3D relativePosition(const size_t componentIndex) const
std::tuple< int, int, int > xyzForDetectorID(const size_t componentIndex, const detid_t detectorID) const
Given the component index of a Rectangular/Grid bank, and a detector ID within it,...
size_t indexOf(Geometry::IComponent const *id) const
const std::string & name(const size_t componentIndex) const
size_t getMemorySize() const
Return memory used by the component info, in bytes.
Kernel::Quat relativeRotation(const size_t componentIndex) const
std::string getParameterType(const size_t componentIndex, const std::string &name, bool recursive=true) const
The type of the named parameter, or an empty string if the component has no such parameter.
void setPosition(size_t componentIndex, const Kernel::V3D &newPosition)
void addDouble(const size_t componentIndex, const std::string &name, double value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named double parameter at a specific component index.
static constexpr size_t invalidIndex
Returned by indexOfOrInvalid() for a component ID that is not part of this instrument.
Kernel::V3D samplePosition() const
const Geometry::IObject & shape(const size_t componentIndex) const
void setScanInterval(const std::pair< Types::Core::DateAndTime, Types::Core::DateAndTime > &interval)
const ParameterInfo::ComponentParameters & parameters(const size_t componentIndex) const
All parameters on one component, non-recursive, ordered by name.
void addBool(const size_t componentIndex, const std::string &name, bool value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named boolean parameter at a specific component index.
size_t indexOfFullName(const std::string &fullName) const
The component with this fully-qualified name, or invalidIndex if there is none.
QuadrilateralComponent quadrilateralComponent(const size_t componentIndex) const
Beamline::ComponentType componentType(const size_t componentIndex) const
void addV3D(const size_t componentIndex, const std::string &name, const Kernel::V3D &value, const std::string *const pDescription=nullptr)
Add or replace a named vector parameter at a specific component index.
Kernel::V3D scaleFactor(const size_t componentIndex) const
ComponentInfo(const ComponentInfo &other)
Private copy constructor. Do not make public.
void addLogfileParameter(size_t const componentIndex, std::string const &cacheKey, std::shared_ptr< const XMLInstrumentParameter > const ¶meter)
Add or replace a logfile parameter on a component.
void addParameter(const size_t componentIndex, const std::string &type, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
Add or replace a named parameter at a specific component index.
Store information about a fitting parameter such as its value if it is constrained or tied.
double getValue(const double &at) const
get paramter value
base class for Geometric IComponent
IObject : Interface for geometry objects.
virtual double solidAngle(const SolidAngleParams ¶ms) const =0
static std::shared_ptr< Parameter > create(const std::string &className, const std::string &name, const std::string &visible="true")
Creates an instance of a parameter.
ParameterInfo : the named parameters of an instrument, addressed by component index.
bool addFittingParameter(size_t const componentIndex, std::shared_ptr< Parameter > const ¶meter, std::string const &fittingFunction)
Add a fitting parameter, deduplicating by (name, function) rather than by name alone so that two func...
void addLogfileParameter(size_t const componentIndex, std::string const &cacheKey, std::shared_ptr< const XMLInstrumentParameter > const ¶meter)
Add a logfile parameter, replacing any existing one with the same cache key on the same component.
void add(size_t const componentIndex, std::shared_ptr< Parameter > const ¶meter)
Add a parameter, replacing any existing parameter of the same name on the same component.
std::multimap< std::string, std::shared_ptr< Parameter >, Kernel::CaseInsensitiveStringComparator > ComponentParameters
Parameters of a single component, ordered by name.
std::map< std::pair< size_t, std::string >, std::shared_ptr< const XMLInstrumentParameter > > LogfileParameters
Parameters whose values are taken from the sample logs when ExperimentInfo::populateInstrumentParamet...
static const std::string & pQuat()
static const std::string & pBool()
static const std::string & pV3D()
static const std::string & pDouble()
static const std::string & pString()
static const std::string & pInt()
const SolidAngleParams copyWithNewObserver(Kernel::V3D newObserver) const
const Kernel::V3D & observer() const
Exception thrown when an attempt is made to dereference a null pointer.
Implements a 2-dimensional vector embedded in a 3D space, i.e.
std::shared_ptr< Parameter > Parameter_sptr
Typedef for the shared pointer.
ComponentInfoIterator< const ComponentInfo > ComponentInfoConstIt
ComponentInfoIterator< ComponentInfo > ComponentInfoIt
Kernel::Quat toQuat(const Eigen::Quaterniond &quat)
Converts Eigen::Quaterniond to Kernel::Quat.
Kernel::V2D toV2D(const Eigen::Vector2d &vec)
Converts Eigen::Vector2d to Kernel::V2D.
Eigen::Vector3d toVector3d(const Kernel::V3D &vec)
Converts Kernel::V3D to Eigen::Vector3d.
Kernel::V3D toV3D(const Eigen::Vector3d &vec)
This header provides conversion helpers between vector and rotation types in MantidKernel and equival...
Eigen::Quaterniond toQuaterniond(const Kernel::Quat &quat)
Converts Kernel::Quat to Eigen::Quaterniond.
int32_t detid_t
Typedef for a detector ID.