|
Mantid
|
Base Instrument Class. More...
#include <Instrument.h>
Public Types | |
| enum | ContainsState { Full , Partial , None } |
| To determine whether the instrument contains elements of some type. More... | |
Public Member Functions | |
| std::shared_ptr< const Instrument > | baseInstrument () const |
| Pointer to the 'real' instrument, for parametrized instruments. | |
| Instrument * | clone () const override |
| Virtual copy constructor. | |
| ContainsState | containsRectDetectors () const |
| Check whether instrument contains rectangular detectors. | |
| size_t | detectorIndex (const detid_t detID) const |
| Returns the index for a detector ID. Used for accessing DetectorInfo. | |
| std::vector< GridDetector_const_sptr > | findGridDetectors () const |
| std::vector< RectangularDetector_const_sptr > | findRectDetectors () const |
| std::vector< std::shared_ptr< const IComponent > > | getAllComponentsWithName (const std::string &cname) const |
| Returns pointers to all components encountered with the given name. | |
| const IDetector * | getBaseDetector (const detid_t &detector_id) const |
| Gets a pointer to the base (non-parametrized) detector from its ID returns null if the detector has not been found. | |
| Kernel::V3D | getBeamDirection () const |
| Gets the beam direction (i.e. | |
| void | getBoundingBox (BoundingBox &assemblyBox) const override |
| Get the bounding box for this component and store it in the given argument. | |
| std::shared_ptr< IComponent > | getChild (const int i) const override |
| Get a pointer to the ith component within the assembly. Easier to use than. | |
| std::shared_ptr< const IComponent > | getComponentByID (const IComponent *id) const |
| Returns a shared pointer to a component. | |
| const std::string & | getDefaultAxis () const |
| Retrieves from which side the instrument to be viewed from when the instrument viewer first starts, possibilities are "Z+, Z-, X+, ...". | |
| const std::string & | getDefaultView () const |
| Get the default type of the instrument view. | |
| IDetector_const_sptr | getDetector (const detid_t &detector_id) const |
| Gets a pointer to the detector from its ID Note that for getting the detector associated with a spectrum, the MatrixWorkspace::getDetector method should be used rather than this one because it takes account of the possibility of more than one detector contributing to a single spectrum. | |
| IDetector_const_sptr | getDetectorG (const std::set< detid_t > &det_ids) const |
| Returns a pointer to the geometrical object for the given set of IDs. | |
| std::vector< detid_t > | getDetectorIDs (bool skipMonitors=false) const |
| Return a vector of detector IDs in this instrument. | |
| std::vector< IDetector_const_sptr > | getDetectors (const std::set< detid_t > &det_ids) const |
| Returns a list of Detectors for the given detectors ids. | |
| std::vector< IDetector_const_sptr > | getDetectors (const std::vector< detid_t > &det_ids) const |
| Returns a list of Detectors for the given detectors ids. | |
| void | getDetectors (detid2det_map &out_map) const |
| return reference to detector cache | |
| void | getDetectorsInBank (std::vector< IDetector_const_sptr > &dets, const IComponent &comp) const |
| Fill a vector with all the detectors contained (at any depth) in a named component. | |
| void | getDetectorsInBank (std::vector< IDetector_const_sptr > &dets, const std::string &bankName) const |
| Fill a vector with all the detectors contained (at any depth) in a named component. | |
| const std::string & | getFilename () const |
| void | getInstrumentParameters (double &l1, Kernel::V3D &beamline, double &beamline_norm, Kernel::V3D &samplePos) const |
| Get several instrument parameters used in tof to D-space conversion. | |
| InstrumentParameterCache & | getLogfileCache () |
| Get information about the parameters described in the instrument definition file and associated parameter files. | |
| const InstrumentParameterCache & | getLogfileCache () const |
| std::map< std::string, std::string > & | getLogfileUnit () |
| Get information about the units used for parameters described in the IDF and associated parameter files. | |
| void | getMinMaxDetectorIDs (detid_t &min, detid_t &max) const |
| Get the minimum and maximum (inclusive) detector IDs. | |
| std::vector< detid_t > | getMonitors () const |
| Returns a list containing the detector ids of monitors. | |
| std::size_t | getNumberDetectors (bool skipMonitors=false) const |
| std::shared_ptr< ParameterMap > | getParameterMap () const |
| Pointer to the NOT const ParameterMap holding the parameters of the modified instrument components. | |
| std::shared_ptr< const Instrument > | getPhysicalInstrument () const |
| INDIRECT GEOMETRY INSTRUMENTS ONLY: Returns the physical instrument, if one has been specified as distinct from the 'neutronic' one. | |
| std::shared_ptr< const std::vector< IObjComponent_const_sptr > > | getPlottable () const |
| Get pointers to plottable components. | |
| std::shared_ptr< const ReferenceFrame > | getReferenceFrame () const |
| Get refernce Frame. | |
| IComponent_const_sptr | getSample () const |
| Gets a pointer to the Sample Position. | |
| IComponent_const_sptr | getSource () const |
| Gets a pointer to the source. | |
| Types::Core::DateAndTime | getValidFromDate () const |
| Types::Core::DateAndTime | getValidToDate () const |
| const std::string & | getXmlText () const |
| bool | hasSample () const |
| Checks to see if the Instrument has a sample. | |
| bool | hasSource () const |
| Checks to see if the Instrument has a source. | |
| Instrument () | |
| Default constructor. | |
| Instrument (const Instrument &) | |
| Copy constructor This method was added to deal with having distinct neutronic and physical positions in indirect instruments. | |
| Instrument (const std::shared_ptr< const Instrument > &instr, const std::shared_ptr< ParameterMap > &map) | |
| Constructor to create a parametrized instrument. | |
| Instrument (const std::string &name) | |
| Constructor with name. | |
| bool | isEmptyInstrument () const |
| bool | isMonitor (const detid_t &detector_id) const |
| bool | isMonitor (const std::set< detid_t > &detector_ids) const |
| bool | isMonitorViaIndex (const size_t index) const |
| Temporary helper for refactoring. Argument is index, not ID! | |
| void | loadNexus (Nexus::File *file, const std::string &group) |
| Load the object from an open NeXus file. | |
| std::pair< std::unique_ptr< ComponentInfo >, std::unique_ptr< DetectorInfo > > | makeBeamline (ParameterMap &pmap, const ParameterMap *source=nullptr) const |
| Return ComponentInfo and DetectorInfo for instrument given by pmap. | |
| std::shared_ptr< ParameterMap > | makeLegacyParameterMap () const |
| Returns a legacy ParameterMap, containing information that is now stored in DetectorInfo (masking, positions, rotations, scale factors). | |
| void | markAsDetector (const IDetector *) |
| mark a Component which has already been added to the Instrument (as a child comp.) to be a Detector component by adding it to _detectorCache | |
| void | markAsDetectorFinalize () |
| Sorts the detector cache. | |
| void | markAsDetectorIncomplete (const IDetector *) |
| As markAsDetector but without the required sorting. | |
| void | markAsMonitor (const IDetector *) |
| mark a Component which has already been added to the Instrument (as a child comp.) to be a monitor and also add it to _detectorCache for possible later retrieval | |
| void | markAsSamplePos (const IComponent *) |
| mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' samplePos Component. | |
| void | markAsSource (const IComponent *) |
| mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' source Component. | |
| void | parseTreeAndCacheBeamline () |
| Parse the instrument tree and create ComponentInfo and DetectorInfo. | |
| void | removeDetector (IDetector *) |
| Remove a detector from the instrument. | |
| void | saveNexus (Nexus::File *file, const std::string &group) const |
| Save the instrument to an open NeXus file. | |
| void | setDefaultView (const std::string &type) |
| Set the default type of the instrument view. | |
| void | setDefaultViewAxis (const std::string &axis) |
| Retrieves from which side the instrument to be viewed from when the instrument viewer first starts, possibilities are "Z+, Z-, X+, ...". | |
| void | setFilename (const std::string &filename) |
| Set the path to the original IDF .xml file that was loaded for this instrument. | |
| void | setPhysicalInstrument (std::unique_ptr< Instrument >) |
| INDIRECT GEOMETRY INSTRUMENTS ONLY: Sets the physical instrument. | |
| void | setReferenceFrame (std::shared_ptr< ReferenceFrame > frame) |
| Set reference Frame. | |
| void | setValidFromDate (const Types::Core::DateAndTime &val) |
| Set the date from which the instrument definition begins to be valid. | |
| void | setValidToDate (const Types::Core::DateAndTime &val) |
| Set the date at which the instrument definition is no longer valid. | |
| void | setXmlText (const std::string &XmlText) |
| Set the Contents of the IDF .xml file that was loaded for this instrument. | |
| std::string | type () const override |
| String description of the type of component. | |
Public Member Functions inherited from Mantid::Geometry::CompAssembly | |
| int | add (IComponent *) override |
| Add a component to the assembly. | |
| void | addChildren (IComponent *comp) |
| Add a copy (clone) of a component. | |
| int | addCopy (IComponent *) override |
| AddCopy method. | |
| int | addCopy (IComponent *, const std::string &) override |
| Add a copy (clone) of a component and rename it. | |
| CompAssembly () | |
| Empty constructor. | |
| CompAssembly (const CompAssembly &) | |
| Copy constructor. | |
| CompAssembly (const IComponent *base, const ParameterMap *map) | |
| Constructor for parametrized version. | |
| CompAssembly (const std::string &, IComponent *reference=nullptr) | |
| Constructor with a name and parent reference. | |
| void | getChildren (std::vector< IComponent_const_sptr > &outVector, bool recursive) const override |
| Returns a vector of all children contained. | |
| std::shared_ptr< const IComponent > | getComponentByName (const std::string &cname, int nlevels=0) const override |
| Returns a pointer to the first component of assembly encountered with the given name. | |
| Kernel::V3D | getPos () const override |
| Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available. | |
| Kernel::Quat | getRotation () const override |
| Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available. | |
| int | nelements () const override |
| Return the number of elements in the assembly. | |
| CompAssembly & | operator= (const CompAssembly &other) |
| std::shared_ptr< IComponent > | operator[] (int i) const override |
| Get a pointer to the ith component in the assembly. | |
| void | printChildren (std::ostream &) const override |
| Print information about all children. | |
| void | printTree (std::ostream &) const override |
| Print information about all the elements in the tree to a stream Loops through all components in the tree and call printSelf(os). | |
| virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
| int | remove (IComponent *) |
| Remove a component from the assembly. | |
| void | testIntersectionWithChildren (Track &testRay, std::deque< IComponent_const_sptr > &searchQueue) const override |
| Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer | |
| ~CompAssembly () override | |
| Destructor. | |
Public Member Functions inherited from Mantid::Geometry::ICompAssembly | |
| ICompAssembly () | |
Public Member Functions inherited from Mantid::Geometry::IComponent | |
| virtual | ~IComponent ()=default |
| Destructor. | |
Public Member Functions inherited from Mantid::Geometry::Component | |
| Component () | |
| Create Empty Component at Origin, with no orientation and null parent. | |
| Component (const IComponent *base, const ParameterMap *map) | |
| Constructor for parametrized component. | |
| Component (std::string name, const Kernel::V3D &position, const Kernel::Quat &rotation, IComponent *parent=nullptr) | |
| Create a named component with positioning vector, orientation and parent. | |
| Component (std::string name, const Kernel::V3D &position, IComponent *parent=nullptr) | |
| Create a named component with positioning vector, and parent component. | |
| Component (std::string name, IComponent *parent=nullptr) | |
| Create a named component with a parent component (optional) | |
| std::vector< std::shared_ptr< const IComponent > > | getAncestors () const override |
| Return an array of all ancestors. | |
| IComponent const * | getBaseComponent () const override |
| Returns const pointer to base component if this component is parametrized. | |
| ComponentID | getComponentID () const override |
| Returns the ComponentID - a unique identifier of the component. | |
| double | getDistance (const IComponent &) const override |
| Get the distance to another IComponent. | |
| std::string | getFullName () const override |
| Get the full pathname. | |
| std::string | getName () const override |
| Get the IComponent name. | |
| std::shared_ptr< const IComponent > | getParent () const override |
| Return a pointer to the current parent. as shared pointer. | |
| Kernel::V3D | getPos () const override |
| Get the position of the IComponent. Tree structure is traverse through the. | |
| Kernel::V3D | getRelativePos () const override |
| Get the position relative to the parent IComponent (absolute if no parent) | |
| Kernel::Quat | getRelativeRot () const override |
| Get the relative Orientation. | |
| Kernel::Quat | getRotation () const override |
| Get the absolute orientation of the IComponent. | |
| std::optional< Kernel::V2D > | getSideBySideViewPos () const override |
| Return the position of the component required on the instrument side by side view. | |
| bool | isParentNamed (const std::string &expectedName, int maxDepth=-1) const |
| Return true if one of the parents of this component is named something. | |
| void | rotate (const Kernel::Quat &) override |
| Rotate the IComponent. This is relative to parent. | |
| void | rotate (double, const Kernel::V3D &) override |
| Rotate the IComponent by an angle in degrees with respect to an axis. | |
| void | setName (const std::string &) override |
| Set the IComponent name. | |
| void | setParent (IComponent *) override |
| Assign a parent IComponent. Previous parent link is lost. | |
| void | setPos (const Kernel::V3D &) override |
| Set the position of the Component The position is with respect to the parent Component. | |
| void | setPos (double, double, double) override |
| Set the IComponent position, x, y, z respective to parent (if present) | |
| void | setRot (const Kernel::Quat &) override |
| Set the orientation Kernel::Quaternion relative to parent (if present) | |
| void | setSideBySideViewPos (const Kernel::V2D &) override |
| Set the IComponent position in the side by side instrument view. | |
| void | translate (const Kernel::V3D &) override |
| Translate the IComponent (vector form). This is relative to parent if. | |
| void | translate (double, double, double) override |
| Translate the IComponent (x,y,z form). This is relative to parent if. | |
| virtual std::string | typeName () const |
| std::set< std::string > | getParameterNames (bool recursive=true) const override |
| Return the parameter names. | |
| std::map< std::string, ComponentID > | getParameterNamesByComponent () const override |
| return the parameter names and the component they are from | |
| bool | hasParameter (const std::string &name, bool recursive=true) const override |
| Returns a boolean indicating if the component has the named parameter. | |
| std::vector< double > | getNumberParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a double. | |
| std::vector< int > | getIntParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as an int. | |
| std::string | getParameterType (const std::string &pname, bool recursive=true) const override |
| Get a parameter's type – this is HACK until Python can export property regardless of the property type. | |
| std::string | getDescription () const |
| Get this component parameter's description – no recursive search within children. | |
| std::string | getParamDescription (const std::string &pname, bool recursive=true) const |
| Get description of a parameter attached to this component | |
| std::string | getParamShortDescription (const std::string &pname, bool recursive=true) const |
| Get a component's parameter short description. | |
| std::string | getShortDescription () const |
| Get a components's short description. | |
| void | setDescription (const std::string &descr) |
| Set components description. | |
| std::vector< bool > | getBoolParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a bool. | |
| std::vector< Kernel::V3D > | getPositionParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a Kernel::V3D. | |
| std::vector< Kernel::Quat > | getRotationParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a Kernel::Quaternion. | |
| std::vector< std::string > | getStringParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a string. | |
| std::string | getParameterAsString (const std::string &pname, bool recursive=true) const override |
| get a string representation of a parameter | |
| bool | getParameterVisible (const std::string &p_name, bool recursive) const override |
| Get a visibility attribute of a parameter from the parameter map. | |
| double | getFittingParameter (const std::string &pname, double xvalue) const |
| Get fitting parameter. | |
| void | printSelf (std::ostream &) const override |
| Prints a text representation of itself. | |
| const IComponent * | base () const |
| Returns the address of the base component. | |
| Kernel::V3D | getScaleFactor () const override |
| Returns the ScaleFactor. | |
| const IComponent * | getBareParent () const override |
| Returns the bare pointer to the IComponent parent. | |
| virtual void | readXMLAttributes (const Poco::XML::Attributes &attr) |
| Reads the XML attributes from Poco XML parser. | |
| virtual void | writeXML (Poco::XML::XMLWriter &writer) const |
| virtual void | appendXML (std::ostream &xmlStream) const |
| Append to an open XML string. | |
| bool | isParametrized () const override |
| Return true if the Component is, in fact, parametrized (that is - it has a valid parameter map) | |
| bool | hasComponentInfo () const |
| size_t | index () const |
| Helper for legacy access mode. Returns the index of the component. | |
Private Member Functions | |
| bool | addAssemblyChildrenToQueue (std::queue< IComponent_const_sptr > &queue, IComponent_const_sptr component) const |
| If component is a ComponentAssembly, we add its children to the queue to check if they're Rectangular Detectors and returns true. | |
| void | addInstrumentChildrenToQueue (std::queue< IComponent_const_sptr > &queue) const |
| void | appendPlottable (const CompAssembly &ca, std::vector< IObjComponent_const_sptr > &lst) const |
| Add a plottable component. | |
| template<typename T > | |
| std::vector< std::shared_ptr< const T > > | findDetectorsOfType () const |
| std::pair< std::unique_ptr< ComponentInfo >, std::unique_ptr< DetectorInfo > > | makeWrappers (ParameterMap &pmap, const ComponentInfo &componentInfo, const DetectorInfo &detectorInfo) const |
| Sets up links between m_detectorInfo, m_componentInfo, and m_instrument. | |
| Instrument & | operator= (const Instrument &) |
| Private copy assignment operator. | |
| void | saveDetectorSetInfoToNexus (Nexus::File *file, const std::vector< detid_t > &detIDs) const |
| Save information about a set of detectors to Nexus. | |
| bool | validateComponentProperties (IComponent_const_sptr component) const |
Private Attributes | |
| std::shared_ptr< const ComponentInfo > | m_componentInfo {nullptr} |
| Pointer to the ComponentInfo object. May be NULL. | |
| std::string | m_defaultView |
| Stores the default type of the instrument view: 3D or one of the "unwrapped". | |
| std::string | m_defaultViewAxis |
| Stores from which side the instrument will be viewed from, initially in the instrument viewer, possibilities are "Z+, Z-, X+, ...". | |
| std::vector< std::tuple< detid_t, IDetector_const_sptr, bool > > | m_detectorCache |
| Map which holds detector-IDs and pointers to detector components, and monitor flags. | |
| std::shared_ptr< const DetectorInfo > | m_detectorInfo {nullptr} |
| Pointer to the DetectorInfo object. May be NULL. | |
| std::string | m_filename |
| Path to the original IDF .xml file that was loaded for this instrument. | |
| std::shared_ptr< const Instrument > | m_instr |
| Pointer to the "real" instrument, for parametrized Instrument. | |
| bool | m_isPhysicalInstrument {false} |
| Flag - is this the physical rather than neutronic instrument. | |
| InstrumentParameterCache | m_logfileCache |
| To store info about the parameters defined in IDF. | |
| std::map< std::string, std::string > | m_logfileUnit |
| Store units used by users to specify angles in IDFs and associated parameter files. | |
| std::shared_ptr< ParameterMap > | m_map_nonconst |
| Non-const pointer to the parameter map. | |
| std::shared_ptr< const Instrument > | m_physicalInstrument |
| Pointer to the physical instrument, where this differs from the 'neutronic' one (indirect geometry) | |
| std::shared_ptr< ReferenceFrame > | m_referenceFrame |
| Pointer to the reference frame object. | |
| const IComponent * | m_sampleCache = nullptr |
| Purpose to hold copy of samplePos component. | |
| const IComponent * | m_sourceCache = nullptr |
| Purpose to hold copy of source component. | |
| Types::Core::DateAndTime | m_ValidFrom |
| the date from which the instrument definition begins to be valid. | |
| Types::Core::DateAndTime | m_ValidTo |
| the date at which the instrument definition is no longer valid. | |
| std::string | m_xmlText |
| Contents of the IDF .xml file that was loaded for this instrument. | |
Additional Inherited Members | |
Protected Types inherited from Mantid::Geometry::CompAssembly | |
| using | comp_it = std::vector< IComponent * >::iterator |
| Iterator type. | |
| using | const_comp_it = std::vector< IComponent * >::const_iterator |
| Const iterator type. | |
Protected Member Functions inherited from Mantid::Geometry::ICompAssembly | |
| ICompAssembly (const ICompAssembly &)=default | |
| Protected copy constructor. | |
Protected Member Functions inherited from Mantid::Geometry::Component | |
| template<class TYPE > | |
| std::vector< TYPE > | getParameter (const std::string &p_name, bool recursive) const |
| Get a parameter from the parameter map. | |
| void | swap (const Component *base, const ParameterMap *pmap) |
| Swap the current references to the un-parameterized component and parameter map for new ones. | |
Protected Attributes inherited from Mantid::Geometry::CompAssembly | |
| BoundingBox * | m_cachedBoundingBox |
| A cached bounding box. | |
| std::vector< IComponent * > | m_children |
| the group of child components | |
Protected Attributes inherited from Mantid::Geometry::Component | |
| const IComponent * | m_parent |
| Parent component in the tree. | |
| const Component * | m_base |
| The base component - this is the unmodified component (without the parameters). | |
| const ParameterMap * | m_map |
| A pointer to const ParameterMap containing the parameters. | |
| std::string | m_name |
| Name of the component. | |
| Kernel::V3D | m_pos |
| Position w. | |
| Kernel::Quat | m_rot |
| Orientation. | |
| std::optional< Kernel::V2D > | m_sidebysideviewpos |
| Position of component in instrument viewer side by side view. | |
To determine whether the instrument contains elements of some type.
| Enumerator | |
|---|---|
| Full | |
| Partial | |
| None | |
Definition at line 202 of file Instrument.h.
| Mantid::Geometry::Instrument::Instrument | ( | const std::shared_ptr< const Instrument > & | instr, |
| const std::shared_ptr< ParameterMap > & | map | ||
| ) |
Constructor to create a parametrized instrument.
| instr | :: instrument for parameter inclusion |
| map | :: parameter map to include |
Definition at line 61 of file Instrument.cpp.
| Mantid::Geometry::Instrument::Instrument | ( | ) |
| Mantid::Geometry::Instrument::Instrument | ( | const std::string & | name | ) |
Constructor with name.
Definition at line 53 of file Instrument.cpp.
| Mantid::Geometry::Instrument::Instrument | ( | const Instrument & | instr | ) |
Copy constructor This method was added to deal with having distinct neutronic and physical positions in indirect instruments.
Definition at line 76 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::getChildren(), Mantid::Geometry::IComponent::getName(), isMonitor(), m_sampleCache, m_sourceCache, markAsDetector(), markAsMonitor(), markAsSamplePos(), markAsSource(), and obj.
|
private |
If component is a ComponentAssembly, we add its children to the queue to check if they're Rectangular Detectors and returns true.
Otherwise, it returns false.
Definition at line 1116 of file Instrument.cpp.
Referenced by containsRectDetectors().
|
private |
Definition at line 1108 of file Instrument.cpp.
References getChild(), and Mantid::Geometry::CompAssembly::nelements().
Referenced by containsRectDetectors().
|
private |
Add a plottable component.
Definition at line 793 of file Instrument.cpp.
References appendPlottable(), Mantid::Geometry::d, Mantid::Kernel::Logger::error(), Mantid::Geometry::g_log, and Mantid::Geometry::CompAssembly::nelements().
Referenced by appendPlottable(), and getPlottable().
| Instrument_const_sptr Mantid::Geometry::Instrument::baseInstrument | ( | ) | const |
Pointer to the 'real' instrument, for parametrized instruments.
Definition at line 124 of file Instrument.cpp.
References m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument(), and Mantid::API::ExperimentInfo::readParameterMap().
|
overridevirtual |
Virtual copy constructor.
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 121 of file Instrument.cpp.
References Instrument().
| Instrument::ContainsState Mantid::Geometry::Instrument::containsRectDetectors | ( | ) | const |
Check whether instrument contains rectangular detectors.
Definition at line 1050 of file Instrument.cpp.
References addAssemblyChildrenToQueue(), addInstrumentChildrenToQueue(), Full, None, Partial, and validateComponentProperties().
| size_t Mantid::Geometry::Instrument::detectorIndex | ( | const detid_t | detID | ) | const |
Returns the index for a detector ID. Used for accessing DetectorInfo.
Definition at line 1137 of file Instrument.cpp.
References m_instr, and Mantid::Geometry::Component::m_map.
Referenced by Mantid::Geometry::ParameterMap::detectorIndex().
|
inlineprivate |
Definition at line 231 of file Instrument.h.
|
inline |
Definition at line 211 of file Instrument.h.
Referenced by export_Instrument().
|
inline |
Definition at line 208 of file Instrument.h.
Referenced by export_Instrument().
| std::vector< std::shared_ptr< const IComponent > > Mantid::Geometry::Instrument::getAllComponentsWithName | ( | const std::string & | cname | ) | const |
Returns pointers to all components encountered with the given name.
Find all components in an Instrument Definition File (IDF) with a given name.
If you know a component has a unique name use instead getComponentByName(), which is as fast or faster for retrieving a uniquely named component.
| cname | :: The name of the component. If there are multiple matches, the first one found is returned. |
Definition at line 396 of file Instrument.cpp.
References Mantid::Geometry::Component::getName().
| const IDetector * Mantid::Geometry::Instrument::getBaseDetector | ( | const detid_t & | detector_id | ) | const |
Gets a pointer to the base (non-parametrized) detector from its ID returns null if the detector has not been found.
| detector_id | The requested detector ID |
Definition at line 480 of file Instrument.cpp.
References m_instr.
| Kernel::V3D Mantid::Geometry::Instrument::getBeamDirection | ( | ) | const |
Gets the beam direction (i.e.
source->sample direction). Not virtual because it relies the getSample() & getPos() virtual functions
Definition at line 372 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::getPos(), getSample(), getSource(), and Mantid::Kernel::normalize().
|
overridevirtual |
Get the bounding box for this component and store it in the given argument.
Get the bounding box for this instrument.
It is simply the sum of the bounding boxes of its children excluding the source
| assemblyBox | :: [Out] The resulting bounding box is stored here. |
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 730 of file Instrument.cpp.
References Mantid::Geometry::ComponentInfo::boundingBox(), Mantid::Geometry::ParameterMap::componentInfo(), getChild(), Mantid::Geometry::IComponent::getComponentID(), getSource(), Mantid::Geometry::BoundingBox::grow(), Mantid::Geometry::ParameterMap::hasComponentInfo(), Mantid::Geometry::Component::index(), Mantid::Geometry::CompAssembly::m_cachedBoundingBox, Mantid::Geometry::CompAssembly::m_children, Mantid::Geometry::Component::m_map, and Mantid::Geometry::CompAssembly::nelements().
|
overridevirtual |
Get a pointer to the ith component within the assembly. Easier to use than.
Get a pointer to the ith component in the assembly.
Note standard C/C++ array notation used, that is, i most be an integer i = 0,1,..., N-1, where N is the number of component in the assembly. Easier to use than the [] operator when you have a pointer
| i | :: The index of the component you want |
| std::runtime_error | if i is not in range |
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 66 of file CompAssembly.cpp.
Referenced by addInstrumentChildrenToQueue(), and getBoundingBox().
| std::shared_ptr< const IComponent > Mantid::Geometry::Instrument::getComponentByID | ( | const IComponent * | id | ) | const |
Returns a shared pointer to a component.
Get a shared pointer to a component by its ID, const version.
| id | :: ID |
Definition at line 379 of file Instrument.cpp.
References Mantid::Geometry::Component::base(), Mantid::Geometry::ParComponentFactory::create(), and Mantid::Geometry::Component::m_map.
|
inline |
Retrieves from which side the instrument to be viewed from when the instrument viewer first starts, possibilities are "Z+, Z-, X+, ...".
Definition at line 154 of file Instrument.h.
|
inline |
Get the default type of the instrument view.
The possible values are: 3D, CYLINDRICAL_X, CYLINDRICAL_Y, CYLINDRICAL_Z, SPHERICAL_X, SPHERICAL_Y, SPHERICAL_Z
Definition at line 147 of file Instrument.h.
Referenced by export_Instrument().
| IDetector_const_sptr Mantid::Geometry::Instrument::getDetector | ( | const detid_t & | detector_id | ) | const |
Gets a pointer to the detector from its ID Note that for getting the detector associated with a spectrum, the MatrixWorkspace::getDetector method should be used rather than this one because it takes account of the possibility of more than one detector contributing to a single spectrum.
| detector_id | The requested detector ID |
| NotFoundError | If no detector is found for the detector ID given |
Definition at line 458 of file Instrument.cpp.
References Mantid::Geometry::ParComponentFactory::createDetector(), m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument(), getDetectorG(), getDetectors(), getDetectors(), getDetectors(), and Mantid::API::ExperimentInfo::readParameterMap().
| IDetector_const_sptr Mantid::Geometry::Instrument::getDetectorG | ( | const std::set< detid_t > & | det_ids | ) | const |
Returns a pointer to the geometrical object for the given set of IDs.
| det_ids | :: A list of detector ids |
| NotFoundError | If no detector is found for the detector ID given |
Definition at line 510 of file Instrument.cpp.
References getDetector().
| std::vector< detid_t > Mantid::Geometry::Instrument::getDetectorIDs | ( | bool | skipMonitors = false | ) | const |
Return a vector of detector IDs in this instrument.
Definition at line 204 of file Instrument.cpp.
References m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
Referenced by saveNexus().
| std::vector< IDetector_const_sptr > Mantid::Geometry::Instrument::getDetectors | ( | const std::set< detid_t > & | det_ids | ) | const |
Returns a list of Detectors for the given detectors ids.
Definition at line 541 of file Instrument.cpp.
References getDetector().
| std::vector< IDetector_const_sptr > Mantid::Geometry::Instrument::getDetectors | ( | const std::vector< detid_t > & | det_ids | ) | const |
Returns a list of Detectors for the given detectors ids.
Definition at line 527 of file Instrument.cpp.
References getDetector().
Referenced by saveDetectorSetInfoToNexus().
| void Mantid::Geometry::Instrument::getDetectors | ( | detid2det_map & | out_map | ) | const |
return reference to detector cache
Fills a copy of the detector cache.
Definition at line 185 of file Instrument.cpp.
References getDetector(), m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
| void Mantid::Geometry::Instrument::getDetectorsInBank | ( | std::vector< IDetector_const_sptr > & | dets, |
| const IComponent & | comp | ||
| ) | const |
Fill a vector with all the detectors contained (at any depth) in a named component.
For example, you might have a bank10 with 4 tubes with 100 pixels each; this will return the 400 contained Detector objects.
| [out] | dets | :: vector filled with detector pointers |
| comp | :: the parent component assembly that contains detectors. |
Definition at line 272 of file Instrument.cpp.
References Mantid::Geometry::ICompAssembly::getChildren().
Referenced by getDetectorsInBank().
| void Mantid::Geometry::Instrument::getDetectorsInBank | ( | std::vector< IDetector_const_sptr > & | dets, |
| const std::string & | bankName | ||
| ) | const |
Fill a vector with all the detectors contained (at any depth) in a named component.
For example, you might have a bank10 with 4 tubes with 100 pixels each; this will return the 400 contained Detector objects.
| [out] | dets | :: vector filled with detector pointers |
| bankName | :: name of the parent component assembly that contains detectors. The name must be unique, otherwise the first matching component (getComponentByName) is used. |
| NotFoundError | if the given bank does not exist. |
Definition at line 298 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::getComponentByName(), and getDetectorsInBank().
| const std::string & Mantid::Geometry::Instrument::getFilename | ( | ) | const |
Definition at line 854 of file Instrument.cpp.
References m_filename, m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument().
| void Mantid::Geometry::Instrument::getInstrumentParameters | ( | double & | l1, |
| Kernel::V3D & | beamline, | ||
| double & | beamline_norm, | ||
| Kernel::V3D & | samplePos | ||
| ) | const |
Get several instrument parameters used in tof to D-space conversion.
| l1 | :: primary flight path (source-sample distance) |
| beamline | :: vector of the direction and length of the beam (source to samepl) |
| beamline_norm | :: 2 * the length of beamline |
| samplePos | :: vector of the position of the sample |
Definition at line 821 of file Instrument.cpp.
References Mantid::Geometry::Component::getName(), getSample(), getSource(), and Mantid::Kernel::V3D::norm().
|
inline |
Get information about the parameters described in the instrument definition file and associated parameter files.
Definition at line 137 of file Instrument.h.
|
inline |
Definition at line 138 of file Instrument.h.
|
inline |
Get information about the units used for parameters described in the IDF and associated parameter files.
Definition at line 142 of file Instrument.h.
Get the minimum and maximum (inclusive) detector IDs.
| min | :: set to the min detector ID |
| max | :: set to the max detector ID |
Definition at line 253 of file Instrument.cpp.
References m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
| std::vector< detid_t > Mantid::Geometry::Instrument::getMonitors | ( | ) | const |
Returns a list containing the detector ids of monitors.
This method returns monitor detector ids.
Definition at line 713 of file Instrument.cpp.
References m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
| std::size_t Mantid::Geometry::Instrument::getNumberDetectors | ( | bool | skipMonitors = false | ) | const |
Definition at line 221 of file Instrument.cpp.
References m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument().
| ParameterMap_sptr Mantid::Geometry::Instrument::getParameterMap | ( | ) | const |
Pointer to the NOT const ParameterMap holding the parameters of the modified instrument components.
Pointer to the ParameterMap holding the parameters of the modified instrument components.
Definition at line 137 of file Instrument.cpp.
References Mantid::Geometry::Component::m_map, and m_map_nonconst.
Referenced by Mantid::Crystal::CalibrationHelpers::adjustBankPositionsAndSizes(), makeLegacyParameterMap(), and Mantid::Crystal::SCDCalibratePanels::saveXmlFile().
| Instrument_const_sptr Mantid::Geometry::Instrument::getPhysicalInstrument | ( | ) | const |
INDIRECT GEOMETRY INSTRUMENTS ONLY: Returns the physical instrument, if one has been specified as distinct from the 'neutronic' one.
Otherwise (and most commonly) returns a null pointer, meaning that the holding instrument is already the physical instrument.
Definition at line 151 of file Instrument.cpp.
References m_instr, Mantid::Geometry::Component::m_map, m_map_nonconst, and m_physicalInstrument.
| std::shared_ptr< const std::vector< IObjComponent_const_sptr > > Mantid::Geometry::Instrument::getPlottable | ( | ) | const |
Get pointers to plottable components.
Definition at line 769 of file Instrument.cpp.
References appendPlottable(), Mantid::Geometry::ParComponentFactory::create(), m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
| std::shared_ptr< const ReferenceFrame > Mantid::Geometry::Instrument::getReferenceFrame | ( | ) | const |
Get refernce Frame.
Getter for the reference frame.
Definition at line 1007 of file Instrument.cpp.
References m_instr, Mantid::Geometry::Component::m_map, and m_referenceFrame.
Referenced by Mantid::Algorithms::BeamProfileFactory::createBeamProfile(), and export_Instrument().
| IComponent_const_sptr Mantid::Geometry::Instrument::getSample | ( | ) | const |
Gets a pointer to the Sample Position.
Definition at line 345 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::CompAssembly(), Mantid::Kernel::Logger::error(), Mantid::Geometry::g_log, Mantid::Geometry::Component::m_base, Mantid::Geometry::Component::m_map, m_sampleCache, and Mantid::Kernel::Logger::warning().
Referenced by export_Instrument(), getBeamDirection(), getInstrumentParameters(), and saveDetectorSetInfoToNexus().
| IComponent_const_sptr Mantid::Geometry::Instrument::getSource | ( | ) | const |
Gets a pointer to the source.
Definition at line 319 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::CompAssembly(), Mantid::Kernel::Logger::error(), Mantid::Geometry::g_log, Mantid::Geometry::Component::m_base, Mantid::Geometry::Component::m_map, m_sourceCache, and Mantid::Kernel::Logger::warning().
Referenced by Mantid::Algorithms::BeamProfileFactory::createBeamProfile(), export_Instrument(), getBeamDirection(), getBoundingBox(), getInstrumentParameters(), and Mantid::Crystal::SCDCalibratePanels::saveXmlFile().
|
inline |
Definition at line 169 of file Instrument.h.
Referenced by export_Instrument(), and Mantid::Crystal::SCDCalibratePanels::saveXmlFile().
|
inline |
Definition at line 172 of file Instrument.h.
Referenced by export_Instrument().
| const std::string & Mantid::Geometry::Instrument::getXmlText | ( | ) | const |
Definition at line 870 of file Instrument.cpp.
References m_instr, Mantid::Geometry::Component::m_map, and m_xmlText.
Referenced by saveNexus().
| bool Mantid::Geometry::Instrument::hasSample | ( | ) | const |
Checks to see if the Instrument has a sample.
Definition at line 314 of file Instrument.cpp.
References m_sampleCache.
| bool Mantid::Geometry::Instrument::hasSource | ( | ) | const |
Checks to see if the Instrument has a source.
Definition at line 309 of file Instrument.cpp.
References m_sourceCache.
| bool Mantid::Geometry::Instrument::isEmptyInstrument | ( | ) | const |
Definition at line 1134 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::nelements().
| bool Mantid::Geometry::Instrument::isMonitor | ( | const detid_t & | detector_id | ) | const |
Definition at line 488 of file Instrument.cpp.
References m_instr, and Mantid::Geometry::Component::m_map.
Referenced by Instrument(), and validateComponentProperties().
| bool Mantid::Geometry::Instrument::isMonitor | ( | const std::set< detid_t > & | detector_ids | ) | const |
Definition at line 496 of file Instrument.cpp.
| bool Mantid::Geometry::Instrument::isMonitorViaIndex | ( | const size_t | index | ) | const |
Temporary helper for refactoring. Argument is index, not ID!
Definition at line 1127 of file Instrument.cpp.
References Mantid::Geometry::Component::index(), m_detectorCache, m_instr, and Mantid::Geometry::Component::m_map.
Referenced by saveNexus().
| void Mantid::Geometry::Instrument::loadNexus | ( | Nexus::File * | file, |
| const std::string & | group | ||
| ) |
Load the object from an open NeXus file.
| file | :: open NeXus file |
| group | :: name of the group to open |
Definition at line 992 of file Instrument.cpp.
References group.
| std::pair< std::unique_ptr< ComponentInfo >, std::unique_ptr< DetectorInfo > > Mantid::Geometry::Instrument::makeBeamline | ( | ParameterMap & | pmap, |
| const ParameterMap * | source = nullptr |
||
| ) | const |
Return ComponentInfo and DetectorInfo for instrument given by pmap.
If suitable ComponentInfo and DetectorInfo are found in this or the (optional) source pmap they are simply copied, otherwise the instrument tree is parsed.
Definition at line 1259 of file Instrument.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::detectorInfo(), Mantid::Geometry::ParameterMap::hasComponentInfo(), m_componentInfo, m_detectorInfo, Mantid::Geometry::InstrumentVisitor::makeWrappers(), and makeWrappers().
Referenced by Mantid::Geometry::ParameterMap::ParameterMap(), and Mantid::Geometry::ParameterMap::setInstrument().
| std::shared_ptr< ParameterMap > Mantid::Geometry::Instrument::makeLegacyParameterMap | ( | ) | const |
Returns a legacy ParameterMap, containing information that is now stored in DetectorInfo (masking, positions, rotations, scale factors).
Definition at line 1145 of file Instrument.cpp.
References Mantid::Geometry::IComponent::getBaseComponent(), getParameterMap(), Mantid::Geometry::IComponent::getRelativePos(), Mantid::Geometry::IComponent::getRelativeRot(), Mantid::Geometry::IComponent::getScaleFactor(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::ComponentInfoBankHelpers::isDetectorFixedInBank(), m_instr, Mantid::Geometry::Component::m_map, Mantid::Geometry::ParameterMap::pos(), Mantid::Geometry::ParameterMap::rot(), Mantid::Geometry::ParameterMap::scale(), Mantid::Kernel::toQuat(), Mantid::Kernel::toQuaterniond(), Mantid::Kernel::toV3D(), and Mantid::Kernel::toVector3d().
Referenced by saveNexus().
|
private |
Sets up links between m_detectorInfo, m_componentInfo, and m_instrument.
Definition at line 1272 of file Instrument.cpp.
References Mantid::Geometry::ComponentInfo::cloneWithoutDetectorInfo(), and Mantid::Geometry::ParComponentFactory::createInstrument().
Referenced by makeBeamline().
| void Mantid::Geometry::Instrument::markAsDetector | ( | const IDetector * | det | ) |
mark a Component which has already been added to the Instrument (as a child comp.) to be a Detector component by adding it to _detectorCache
Mark a Component which has already been added to the Instrument (as a child component) to be a Detector by adding it to a detector cache.
Definition at line 617 of file Instrument.cpp.
References Mantid::Geometry::IDetector::getID(), m_detectorCache, and Mantid::Geometry::Component::m_map.
Referenced by ComponentCreationHelper::addRectangularBank(), Instrument(), ComponentCreationHelper::makeBank(), and markAsMonitor().
| void Mantid::Geometry::Instrument::markAsDetectorFinalize | ( | ) |
Sorts the detector cache.
Called after all detectors have been marked via markAsDetectorIncomplete.
Definition at line 648 of file Instrument.cpp.
References m_detectorCache.
| void Mantid::Geometry::Instrument::markAsDetectorIncomplete | ( | const IDetector * | det | ) |
As markAsDetector but without the required sorting.
Must call markAsDetectorFinalize before accessing detectors.
Definition at line 635 of file Instrument.cpp.
References Mantid::Geometry::IDetector::getID(), m_detectorCache, and Mantid::Geometry::Component::m_map.
| void Mantid::Geometry::Instrument::markAsMonitor | ( | const IDetector * | det | ) |
mark a Component which has already been added to the Instrument (as a child comp.) to be a monitor and also add it to _detectorCache for possible later retrieval
Mark a Component which has already been added to the Instrument class as a monitor and add it to the detector cache.
| Exception::ExistsError | if cannot add detector to cache |
Definition at line 674 of file Instrument.cpp.
References Mantid::Geometry::IDetector::getID(), m_detectorCache, Mantid::Geometry::Component::m_map, and markAsDetector().
Referenced by Instrument().
| void Mantid::Geometry::Instrument::markAsSamplePos | ( | const IComponent * | comp | ) |
mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' samplePos Component.
Mark a component which has already been added to the Instrument (as a child component) to be 'the' samplePos component.
For now it is assumed that we have at most one of these.
NOTE THOUGH THAT THIS METHOD DOES NOT VERIFY THAT THIS IS THE CASE. It is assumed that we have at only one of these. The component is required to have a name.
Definition at line 561 of file Instrument.cpp.
References Mantid::Geometry::g_log, Mantid::Geometry::IComponent::getName(), Mantid::Geometry::Component::m_map, m_sampleCache, and Mantid::Kernel::Logger::warning().
Referenced by Instrument().
| void Mantid::Geometry::Instrument::markAsSource | ( | const IComponent * | comp | ) |
mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' source Component.
Mark a component which has already been added to the Instrument (as a child component) to be 'the' source component.NOTE THOUGH THAT THIS METHOD DOES NOT VERIFY THAT THIS IS THE CASE.
For now it is assumed that we have at most one of these.
It is assumed that we have at only one of these. The component is required to have a name.
Definition at line 594 of file Instrument.cpp.
References Mantid::Geometry::g_log, Mantid::Geometry::IComponent::getName(), Mantid::Geometry::Component::m_map, m_sourceCache, and Mantid::Kernel::Logger::warning().
Referenced by Instrument().
|
private |
Private copy assignment operator.
| void Mantid::Geometry::Instrument::parseTreeAndCacheBeamline | ( | ) |
Parse the instrument tree and create ComponentInfo and DetectorInfo.
This can be called for the base instrument once it is completely created, in particular when it is stored in the InstrumentDataService for reusing it later and avoiding repeated tree walks if several workspaces with the same instrument are loaded.
Definition at line 1245 of file Instrument.cpp.
References Mantid::Geometry::Component::isParametrized(), m_componentInfo, m_detectorInfo, and Mantid::Geometry::InstrumentVisitor::makeWrappers().
| void Mantid::Geometry::Instrument::removeDetector | ( | IDetector * | det | ) |
Remove a detector from the instrument.
Removes a detector from the instrument and from the detector cache.
The object is deleted.
| det | The detector to remove |
Definition at line 691 of file Instrument.cpp.
References Mantid::Geometry::IComponent::getBareParent(), Mantid::Geometry::IDetector::getID(), m_detectorCache, Mantid::Geometry::Component::m_map, and Mantid::Geometry::CompAssembly::remove().
|
private |
Save information about a set of detectors to Nexus.
Definition at line 946 of file Instrument.cpp.
References getDetectors(), getSample(), and Mantid::Kernel::V3D::getSpherical().
Referenced by saveNexus().
| void Mantid::Geometry::Instrument::saveNexus | ( | Nexus::File * | file, |
| const std::string & | group | ||
| ) | const |
Save the instrument to an open NeXus file.
This saves the name, valid date, source xml file name, and the full XML text of the definition file. It also saves the parameter map, in the case of a parametrized instrument.
| file | :: open NeXus file |
| group | :: name of the group to create |
Definition at line 886 of file Instrument.cpp.
References Mantid::Geometry::g_log, getDetectorIDs(), Mantid::Geometry::Component::getName(), getXmlText(), group, isMonitorViaIndex(), Mantid::Geometry::Component::isParametrized(), makeLegacyParameterMap(), saveDetectorSetInfoToNexus(), and Mantid::Kernel::Logger::warning().
| void Mantid::Geometry::Instrument::setDefaultView | ( | const std::string & | type | ) |
Set the default type of the instrument view.
The possible values are: 3D, CYLINDRICAL_X, CYLINDRICAL_Y, CYLINDRICAL_Z, SPHERICAL_X, SPHERICAL_Y, SPHERICAL_Z
| type | :: A string with one of the values: 3D, CYLINDRICAL_X, CYLINDRICAL_Y, CYLINDRICAL_Z, SPHERICAL_X, SPHERICAL_Y, SPHERICAL_Z Caseless. If a wrong value is given logs a warning and sets the view to "3D" |
Definition at line 1023 of file Instrument.cpp.
References Mantid::Geometry::g_log, m_defaultView, type(), and Mantid::Kernel::Logger::warning().
|
inline |
Retrieves from which side the instrument to be viewed from when the instrument viewer first starts, possibilities are "Z+, Z-, X+, ...".
Definition at line 157 of file Instrument.h.
| void Mantid::Geometry::Instrument::setFilename | ( | const std::string & | filename | ) |
Set the path to the original IDF .xml file that was loaded for this instrument.
Definition at line 845 of file Instrument.cpp.
References m_filename, m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument().
| void Mantid::Geometry::Instrument::setPhysicalInstrument | ( | std::unique_ptr< Instrument > | physInst | ) |
INDIRECT GEOMETRY INSTRUMENTS ONLY: Sets the physical instrument.
The holding instrument is then the 'neutronic' one, and is used in all algorithms.
| physInst | A pointer to the physical instrument object. |
Definition at line 173 of file Instrument.cpp.
References Mantid::Geometry::Component::m_map, and m_physicalInstrument.
| void Mantid::Geometry::Instrument::setReferenceFrame | ( | std::shared_ptr< ReferenceFrame > | frame | ) |
Set reference Frame.
Setter for the reference frame.
| frame | : reference frame object to use. |
Definition at line 1001 of file Instrument.cpp.
References m_referenceFrame.
| void Mantid::Geometry::Instrument::setValidFromDate | ( | const Types::Core::DateAndTime & | val | ) |
Set the date from which the instrument definition begins to be valid.
| val | :: date and time |
| InstrumentDefinitionError | Thrown if date is earlier than 1900-01-31 23:59:01 |
Definition at line 1039 of file Instrument.cpp.
References m_filename, and m_ValidFrom.
|
inline |
Set the date at which the instrument definition is no longer valid.
| val | :: date |
Definition at line 179 of file Instrument.h.
| void Mantid::Geometry::Instrument::setXmlText | ( | const std::string & | XmlText | ) |
Set the Contents of the IDF .xml file that was loaded for this instrument.
Definition at line 862 of file Instrument.cpp.
References m_instr, Mantid::Geometry::Component::m_map, and m_xmlText.
|
inlineoverridevirtual |
String description of the type of component.
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 50 of file Instrument.h.
Referenced by setDefaultView().
|
private |
Definition at line 1085 of file Instrument.cpp.
References Mantid::Geometry::IComponent::getComponentID(), isMonitor(), m_sampleCache, m_sourceCache, and name.
Referenced by containsRectDetectors().
|
private |
Pointer to the ComponentInfo object. May be NULL.
Definition at line 328 of file Instrument.h.
Referenced by makeBeamline(), and parseTreeAndCacheBeamline().
|
private |
Stores the default type of the instrument view: 3D or one of the "unwrapped".
Definition at line 295 of file Instrument.h.
Referenced by setDefaultView().
|
private |
Stores from which side the instrument will be viewed from, initially in the instrument viewer, possibilities are "Z+, Z-, X+, ...".
Definition at line 298 of file Instrument.h.
|
private |
Map which holds detector-IDs and pointers to detector components, and monitor flags.
Definition at line 267 of file Instrument.h.
Referenced by getDetectorIDs(), getDetectors(), getMinMaxDetectorIDs(), getMonitors(), getNumberDetectors(), getPlottable(), isMonitorViaIndex(), markAsDetector(), markAsDetectorFinalize(), markAsDetectorIncomplete(), markAsMonitor(), and removeDetector().
|
private |
Pointer to the DetectorInfo object. May be NULL.
Definition at line 325 of file Instrument.h.
Referenced by makeBeamline(), and parseTreeAndCacheBeamline().
|
mutableprivate |
Path to the original IDF .xml file that was loaded for this instrument.
Definition at line 312 of file Instrument.h.
Referenced by getFilename(), setFilename(), and setValidFromDate().
|
private |
Pointer to the "real" instrument, for parametrized Instrument.
Definition at line 301 of file Instrument.h.
Referenced by baseInstrument(), detectorIndex(), getBaseDetector(), getDetector(), getDetectorIDs(), getDetectors(), getFilename(), getMinMaxDetectorIDs(), getMonitors(), getNumberDetectors(), getPhysicalInstrument(), getPlottable(), getReferenceFrame(), getXmlText(), isMonitor(), isMonitorViaIndex(), makeLegacyParameterMap(), setFilename(), and setXmlText().
|
private |
Flag - is this the physical rather than neutronic instrument.
Definition at line 331 of file Instrument.h.
|
private |
To store info about the parameters defined in IDF.
Indexed according to logfile-IDs, which equals logfile filename minus the run number and file extension
Definition at line 280 of file Instrument.h.
|
private |
Store units used by users to specify angles in IDFs and associated parameter files.
By default this one is empty meaning that the default of angle=degree etc are used see docs/source/concepts/InstrumentDefinitionFile.rst However if map below contains e.g. <"angle", "radian"> it means that all "angle"-parameters in the _logfileCache are assumed to have been specified by the user in radian (not degrees)
Definition at line 291 of file Instrument.h.
|
private |
Non-const pointer to the parameter map.
Definition at line 304 of file Instrument.h.
Referenced by getParameterMap(), and getPhysicalInstrument().
|
private |
Pointer to the physical instrument, where this differs from the 'neutronic' one (indirect geometry)
Definition at line 319 of file Instrument.h.
Referenced by getPhysicalInstrument(), and setPhysicalInstrument().
|
private |
Pointer to the reference frame object.
Definition at line 322 of file Instrument.h.
Referenced by getReferenceFrame(), and setReferenceFrame().
|
private |
Purpose to hold copy of samplePos component.
For now assumed to be just one component
Definition at line 275 of file Instrument.h.
Referenced by getSample(), hasSample(), Instrument(), markAsSamplePos(), and validateComponentProperties().
|
private |
Purpose to hold copy of source component.
For now assumed to be just one component
Definition at line 271 of file Instrument.h.
Referenced by getSource(), hasSource(), Instrument(), markAsSource(), and validateComponentProperties().
|
private |
the date from which the instrument definition begins to be valid.
Definition at line 307 of file Instrument.h.
Referenced by setValidFromDate().
|
private |
the date at which the instrument definition is no longer valid.
Definition at line 309 of file Instrument.h.
|
mutableprivate |
Contents of the IDF .xml file that was loaded for this instrument.
Definition at line 315 of file Instrument.h.
Referenced by getXmlText(), and setXmlText().