|
Mantid
|
Parameter map iterator typedef. More...
#include <ParameterMap.h>
Public Types | |
| using | Entry = std::pair< size_t, std::shared_ptr< Parameter > > |
| A stored parameter together with the component index of 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") |
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. | |
| using | ComponentIDs = std::vector< Geometry::IComponent * > |
| The components of one instrument, by index, as held by its ComponentInfo. | |
| using | ComponentIndices = std::unordered_map< Geometry::IComponent const *, size_t > |
| The reverse of ComponentIDs. | |
| 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::shared_ptr< const ComponentIDs > | m_domainIds |
| The index domain: the components of the instrument this map is attached to, shared with that instrument's ComponentInfo. | |
| std::shared_ptr< const ComponentIndices > | m_domainIndices |
| std::unordered_map< Geometry::IComponent const *, size_t > | m_stagedIndices |
| Staging indices, for the components of a detached map, which has no component indices yet. | |
| std::vector< ComponentID > | m_stagedIds |
| 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 (std::shared_ptr< const ComponentIDs > componentIds, std::shared_ptr< const ComponentIndices > componentIndices) |
| Attach this map to an instrument's component index domain, rekeying its parameters onto the instrument's component indices, and return 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. | |
| void | seedLogfileParameters () |
| Copies m_instrument's logfile parameters into the store. Requires the beamline to be built. | |
| bool | relErr (double x1, double x2, double errorVal) const |
| calculate relative error for use in diff | |
| size_t | domainSize () const |
| The number of components in the index domain. | |
| 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 staging index for a component of a detached map seen for the first time. | |
| std::string | componentName (const size_t index) const |
| The name of the component with this store index. | |
| std::string | componentFullName (const size_t index) const |
| The full name of the component with this store index. | |
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 | 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 component's index in the instrument this map belongs to, 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 std::string | asString (const std::vector< Entry > &entries, const ComponentInfo &componentInfo, const DetectorInfo &detectorInfo) |
| Returns the same for the given parameters, naming their components from the given layers. | |
| static std::string | asStringEntry (const std::string &component, const Parameter ¶meter) |
| Returns the asString() entry for one parameter of a component, given as "detID:<id>" or by full name. | |
| static void | saveNexus (Nexus::File *file, const std::string &group, const std::string &contents) |
| Persist a representation of a Parameter map, as given by asString(), to the open Nexus file. | |
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 41 of file ParameterMap.h.
| using Mantid::Geometry::ParameterMap::ComponentIDs = std::vector<Geometry::IComponent *> |
The components of one instrument, by index, as held by its ComponentInfo.
Definition at line 342 of file ParameterMap.h.
| using Mantid::Geometry::ParameterMap::ComponentIndices = std::unordered_map<Geometry::IComponent const *, size_t> |
The reverse of ComponentIDs.
Definition at line 344 of file ParameterMap.h.
| using Mantid::Geometry::ParameterMap::Entry = std::pair<size_t, std::shared_ptr<Parameter> > |
A stored parameter together with the component index of the component it belongs to.
Definition at line 44 of file ParameterMap.h.
| Mantid::Geometry::ParameterMap::ParameterMap | ( | ) |
Default constructor.
Definition at line 66 of file ParameterMap.cpp.
| Mantid::Geometry::ParameterMap::ParameterMap | ( | const ParameterMap & | other | ) |
Const constructor.
Definition at line 68 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 456 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 463 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 442 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(), and addV3D().
|
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 122 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 477 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 696 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 683 of file ParameterMap.cpp.
| 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 627 of file ParameterMap.cpp.
References add(), name, pDouble(), and value.
Referenced by addRotationParam().
| 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 641 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 498 of file ParameterMap.cpp.
References addFittingParameter(), indexForWrite(), name, and value.
Referenced by addFittingParameter().
| 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 504 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 655 of file ParameterMap.cpp.
| 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 669 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 1080 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 532 of file ParameterMap.cpp.
References addV3D(), 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 767 of file ParameterMap.cpp.
References add(), 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 576 of file ParameterMap.cpp.
References addDouble(), addQuat(), 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 728 of file ParameterMap.cpp.
| 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 754 of file ParameterMap.cpp.
| 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 741 of file ParameterMap.cpp.
References add(), 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 989 of file ParameterMap.cpp.
References asString(), componentInfo(), detectorInfo(), entries(), and m_parameterInfo.
Referenced by asString(), diff(), and Mantid::Geometry::Instrument::saveNexus().
|
static |
Returns the same for the given parameters, naming their components from the given layers.
Return the asString() representation of the given parameters.
| entries | :: The parameters, by component index |
| componentInfo | :: The ComponentInfo the component indices refer to |
| detectorInfo | :: The DetectorInfo that goes with it |
Definition at line 1003 of file ParameterMap.cpp.
References asStringEntry(), componentInfo(), Mantid::Geometry::DetectorInfo::detectorIDs(), detectorInfo(), entries(), Mantid::Geometry::ComponentInfo::fullName(), index, Mantid::Geometry::ComponentInfo::isDetector(), and std::to_string().
|
static |
Returns the asString() entry for one parameter of a component, given as "detID:<id>" or by full name.
Return the asString() representation of one parameter.
| component | :: The component, as "detID:id-value" for a detector or its full name otherwise |
| parameter | :: The parameter |
Definition at line 1025 of file ParameterMap.cpp.
References Mantid::Geometry::Parameter::asString(), Mantid::Geometry::Parameter::name(), Mantid::Geometry::Parameter::type(), and Mantid::Geometry::Parameter::visible().
Referenced by asString(), and Mantid::Algorithms::CopyInstrumentParameters::exec().
|
private |
Builds m_instrumentMetadata from m_instrument. Requires m_instrument to be set.
Definition at line 1200 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, m_instrumentMetadata, Mantid::Geometry::InstrumentVisitor::makeWrappers(), and Mantid::Geometry::InstrumentVisitor::walkInstrument().
Referenced by rebuildBeamlineFrom(), and setInstrument().
|
inline |
Clears the map.
Definition at line 83 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 413 of file ParameterMap.cpp.
References m_parameterInfo, name, and PARALLEL_CRITICAL.
| 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 424 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_parameterInfo, name, and PARALLEL_CRITICAL.
|
private |
The full name of the component with this store index.
Definition at line 134 of file ParameterMap.cpp.
References componentInfo(), Mantid::Geometry::ComponentInfo::fullName(), and index.
Referenced by diff().
| const std::vector< Geometry::ComponentID > & Mantid::Geometry::ParameterMap::componentIds | ( | ) | const |
Referenced by rekey().
| size_t Mantid::Geometry::ParameterMap::componentIndex | ( | const Geometry::ComponentID | componentId | ) | const |
Definition at line 1150 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 1124 of file ParameterMap.cpp.
References hasComponentInfo(), m_componentInfo, and m_instrument.
Referenced by asString(), asString(), componentFullName(), componentName(), 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().
|
private |
The name of the component with this store index.
Definition at line 132 of file ParameterMap.cpp.
References componentInfo(), index, and Mantid::Geometry::ComponentInfo::name().
Referenced by getDescription(), and getShortDescription().
| 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 791 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 802 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 779 of file ParameterMap.cpp.
References contains(), and name.
Referenced by contains(), Mantid::Geometry::GridDetector::getBoundingBoxAtXYZ(), 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 1038 of file ParameterMap.cpp.
References get(), indexForWrite(), m_parameterInfo, and names().
|
private |
Wrapper for ParameterFactory::create to avoid include in header.
Definition at line 1083 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 1148 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 1110 of file ParameterMap.cpp.
References hasDetectorInfo(), m_detectorInfo, and m_instrument.
Referenced by asString(), asString(), and 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 327 of file ParameterMap.cpp.
References asString(), componentFullName(), index, m_parameterInfo, name, relErr(), rhs, size(), and std::to_string().
Referenced by Mantid::Algorithms::CompareWorkspaces::checkInstrument(), and operator==().
|
inlineprivate |
The number of components in the index domain.
Definition at line 366 of file ParameterMap.h.
|
inline |
Returns true if the map is empty, false otherwise.
Definition at line 52 of file ParameterMap.h.
Referenced by Mantid::Geometry::InstrumentVisitor::walkInstrument().
| std::vector< ParameterMap::Entry > Mantid::Geometry::ParameterMap::entries | ( | ) | const |
Every stored parameter with its component's index in the instrument this map belongs to, in component-index order.
Throws for a detached map, which has no component indices yet.
Definition at line 136 of file ParameterMap.cpp.
References index, m_domainIds, and m_parameterInfo.
Referenced by asString(), asString(), 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 708 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 835 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 824 of file ParameterMap.cpp.
Referenced by addPositionCoordinate(), addRotationParam(), copyFromParameterMap(), get(), Mantid::Geometry::GridDetector::getBoundingBoxAtXYZ(), 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(), 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 846 of file ParameterMap.cpp.
References index, indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, and m_parameterInfo.
Referenced by getRecursiveByType().
| 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 251 of file ParameterMap.cpp.
References componentName(), index, m_parameterInfo, and name.
|
inline |
Returns a double parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 268 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 1219 of file ParameterMap.cpp.
References m_componentInfo, m_detectorInfo, m_parameterFileNames, m_parameterInfo, m_stagedIds, and m_stagedIndices.
| const std::vector< std::string > & Mantid::Geometry::ParameterMap::getParameterFilenames | ( | ) | const |
Returns a list of all the parameter files loaded.
Definition at line 1075 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 891 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 878 of file ParameterMap.cpp.
References getRecursive(), and name.
Referenced by 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 857 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 920 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 273 of file ParameterMap.cpp.
References componentName(), index, m_parameterInfo, and name.
| 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 961 of file ParameterMap.cpp.
References get(), getRecursive(), and name.
|
inline |
Returns a string parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 258 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 235 of file ParameterMap.h.
|
inline |
Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't.
Definition at line 278 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 1103 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 1094 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 staging index for a component of a detached map seen for the first time.
Throws for a component outside the index domain of an attached map.
Definition at line 116 of file ParameterMap.cpp.
References Mantid::Geometry::IComponent::getComponentID(), Mantid::Geometry::IComponent::getFullName(), indexOf(), Mantid::Geometry::ComponentInfo::invalidIndex, m_domainIndices, m_stagedIds, and m_stagedIndices.
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, m_domainIndices, and m_stagedIndices.
Referenced by clearParametersByName(), contains(), contains(), get(), getByType(), getRecursiveFittingParameter(), indexForWrite(), and names().
| const Geometry::InstrumentMetadata & Mantid::Geometry::ParameterMap::instrumentMetadata | ( | ) | const |
Only for use by ExperimentInfo. Returns a reference to the InstrumentMetadata.
Definition at line 1140 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 1132 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 1117 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 978 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 234 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 242 of file ParameterMap.cpp.
Referenced by operator!=().
|
static |
Definition at line 217 of file ParameterMap.cpp.
Referenced by addBool(), addBool(), Mantid::Geometry::ComponentInfo::addBool(), forceUnsafeSetMasked(), and Mantid::Geometry::Instrument::legacyParameters().
|
static |
Definition at line 213 of file ParameterMap.cpp.
Referenced by addDouble(), addDouble(), and Mantid::Geometry::ComponentInfo::addDouble().
|
static |
Definition at line 215 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 195 of file ParameterMap.cpp.
Referenced by addPositionCoordinate(), and Mantid::Geometry::Instrument::legacyParameters().
|
static |
Definition at line 197 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 199 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 201 of file ParameterMap.cpp.
Referenced by addPositionCoordinate().
|
static |
Definition at line 223 of file ParameterMap.cpp.
Referenced by addQuat(), Mantid::Geometry::ComponentInfo::addQuat(), and Mantid::Geometry::Instrument::legacyParameters().
|
static |
Definition at line 219 of file ParameterMap.cpp.
Referenced by addString(), and Mantid::Geometry::ComponentInfo::addString().
|
static |
Definition at line 221 of file ParameterMap.cpp.
Referenced by addV3D(), addV3D(), Mantid::Geometry::ComponentInfo::addV3D(), and Mantid::Geometry::Instrument::legacyParameters().
| 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 78 of file ParameterMap.cpp.
References buildInstrumentMetadata(), m_componentInfo, m_detectorInfo, m_instrument, m_instrumentMetadata, and Mantid::Geometry::Instrument::makeBeamline().
| std::shared_ptr< ParameterInfo > Mantid::Geometry::ParameterMap::rekey | ( | std::shared_ptr< const ComponentIDs > | componentIds, |
| std::shared_ptr< const ComponentIndices > | componentIndices | ||
| ) |
Attach this map to an instrument's component index domain, rekeying its parameters onto the instrument's component indices, and return the resulting store.
Parameters of components outside the domain are dropped. A map already attached to this domain is left as it is.
Definition at line 154 of file ParameterMap.cpp.
References componentIds(), m_domainIds, m_domainIndices, m_parameterInfo, m_stagedIds, and m_stagedIndices.
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 303 of file ParameterMap.cpp.
Referenced by diff().
|
static |
Definition at line 204 of file ParameterMap.cpp.
Referenced by addRotationParam(), and Mantid::Geometry::Instrument::legacyParameters().
|
static |
Definition at line 206 of file ParameterMap.cpp.
Referenced by addRotationParam().
|
static |
Definition at line 208 of file ParameterMap.cpp.
Referenced by addRotationParam().
|
static |
Definition at line 210 of file ParameterMap.cpp.
Referenced by addRotationParam().
|
static |
Persist a representation of a Parameter map, as given by asString(), to the open Nexus file.
Save a parameter map to an open NeXus file.
| file | :: open NeXus file |
| group | :: name of the group to create |
| contents | :: the parameter map, as given by asString() |
Definition at line 1056 of file ParameterMap.cpp.
References group.
Referenced by Mantid::Geometry::Instrument::saveNexus().
|
static |
Definition at line 226 of file ParameterMap.cpp.
Referenced by Mantid::Geometry::Component::getScaleFactor(), and Mantid::Geometry::Instrument::legacyParameters().
|
private |
Copies m_instrument's logfile parameters into the store. Requires the beamline to be built.
Copies the instrument definition's logfile parameters into this map's store, by component index.
Only a newly attached map is seeded; a copied map already carries its source's logfile parameters, including any added since from a parameter file.
Definition at line 1190 of file ParameterMap.cpp.
References Mantid::Geometry::Instrument::getLogfileCache(), index, Mantid::Geometry::ComponentInfo::invalidIndex, m_componentInfo, m_instrument, and m_parameterInfo.
Referenced by setInstrument().
| void Mantid::Geometry::ParameterMap::setInstrument | ( | const Instrument * | instrument | ) |
Only for use by Instrument. Sets the pointer to the owning instrument.
Definition at line 1155 of file ParameterMap.cpp.
References buildInstrumentMetadata(), Mantid::Geometry::Component::isParametrized(), m_componentInfo, m_detectorInfo, m_instrument, m_instrumentMetadata, m_parameterInfo, Mantid::Geometry::Instrument::makeBeamline(), Mantid::Geometry::Instrument::makeBeamlineNew(), and seedLogfileParameters().
|
inline |
Definition at line 336 of file ParameterMap.h.
|
inline |
Definition at line 337 of file ParameterMap.h.
|
inline |
Definition at line 338 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 335 of file ParameterMap.h.
|
inline |
|
inline |
method swaps two parameter maps contents each other
Definition at line 89 of file ParameterMap.h.
|
private |
Definition at line 405 of file ParameterMap.h.
Referenced by componentIndex(), componentInfo(), getMemorySize(), hasComponentInfo(), mutableComponentInfo(), rebuildBeamlineFrom(), seedLogfileParameters(), 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 404 of file ParameterMap.h.
Referenced by detectorInfo(), getMemorySize(), hasDetectorInfo(), mutableDetectorInfo(), rebuildBeamlineFrom(), and setInstrument().
|
private |
The index domain: the components of the instrument this map is attached to, shared with that instrument's ComponentInfo.
Within it, a component's store index is its component index. Both null for a detached map.
Definition at line 386 of file ParameterMap.h.
|
private |
Definition at line 387 of file ParameterMap.h.
Referenced by indexForWrite(), indexOf(), 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 412 of file ParameterMap.h.
Referenced by buildInstrumentMetadata(), componentInfo(), detectorIndex(), detectorInfo(), hasComponentInfo(), hasDetectorInfo(), mutableComponentInfo(), mutableDetectorInfo(), rebuildBeamlineFrom(), seedLogfileParameters(), and setInstrument().
|
private |
Definition at line 406 of file ParameterMap.h.
Referenced by buildInstrumentMetadata(), instrumentMetadata(), rebuildBeamlineFrom(), and setInstrument().
|
private |
internal list of parameter files loaded
Definition at line 378 of file ParameterMap.h.
Referenced by addParameterFilename(), getMemorySize(), and getParameterFilenames().
|
private |
The parameter store, owner of the parameter info.
Definition at line 381 of file ParameterMap.h.
Referenced by add(), addFittingParameter(), asString(), clearParametersByName(), clearParametersByName(), contains(), contains(), copyFromParameterMap(), diff(), entries(), forceUnsafeSetMasked(), get(), getByType(), getDescription(), getMemorySize(), getRecursiveFittingParameter(), getShortDescription(), names(), rekey(), seedLogfileParameters(), and setInstrument().
|
private |
Definition at line 392 of file ParameterMap.h.
Referenced by getMemorySize(), indexForWrite(), and rekey().
|
private |
Staging indices, for the components of a detached map, which has no component indices yet.
Staging index i is m_stagedIds[i]. rekey() converts them to component indices and clears them.
Definition at line 391 of file ParameterMap.h.
Referenced by getMemorySize(), indexForWrite(), indexOf(), and rekey().