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 | |
virtual int | add (IComponent *component) override |
Add a component to the instrument. More... | |
std::shared_ptr< const Instrument > | baseInstrument () const |
Pointer to the 'real' instrument, for parametrized instruments. More... | |
Instrument * | clone () const override |
Virtual copy constructor. More... | |
ContainsState | containsRectDetectors () const |
Check whether instrument contains rectangular detectors. More... | |
size_t | detectorIndex (const detid_t detID) const |
Returns the index for a detector ID. Used for accessing DetectorInfo. More... | |
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. More... | |
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. More... | |
Kernel::V3D | getBeamDirection () const |
Gets the beam direction (i.e. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
std::shared_ptr< IComponent > | getChild (const int i) const override |
Get a pointer to the ith component within the assembly. Easier to use than. More... | |
std::shared_ptr< const IComponent > | getComponentByID (const IComponent *id) const |
Returns a shared pointer to a component. More... | |
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+, ...". More... | |
std::string | getDefaultView () const |
Get the default type of the instrument view. More... | |
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. More... | |
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. More... | |
std::vector< detid_t > | getDetectorIDs (bool skipMonitors=false) const |
Return a vector of detector IDs in this instrument. More... | |
std::vector< IDetector_const_sptr > | getDetectors (const std::set< detid_t > &det_ids) const |
Returns a list of Detectors for the given detectors ids. More... | |
std::vector< IDetector_const_sptr > | getDetectors (const std::vector< detid_t > &det_ids) const |
Returns a list of Detectors for the given detectors ids. More... | |
void | getDetectors (detid2det_map &out_map) const |
return reference to detector cache More... | |
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. More... | |
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. More... | |
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. More... | |
InstrumentParameterCache & | getLogfileCache () |
Get information about the parameters described in the instrument definition file and associated parameter files. More... | |
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. More... | |
void | getMinMaxDetectorIDs (detid_t &min, detid_t &max) const |
Get the minimum and maximum (inclusive) detector IDs. More... | |
std::vector< detid_t > | getMonitors () const |
Returns a list containing the detector ids of monitors. More... | |
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. More... | |
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. More... | |
std::shared_ptr< const std::vector< IObjComponent_const_sptr > > | getPlottable () const |
Get pointers to plottable components. More... | |
std::shared_ptr< const ReferenceFrame > | getReferenceFrame () const |
Get refernce Frame. More... | |
IComponent_const_sptr | getSample () const |
Gets a pointer to the Sample Position. More... | |
IComponent_const_sptr | getSource () const |
Gets a pointer to the source. More... | |
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. More... | |
bool | hasSource () const |
Checks to see if the Instrument has a source. More... | |
Instrument () | |
Default constructor. More... | |
Instrument (const Instrument &) | |
Copy constructor This method was added to deal with having distinct neutronic and physical positions in indirect instruments. More... | |
Instrument (const std::shared_ptr< const Instrument > &instr, const std::shared_ptr< ParameterMap > &map) | |
Constructor to create a parametrized instrument. More... | |
Instrument (const std::string &name) | |
Constructor with name. More... | |
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! More... | |
void | loadNexus (::NeXus::File *file, const std::string &group) |
Load the object from an open NeXus file. More... | |
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. More... | |
std::shared_ptr< ParameterMap > | makeLegacyParameterMap () const |
Returns a legacy ParameterMap, containing information that is now stored in DetectorInfo (masking, positions, rotations, scale factors). More... | |
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 More... | |
void | markAsDetectorFinalize () |
Sorts the detector cache. More... | |
void | markAsDetectorIncomplete (const IDetector *) |
As markAsDetector but without the required sorting. More... | |
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 More... | |
void | markAsSamplePos (const IComponent *) |
mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' samplePos Component. More... | |
void | markAsSource (const IComponent *) |
mark a Component which has already been added to the Instrument (as a child comp.) to be 'the' source Component. More... | |
void | parseTreeAndCacheBeamline () |
Parse the instrument tree and create ComponentInfo and DetectorInfo. More... | |
void | removeDetector (IDetector *) |
Remove a detector from the instrument. More... | |
void | saveNexus (::NeXus::File *file, const std::string &group) const |
Save the instrument to an open NeXus file. More... | |
void | setDefaultView (const std::string &type) |
Set the default type of the instrument view. More... | |
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+, ...". More... | |
void | setFilename (const std::string &filename) |
Set the path to the original IDF .xml file that was loaded for this instrument. More... | |
void | setPhysicalInstrument (std::unique_ptr< Instrument >) |
INDIRECT GEOMETRY INSTRUMENTS ONLY: Sets the physical instrument. More... | |
void | setReferenceFrame (std::shared_ptr< ReferenceFrame > frame) |
Set reference Frame. More... | |
void | setValidFromDate (const Types::Core::DateAndTime &val) |
Set the date from which the instrument definition begins to be valid. More... | |
void | setValidToDate (const Types::Core::DateAndTime &val) |
Set the date at which the instrument definition is no longer valid. More... | |
void | setXmlText (const std::string &XmlText) |
Set the Contents of the IDF .xml file that was loaded for this instrument. More... | |
std::string | type () const override |
String description of the type of component. More... | |
Public Member Functions inherited from Mantid::Geometry::CompAssembly | |
int | add (IComponent *) override |
Add a component to the assembly. More... | |
void | addChildren (IComponent *comp) |
Add a copy (clone) of a component. More... | |
int | addCopy (IComponent *) override |
AddCopy method. More... | |
int | addCopy (IComponent *, const std::string &) override |
Add a copy (clone) of a component and rename it. More... | |
IComponent * | clone () const override |
Make a clone of the present component. More... | |
CompAssembly () | |
Empty constructor. More... | |
CompAssembly (const CompAssembly &) | |
Copy constructor. More... | |
CompAssembly (const IComponent *base, const ParameterMap *map) | |
Constructor for parametrized version. More... | |
CompAssembly (const std::string &, IComponent *reference=nullptr) | |
Constructor with a name and parent reference. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
std::shared_ptr< IComponent > | getChild (const int i) const override |
Get a pointer to the ith component within the assembly. Easier to use than. More... | |
void | getChildren (std::vector< IComponent_const_sptr > &outVector, bool recursive) const override |
Returns a vector of all children contained. More... | |
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. More... | |
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. More... | |
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. More... | |
int | nelements () const override |
Return the number of elements in the assembly. More... | |
CompAssembly & | operator= (const CompAssembly &other) |
std::shared_ptr< IComponent > | operator[] (int i) const override |
Get a pointer to the ith component in the assembly. More... | |
void | printChildren (std::ostream &) const override |
Print information about all children. More... | |
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). More... | |
virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
int | remove (IComponent *) |
Remove a component from the assembly. More... | |
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 More... | |
std::string | type () const override |
String description of the type of component. More... | |
~CompAssembly () override | |
Destructor. More... | |
Public Member Functions inherited from Mantid::Geometry::ICompAssembly | |
virtual int | add (IComponent *)=0 |
Add a component to the assembly. More... | |
virtual int | addCopy (IComponent *)=0 |
Add a copy (clone) of a component. More... | |
virtual int | addCopy (IComponent *, const std::string &)=0 |
Add a copy (clone) of a component and rename it. More... | |
IComponent * | clone () const override=0 |
Make a clone of the present component. More... | |
virtual std::shared_ptr< IComponent > | getChild (const int i) const =0 |
Get a pointer to the ith component within the assembly. More... | |
virtual void | getChildren (std::vector< IComponent_const_sptr > &outVector, bool recursive) const =0 |
Get all children. More... | |
virtual std::shared_ptr< const IComponent > | getComponentByName (const std::string &cname, int nlevels=0) const =0 |
Returns a pointer to the first component of assembly encountered with the given name. More... | |
ICompAssembly () | |
virtual int | nelements () const =0 |
Return the number of elements in the assembly. More... | |
virtual std::shared_ptr< IComponent > | operator[] (int i) const =0 |
Overloaded index operator. More... | |
virtual void | printChildren (std::ostream &) const =0 |
Print information about all children. More... | |
virtual void | printTree (std::ostream &) const =0 |
Print information about all the elements in the tree to a stream Loops through all components in the tree and call printSelf(os). More... | |
virtual void | testIntersectionWithChildren (Track &testRay, std::deque< IComponent_const_sptr > &searchQueue) const =0 |
Test the intersection of the ray with the children of the component assembly. More... | |
std::string | type () const override |
String description of the type of component. More... | |
Public Member Functions inherited from Mantid::Geometry::IComponent | |
virtual IComponent * | clone () const =0 |
Return a clone to the current object. More... | |
virtual std::vector< std::shared_ptr< const IComponent > > | getAncestors () const =0 |
Return an array of all ancestors, the nearest first. More... | |
virtual const IComponent * | getBareParent () const =0 |
Returns the bare pointer to the IComponent parent. More... | |
virtual IComponent const * | getBaseComponent () const =0 |
Returns const pointer to base component if this component is parametrized. More... | |
virtual void | getBoundingBox (BoundingBox &boundingBox) const =0 |
Get the bounding box for this component and store it in the given argument. More... | |
virtual ComponentID | getComponentID () const =0 |
Returns the ComponentID - a unique identifier of the component. More... | |
virtual double | getDistance (const IComponent &) const =0 |
Get the distance to another IComponent. More... | |
virtual std::string | getFullName () const =0 |
Get the IComponent full path name. More... | |
virtual std::string | getName () const =0 |
Get the IComponent name. More... | |
virtual std::shared_ptr< const IComponent > | getParent () const =0 |
Return a pointer to the current parent. More... | |
virtual Kernel::V3D | getPos () const =0 |
Get the position of the IComponent. Tree structure is traverse through the. More... | |
virtual Kernel::V3D | getRelativePos () const =0 |
Get the position relative to the parent IComponent (absolute if no parent) More... | |
virtual Kernel::Quat | getRelativeRot () const =0 |
Get the relative Orientation. More... | |
virtual Kernel::Quat | getRotation () const =0 |
Get the absolute orientation of the IComponent. More... | |
virtual Kernel::V3D | getScaleFactor () const |
Gets the scaling factor of the object for the Object Component. More... | |
virtual void | rotate (const Kernel::Quat &)=0 |
Rotate the IComponent. This is relative to parent. More... | |
virtual void | rotate (double, const Kernel::V3D &)=0 |
Rotate the IComponent by an angle in degrees with respect to an axis. More... | |
virtual void | setName (const std::string &)=0 |
Set the IComponent name. More... | |
virtual void | setParent (IComponent *)=0 |
Assign a parent IComponent. Previous parent link is lost. More... | |
virtual void | setPos (const Kernel::V3D &)=0 |
Set the position of the component The position is with respect to the parent component. More... | |
virtual void | setPos (double, double, double)=0 |
Set the IComponent position, x, y, z respective to parent (if present) More... | |
virtual void | setRot (const Kernel::Quat &)=0 |
Set the orientation Kernel::Quaternion relative to parent (if present) More... | |
virtual void | translate (const Kernel::V3D &)=0 |
Copy the Rotation from another IComponent. More... | |
virtual void | translate (double, double, double)=0 |
Translate the IComponent (x,y,z form). This is relative to parent if. More... | |
virtual std::string | type () const |
Returns a string representation of the IComponent type. More... | |
virtual | ~IComponent ()=default |
Destructor. More... | |
Public Member Functions inherited from Mantid::Geometry::Component | |
IComponent * | clone () const override |
Clone method Make a copy of the Component. More... | |
Component () | |
Create Empty Component at Origin, with no orientation and null parent. More... | |
Component (const IComponent *base, const ParameterMap *map) | |
Constructor for parametrized component. More... | |
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. More... | |
Component (std::string name, const Kernel::V3D &position, IComponent *parent=nullptr) | |
Create a named component with positioning vector, and parent component. More... | |
Component (std::string name, IComponent *parent=nullptr) | |
Create a named component with a parent component (optional) More... | |
std::vector< std::shared_ptr< const IComponent > > | getAncestors () const override |
Return an array of all ancestors. More... | |
IComponent const * | getBaseComponent () const override |
Returns const pointer to base component if this component is parametrized. More... | |
void | getBoundingBox (BoundingBox &boundingBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
ComponentID | getComponentID () const override |
Returns the ComponentID - a unique identifier of the component. More... | |
double | getDistance (const IComponent &) const override |
Get the distance to another IComponent. More... | |
std::string | getFullName () const override |
Get the full pathname. More... | |
std::string | getName () const override |
Get the IComponent name. More... | |
std::shared_ptr< const IComponent > | getParent () const override |
Return a pointer to the current parent. as shared pointer. More... | |
Kernel::V3D | getPos () const override |
Get the position of the IComponent. Tree structure is traverse through the. More... | |
Kernel::V3D | getRelativePos () const override |
Get the position relative to the parent IComponent (absolute if no parent) More... | |
Kernel::Quat | getRelativeRot () const override |
Get the relative Orientation. More... | |
Kernel::Quat | getRotation () const override |
Get the absolute orientation of the IComponent. More... | |
bool | isParentNamed (const std::string &expectedName, int maxDepth=-1) const |
Return true if one of the parents of this component is named something. More... | |
void | rotate (const Kernel::Quat &) override |
Rotate the IComponent. This is relative to parent. More... | |
void | rotate (double, const Kernel::V3D &) override |
Rotate the IComponent by an angle in degrees with respect to an axis. More... | |
void | setName (const std::string &) override |
Set the IComponent name. More... | |
void | setParent (IComponent *) override |
Assign a parent IComponent. Previous parent link is lost. More... | |
void | setPos (const Kernel::V3D &) override |
Set the position of the Component The position is with respect to the parent Component. More... | |
void | setPos (double, double, double) override |
Set the IComponent position, x, y, z respective to parent (if present) More... | |
void | setRot (const Kernel::Quat &) override |
Set the orientation Kernel::Quaternion relative to parent (if present) More... | |
void | translate (const Kernel::V3D &) override |
Translate the IComponent (vector form). This is relative to parent if. More... | |
void | translate (double, double, double) override |
Translate the IComponent (x,y,z form). This is relative to parent if. More... | |
virtual std::string | typeName () const |
std::set< std::string > | getParameterNames (bool recursive=true) const override |
Return the parameter names. More... | |
std::map< std::string, ComponentID > | getParameterNamesByComponent () const override |
return the parameter names and the component they are from More... | |
bool | hasParameter (const std::string &name, bool recursive=true) const override |
Returns a boolean indicating if the component has the named parameter. More... | |
std::vector< double > | getNumberParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as a double. More... | |
std::vector< int > | getIntParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as an int. More... | |
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. More... | |
std::string | getDescription () const |
Get this component parameter's description – no recursive search within children. More... | |
std::string | getParamDescription (const std::string &pname, bool recursive=true) const |
Get description of a parameter attached to this component More... | |
std::string | getParamShortDescription (const std::string &pname, bool recursive=true) const |
Get a component's parameter short description. More... | |
std::string | getShortDescription () const |
Get a components's short description. More... | |
void | setDescription (const std::string &descr) |
Set components description. More... | |
std::vector< bool > | getBoolParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as a bool. More... | |
std::vector< Kernel::V3D > | getPositionParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as a Kernel::V3D. More... | |
std::vector< Kernel::Quat > | getRotationParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as a Kernel::Quaternion. More... | |
std::vector< std::string > | getStringParameter (const std::string &pname, bool recursive=true) const override |
Get a parameter defined as a string. More... | |
std::string | getParameterAsString (const std::string &pname, bool recursive=true) const override |
get a string representation of a parameter More... | |
bool | getParameterVisible (const std::string &p_name, bool recursive) const override |
Get a visibility attribute of a parameter from the parameter map. More... | |
void | printSelf (std::ostream &) const override |
Prints a text representation of itself. More... | |
const IComponent * | base () const |
Returns the address of the base component. More... | |
Kernel::V3D | getScaleFactor () const override |
Returns the ScaleFactor. More... | |
const IComponent * | getBareParent () const override |
Returns the bare pointer to the IComponent parent. More... | |
virtual void | readXMLAttributes (const Poco::XML::Attributes &attr) |
Reads the XML attributes from Poco XML parser. More... | |
virtual void | writeXML (Poco::XML::XMLWriter &writer) const |
virtual void | appendXML (std::ostream &xmlStream) const |
Append to an open XML string. More... | |
bool | isParametrized () const override |
Return true if the Component is, in fact, parametrized (that is - it has a valid parameter map) More... | |
bool | hasComponentInfo () const |
size_t | index () const |
Helper for legacy access mode. Returns the index of the component. More... | |
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. More... | |
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. More... | |
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. More... | |
Instrument & | operator= (const Instrument &) |
Private copy assignment operator. More... | |
void | saveDetectorSetInfoToNexus (::NeXus::File *file, const std::vector< detid_t > &detIDs) const |
Save information about a set of detectors to Nexus. More... | |
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. More... | |
std::string | m_defaultView |
Stores the default type of the instrument view: 3D or one of the "unwrapped". More... | |
std::string | m_defaultViewAxis |
Stores from which side the instrument will be viewed from, initially in the instrument viewer, possibilities are "Z+, Z-, X+, ...". More... | |
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. More... | |
std::shared_ptr< const DetectorInfo > | m_detectorInfo {nullptr} |
Pointer to the DetectorInfo object. May be NULL. More... | |
std::string | m_filename |
Path to the original IDF .xml file that was loaded for this instrument. More... | |
std::shared_ptr< const Instrument > | m_instr |
Pointer to the "real" instrument, for parametrized Instrument. More... | |
bool | m_isPhysicalInstrument {false} |
Flag - is this the physical rather than neutronic instrument. More... | |
InstrumentParameterCache | m_logfileCache |
To store info about the parameters defined in IDF. More... | |
std::map< std::string, std::string > | m_logfileUnit |
Store units used by users to specify angles in IDFs and associated parameter files. More... | |
std::shared_ptr< ParameterMap > | m_map_nonconst |
Non-const pointer to the parameter map. More... | |
std::shared_ptr< const Instrument > | m_physicalInstrument |
Pointer to the physical instrument, where this differs from the 'neutronic' one (indirect geometry) More... | |
std::shared_ptr< ReferenceFrame > | m_referenceFrame |
Pointer to the reference frame object. More... | |
const IComponent * | m_sampleCache |
Purpose to hold copy of samplePos component. More... | |
const IComponent * | m_sourceCache |
Purpose to hold copy of source component. More... | |
Types::Core::DateAndTime | m_ValidFrom |
the date from which the instrument definition begins to be valid. More... | |
Types::Core::DateAndTime | m_ValidTo |
the date at which the instrument definition is no longer valid. More... | |
std::string | m_xmlText |
Contents of the IDF .xml file that was loaded for this instrument. More... | |
Additional Inherited Members | |
Protected Types inherited from Mantid::Geometry::CompAssembly | |
using | comp_it = std::vector< IComponent * >::iterator |
Iterator type. More... | |
using | const_comp_it = std::vector< IComponent * >::const_iterator |
Const iterator type. More... | |
Protected Member Functions inherited from Mantid::Geometry::ICompAssembly | |
ICompAssembly (const ICompAssembly &)=default | |
Protected copy constructor. More... | |
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. More... | |
void | swap (const Component *base, const ParameterMap *pmap) |
Swap the current references to the un-parameterized component and parameter map for new ones. More... | |
Protected Attributes inherited from Mantid::Geometry::CompAssembly | |
BoundingBox * | m_cachedBoundingBox |
A cached bounding box. More... | |
std::vector< IComponent * > | m_children |
the group of child components More... | |
Protected Attributes inherited from Mantid::Geometry::Component | |
const IComponent * | m_parent |
Parent component in the tree. More... | |
const Component * | m_base |
The base component - this is the unmodified component (without the parameters). More... | |
const ParameterMap * | m_map |
A pointer to const ParameterMap containing the parameters. More... | |
std::string | m_name |
Name of the component. More... | |
Kernel::V3D | m_pos |
Position w. More... | |
Kernel::Quat | m_rot |
Orientation. More... | |
To determine whether the instrument contains elements of some type.
Enumerator | |
---|---|
Full | |
Partial | |
None |
Definition at line 203 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.
|
overridevirtual |
Add a component to the instrument.
Implements Mantid::Geometry::ICompAssembly.
Definition at line 1164 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::add().
Referenced by ComponentCreationHelper::addRectangularBank().
|
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 1144 of file Instrument.cpp.
Referenced by containsRectDetectors(), and findRectDetectors().
|
private |
Definition at line 1136 of file Instrument.cpp.
References getChild(), and Mantid::Geometry::CompAssembly::nelements().
Referenced by containsRectDetectors(), and findRectDetectors().
|
private |
Add a plottable component.
Definition at line 796 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.
Implements Mantid::Geometry::ICompAssembly.
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 1053 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 1170 of file Instrument.cpp.
References m_instr, and Mantid::Geometry::Component::m_map.
Referenced by Mantid::Geometry::ParameterMap::detectorIndex().
std::vector< RectangularDetector_const_sptr > Mantid::Geometry::Instrument::findRectDetectors | ( | ) | const |
Definition at line 1088 of file Instrument.cpp.
References addAssemblyChildrenToQueue(), addInstrumentChildrenToQueue(), and validateComponentProperties().
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 399 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 483 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 375 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. |
Implements Mantid::Geometry::IComponent.
Definition at line 733 of file Instrument.cpp.
References Mantid::Geometry::ComponentInfo::boundingBox(), Mantid::Geometry::ParameterMap::componentInfo(), getChild(), 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 382 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.
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 461 of file Instrument.cpp.
References Mantid::Geometry::ParComponentFactory::createDetector(), m_instr, and Mantid::Geometry::Component::m_map.
Referenced by export_Instrument(), getDetectorG(), 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 513 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 205 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 544 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 530 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 186 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 275 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 301 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::getComponentByName(), and getDetectorsInBank().
const std::string & Mantid::Geometry::Instrument::getFilename | ( | ) | const |
Definition at line 857 of file Instrument.cpp.
References m_filename, m_instr, and Mantid::Geometry::Component::m_map.
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 824 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 256 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 716 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 222 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 772 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 1010 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 348 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 322 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 873 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 317 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 312 of file Instrument.cpp.
References m_sourceCache.
bool Mantid::Geometry::Instrument::isEmptyInstrument | ( | ) | const |
Definition at line 1162 of file Instrument.cpp.
References Mantid::Geometry::CompAssembly::nelements().
bool Mantid::Geometry::Instrument::isMonitor | ( | const detid_t & | detector_id | ) | const |
Definition at line 491 of file Instrument.cpp.
References m_instr, and Mantid::Geometry::Component::m_map.
Referenced by Instrument(), markAsDetector(), markAsDetectorIncomplete(), and validateComponentProperties().
bool Mantid::Geometry::Instrument::isMonitor | ( | const std::set< detid_t > & | detector_ids | ) | const |
Definition at line 499 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 1155 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 995 of file Instrument.cpp.
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 1292 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 1178 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 1305 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 620 of file Instrument.cpp.
References Mantid::Geometry::IDetector::getID(), isMonitor(), 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 651 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 638 of file Instrument.cpp.
References Mantid::Geometry::IDetector::getID(), isMonitor(), 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 677 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 564 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 597 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 1278 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 694 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 949 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 889 of file Instrument.cpp.
References Mantid::Geometry::g_log, getDetectorIDs(), Mantid::Geometry::Component::getName(), getXmlText(), 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 1026 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 848 of file Instrument.cpp.
References m_filename, m_instr, and Mantid::Geometry::Component::m_map.
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 1004 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 |
val | :: date and time |
InstrumentDefinitionError | Thrown if date is earlier than 1900-01-31 23:59:01 |
Definition at line 1042 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 180 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 865 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::ICompAssembly.
Definition at line 50 of file Instrument.h.
Referenced by setDefaultView().
|
private |
Definition at line 1113 of file Instrument.cpp.
References Mantid::Geometry::IComponent::getComponentID(), isMonitor(), m_sampleCache, and m_sourceCache.
Referenced by containsRectDetectors(), and findRectDetectors().
|
private |
Pointer to the ComponentInfo object. May be NULL.
Definition at line 305 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 272 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 275 of file Instrument.h.
|
private |
Map which holds detector-IDs and pointers to detector components, and monitor flags.
Definition at line 244 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 302 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 289 of file Instrument.h.
Referenced by getFilename(), setFilename(), and setValidFromDate().
|
private |
Pointer to the "real" instrument, for parametrized Instrument.
Definition at line 278 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 308 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 257 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 http://www.mantidproject.org/IDF 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 268 of file Instrument.h.
|
private |
Non-const pointer to the parameter map.
Definition at line 281 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 296 of file Instrument.h.
Referenced by getPhysicalInstrument(), and setPhysicalInstrument().
|
private |
Pointer to the reference frame object.
Definition at line 299 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 252 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 248 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 284 of file Instrument.h.
Referenced by setValidFromDate().
|
private |
the date at which the instrument definition is no longer valid.
Definition at line 286 of file Instrument.h.
|
mutableprivate |
Contents of the IDF .xml file that was loaded for this instrument.
Definition at line 292 of file Instrument.h.
Referenced by getXmlText(), and setXmlText().