Skip to content
Snippets Groups Projects
Commit 00e8658d authored by Russell Taylor's avatar Russell Taylor
Browse files

Remove unnecessary IDetector method. Re #1944.

parent cc50dd6e
No related merge requests found
...@@ -155,7 +155,7 @@ void AbsorptionCorrection::exec() ...@@ -155,7 +155,7 @@ void AbsorptionCorrection::exec()
if (m_emode==2) if (m_emode==2)
{ {
try { try {
Parameter_sptr par = pmap.get(det->getComponent(),"Efixed"); Parameter_sptr par = pmap.get(det.get(),"Efixed");
if (par) if (par)
{ {
Unit_const_sptr energy = UnitFactory::Instance().create("Energy"); Unit_const_sptr energy = UnitFactory::Instance().create("Energy");
......
...@@ -434,7 +434,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit, API::MatrixWo ...@@ -434,7 +434,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit, API::MatrixWo
{ {
try try
{ {
Parameter_sptr par = pmap.getRecursive(det->getComponent(),"Efixed"); Parameter_sptr par = pmap.getRecursive(det.get(),"Efixed");
if (par) if (par)
{ {
efixed = par->value<double>(); efixed = par->value<double>();
......
...@@ -117,7 +117,7 @@ void SofQW::exec() ...@@ -117,7 +117,7 @@ void SofQW::exec()
if (emode==2) if (emode==2)
{ {
try { try {
Parameter_sptr par = pmap.get(spectrumDet->getComponent(),"Efixed"); Parameter_sptr par = pmap.get(spectrumDet.get(),"Efixed");
if (par) if (par)
{ {
efixed = par->value<double>(); efixed = par->value<double>();
......
...@@ -417,11 +417,10 @@ void LoadDetectorInfo::setDetectorParams(const detectorInfo &params, detectorInf ...@@ -417,11 +417,10 @@ void LoadDetectorInfo::setDetectorParams(const detectorInfo &params, detectorInf
} }
Geometry::ParameterMap &pmap = m_workspace->instrumentParameters(); Geometry::ParameterMap &pmap = m_workspace->instrumentParameters();
const IComponent* comp = det->getComponent();
// Set the detectors pressure. // Set the detectors pressure.
pmap.addDouble(comp, "3He(atm)", params.pressure); pmap.addDouble(det.get(), "3He(atm)", params.pressure);
// Set the wall thickness // Set the wall thickness
pmap.addDouble(comp, "wallT(m)", params.wallThick); pmap.addDouble(det.get(), "wallT(m)", params.wallThick);
// If we have a l2, theta and phi. Update the postion if required // If we have a l2, theta and phi. Update the postion if required
if( m_moveDets && if( m_moveDets &&
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
boost::shared_ptr<const IComponent> comp = boost::shared_ptr<const IComponent> comp =
boost::dynamic_pointer_cast<const IComponent>(detector); boost::dynamic_pointer_cast<const IComponent>(detector);
const IComponent* baseComp = detector->getComponent(); const IComponent* baseComp = detector->getComponentID();
Parameter_sptr par = pmap.get(baseComp,"3He(atm)"); Parameter_sptr par = pmap.get(baseComp,"3He(atm)");
// this is only for PSD detectors, code 3 // this is only for PSD detectors, code 3
...@@ -221,14 +221,13 @@ public: ...@@ -221,14 +221,13 @@ public:
for ( int i = 0; i < NUMRANDOM; ++i) for ( int i = 0; i < NUMRANDOM; ++i)
{ {
int detID = DETECTS[i]; int detID = DETECTS[i];
boost::shared_ptr<const IDetector> detector =WS->getInstrument()->getDetector(detID); IDetector_const_sptr detector =WS->getInstrument()->getDetector(detID);
const IComponent* baseComp = detector->getComponent(); Parameter_sptr par = pmap.get(detector.get(),"3He(atm)");
Parameter_sptr par = pmap.get(baseComp,"3He(atm)");
TS_ASSERT(par); TS_ASSERT(par);
TS_ASSERT_EQUALS(par->asString(), castaround("10.0")); TS_ASSERT_EQUALS(par->asString(), castaround("10.0"));
par = pmap.get(baseComp,"wallT(m)"); par = pmap.get(detector.get(),"wallT(m)");
TS_ASSERT(par); TS_ASSERT(par);
TS_ASSERT_EQUALS(par->asString(), castaround("0.0008").substr(0,6)); TS_ASSERT_EQUALS(par->asString(), castaround("0.0008").substr(0,6));
......
...@@ -3,7 +3,6 @@ set ( SRC_FILES ...@@ -3,7 +3,6 @@ set ( SRC_FILES
src/Crystal/OrientedLattice.cpp src/Crystal/OrientedLattice.cpp
src/Crystal/ReflectionCondition.cpp src/Crystal/ReflectionCondition.cpp
src/Crystal/UnitCell.cpp src/Crystal/UnitCell.cpp
src/IDetector.cpp
src/Instrument.cpp src/Instrument.cpp
src/IObjComponent.cpp src/IObjComponent.cpp
src/Instrument/CompAssembly.cpp src/Instrument/CompAssembly.cpp
......
...@@ -25,7 +25,14 @@ namespace Kernel ...@@ -25,7 +25,14 @@ namespace Kernel
namespace Geometry namespace Geometry
{ {
/** Describes the topology of a detectors group used to calculate angular position and angular
* measures for detectors. The topology defines the meaning of angular measurements for a detector
*/
enum det_topology{
rect, //< rectangular geometry
cyl, //< cylindrical geometry
undef //< the geometry is yet undefined, if you need to know the geometry, a method to identify it must be deployed
};
/** Interface class for detector objects. /** Interface class for detector objects.
...@@ -52,14 +59,6 @@ namespace Geometry ...@@ -52,14 +59,6 @@ namespace Geometry
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
/** enum describes the toplogy of a detectors group used to calculate angular position and angular
* measures for detecors. The topology defines the meaning of angular measurements for a detector
*/
enum det_topology{
rect, //< rectangular geometry
cyl, //< cylindrical geometry
undef //< the geometry is yet undefined, if you need to know the geometry, a method to identify it must be deployed
};
class MANTID_GEOMETRY_DLL IDetector : public virtual IObjComponent class MANTID_GEOMETRY_DLL IDetector : public virtual IObjComponent
{ {
public: public:
...@@ -90,8 +89,6 @@ public: ...@@ -90,8 +89,6 @@ public:
/// Indicates whether this is a monitor detector /// Indicates whether this is a monitor detector
virtual bool isMonitor() const = 0; virtual bool isMonitor() const = 0;
/// Must return a pointer to itself if derived from IComponent
virtual const IComponent* getComponent() const;
/// returns the geometry of detectors, meaningful for groups, rectangular for single; returns the centre of a detector /// returns the geometry of detectors, meaningful for groups, rectangular for single; returns the centre of a detector
virtual det_topology getTopology(Kernel::V3D &center)const = 0; virtual det_topology getTopology(Kernel::V3D &center)const = 0;
......
...@@ -64,8 +64,6 @@ public: ...@@ -64,8 +64,6 @@ public:
double getPhi() const; double getPhi() const;
bool isMasked() const; bool isMasked() const;
bool isMonitor() const; bool isMonitor() const;
/// Returns a reference to itself
const IComponent* getComponent() const {return static_cast<const IComponent*>(this);}
// end IDetector methods // end IDetector methods
void markAsMonitor(const bool flag = true); void markAsMonitor(const bool flag = true);
/** returns the detector's topology, namely, the meaning of the detector's angular measurements. /** returns the detector's topology, namely, the meaning of the detector's angular measurements.
......
#include "MantidGeometry/IDetector.h"
using namespace Mantid::Geometry;
/// Must return a pointer to itself if derived from IComponent
const IComponent* IDetector::getComponent() const
{
throw std::runtime_error("This detector class does not inherit from IComponent.");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment