Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Mantid::Geometry::DetectorGroup Class Reference

Holds a collection of detectors. More...

#include <DetectorGroup.h>

Inheritance diagram for Mantid::Geometry::DetectorGroup:
Mantid::Geometry::IDetector Mantid::Geometry::IObjComponent Mantid::Geometry::IComponent

Public Member Functions

void addDetector (const IDetector_const_sptr &det)
 Add a detector to the collection. More...
 
IDetectorcloneParameterized (const ParameterMap *) const override
 Create a cloned instance with a parameter map applied. More...
 
 DetectorGroup ()
 Default constructor. More...
 
 DetectorGroup (const std::vector< IDetector_const_sptr > &dets)
 Constructor that takes a list of detectors to add. More...
 
void getBoundingBox (BoundingBox &boundingBox) const override
 Get the bounding box for this component and store it in the given argument. More...
 
std::vector< detid_tgetDetectorIDs () const
 What detectors are contained in the group? More...
 
std::vector< IDetector_const_sptrgetDetectors () const
 What detectors are contained in the group? More...
 
double getDistance (const IComponent &comp) const override
 Gives the average distance of a group of detectors from the given component. More...
 
detid_t getID () const override
 Get the detector ID. More...
 
double getPhi () const override
 Computes the average position and returns the phi value. More...
 
double getPhiOffset (const double &offset) const override
 Computes the average position and returns the phi value. More...
 
int getPointInObject (Kernel::V3D &point) const override
 Try to find a point that lies within (or on) the object. More...
 
Kernel::V3D getPos () const override
 Returns the position of the DetectorGroup. More...
 
double getSignedTwoTheta (const Kernel::V3D &observer, const Kernel::V3D &axis, const Kernel::V3D &instrumentUp) const override
 Gives the signed angle of this detector object with respect to an axis. More...
 
double getTwoTheta (const Kernel::V3D &observer, const Kernel::V3D &axis) const override
 Gives the average angle of a group of detectors from the observation point, relative to the axis given. More...
 
bool isOnSide (const Kernel::V3D &point) const override
 Does the point given lie on the surface of one of the detectors. More...
 
bool isParametrized () const override
 Return true if any detector in the group is parametrized. More...
 
bool isValid (const Kernel::V3D &point) const override
 isValid() is true if the point is inside any of the detectors, i.e. More...
 
std::size_t nDets () const override
 Get the number of physical detectors this object represents. More...
 
double solidAngle (const Kernel::V3D &observer) const override
 Gives the total solid angle subtended by a group of detectors by summing the contributions from the individual detectors. More...
 
- Public Member Functions inherited from Mantid::Geometry::IDetector
virtual IDetectorcloneParameterized (const ParameterMap *map) const =0
 Create a cloned instance with a parameter map applied. More...
 
double getDistance (const IComponent &comp) const override=0
 Get the distance of this detector object from another Component. More...
 
virtual detid_t getID () const =0
 Get the detector ID. More...
 
virtual double getPhi () const =0
 Gives the phi of this detector object in radians. More...
 
virtual double getPhiOffset (const double &offset) const =0
 Gives the phi of this detector offset from y=0 by offset. More...
 
virtual double getSignedTwoTheta (const Kernel::V3D &observer, const Kernel::V3D &axis, const Kernel::V3D &instrumentUp) const =0
 Gives the signed angle of this detector object with respect to an axis. More...
 
virtual det_topology getTopology (Kernel::V3D &center) const =0
 returns the geometry of detectors, meaningful for groups, rectangular for single; returns the centre of a detector More...
 
virtual double getTwoTheta (const Kernel::V3D &observer, const Kernel::V3D &axis) const =0
 Gives the angle of this detector object with respect to an axis. More...
 
 IDetector ()
 (Empty) Constructor. More...
 
virtual size_t index () const =0
 Helper for legacy access mode. Returns the index of the detector. More...
 
virtual std::size_t nDets () const =0
 Get the number of physical detectors this object represents. More...
 
virtual const ParameterMapparameterMap () const =0
 Helper for legacy access mode. Returns a reference to the ParameterMap. More...
 
- Public Member Functions inherited from Mantid::Geometry::IObjComponent
IComponentclone () const override=0
 Virtual Copy Constructor. More...
 
virtual void draw () const =0
 Draws the objcomponent. More...
 
virtual void drawObject () const =0
 Draws the Object. More...
 
virtual int getPointInObject (Kernel::V3D &point) const =0
 Try to find a point that lies within (or on) the object. More...
 
GeometryHandlerHandle () const
 Gets the GeometryHandler. More...
 
virtual void initDraw () const =0
 Initializes the ObjComponent for rendering, this function should be called before rendering. More...
 
virtual int interceptSurface (Track &track) const =0
 Checks whether the track given will pass through this Component. More...
 
 IObjComponent ()
 
 IObjComponent (const IObjComponent &)
 Copy constructor. More...
 
 IObjComponent (GeometryHandler *the_handler)
 Constructor, specifying the GeometryHandler (renderer engine) for this IObjComponent. More...
 
virtual bool isOnSide (const Kernel::V3D &point) const =0
 Does the point given lie on the surface of this object component? More...
 
virtual bool isValid (const Kernel::V3D &point) const =0
 Does the point given lie within this object component? More...
 
virtual const Kernel::Material material () const =0
 Returns the material of the Object. More...
 
IObjComponentoperator= (const IObjComponent &rhs)
 Assignment operator. More...
 
virtual const std::shared_ptr< const IObjectshape () const =0
 Returns the shape of the Object. More...
 
virtual double solidAngle (const Kernel::V3D &observer) const =0
 Finds the approximate solid angle covered by the component when viewed from the point given. More...
 
std::string type () const override
 type string More...
 
 ~IObjComponent () override
 
- Public Member Functions inherited from Mantid::Geometry::IComponent
virtual IComponentclone () 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 IComponentgetBareParent () 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 IComponentgetParent () 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...
 

ParameterMap access

using DetCollection = std::map< int, IDetector_const_sptr >
 The type of collection used for the detectors. More...
 
int m_id
 The ID of this effective detector. More...
 
DetCollection m_detectors
 The collection of grouped detectors. More...
 
det_topology group_topology
 the parameter describes the topology of the detector's group namely if detectors form a box or a ring. More...
 
Kernel::V3D groupCentre
 group centre is the geometrical centre of the detectors group calculated when the calculate group topology is invoked More...
 
std::set< std::string > getParameterNames (bool recursive=true) const override
 Return the parameter names. More...
 
std::map< std::string, ComponentIDgetParameterNamesByComponent () 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 whether the parameter exists or not. More...
 
std::string getParameterType (const std::string &name, bool recursive=true) const override
 Detectors group assumed to be non-parameterized. More...
 
std::vector< double > getNumberParameter (const std::string &pname, bool recursive=true) const override
 Get a parameter defined as a double. More...
 
std::vector< Kernel::V3DgetPositionParameter (const std::string &pname, bool recursive=true) const override
 Get a parameter defined as a Kernel::V3D. More...
 
std::vector< Kernel::QuatgetRotationParameter (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::vector< int > getIntParameter (const std::string &pname, bool recursive=true) const override
 Get a parameter defined as an integer. More...
 
std::vector< bool > getBoolParameter (const std::string &pname, bool recursive=true) const override
 Get a parameter defined as an integer. 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 &pname, bool recursive=true) const override
 Get a visibility attribute of a parameter. More...
 
det_topology getTopology (Kernel::V3D &center) const override
 returns the detector's group topology if it has been calculated before or invokes the procedure of calculating such topology if it was not More...
 
std::string getNameSeparator () const
 Return separator for list of names of detectors. More...
 
IComponent const * getBaseComponent () const override
 Returns const pointer to itself. More...
 
const ParameterMapparameterMap () const override
 Helper for legacy access mode. Always throws for DetectorGroup. More...
 
size_t index () const override
 Helper for legacy access mode. Always throws for DetectorGroup. More...
 
virtual size_t registerContents (class ComponentVisitor &visitor) const override
 
Componentclone () const override
 Virtual Copy Constructor. More...
 
ComponentID getComponentID () const override
 Returns the ComponentID - a unique identifier of the component. More...
 
std::shared_ptr< const IComponentgetParent () const override
 Return a pointer to the current parent. More...
 
const IComponentgetBareParent () const override
 Returns the bare pointer to the IComponent parent. More...
 
std::vector< std::shared_ptr< const IComponent > > getAncestors () const override
 Return an array of all ancestors, the nearest first. More...
 
std::string getName () const override
 Get the IComponent name. More...
 
std::string getFullName () const override
 Get the IComponent full path name. More...
 
void setParent (IComponent *) override
 Assign a parent IComponent. Previous parent link is lost. More...
 
void setName (const std::string &) override
 Set the IComponent name. More...
 
void setPos (double, double, double) override
 Set the IComponent position, x, y, z respective to parent (if present) More...
 
void setPos (const Kernel::V3D &) override
 Set the position of the component The position is with respect to the parent component. More...
 
void setRot (const Kernel::Quat &) override
 Set the orientation Kernel::Quaternion relative to parent (if present) More...
 
void copyRot (const IComponent &)
 
int interceptSurface (Track &) const override
 Checks whether the track given will pass through this Component. More...
 
void translate (const Kernel::V3D &) override
 Copy the Rotation from another IComponent. More...
 
void translate (double, double, double) override
 Translate the IComponent (x,y,z form). This is relative to parent if. 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...
 
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...
 
void printSelf (std::ostream &) const override
 Prints a text representation of itself. More...
 
void getBoundingBox (double &, double &, double &, double &, double &, double &) const
 
void draw () const override
 Draws the objcomponent. More...
 
void drawObject () const override
 Draws the Object. More...
 
void initDraw () const override
 Initializes the ObjComponent for rendering, this function should be called before rendering. More...
 
const std::shared_ptr< const IObjectshape () const override
 Returns the shape of the Object. More...
 
const Kernel::Material material () const override
 Returns the material of the Object. More...
 
 DetectorGroup (const DetectorGroup &)
 Private, unimplemented copy constructor. More...
 
DetectorGroupoperator= (const DetectorGroup &)
 Private, unimplemented copy assignment operator. More...
 
void calculateGroupTopology () const
 function calculates the detectors arrangement (topology) More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Geometry::IObjComponent
void setGeometryHandler (GeometryHandler *h)
 Reset the current geometry handler. More...
 

Detailed Description

Holds a collection of detectors.

Responds to IDetector methods as though it were a single detector. Currently, detectors in a group are treated as pointlike (or at least) homogenous entities. This means that it's up to the use to make only sensible groupings of similar detectors since no weighting according to solid angle size takes place and the DetectorGroup's position is just a simple average of its constituents.

Author
Russell Taylor, Tessella Support Services plc
Date
08/04/2008

Definition at line 28 of file DetectorGroup.h.

Member Typedef Documentation

◆ DetCollection

The type of collection used for the detectors.

  • a map of detector pointers with the detector ID as the key

Definition at line 166 of file DetectorGroup.h.

Constructor & Destructor Documentation

◆ DetectorGroup() [1/3]

Mantid::Geometry::DetectorGroup::DetectorGroup ( )

Default constructor.

Definition at line 28 of file DetectorGroup.cpp.

◆ DetectorGroup() [2/3]

Mantid::Geometry::DetectorGroup::DetectorGroup ( const std::vector< IDetector_const_sptr > &  dets)

Constructor that takes a list of detectors to add.

Parameters
dets:: The vector of IDetector pointers that this virtual detector will hold
Exceptions
std::invalid_argumentIf an empty vector is passed as argument

Definition at line 35 of file DetectorGroup.cpp.

References addDetector(), Mantid::Kernel::Logger::error(), and Mantid::Geometry::g_log.

◆ DetectorGroup() [3/3]

Mantid::Geometry::DetectorGroup::DetectorGroup ( const DetectorGroup )
private

Private, unimplemented copy constructor.

Member Function Documentation

◆ addDetector()

void Mantid::Geometry::DetectorGroup::addDetector ( const IDetector_const_sptr det)

Add a detector to the collection.

Parameters
det:: A pointer to the detector to add

Definition at line 50 of file DetectorGroup.cpp.

References group_topology, m_detectors, m_id, and Mantid::Geometry::undef.

Referenced by DetectorGroup().

◆ calculateGroupTopology()

void Mantid::Geometry::DetectorGroup::calculateGroupTopology ( ) const
private

function calculates the detectors arrangement (topology)

the private function calculates the topology of the detector's group, namely if the detectors arranged into a ring or into a rectangle.

Uses assumption that a ring has hole inside, so geometrical centre of the shape does not belong to a ring but does belong to a rectangle

Definition at line 381 of file DetectorGroup.cpp.

References Mantid::Geometry::cyl, getPos(), group_topology, groupCentre, isValid(), m_detectors, Mantid::Geometry::rect, Mantid::Geometry::undef, and Mantid::Geometry::BoundingBox::width().

Referenced by getTopology().

◆ clone()

Component * Mantid::Geometry::DetectorGroup::clone ( ) const
inlineoverrideprotectedvirtual

Virtual Copy Constructor.

Returns
A pointer to a copy of the input ObjComponent

Implements Mantid::Geometry::IObjComponent.

Definition at line 179 of file DetectorGroup.h.

◆ cloneParameterized()

IDetector * Mantid::Geometry::DetectorGroup::cloneParameterized ( const ParameterMap map) const
inlineoverridevirtual

Create a cloned instance with a parameter map applied.

Implements Mantid::Geometry::IDetector.

Definition at line 36 of file DetectorGroup.h.

◆ copyRot()

void Mantid::Geometry::DetectorGroup::copyRot ( const IComponent )
inlineprotected

Definition at line 194 of file DetectorGroup.h.

◆ draw()

void Mantid::Geometry::DetectorGroup::draw ( ) const
inlineoverrideprotectedvirtual

Draws the objcomponent.

Implements Mantid::Geometry::IObjComponent.

Definition at line 213 of file DetectorGroup.h.

◆ drawObject()

void Mantid::Geometry::DetectorGroup::drawObject ( ) const
inlineoverrideprotectedvirtual

Draws the Object.

Implements Mantid::Geometry::IObjComponent.

Definition at line 214 of file DetectorGroup.h.

◆ getAncestors()

std::vector< std::shared_ptr< const IComponent > > Mantid::Geometry::DetectorGroup::getAncestors ( ) const
inlineoverrideprotectedvirtual

Return an array of all ancestors, the nearest first.

Implements Mantid::Geometry::IComponent.

Definition at line 183 of file DetectorGroup.h.

◆ getBareParent()

const IComponent * Mantid::Geometry::DetectorGroup::getBareParent ( ) const
inlineoverrideprotectedvirtual

Returns the bare pointer to the IComponent parent.

Implements Mantid::Geometry::IComponent.

Definition at line 182 of file DetectorGroup.h.

◆ getBaseComponent()

IComponent const * Mantid::Geometry::DetectorGroup::getBaseComponent ( ) const
inlineoverridevirtual

Returns const pointer to itself.

This currently (2914/04/24) contradicts the logic behind getComponentID overload, so CopyInstrumentParameters will fail on grouped instrument but it is something TO DO:

Implements Mantid::Geometry::IComponent.

Definition at line 154 of file DetectorGroup.h.

◆ getBoolParameter()

std::vector< bool > Mantid::Geometry::DetectorGroup::getBoolParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as an integer.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 363 of file DetectorGroup.cpp.

◆ getBoundingBox() [1/2]

void Mantid::Geometry::DetectorGroup::getBoundingBox ( BoundingBox boundingBox) const
overridevirtual

Get the bounding box for this component and store it in the given argument.

Get the bounding box for this group of detectors.

It is simply the sum of the bounding boxes of its constituents.

Parameters
boundingBox:: [Out] The resulting bounding box is stored here.

Implements Mantid::Geometry::IComponent.

Definition at line 305 of file DetectorGroup.cpp.

References Mantid::Geometry::BoundingBox::getCoordSystem(), Mantid::Geometry::BoundingBox::grow(), Mantid::Geometry::BoundingBox::isAxisAligned(), m_detectors, and Mantid::Geometry::BoundingBox::realign().

◆ getBoundingBox() [2/2]

void Mantid::Geometry::DetectorGroup::getBoundingBox ( double &  ,
double &  ,
double &  ,
double &  ,
double &  ,
double &   
) const
inlineprotected

Definition at line 211 of file DetectorGroup.h.

◆ getComponentID()

ComponentID Mantid::Geometry::DetectorGroup::getComponentID ( ) const
inlineoverrideprotectedvirtual

Returns the ComponentID - a unique identifier of the component.

Implements Mantid::Geometry::IComponent.

Definition at line 180 of file DetectorGroup.h.

◆ getDetectorIDs()

std::vector< detid_t > Mantid::Geometry::DetectorGroup::getDetectorIDs ( ) const

What detectors are contained in the group?

Return IDs for the detectors grouped.

Returns
vector of detector IDs

Definition at line 160 of file DetectorGroup.cpp.

References m_detectors.

Referenced by Mantid::DataHandling::GenerateGroupingPowder::exec(), export_DetectorGroup(), Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesNonPSD(), and Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesTable().

◆ getDetectors()

std::vector< IDetector_const_sptr > Mantid::Geometry::DetectorGroup::getDetectors ( ) const

What detectors are contained in the group?

Return the list of detectors held within this group.

Returns
A vector of IDetector pointers

Definition at line 174 of file DetectorGroup.cpp.

References m_detectors.

Referenced by Mantid::Algorithms::CreatePSDBleedMask::exec().

◆ getDistance()

double Mantid::Geometry::DetectorGroup::getDistance ( const IComponent comp) const
overridevirtual

Gives the average distance of a group of detectors from the given component.

Implements Mantid::Geometry::IDetector.

Definition at line 93 of file DetectorGroup.cpp.

References m_detectors.

◆ getFullName()

std::string Mantid::Geometry::DetectorGroup::getFullName ( ) const
overrideprotectedvirtual

Get the IComponent full path name.

Implements Mantid::Geometry::IComponent.

Definition at line 431 of file DetectorGroup.cpp.

References getNameSeparator(), and m_detectors.

◆ getID()

detid_t Mantid::Geometry::DetectorGroup::getID ( ) const
overridevirtual

Get the detector ID.

Implements Mantid::Geometry::IDetector.

Definition at line 62 of file DetectorGroup.cpp.

References m_id.

◆ getIntParameter()

std::vector< int > Mantid::Geometry::DetectorGroup::getIntParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as an integer.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 358 of file DetectorGroup.cpp.

◆ getName()

std::string Mantid::Geometry::DetectorGroup::getName ( ) const
overrideprotectedvirtual

Get the IComponent name.

Implements Mantid::Geometry::IComponent.

Definition at line 422 of file DetectorGroup.cpp.

References getNameSeparator(), and m_detectors.

◆ getNameSeparator()

std::string Mantid::Geometry::DetectorGroup::getNameSeparator ( ) const
inline

Return separator for list of names of detectors.

Definition at line 149 of file DetectorGroup.h.

Referenced by export_DetectorGroup(), getFullName(), and getName().

◆ getNumberParameter()

std::vector< double > Mantid::Geometry::DetectorGroup::getNumberParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as a double.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 338 of file DetectorGroup.cpp.

◆ getParameterAsString()

std::string Mantid::Geometry::DetectorGroup::getParameterAsString ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a string representation of a parameter.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A empty string as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 281 of file DetectorGroup.cpp.

◆ getParameterNames()

std::set< std::string > Mantid::Geometry::DetectorGroup::getParameterNames ( bool  recursive = true) const
overridevirtual

Return the parameter names.

Get the names of the parameters for this component.

Parameters
recursive:: If true, the parameters for all of the parent components are also included
Returns
A set of strings giving the parameter names for this component

Implements Mantid::Geometry::IComponent.

Definition at line 259 of file DetectorGroup.cpp.

◆ getParameterNamesByComponent()

std::map< std::string, ComponentID > Mantid::Geometry::DetectorGroup::getParameterNamesByComponent ( ) const
overridevirtual

return the parameter names and the component they are from

Get the names of the parameters for this component and it's parents.

Returns
A map of strings giving the parameter names and the component they are from, warning this contains shared pointers keeping transient objects alive, do not keep longer than needed

Implements Mantid::Geometry::IComponent.

Definition at line 270 of file DetectorGroup.cpp.

◆ getParameterType()

std::string Mantid::Geometry::DetectorGroup::getParameterType ( const std::string &  name,
bool  recursive = true 
) const
overridevirtual

Detectors group assumed to be non-parameterized.

Implements Mantid::Geometry::IComponent.

Definition at line 333 of file DetectorGroup.cpp.

◆ getParameterVisible()

bool Mantid::Geometry::DetectorGroup::getParameterVisible ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a visibility attribute of a parameter.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A boolean containing the visibility attribute of the parameter, false if does not exist

Implements Mantid::Geometry::IComponent.

Definition at line 294 of file DetectorGroup.cpp.

◆ getParent()

std::shared_ptr< const IComponent > Mantid::Geometry::DetectorGroup::getParent ( ) const
inlineoverrideprotectedvirtual

Return a pointer to the current parent.

Implements Mantid::Geometry::IComponent.

Definition at line 181 of file DetectorGroup.h.

◆ getPhi()

double Mantid::Geometry::DetectorGroup::getPhi ( ) const
overridevirtual

Computes the average position and returns the phi value.

Implements Mantid::Geometry::IDetector.

Definition at line 143 of file DetectorGroup.cpp.

References getPos(), and Mantid::Kernel::V3D::getSpherical().

Referenced by getPhiOffset().

◆ getPhiOffset()

double Mantid::Geometry::DetectorGroup::getPhiOffset ( const double &  offset) const
overridevirtual

Computes the average position and returns the phi value.

Implements Mantid::Geometry::IDetector.

Definition at line 151 of file DetectorGroup.cpp.

References getPhi().

◆ getPointInObject()

int Mantid::Geometry::DetectorGroup::getPointInObject ( Kernel::V3D point) const
overridevirtual

Try to find a point that lies within (or on) the object.

tries to find a point that lies on or within the first detector in the storage found in the storage map

Parameters
point:: if a point is found its coordinates will be stored in this varible
Returns
1 if point found, 0 otherwise

Implements Mantid::Geometry::IObjComponent.

Definition at line 245 of file DetectorGroup.cpp.

References m_detectors.

◆ getPos()

V3D Mantid::Geometry::DetectorGroup::getPos ( ) const
overridevirtual

Returns the position of the DetectorGroup.

In the absence of a full surface/solid angle implementation, this is a simple average of the component detectors (i.e. there's no weighting for size or if one or more of the detectors is masked). Also, no regard is made to whether a constituent detector is itself a DetectorGroup - it's just treated as a single, pointlike object with the same weight as any other detector.

Returns
a V3D object of the detector group position

Implements Mantid::Geometry::IComponent.

Definition at line 74 of file DetectorGroup.cpp.

References m_detectors, and Mantid::Kernel::Tolerance.

Referenced by calculateGroupTopology(), and getPhi().

◆ getPositionParameter()

std::vector< V3D > Mantid::Geometry::DetectorGroup::getPositionParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as a Kernel::V3D.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 343 of file DetectorGroup.cpp.

◆ getRelativePos()

Kernel::V3D Mantid::Geometry::DetectorGroup::getRelativePos ( ) const
inlineoverrideprotectedvirtual

Get the position relative to the parent IComponent (absolute if no parent)

Implements Mantid::Geometry::IComponent.

Definition at line 200 of file DetectorGroup.h.

◆ getRelativeRot()

Kernel::Quat Mantid::Geometry::DetectorGroup::getRelativeRot ( ) const
inlineoverrideprotectedvirtual

Get the relative Orientation.

Implements Mantid::Geometry::IComponent.

Definition at line 203 of file DetectorGroup.h.

◆ getRotation()

Kernel::Quat Mantid::Geometry::DetectorGroup::getRotation ( ) const
inlineoverrideprotectedvirtual

Get the absolute orientation of the IComponent.

Implements Mantid::Geometry::IComponent.

Definition at line 206 of file DetectorGroup.h.

◆ getRotationParameter()

std::vector< Quat > Mantid::Geometry::DetectorGroup::getRotationParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as a Kernel::Quaternion.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 348 of file DetectorGroup.cpp.

◆ getSignedTwoTheta()

double Mantid::Geometry::DetectorGroup::getSignedTwoTheta ( const Kernel::V3D observer,
const Kernel::V3D axis,
const Kernel::V3D instrumentUp 
) const
overridevirtual

Gives the signed angle of this detector object with respect to an axis.

Parameters
observer:: The point to calculate the angle relative to (typically the sample position)
axis:: The axis to which the required angle is relative
instrumentUp:: Direction corresponding to the instrument up direction. Used to determine signs.
Returns
The angle in radians

Implements Mantid::Geometry::IDetector.

Definition at line 124 of file DetectorGroup.cpp.

References Mantid::Kernel::V3D::angle(), Mantid::Kernel::V3D::cross_prod(), m_detectors, and Mantid::Kernel::V3D::scalar_prod().

◆ getStringParameter()

std::vector< std::string > Mantid::Geometry::DetectorGroup::getStringParameter ( const std::string &  pname,
bool  recursive = true 
) const
overridevirtual

Get a parameter defined as a string.

Default implementation.

Parameters
pname:: The name of the parameter
recursive:: If true the search will walk up through the parent components
Returns
A list of size 0 as this is not a parameterized component

Implements Mantid::Geometry::IComponent.

Definition at line 353 of file DetectorGroup.cpp.

◆ getTopology()

det_topology Mantid::Geometry::DetectorGroup::getTopology ( Kernel::V3D center) const
overridevirtual

returns the detector's group topology if it has been calculated before or invokes the procedure of calculating such topology if it was not

Implements Mantid::Geometry::IDetector.

Definition at line 368 of file DetectorGroup.cpp.

References calculateGroupTopology(), group_topology, groupCentre, and Mantid::Geometry::undef.

◆ getTwoTheta()

double Mantid::Geometry::DetectorGroup::getTwoTheta ( const Kernel::V3D observer,
const Kernel::V3D axis 
) const
overridevirtual

Gives the average angle of a group of detectors from the observation point, relative to the axis given.

Implements Mantid::Geometry::IDetector.

Definition at line 104 of file DetectorGroup.cpp.

References Mantid::Kernel::V3D::angle(), and m_detectors.

◆ hasParameter()

bool Mantid::Geometry::DetectorGroup::hasParameter ( const std::string &  name,
bool  recursive = true 
) const
overridevirtual

Returns a boolean indicating whether the parameter exists or not.

Returns a boolean indicating if the component has the named parameter.

Parameters
name:: The name of the parameter
recursive:: If true the parent components will also be searched (Default: true)
Returns
A boolean indicating if the search was successful or not. Always false as this is not parameterized

Implements Mantid::Geometry::IComponent.

Definition at line 327 of file DetectorGroup.cpp.

◆ index()

size_t Mantid::Geometry::DetectorGroup::index ( ) const
overridevirtual

Helper for legacy access mode. Always throws for DetectorGroup.

Implements Mantid::Geometry::IDetector.

Definition at line 448 of file DetectorGroup.cpp.

◆ initDraw()

void Mantid::Geometry::DetectorGroup::initDraw ( ) const
inlineoverrideprotectedvirtual

Initializes the ObjComponent for rendering, this function should be called before rendering.

Implements Mantid::Geometry::IObjComponent.

Definition at line 215 of file DetectorGroup.h.

◆ interceptSurface()

int Mantid::Geometry::DetectorGroup::interceptSurface ( Track track) const
inlineoverrideprotectedvirtual

Checks whether the track given will pass through this Component.

Implements Mantid::Geometry::IObjComponent.

Definition at line 195 of file DetectorGroup.h.

◆ isOnSide()

bool Mantid::Geometry::DetectorGroup::isOnSide ( const Kernel::V3D point) const
overridevirtual

Does the point given lie on the surface of one of the detectors.

Parameters
point:: the point that is tested to see if it is one of the detectors
Returns
true if the point is on the side of a detector else it returns false

Implements Mantid::Geometry::IObjComponent.

Definition at line 229 of file DetectorGroup.cpp.

References m_detectors.

◆ isParametrized()

bool Mantid::Geometry::DetectorGroup::isParametrized ( ) const
overridevirtual

Return true if any detector in the group is parametrized.

Implements Mantid::Geometry::IComponent.

Definition at line 201 of file DetectorGroup.cpp.

References m_detectors.

◆ isValid()

bool Mantid::Geometry::DetectorGroup::isValid ( const Kernel::V3D point) const
overridevirtual

isValid() is true if the point is inside any of the detectors, i.e.

one of the detectors has isValid() == true

Parameters
point:: this point is tested to see if it is one of the detectors
Returns
if the point is in a detector it returns true else it returns false

Implements Mantid::Geometry::IObjComponent.

Definition at line 215 of file DetectorGroup.cpp.

References m_detectors.

Referenced by calculateGroupTopology().

◆ material()

const Kernel::Material Mantid::Geometry::DetectorGroup::material ( ) const
overrideprotectedvirtual

Returns the material of the Object.

Implements Mantid::Geometry::IObjComponent.

Definition at line 440 of file DetectorGroup.cpp.

◆ nDets()

std::size_t Mantid::Geometry::DetectorGroup::nDets ( ) const
overridevirtual

Get the number of physical detectors this object represents.

Implements Mantid::Geometry::IDetector.

Definition at line 64 of file DetectorGroup.cpp.

References m_detectors.

◆ operator=()

DetectorGroup & Mantid::Geometry::DetectorGroup::operator= ( const DetectorGroup )
private

Private, unimplemented copy assignment operator.

◆ parameterMap()

const ParameterMap & Mantid::Geometry::DetectorGroup::parameterMap ( ) const
overridevirtual

Helper for legacy access mode. Always throws for DetectorGroup.

Implements Mantid::Geometry::IDetector.

Definition at line 443 of file DetectorGroup.cpp.

◆ printSelf()

void Mantid::Geometry::DetectorGroup::printSelf ( std::ostream &  ) const
inlineoverrideprotectedvirtual

Prints a text representation of itself.

Implements Mantid::Geometry::IComponent.

Definition at line 207 of file DetectorGroup.h.

◆ registerContents()

size_t Mantid::Geometry::DetectorGroup::registerContents ( class ComponentVisitor visitor) const
overridevirtual

Implements Mantid::Geometry::IComponent.

Definition at line 450 of file DetectorGroup.cpp.

◆ rotate() [1/2]

void Mantid::Geometry::DetectorGroup::rotate ( const Kernel::Quat )
inlineoverrideprotectedvirtual

Rotate the IComponent. This is relative to parent.

Implements Mantid::Geometry::IComponent.

Definition at line 198 of file DetectorGroup.h.

◆ rotate() [2/2]

void Mantid::Geometry::DetectorGroup::rotate ( double  ,
const Kernel::V3D  
)
inlineoverrideprotectedvirtual

Rotate the IComponent by an angle in degrees with respect to an axis.

Implements Mantid::Geometry::IComponent.

Definition at line 199 of file DetectorGroup.h.

◆ setName()

void Mantid::Geometry::DetectorGroup::setName ( const std::string &  )
inlineoverrideprotectedvirtual

Set the IComponent name.

Implements Mantid::Geometry::IComponent.

Definition at line 189 of file DetectorGroup.h.

◆ setParent()

void Mantid::Geometry::DetectorGroup::setParent ( IComponent )
inlineoverrideprotectedvirtual

Assign a parent IComponent. Previous parent link is lost.

Implements Mantid::Geometry::IComponent.

Definition at line 188 of file DetectorGroup.h.

◆ setPos() [1/2]

void Mantid::Geometry::DetectorGroup::setPos ( const Kernel::V3D )
inlineoverrideprotectedvirtual

Set the position of the component The position is with respect to the parent component.

Implements Mantid::Geometry::IComponent.

Definition at line 192 of file DetectorGroup.h.

◆ setPos() [2/2]

void Mantid::Geometry::DetectorGroup::setPos ( double  ,
double  ,
double   
)
inlineoverrideprotectedvirtual

Set the IComponent position, x, y, z respective to parent (if present)

Implements Mantid::Geometry::IComponent.

Definition at line 191 of file DetectorGroup.h.

◆ setRot()

void Mantid::Geometry::DetectorGroup::setRot ( const Kernel::Quat )
inlineoverrideprotectedvirtual

Set the orientation Kernel::Quaternion relative to parent (if present)

Implements Mantid::Geometry::IComponent.

Definition at line 193 of file DetectorGroup.h.

◆ shape()

const std::shared_ptr< const IObject > Mantid::Geometry::DetectorGroup::shape ( ) const
inlineoverrideprotectedvirtual

Returns the shape of the Object.

Implements Mantid::Geometry::IObjComponent.

Definition at line 218 of file DetectorGroup.h.

◆ solidAngle()

double Mantid::Geometry::DetectorGroup::solidAngle ( const Kernel::V3D observer) const
overridevirtual

Gives the total solid angle subtended by a group of detectors by summing the contributions from the individual detectors.

Parameters
observer:: The point from which the detector is being viewed
Returns
The solid angle in steradians
Exceptions
NullPointerExceptionIf geometrical form of any detector has not been provided in the instrument definition file

Implements Mantid::Geometry::IObjComponent.

Definition at line 191 of file DetectorGroup.cpp.

References m_detectors.

◆ translate() [1/2]

void Mantid::Geometry::DetectorGroup::translate ( const Kernel::V3D )
inlineoverrideprotectedvirtual

Copy the Rotation from another IComponent.

Translate the IComponent (vector form). This is relative to parent if

Implements Mantid::Geometry::IComponent.

Definition at line 196 of file DetectorGroup.h.

◆ translate() [2/2]

void Mantid::Geometry::DetectorGroup::translate ( double  ,
double  ,
double   
)
inlineoverrideprotectedvirtual

Translate the IComponent (x,y,z form). This is relative to parent if.

Implements Mantid::Geometry::IComponent.

Definition at line 197 of file DetectorGroup.h.

Member Data Documentation

◆ group_topology

det_topology Mantid::Geometry::DetectorGroup::group_topology
mutableprotected

the parameter describes the topology of the detector's group namely if detectors form a box or a ring.

the topology is undefined on construction and calculated on first request

Definition at line 173 of file DetectorGroup.h.

Referenced by addDetector(), calculateGroupTopology(), and getTopology().

◆ groupCentre

Kernel::V3D Mantid::Geometry::DetectorGroup::groupCentre
mutableprotected

group centre is the geometrical centre of the detectors group calculated when the calculate group topology is invoked

Definition at line 176 of file DetectorGroup.h.

Referenced by calculateGroupTopology(), and getTopology().

◆ m_detectors

DetCollection Mantid::Geometry::DetectorGroup::m_detectors
protected

◆ m_id

int Mantid::Geometry::DetectorGroup::m_id
protected

The ID of this effective detector.

Definition at line 162 of file DetectorGroup.h.

Referenced by addDetector(), and getID().


The documentation for this class was generated from the following files: