|
Mantid
|
Parameter map iterator typedef. More...
#include <ParameterMap.h>
Public Types | |
| using | Entry = std::pair< ComponentID, std::shared_ptr< Parameter > > |
| A stored parameter together with the component it belongs to. | |
Public Member Functions | |
| void | add (const IComponent *comp, const std::shared_ptr< Parameter > &par, const std::string *const pDescription=nullptr) |
| Method for adding a parameter providing shared pointer to it. | |
| void | add (const std::string &type, const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &visible="true") |
| Method for adding a parameter providing its value as a string. | |
| template<class T > | |
| void | add (const std::string &type, const IComponent *comp, const std::string &name, const T &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Method for adding a parameter providing its value of a particular type. | |
| void | addFittingParameter (const IComponent *comp, 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. | |
| void | clear () |
| Clears the map. | |
| void | clearParametersByName (const std::string &name) |
| Clear any parameters with the given name. | |
| void | clearParametersByName (const std::string &name, const IComponent *comp) |
| Clear any parameters with the given name for a specified component. | |
| const std::string | diff (const ParameterMap &rhs, const bool &firstDiffOnly=false, const bool relative=false, const double doubleTolerance=Kernel::Tolerance) const |
| Output information that helps understanding the mismatch between two parameter maps. | |
| bool | empty () const |
| Returns true if the map is empty, false otherwise. | |
| size_t | getMemorySize () const |
| Get the footprint in memory in bytes. | |
| bool | operator!= (const ParameterMap &rhs) const |
| Inquality comparison operator. | |
| bool | operator== (const ParameterMap &rhs) const |
| Equality comparison operator. | |
| ParameterMap () | |
| Default constructor. | |
| ParameterMap (const ParameterMap &other) | |
| Const constructor. | |
| int | size () const |
| Return the size of the map. | |
| void | swap (ParameterMap &other) |
| method swaps two parameter maps contents each other. | |
| ~ParameterMap () | |
Index-addressed mutators | |
The same operations addressed by component index instead of by a legacy component pointer, for callers that already hold an index. These are the primary implementations; the pointer-based overloads above translate and delegate to them. A componentIndex of ComponentInfo::invalidIndex is ignored, so a caller whose lookup failed need not branch. | |
| void | add (const std::string &type, const size_t componentIndex, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| void | add (const size_t componentIndex, const std::shared_ptr< Parameter > &par, const std::string *const pDescription=nullptr) |
| 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") |
Helper methods for adding and updating parameter types <br> | |
| void | addPositionCoordinate (const IComponent *comp, const std::string &name, const double value, const std::string *const pDescription=nullptr) |
| Create or adjust "pos" parameter for a component. | |
| void | addRotationParam (const IComponent *comp, const std::string &name, const double deg, const std::string *const pDescription=nullptr) |
| Create or adjust "rot" parameter for a component. | |
| void | addDouble (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds a double value to the parameter map. | |
| void | addDouble (const IComponent *comp, const std::string &name, double value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds a double value to the parameter map. | |
| void | addInt (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds an int value to the parameter map. | |
| void | addInt (const IComponent *comp, const std::string &name, int value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds an int value to the parameter map. | |
| void | addBool (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds a bool value to the parameter map. | |
| void | addBool (const IComponent *comp, const std::string &name, bool value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds a bool value to the parameter map. | |
| void | addString (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true") |
| Adds a std::string value to the parameter map. | |
| void | addV3D (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr) |
| Adds a Kernel::V3D value to the parameter map. | |
| void | addV3D (const IComponent *comp, const std::string &name, const Kernel::V3D &value, const std::string *const pDescription=nullptr) |
| Adds a Kernel::V3D value to the parameter map. | |
| void | addQuat (const IComponent *comp, const std::string &name, const Kernel::Quat &value, const std::string *const pDescription=nullptr) |
| Adds a Kernel::Quat value to the parameter map. | |
| void | forceUnsafeSetMasked (const IComponent *comp, bool value) |
| Force adding masking information. | |
| bool | contains (const IComponent *comp, const std::string &name, const std::string &type="") const |
| Does the named parameter exist for the given component and type (std::string version) | |
| bool | contains (const IComponent *comp, const char *name, const char *type="") const |
| Does the named parameter exist for the given component (c-string version) | |
| bool | contains (const IComponent *comp, const Parameter ¶meter) const |
| Does the given parameter & component combination exist. | |
| 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) | |
| std::shared_ptr< Parameter > | get (const IComponent *comp, const char *name, const char *type="") const |
| Get a parameter with a given name and type (c-string version) | |
| std::shared_ptr< Parameter > | getByType (const IComponent *comp, const std::string &type) const |
| Finds the parameter in the map via the parameter type. | |
| std::shared_ptr< Parameter > | getRecursive (const IComponent *comp, const std::string &name, const std::string &type="") const |
| Use get() recursively to see if can find param in all parents of comp and given type (std::string version) | |
| std::shared_ptr< Parameter > | getRecursive (const IComponent *comp, const char *name, const char *type="") const |
| Use get() recursively to see if can find param in all parents of comp and given type (const char type) | |
| std::shared_ptr< Parameter > | getRecursiveByType (const IComponent *comp, const std::string &type) const |
| Looks recursively upwards in the component tree for the first instance of a parameter with a specified type. | |
| std::shared_ptr< Parameter > | getRecursiveFittingParameter (const IComponent *comp, const std::string &name, const std::string &fittingFunction) const |
| Look for a fitting parameter recursively, picking the one whose embedded FitParameter function name matches fittingFunction. | |
| template<class T > | |
| std::vector< T > | getType (const std::string &compName, const std::string &name) const |
| Get the values of a given parameter of all the components that have the name: compName. | |
| const std::string | getDescription (const std::string &compName, const std::string &name) const |
| Get the component description by name. | |
| const std::string | getShortDescription (const std::string &compName, const std::string &name) const |
| Get the component tooltip by name. | |
| std::string | getString (const IComponent *comp, const std::string &name, bool recursive=false) const |
| Return the value of a parameter as a string. | |
| std::vector< std::string > | getString (const std::string &compName, const std::string &name) const |
| Returns a string parameter as vector's first element if exists and an empty vector if it doesn't. | |
| std::vector< double > | getDouble (const std::string &compName, const std::string &name) const |
| Returns a double parameter as vector's first element if exists and an empty vector if it doesn't. | |
| std::vector< Kernel::V3D > | getV3D (const std::string &compName, const std::string &name) const |
| Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't. | |
| std::set< std::string > | names (const IComponent *comp) const |
| Returns a set with all parameter names for component. | |
| std::string | asString () const |
| Returns a string with all component names, parameter names and values. | |
| void | clearPositionSensitiveCaches () |
| Clears the location, rotation & bounding box caches. | |
| void | setCachedLocation (const IComponent *comp, const Kernel::V3D &location) const |
| Sets a cached location on the location cache. | |
| bool | getCachedLocation (const IComponent *comp, Kernel::V3D &location) const |
| Attempts to retrieve a location from the location cache. | |
| void | setCachedRotation (const IComponent *comp, const Kernel::Quat &rotation) const |
| Sets a cached rotation on the rotation cache. | |
| bool | getCachedRotation (const IComponent *comp, Kernel::Quat &rotation) const |
| Attempts to retrieve a rotation from the rotation cache. | |
| void | saveNexus (Nexus::File *file, const std::string &group) const |
| Persist a representation of the Parameter map to the open Nexus file. | |
| void | copyFromParameterMap (const IComponent *oldComp, const IComponent *newComp, const ParameterMap *oldPMap) |
| Copy pairs (oldComp->id,Parameter) to the m_map assigning the new newComp->id. | |
| const std::vector< std::string > & | getParameterFilenames () const |
| Returns a list of all the parameter files loaded. | |
| void | addParameterFilename (const std::string &filename) |
| adds a parameter filename that has been loaded | |
| std::vector< Entry > | entries () const |
| Every stored parameter with its owning component, in component-index order. | |
| bool | hasDetectorInfo (const Instrument *instrument) const |
| Only for use by ExperimentInfo. | |
| bool | hasComponentInfo (const Instrument *instrument) const |
| Only for use by ExperimentInfo. | |
| const Geometry::DetectorInfo & | detectorInfo () const |
| Only for use by ExperimentInfo. Returns a reference to the DetectorInfo. | |
| Geometry::DetectorInfo & | mutableDetectorInfo () |
| Only for use by ExperimentInfo. Returns a reference to the DetectorInfo. | |
| const Geometry::ComponentInfo & | componentInfo () const |
| Only for use by ExperimentInfo. Returns a reference to the ComponentInfo. | |
| Geometry::ComponentInfo & | mutableComponentInfo () |
| Only for use by ExperimentInfo. Returns a reference to the ComponentInfo. | |
| Geometry::InstrumentMetadata const & | instrumentMetadata () const |
| Only for use by ExperimentInfo. Returns a reference to the InstrumentMetadata. | |
| size_t | detectorIndex (const detid_t detID) const |
| Only for use by Detector. Returns a detector index for a detector ID. | |
| size_t | componentIndex (const Geometry::ComponentID componentId) const |
| const std::vector< Geometry::ComponentID > & | componentIds () const |
| void | setInstrument (const Instrument *instrument) |
| Only for use by Instrument. Sets the pointer to the owning instrument. | |
| void | rebuildBeamlineFrom (const ParameterMap &source) |
Rebuild the 2.0 layers for a map that was copy-constructed from source. | |
Static Public Member Functions | |
| static const std::string & | pBool () |
| static const std::string & | pDouble () |
| static const std::string & | pInt () |
| static const std::string & | pos () |
| Return string to be used in the map. | |
| static const std::string & | posx () |
| static const std::string & | posy () |
| static const std::string & | posz () |
| static const std::string & | pQuat () |
| static const std::string & | pString () |
| static const std::string & | pV3D () |
| static const std::string & | rot () |
| static const std::string & | rotx () |
| static const std::string & | roty () |
| static const std::string & | rotz () |
| static const std::string & | scale () |
Shared ownership of the 2.0 layers, for ExperimentInfo only. | |
ExperimentInfo takes co-ownership of whatever setInstrument() built, so that it can serve componentInfo()/detectorInfo()/instrumentMetadata() directly instead of reaching through this map. Null before setInstrument() has run. | |
| std::vector< std::string > | m_parameterFileNames |
| internal list of parameter files loaded | |
| std::shared_ptr< ParameterInfo > | m_parameterInfo |
| The parameter store, owner of the parameter info. | |
| std::unordered_map< Geometry::IComponent const *, size_t > | m_idToIndex |
| Component pointer to index translation. | |
| std::vector< ComponentID > | m_indexToId |
| Reverse of m_idToIndex. | |
| std::unique_ptr< Kernel::Cache< const ComponentID, Kernel::V3D > > | m_cacheLocMap |
| internal cache map instance for cached position values | |
| std::unique_ptr< Kernel::Cache< const ComponentID, Kernel::Quat > > | m_cacheRotMap |
| internal cache map instance for cached rotation values | |
| std::shared_ptr< Geometry::DetectorInfo > | m_detectorInfo |
| The 2.0 instrument layers, co-owned with the ExperimentInfo that built them. | |
| std::shared_ptr< Geometry::ComponentInfo > | m_componentInfo |
| std::shared_ptr< Geometry::InstrumentMetadata > | m_instrumentMetadata |
| const Instrument * | m_instrument {nullptr} |
| Pointer to the owning instrument for translating detector IDs into detector indices when accessing the DetectorInfo object. | |
| const std::shared_ptr< ParameterInfo > & | sharedParameterInfo () const |
| The parameter store this map owns. | |
| const std::shared_ptr< Geometry::ComponentInfo > & | sharedComponentInfo () const |
| const std::shared_ptr< Geometry::DetectorInfo > & | sharedDetectorInfo () const |
| const std::shared_ptr< Geometry::InstrumentMetadata > & | sharedInstrumentMetadata () const |
| 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 indices, returning the resulting store. | |
| std::shared_ptr< Parameter > | create (const std::string &className, const std::string &name, const std::string &visible="true") const |
| Wrapper for ParameterFactory::create to avoid include in header. | |
| ParameterMap & | operator= (ParameterMap *rhs) |
| Assignment operator. | |
| void | buildInstrumentMetadata () |
| Builds m_instrumentMetadata from m_instrument. Requires m_instrument to be set. | |
| bool | relErr (double x1, double x2, double errorVal) const |
| calculate relative error for use in diff | |
| size_t | indexOf (const IComponent *comp) const |
| Index for a component, or ComponentInfo::invalidIndex if this map holds nothing for it. | |
| size_t | indexForWrite (const IComponent *comp) |
| As indexOf(), but allocating a new index for a component seen for the first time. | |
| ComponentID | componentIdAt (const size_t index) const |
| The component an index refers to. Only valid for an index this map issued. | |
Parameter map iterator typedef.
ParameterMap class.
Holds the parameters of modified (parametrized) instrument components. ParameterMap has a number of 'add' methods for adding parameters of different types.
Definition at line 44 of file ParameterMap.h.
| using Mantid::Geometry::ParameterMap::Entry = std::pair<ComponentID, std::shared_ptr<Parameter> > |
A stored parameter together with the component it belongs to.
Definition at line 47 of file ParameterMap.h.
| Mantid::Geometry::ParameterMap::ParameterMap | ( | ) |
Default constructor.
Definition at line 67 of file ParameterMap.cpp.
| Mantid::Geometry::ParameterMap::ParameterMap | ( | const ParameterMap & | other | ) |
Const constructor.
Definition at line 72 of file ParameterMap.cpp.
|
default |
| void Mantid::Geometry::ParameterMap::add | ( | const IComponent * | comp, |
| const std::shared_ptr< Parameter > & | par, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Method for adding a parameter providing shared pointer to it.
Method for adding/replacing a parameter providing shared pointer to it.
The class stores share pointer and increment ref count to it
| comp | :: A pointer to the component that this parameter is attached to |
| par | :: a shared pointer to existing parameter. The ParameterMap stores share pointer and increment ref count to it |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
Definition at line 442 of file ParameterMap.cpp.
References add(), and indexForWrite().
| void Mantid::Geometry::ParameterMap::add | ( | const size_t | componentIndex, |
| const std::shared_ptr< Parameter > & | par, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Definition at line 449 of file ParameterMap.cpp.
References componentIndex(), Mantid::Geometry::ComponentInfo::invalidIndex, and m_parameterInfo.
| void Mantid::Geometry::ParameterMap::add | ( | const std::string & | type, |
| const IComponent * | comp, | ||
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Method for adding a parameter providing its value as a string.
Add a value into the map.
| type | :: A string denoting the type, e.g. double, string, fitting |
| comp | :: A pointer to the component that this parameter is attached to |
| name | :: The name of the parameter |
| value | :: The parameter's value |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 428 of file ParameterMap.cpp.
References add(), Mantid::Geometry::ParameterFactory::create(), name, and value.
Referenced by add(), add(), add(), addBool(), addBool(), addDouble(), addDouble(), addInt(), addInt(), addQuat(), addV3D(), addV3D(), and Mantid::Algorithms::CopyInstrumentParameters::exec().
|
inline |
Method for adding a parameter providing its value of a particular type.
If a parameter already exists then it is replaced with a new one of the given type and value
| T | The concrete type |
| type | :: A string denoting the type, e.g. double, string, fitting |
| comp | :: A pointer to the component that this parameter is attached to |
| name | :: The name of the parameter |
| value | :: The parameter's value |
| pDescription | :: if present, the constant pointer to a constant string, containing parameter's description. |
| pVisible | :: if present, defines whether the parameter should be visible in InstrumentViewer |
Definition at line 126 of file ParameterMap.h.
References Mantid::DataObjects::create(), name, and value.
| void Mantid::Geometry::ParameterMap::add | ( | const std::string & | type, |
| const size_t | componentIndex, | ||
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Definition at line 463 of file ParameterMap.cpp.
References add(), componentIndex(), Mantid::Geometry::ParameterFactory::create(), name, and value.
| void Mantid::Geometry::ParameterMap::addBool | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| bool | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds a bool value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a bool |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 687 of file ParameterMap.cpp.
| void Mantid::Geometry::ParameterMap::addBool | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds a bool value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a string |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 674 of file ParameterMap.cpp.
References add(), name, pBool(), and value.
Referenced by Mantid::API::ExperimentInfo::populateWithParameter().
| void Mantid::Geometry::ParameterMap::addDouble | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds a double value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a string |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 618 of file ParameterMap.cpp.
References add(), name, pDouble(), and value.
Referenced by addRotationParam(), and Mantid::API::ExperimentInfo::populateWithParameter().
| void Mantid::Geometry::ParameterMap::addDouble | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| double | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds a double value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a double |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 632 of file ParameterMap.cpp.
| void Mantid::Geometry::ParameterMap::addFittingParameter | ( | const IComponent * | comp, |
| 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.
Add a fitting parameter, deduplicating by (name, fittingFunction) instead of name alone.
Dedupes by (name, fittingFunction) rather than just name so that two functions attached to the same component sharing a parameter name (e.g. IkedaCarpenterPV:Alpha0 and IkedaCarpenterMD:Alpha0) can coexist in the map.
Two different fitting functions attached to the same component can declare a parameter with the same short name (e.g. Bk2BkExpConvPV:Gamma and IkedaCarpenterPV:Gamma). The regular add() path uses positionOf() which only matches by name and would let one entry silently overwrite the other.
| comp | :: Component the parameter is attached to |
| name | :: Parameter short name (e.g. "Gamma") |
| fittingFunction | :: Name of the fitting function this parameter applies to (may be empty) |
| value | :: Serialised FitParameter value string (as built by ExperimentInfo) |
| pDescription | :: Optional description |
| pVisible | :: Visibility flag |
Definition at line 484 of file ParameterMap.cpp.
References addFittingParameter(), indexForWrite(), name, and value.
Referenced by addFittingParameter(), and Mantid::API::ExperimentInfo::populateWithParameter().
| void Mantid::Geometry::ParameterMap::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" |
||
| ) |
Definition at line 490 of file ParameterMap.cpp.
References componentIndex(), Mantid::Geometry::ParameterFactory::create(), Mantid::Kernel::Logger::debug(), Mantid::Geometry::g_log, Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, name, and value.
| void Mantid::Geometry::ParameterMap::addInt | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds an int value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a string |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 646 of file ParameterMap.cpp.
References add(), name, pInt(), and value.
Referenced by Mantid::API::ExperimentInfo::populateWithParameter().
| void Mantid::Geometry::ParameterMap::addInt | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| int | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds an int value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as an int |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 660 of file ParameterMap.cpp.
| void Mantid::Geometry::ParameterMap::addParameterFilename | ( | const std::string & | filename | ) |
adds a parameter filename that has been loaded
| filename | the filename to add |
Definition at line 1090 of file ParameterMap.cpp.
References m_parameterFileNames.
| void Mantid::Geometry::ParameterMap::addPositionCoordinate | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const double | value, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Create or adjust "pos" parameter for a component.
Create or adjust "pos" parameter for a component Assumed that name either equals "x", "y" or "z" otherwise this method will not add or modify "pos" parameter.
| comp | :: Component |
| name | :: name of the parameter |
| value | :: value |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory |
Definition at line 518 of file ParameterMap.cpp.
References addV3D(), clearPositionSensitiveCaches(), Mantid::Geometry::g_log, get(), Mantid::Geometry::IComponent::getPos(), name, pos(), position, posx(), posy(), posz(), Mantid::Kernel::V3D::setX(), value, and Mantid::Kernel::Logger::warning().
| void Mantid::Geometry::ParameterMap::addQuat | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const Kernel::Quat & | value, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Adds a Kernel::Quat value to the parameter map.
Adds a Quat value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a Quat |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
Definition at line 760 of file ParameterMap.cpp.
References add(), clearPositionSensitiveCaches(), name, pQuat(), and value.
Referenced by addRotationParam().
| void Mantid::Geometry::ParameterMap::addRotationParam | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const double | deg, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Create or adjust "rot" parameter for a component.
Create or adjust "rot" parameter for a component Assumed that name either equals "rotx", "roty" or "rotz" otherwise this method will not add/modify "rot" parameter.
| comp | :: Component |
| name | :: Parameter name |
| deg | :: Parameter value in degrees |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
Definition at line 564 of file ParameterMap.cpp.
References addDouble(), addQuat(), clearPositionSensitiveCaches(), Mantid::Geometry::g_log, get(), name, rot(), rotx(), roty(), rotz(), and Mantid::Kernel::Logger::warning().
| void Mantid::Geometry::ParameterMap::addString | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr, |
||
| const std::string & | pVisible = "true" |
||
| ) |
Adds a std::string value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
| pVisible | :: Whether the parameter should be visible in InstrumentViewer |
Definition at line 719 of file ParameterMap.cpp.
References name, pString(), and value.
Referenced by Mantid::API::ExperimentInfo::populateWithParameter().
| void Mantid::Geometry::ParameterMap::addV3D | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const Kernel::V3D & | value, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Adds a Kernel::V3D value to the parameter map.
Adds a V3D value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a V3D |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
Definition at line 746 of file ParameterMap.cpp.
References add(), clearPositionSensitiveCaches(), name, pV3D(), and value.
| void Mantid::Geometry::ParameterMap::addV3D | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string *const | pDescription = nullptr |
||
| ) |
Adds a Kernel::V3D value to the parameter map.
Adds a V3D value to the parameter map.
| comp | :: Component to which the new parameter is related |
| name | :: Name for the new parameter |
| value | :: Parameter value as a string |
| pDescription | :: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory |
Definition at line 732 of file ParameterMap.cpp.
References add(), clearPositionSensitiveCaches(), name, pV3D(), and value.
Referenced by addPositionCoordinate().
| std::string Mantid::Geometry::ParameterMap::asString | ( | ) | const |
Returns a string with all component names, parameter names and values.
Return a string representation of the parameter map.
The format is either: |detID:id-value;param-type;param-name;param-value| for a detector or |comp-name;param-type;param-name;param-value| for other components.
Definition at line 983 of file ParameterMap.cpp.
References entries(), and Mantid::Geometry::IDetector::getID().
Referenced by diff(), Mantid::Algorithms::CopyInstrumentParameters::exec(), and saveNexus().
|
private |
Builds m_instrumentMetadata from m_instrument. Requires m_instrument to be set.
Definition at line 1197 of file ParameterMap.cpp.
References Mantid::Geometry::Instrument::getDefaultAxis(), Mantid::Geometry::Instrument::getDefaultView(), Mantid::Geometry::Instrument::getFilename(), Mantid::Geometry::Instrument::getPhysicalInstrument(), Mantid::Geometry::Instrument::getValidFromDate(), Mantid::Geometry::Instrument::getValidToDate(), Mantid::Geometry::Instrument::getXmlText(), m_instrument, and m_instrumentMetadata.
Referenced by rebuildBeamlineFrom(), and setInstrument().
|
inline |
Clears the map.
Definition at line 86 of file ParameterMap.h.
| void Mantid::Geometry::ParameterMap::clearParametersByName | ( | const std::string & | name | ) |
Clear any parameters with the given name.
| name | :: The name of the parameter |
Definition at line 392 of file ParameterMap.cpp.
References clearPositionSensitiveCaches(), m_parameterInfo, name, PARALLEL_CRITICAL, pos(), and rot().
| void Mantid::Geometry::ParameterMap::clearParametersByName | ( | const std::string & | name, |
| const IComponent * | comp | ||
| ) |
Clear any parameters with the given name for a specified component.
| name | :: The name of the parameter |
| comp | :: The component to clear parameters from |
Definition at line 406 of file ParameterMap.cpp.
References clearPositionSensitiveCaches(), index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, name, PARALLEL_CRITICAL, pos(), and rot().
| void Mantid::Geometry::ParameterMap::clearPositionSensitiveCaches | ( | ) |
Clears the location, rotation & bounding box caches.
Definition at line 1006 of file ParameterMap.cpp.
References m_cacheLocMap, and m_cacheRotMap.
Referenced by addPositionCoordinate(), addQuat(), addRotationParam(), addV3D(), addV3D(), clearParametersByName(), and clearParametersByName().
|
private |
The component an index refers to. Only valid for an index this map issued.
Definition at line 131 of file ParameterMap.cpp.
References index, and m_indexToId.
| const std::vector< Geometry::ComponentID > & Mantid::Geometry::ParameterMap::componentIds | ( | ) | const |
| size_t Mantid::Geometry::ParameterMap::componentIndex | ( | const Geometry::ComponentID | componentId | ) | const |
Definition at line 1160 of file ParameterMap.cpp.
References m_componentInfo.
Referenced by add(), add(), addFittingParameter(), and Mantid::Geometry::Component::index().
| const Geometry::ComponentInfo & Mantid::Geometry::ParameterMap::componentInfo | ( | ) | const |
Only for use by ExperimentInfo. Returns a reference to the ComponentInfo.
Definition at line 1134 of file ParameterMap.cpp.
References hasComponentInfo(), m_componentInfo, and m_instrument.
Referenced by Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::Instrument::getBoundingBox(), Mantid::Geometry::CompAssembly::getBoundingBox(), Mantid::Geometry::GridDetector::getBoundingBox(), Mantid::Geometry::StructuredDetector::getBoundingBox(), Mantid::Geometry::Component::getPos(), Mantid::Geometry::Component::getRelativePos(), Mantid::Geometry::Component::getRelativeRot(), Mantid::Geometry::Component::getRotation(), Mantid::Geometry::Component::getScaleFactor(), Mantid::Geometry::Instrument::makeBeamline(), and Mantid::Geometry::ObjComponent::solidAngle().
| bool Mantid::Geometry::ParameterMap::contains | ( | const IComponent * | comp, |
| const char * | name, | ||
| const char * | type = "" |
||
| ) | const |
Does the named parameter exist for the given component (c-string version)
Avoids having to instantiate temporary std::string in method below when called with a string directly.
| comp | :: The component to be searched as a c-string |
| name | :: The name of the parameter |
| type | :: The type of the component |
Definition at line 785 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, and name.
| bool Mantid::Geometry::ParameterMap::contains | ( | const IComponent * | comp, |
| const Parameter & | parameter | ||
| ) | const |
Does the given parameter & component combination exist.
| comp | A pointer to a component |
| parameter | A Parameter object |
Definition at line 796 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, and Mantid::Geometry::Parameter::name().
| bool Mantid::Geometry::ParameterMap::contains | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | type = "" |
||
| ) | const |
Does the named parameter exist for the given component and type (std::string version)
Does the named parameter exist for the given component and given type.
| comp | :: The component to be searched |
| name | :: The name of the parameter |
| type | :: The type of the component as a string |
Definition at line 773 of file ParameterMap.cpp.
References contains(), and name.
Referenced by contains(), Mantid::Geometry::GridDetector::getBoundingBoxAtXYZ(), Mantid::API::ExperimentInfo::getEMode(), Mantid::Geometry::Component::getRelativePos(), Mantid::Geometry::GridDetector::getRelativePosAtXYZ(), Mantid::Geometry::Component::getRelativeRot(), Mantid::Geometry::Component::hasParameter(), Mantid::Geometry::GridDetector::xsize(), Mantid::Geometry::GridDetector::xstart(), Mantid::Geometry::GridDetector::xstep(), Mantid::Geometry::GridDetector::ysize(), Mantid::Geometry::GridDetector::ystart(), Mantid::Geometry::GridDetector::ystep(), Mantid::Geometry::GridDetector::zsize(), Mantid::Geometry::GridDetector::zstart(), and Mantid::Geometry::GridDetector::zstep().
| void Mantid::Geometry::ParameterMap::copyFromParameterMap | ( | const IComponent * | oldComp, |
| const IComponent * | newComp, | ||
| const ParameterMap * | oldPMap | ||
| ) |
Copy pairs (oldComp->id,Parameter) to the m_map assigning the new newComp->id.
| oldComp | :: Old component |
| newComp | :: New component |
| oldPMap | :: Old map corresponding to the Old component |
Definition at line 1048 of file ParameterMap.cpp.
References get(), indexForWrite(), m_parameterInfo, and names().
|
private |
Wrapper for ParameterFactory::create to avoid include in header.
Definition at line 1093 of file ParameterMap.cpp.
References Mantid::Geometry::ParameterFactory::create(), and name.
Referenced by forceUnsafeSetMasked().
| size_t Mantid::Geometry::ParameterMap::detectorIndex | ( | const detid_t | detID | ) | const |
Only for use by Detector. Returns a detector index for a detector ID.
Definition at line 1158 of file ParameterMap.cpp.
References Mantid::Geometry::Instrument::detectorIndex(), and m_instrument.
Referenced by Mantid::Geometry::Detector::index().
| const Geometry::DetectorInfo & Mantid::Geometry::ParameterMap::detectorInfo | ( | ) | const |
Only for use by ExperimentInfo. Returns a reference to the DetectorInfo.
Definition at line 1120 of file ParameterMap.cpp.
References hasDetectorInfo(), m_detectorInfo, and m_instrument.
Referenced by Mantid::Geometry::Instrument::makeBeamline().
| const std::string Mantid::Geometry::ParameterMap::diff | ( | const ParameterMap & | rhs, |
| const bool & | firstDiffOnly = false, |
||
| const bool | relative = false, |
||
| const double | doubleTolerance = Kernel::Tolerance |
||
| ) | const |
Output information that helps understanding the mismatch between two parameter maps.
To loop through the difference between two very large parameter map can take time, in which you can a hit to what causes the difference faster setting firstDiffOnly to true
| rhs | A reference to a ParameterMap object to compare it to |
| firstDiffOnly | If true return only first difference found |
| relative | Indicates whether to treat the error as relative or absolute |
| doubleTolerance | The tolerance to use when comparing parameter values of type double |
Definition at line 311 of file ParameterMap.cpp.
References asString(), entries(), name, relErr(), rhs, size(), and std::to_string().
Referenced by Mantid::Algorithms::CompareWorkspaces::checkInstrument(), and operator==().
|
inline |
Returns true if the map is empty, false otherwise.
Definition at line 55 of file ParameterMap.h.
Referenced by Mantid::Geometry::InstrumentVisitor::walkInstrument().
| std::vector< ParameterMap::Entry > Mantid::Geometry::ParameterMap::entries | ( | ) | const |
Every stored parameter with its owning component, in component-index order.
Definition at line 135 of file ParameterMap.cpp.
References componentIdAt(), index, and m_parameterInfo.
Referenced by asString(), diff(), getDescription(), getShortDescription(), and Mantid::API::ExperimentInfo::populateInstrumentParameters().
| void Mantid::Geometry::ParameterMap::forceUnsafeSetMasked | ( | const IComponent * | comp, |
| bool | value | ||
| ) |
Force adding masking information.
ONLY FOR INTERNAL USE by class Instrument.
ParameterMap usually rejects "legacy style" masking information since it is now stored in DetectorInfo. However, for the purpose of writing files class Instrument needs to insert masking information. This method is only for internal use by class Instrument. ParameterMaps modified by this method are only for use as a temporary.
Definition at line 699 of file ParameterMap.cpp.
References create(), indexForWrite(), m_parameterInfo, name, pBool(), and value.
| std::shared_ptr< Parameter > Mantid::Geometry::ParameterMap::get | ( | const IComponent * | comp, |
| const char * | name, | ||
| const char * | type = "" |
||
| ) | const |
Get a parameter with a given name and type (c-string version)
Return a named parameter of a given type.
Avoids allocating std::string temporaries
| comp | :: Component to which parameter is related |
| name | :: Parameter name |
| type | :: An optional type string |
Definition at line 829 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, and name.
| Parameter_sptr Mantid::Geometry::ParameterMap::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)
Return a named parameter of a given type.
| comp | :: Component to which parameter is related |
| name | :: Parameter name |
| type | :: An optional type string |
Definition at line 818 of file ParameterMap.cpp.
Referenced by addPositionCoordinate(), addRotationParam(), copyFromParameterMap(), get(), Mantid::Geometry::GridDetector::getBoundingBoxAtXYZ(), getDescription(), Mantid::API::ExperimentInfo::getEMode(), Mantid::Geometry::Component::getParamDescription(), Mantid::Geometry::Component::getParameter(), Mantid::Geometry::Component::getParamShortDescription(), getRecursive(), Mantid::Geometry::Component::getRelativePos(), Mantid::Geometry::GridDetectorPixel::getRelativePos(), Mantid::Geometry::GridDetector::getRelativePosAtXYZ(), Mantid::Geometry::Component::getRelativeRot(), Mantid::Geometry::Component::getScaleFactor(), getShortDescription(), getString(), Mantid::Geometry::InstrumentVisitor::InstrumentVisitor(), Mantid::Geometry::GridDetector::xsize(), Mantid::Geometry::GridDetector::xstart(), Mantid::Geometry::GridDetector::xstep(), Mantid::Geometry::GridDetector::ysize(), Mantid::Geometry::GridDetector::ystart(), Mantid::Geometry::GridDetector::ystep(), Mantid::Geometry::GridDetector::zsize(), Mantid::Geometry::GridDetector::zstart(), and Mantid::Geometry::GridDetector::zstep().
| Parameter_sptr Mantid::Geometry::ParameterMap::getByType | ( | const IComponent * | comp, |
| const std::string & | type | ||
| ) | const |
Finds the parameter in the map via the parameter type.
Look for a parameter in the given component by the type of the parameter.
Definition at line 840 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, and m_parameterInfo.
Referenced by getRecursiveByType().
| bool Mantid::Geometry::ParameterMap::getCachedLocation | ( | const IComponent * | comp, |
| Kernel::V3D & | location | ||
| ) | const |
Attempts to retrieve a location from the location cache.
| comp | :: The Component to find the location of |
| location | :: If the location is found it's value will be set here |
Definition at line 1022 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), and m_cacheLocMap.
Referenced by Mantid::Geometry::CompAssembly::getPos(), Mantid::Geometry::Component::getPos(), and Mantid::Geometry::ObjCompAssembly::getPos().
| bool Mantid::Geometry::ParameterMap::getCachedRotation | ( | const IComponent * | comp, |
| Kernel::Quat & | rotation | ||
| ) | const |
Attempts to retrieve a rotation from the rotation cache.
| comp | :: The Component to find the rotation of |
| rotation | :: If the rotation is found it's value will be set here |
Definition at line 1037 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), m_cacheRotMap, and rotation.
Referenced by Mantid::Geometry::Component::getPos(), Mantid::Geometry::CompAssembly::getRotation(), Mantid::Geometry::Component::getRotation(), and Mantid::Geometry::ObjCompAssembly::getRotation().
| const std::string Mantid::Geometry::ParameterMap::getDescription | ( | const std::string & | compName, |
| const std::string & | name | ||
| ) | const |
Get the component description by name.
| compName | :: The name of the component |
| name | :: The name of the parameter |
Definition at line 237 of file ParameterMap.cpp.
|
inline |
Returns a double parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 271 of file ParameterMap.h.
References name.
Referenced by Mantid::WorkflowAlgorithms::SofTwoThetaTOF::clarifyAngleStep().
| size_t Mantid::Geometry::ParameterMap::getMemorySize | ( | ) | const |
Get the footprint in memory in bytes.
Return memory used by the parameter map, in bytes.
Definition at line 1214 of file ParameterMap.cpp.
References m_cacheLocMap, m_cacheRotMap, m_componentInfo, m_detectorInfo, m_idToIndex, m_indexToId, m_parameterFileNames, and m_parameterInfo.
| const std::vector< std::string > & Mantid::Geometry::ParameterMap::getParameterFilenames | ( | ) | const |
Returns a list of all the parameter files loaded.
Definition at line 1085 of file ParameterMap.cpp.
References m_parameterFileNames.
Referenced by Mantid::API::ExperimentInfo::toString().
| Parameter_sptr Mantid::Geometry::ParameterMap::getRecursive | ( | const IComponent * | comp, |
| const char * | name, | ||
| const char * | type = "" |
||
| ) | const |
Use get() recursively to see if can find param in all parents of comp and given type (const char type)
Find a parameter by name, recursively going up the component tree to higher parents.
| comp | :: The component to start the search with |
| name | :: Parameter name |
| type | :: An optional type string |
Definition at line 885 of file ParameterMap.cpp.
References get(), Mantid::Geometry::IComponent::getComponentID(), Mantid::Geometry::IComponent::getParent(), and name.
| Parameter_sptr Mantid::Geometry::ParameterMap::getRecursive | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | type = "" |
||
| ) | const |
Use get() recursively to see if can find param in all parents of comp and given type (std::string version)
Find a parameter by name, recursively going up the component tree to higher parents.
| comp | :: The component to start the search with |
| name | :: Parameter name |
| type | :: An optional type string |
Definition at line 872 of file ParameterMap.cpp.
References getRecursive(), and name.
Referenced by Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), Mantid::API::TimeAtSampleStrategyIndirect::getEfixed(), Mantid::API::ExperimentInfo::getEFixedForIndirect(), Mantid::Geometry::Component::getFittingParameter(), Mantid::Geometry::Component::getParamDescription(), Mantid::Geometry::Component::getParameter(), Mantid::Geometry::Component::getParamShortDescription(), getRecursive(), getString(), and Mantid::Geometry::Component::setDescription().
| Parameter_sptr Mantid::Geometry::ParameterMap::getRecursiveByType | ( | const IComponent * | comp, |
| const std::string & | type | ||
| ) | const |
Looks recursively upwards in the component tree for the first instance of a parameter with a specified type.
Looks recursively upwards in the component tree for the first instance of a component with a matching type.
| comp | :: The component to start the search with |
| type | :: Parameter type |
Definition at line 851 of file ParameterMap.cpp.
References getByType().
| Parameter_sptr Mantid::Geometry::ParameterMap::getRecursiveFittingParameter | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| const std::string & | fittingFunction | ||
| ) | const |
Look for a fitting parameter recursively, picking the one whose embedded FitParameter function name matches fittingFunction.
Find a fitting parameter recursively, picking the one whose embedded FitParameter function name matches the requested fittingFunction.
Multiple fitting parameters can share a short name on the same component (one per function) — getRecursive() would short-circuit on the first match, this walks them all.
When two functions attached to the same component share a parameter short name (e.g. Bk2BkExpConvPV:Gamma and IkedaCarpenterPV:Gamma), getRecursive() short-circuits on the first match and may return the wrong function's parameter. This method walks every entry on each level of the component tree so it can disambiguate by function name.
| comp | :: The component to start the search with |
| name | :: Parameter short name (e.g. "Gamma") |
| fittingFunction | :: The fitting function name this parameter must belong to |
Definition at line 914 of file ParameterMap.cpp.
References Mantid::Geometry::FitParameter::getFunction(), Mantid::Geometry::IComponent::getParent(), index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, and name.
| const std::string Mantid::Geometry::ParameterMap::getShortDescription | ( | const std::string & | compName, |
| const std::string & | name | ||
| ) | const |
Get the component tooltip by name.
Get the component short description by name.
| compName | :: The name of the component |
| name | :: The name of the parameter |
Definition at line 258 of file ParameterMap.cpp.
| std::string Mantid::Geometry::ParameterMap::getString | ( | const IComponent * | comp, |
| const std::string & | name, | ||
| bool | recursive = false |
||
| ) | const |
Return the value of a parameter as a string.
| comp | :: Component to which parameter is related |
| name | :: Parameter name |
| recursive | :: Whether to travel up the instrument tree if not found at this level |
Definition at line 955 of file ParameterMap.cpp.
References get(), getRecursive(), and name.
Referenced by Mantid::API::ExperimentInfo::getLog(), and Mantid::API::ExperimentInfo::getLogAsSingleValue().
|
inline |
Returns a string parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 261 of file ParameterMap.h.
References name.
|
inline |
Get the values of a given parameter of all the components that have the name: compName.
| The | parameter type |
| compName | :: The name of the component |
| name | :: The name of the parameter |
Definition at line 239 of file ParameterMap.h.
References name.
|
inline |
Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 281 of file ParameterMap.h.
References name.
| bool Mantid::Geometry::ParameterMap::hasComponentInfo | ( | const Instrument * | instrument | ) | const |
Only for use by ExperimentInfo.
Returns returns true if this instrument contains a ComponentInfo.
Definition at line 1113 of file ParameterMap.cpp.
References m_componentInfo, and m_instrument.
Referenced by componentInfo(), Mantid::Geometry::Instrument::getBoundingBox(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Instrument::makeBeamline(), and mutableComponentInfo().
| bool Mantid::Geometry::ParameterMap::hasDetectorInfo | ( | const Instrument * | instrument | ) | const |
Only for use by ExperimentInfo.
Returns returns true if this instrument contains a DetectorInfo.
The instrument argument is needed for the special case of having a neutronic and* a physical instrument. Instrument uses the same parameter map for both, but the DetectorInfo is only for the neutronic instrument.
Definition at line 1104 of file ParameterMap.cpp.
References m_detectorInfo, and m_instrument.
Referenced by detectorInfo(), Mantid::Geometry::Detector::hasDetectorInfo(), and mutableDetectorInfo().
|
private |
As indexOf(), but allocating a new index for a component seen for the first time.
Definition at line 114 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), Mantid::Geometry::ComponentInfo::invalidIndex, m_idToIndex, and m_indexToId.
Referenced by add(), addFittingParameter(), copyFromParameterMap(), and forceUnsafeSetMasked().
|
private |
Index for a component, or ComponentInfo::invalidIndex if this map holds nothing for it.
Definition at line 103 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), Mantid::Geometry::ComponentInfo::invalidIndex, and m_idToIndex.
Referenced by clearParametersByName(), contains(), contains(), get(), getByType(), getRecursiveFittingParameter(), and names().
| const Geometry::InstrumentMetadata & Mantid::Geometry::ParameterMap::instrumentMetadata | ( | ) | const |
Only for use by ExperimentInfo. Returns a reference to the InstrumentMetadata.
Definition at line 1150 of file ParameterMap.cpp.
References m_instrumentMetadata.
| Geometry::ComponentInfo & Mantid::Geometry::ParameterMap::mutableComponentInfo | ( | ) |
Only for use by ExperimentInfo. Returns a reference to the ComponentInfo.
Definition at line 1142 of file ParameterMap.cpp.
References hasComponentInfo(), m_componentInfo, and m_instrument.
| Geometry::DetectorInfo & Mantid::Geometry::ParameterMap::mutableDetectorInfo | ( | ) |
Only for use by ExperimentInfo. Returns a reference to the DetectorInfo.
Definition at line 1127 of file ParameterMap.cpp.
References hasDetectorInfo(), m_detectorInfo, and m_instrument.
| std::set< std::string > Mantid::Geometry::ParameterMap::names | ( | const IComponent * | comp | ) | const |
Returns a set with all parameter names for component.
Returns a set with all the parameter names for the given component.
| comp | :: A pointer to the component of interest |
Definition at line 972 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, and m_parameterInfo.
Referenced by copyFromParameterMap(), and Mantid::Geometry::Component::getParameterNames().
| bool Mantid::Geometry::ParameterMap::operator!= | ( | const ParameterMap & | rhs | ) | const |
Inquality comparison operator.
Compares the values in this object with that given for inequality The order of the values in the map is not important.
| rhs | A reference to a ParameterMap object to compare it to |
Definition at line 220 of file ParameterMap.cpp.
References operator==().
|
private |
Assignment operator.
| bool Mantid::Geometry::ParameterMap::operator== | ( | const ParameterMap & | rhs | ) | const |
Equality comparison operator.
Compares the values in this object with that given for equality The order of the values in the map is not important.
| rhs | A reference to a ParameterMap object to compare it to |
Definition at line 228 of file ParameterMap.cpp.
Referenced by operator!=().
|
static |
Definition at line 203 of file ParameterMap.cpp.
Referenced by addBool(), addBool(), Mantid::Geometry::ComponentInfo::addBool(), and forceUnsafeSetMasked().
|
static |
Definition at line 199 of file ParameterMap.cpp.
Referenced by addDouble(), addDouble(), and Mantid::Geometry::ComponentInfo::addDouble().
|
static |
Definition at line 201 of file ParameterMap.cpp.
Referenced by addInt(), addInt(), and Mantid::Geometry::ComponentInfo::addInt().
|
static |
Return string to be used in the map.
Return string to be inserted into the parameter map.
Definition at line 181 of file ParameterMap.cpp.
Referenced by addPositionCoordinate(), clearParametersByName(), clearParametersByName(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
|
static |
Definition at line 183 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 185 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 187 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 209 of file ParameterMap.cpp.
Referenced by addQuat(), and Mantid::Geometry::ComponentInfo::addQuat().
|
static |
Definition at line 205 of file ParameterMap.cpp.
Referenced by addString(), and Mantid::Geometry::ComponentInfo::addString().
|
static |
Definition at line 207 of file ParameterMap.cpp.
Referenced by addV3D(), addV3D(), and Mantid::Geometry::ComponentInfo::addV3D().
| void Mantid::Geometry::ParameterMap::rebuildBeamlineFrom | ( | const ParameterMap & | source | ) |
Rebuild the 2.0 layers for a map that was copy-constructed from source.
The copy constructor deliberately leaves them null; ExperimentInfo calls this after copying, because it is the owner and the only caller that needs them. A map whose instrument is not set is left alone.
Definition at line 84 of file ParameterMap.cpp.
References buildInstrumentMetadata(), m_componentInfo, m_detectorInfo, m_instrument, and Mantid::Geometry::Instrument::makeBeamline().
| std::shared_ptr< ParameterInfo > Mantid::Geometry::ParameterMap::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 indices, returning the resulting store.
Definition at line 150 of file ParameterMap.cpp.
References componentIdAt(), index, m_idToIndex, m_indexToId, and m_parameterInfo.
Referenced by Mantid::Geometry::InstrumentVisitor::makeParameterInfo().
|
private |
calculate relative error for use in diff
Function which calculates relative error between two values and analyses if this error is within the limits requested.
When the absolute value of the difference is smaller then the value of the error requested, absolute error is used instead of relative error.
| x1 | – first value to check difference |
| x2 | – second value to check difference |
| errorVal | – the value of the error, to check against. Should be large then 0 |
Definition at line 287 of file ParameterMap.cpp.
Referenced by diff().
|
static |
Definition at line 190 of file ParameterMap.cpp.
Referenced by addRotationParam(), clearParametersByName(), clearParametersByName(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
|
static |
Definition at line 192 of file ParameterMap.cpp.
Referenced by addRotationParam().
|
static |
Definition at line 194 of file ParameterMap.cpp.
Referenced by addRotationParam().
|
static |
Definition at line 196 of file ParameterMap.cpp.
Referenced by addRotationParam().
| void Mantid::Geometry::ParameterMap::saveNexus | ( | Nexus::File * | file, |
| const std::string & | group | ||
| ) | const |
Persist a representation of the Parameter map to the open Nexus file.
Save the object to an open NeXus file.
| file | :: open NeXus file |
| group | :: name of the group to create |
Definition at line 1065 of file ParameterMap.cpp.
References asString(), and group.
|
static |
Definition at line 212 of file ParameterMap.cpp.
Referenced by Mantid::Geometry::Component::getScaleFactor(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
| void Mantid::Geometry::ParameterMap::setCachedLocation | ( | const IComponent * | comp, |
| const Kernel::V3D & | location | ||
| ) | const |
Sets a cached location on the location cache.
| comp | :: The Component to set the location of |
| location | :: The location |
Definition at line 1014 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), and m_cacheLocMap.
Referenced by Mantid::Geometry::CompAssembly::getPos(), and Mantid::Geometry::ObjCompAssembly::getPos().
| void Mantid::Geometry::ParameterMap::setCachedRotation | ( | const IComponent * | comp, |
| const Kernel::Quat & | rotation | ||
| ) | const |
Sets a cached rotation on the rotation cache.
| comp | :: The Component to set the rotation of |
| rotation | :: The rotation as a quaternion |
Definition at line 1029 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), m_cacheRotMap, and rotation.
Referenced by Mantid::Geometry::CompAssembly::getRotation(), and Mantid::Geometry::ObjCompAssembly::getRotation().
| void Mantid::Geometry::ParameterMap::setInstrument | ( | const Instrument * | instrument | ) |
Only for use by Instrument. Sets the pointer to the owning instrument.
Definition at line 1165 of file ParameterMap.cpp.
References buildInstrumentMetadata(), Mantid::Geometry::Component::isParametrized(), m_componentInfo, m_detectorInfo, m_instrument, m_instrumentMetadata, m_parameterInfo, Mantid::Geometry::Instrument::makeBeamline(), and Mantid::Geometry::Instrument::makeBeamlineNew().
|
inline |
Definition at line 343 of file ParameterMap.h.
|
inline |
Definition at line 344 of file ParameterMap.h.
|
inline |
Definition at line 345 of file ParameterMap.h.
|
inline |
The parameter store this map owns.
Instrument::makeWrappers() installs it into a freshly cloned ComponentInfo, so that the clone reads this map's parameters rather than the ones belonging to whichever ComponentInfo it was cloned from.
Definition at line 342 of file ParameterMap.h.
|
inline |
|
inline |
method swaps two parameter maps contents each other.
All caches contents is nullified (TO DO: it can be efficiently swapped too)
Definition at line 94 of file ParameterMap.h.
|
private |
internal cache map instance for cached position values
Definition at line 382 of file ParameterMap.h.
Referenced by clearPositionSensitiveCaches(), getCachedLocation(), getMemorySize(), and setCachedLocation().
|
private |
internal cache map instance for cached rotation values
Definition at line 384 of file ParameterMap.h.
Referenced by clearPositionSensitiveCaches(), getCachedRotation(), getMemorySize(), and setCachedRotation().
|
private |
Definition at line 397 of file ParameterMap.h.
Referenced by componentIndex(), componentInfo(), getMemorySize(), hasComponentInfo(), mutableComponentInfo(), rebuildBeamlineFrom(), and setInstrument().
|
private |
The 2.0 instrument layers, co-owned with the ExperimentInfo that built them.
ExperimentInfo is the primary owner and serves its own accessors from its copies of these pointers rather than reaching through this map. They are co-owned here, rather than merely pointed at, because a parametrized legacy Component reaches ComponentInfo ONLY through its ParameterMap (Component::getPos() -> m_map->componentInfo().position(index())), and ExperimentInfo::getInstrument() hands out parametrized instruments that share this map and may outlive the ExperimentInfo. Shared ownership is what keeps those from dangling.
All NULL unless the instrument is associated with an ExperimentInfo object.
Definition at line 396 of file ParameterMap.h.
Referenced by detectorInfo(), getMemorySize(), hasDetectorInfo(), mutableDetectorInfo(), rebuildBeamlineFrom(), and setInstrument().
|
private |
Component pointer to index translation.
Definition at line 377 of file ParameterMap.h.
Referenced by getMemorySize(), indexForWrite(), indexOf(), and rekey().
|
private |
Reverse of m_idToIndex.
Needed because several accessors (asString, diff, getType) must recover the component from a stored parameter to report its name.
Definition at line 380 of file ParameterMap.h.
Referenced by componentIdAt(), getMemorySize(), indexForWrite(), and rekey().
|
private |
Pointer to the owning instrument for translating detector IDs into detector indices when accessing the DetectorInfo object.
If the workspace distinguishes between a neutronic instrument and a physical instrument the owning instrument is the neutronic one.
Definition at line 404 of file ParameterMap.h.
Referenced by buildInstrumentMetadata(), componentInfo(), detectorIndex(), detectorInfo(), hasComponentInfo(), hasDetectorInfo(), mutableComponentInfo(), mutableDetectorInfo(), rebuildBeamlineFrom(), and setInstrument().
|
private |
Definition at line 398 of file ParameterMap.h.
Referenced by buildInstrumentMetadata(), instrumentMetadata(), and setInstrument().
|
private |
internal list of parameter files loaded
Definition at line 371 of file ParameterMap.h.
Referenced by addParameterFilename(), getMemorySize(), and getParameterFilenames().
|
private |
The parameter store, owner of the parameter info.
Definition at line 374 of file ParameterMap.h.
Referenced by add(), addFittingParameter(), clearParametersByName(), clearParametersByName(), contains(), contains(), copyFromParameterMap(), entries(), forceUnsafeSetMasked(), get(), getByType(), getMemorySize(), getRecursiveFittingParameter(), names(), rekey(), and setInstrument().