|
17 | 17 | #include "MantidGeometry/Instrument.h"
|
18 | 18 | #include "MantidGeometry/Instrument/Component.h"
|
19 | 19 | #include "MantidGeometry/Instrument/RectangularDetector.h"
|
| 20 | +#include "MantidKernel/DynamicPointerCastHelper.h" |
20 | 21 | #include "MantidKernel/FileValidator.h"
|
21 | 22 | #include <algorithm>
|
22 | 23 | #include <boost/math/special_functions/round.hpp>
|
@@ -76,7 +77,9 @@ void SCDPanelErrors::moveDetector(double x, double y, double z, double rotx, dou
|
76 | 77 | if (detname.compare("none") == 0.0)
|
77 | 78 | return;
|
78 | 79 | // CORELLI has sixteenpack under bank
|
79 |
| - DataObjects::PeaksWorkspace_sptr inputP = std::dynamic_pointer_cast<DataObjects::PeaksWorkspace>(inputW); |
| 80 | + DataObjects::PeaksWorkspace_sptr inputP = |
| 81 | + Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<DataObjects::PeaksWorkspace, API::Workspace>( |
| 82 | + inputW); |
80 | 83 | Geometry::Instrument_sptr inst = std::const_pointer_cast<Geometry::Instrument>(inputP->getInstrument());
|
81 | 84 | if (inst->getName().compare("CORELLI") == 0.0 && detname != "moderator")
|
82 | 85 | detname.append("/sixteenpack");
|
@@ -175,15 +178,9 @@ void SCDPanelErrors::eval(double xshift, double yshift, double zshift, double xr
|
175 | 178 | std::shared_ptr<API::Workspace> cloned = m_workspace->clone();
|
176 | 179 | moveDetector(xshift, yshift, zshift, xrotate, yrotate, zrotate, scalex, scaley, m_bank, cloned);
|
177 | 180 |
|
178 |
| - auto inputP = std::dynamic_pointer_cast<DataObjects::PeaksWorkspace>(cloned); |
179 |
| - // IAlgorithm_sptr alg = |
180 |
| - // Mantid::API::AlgorithmFactory::Instance().create("IndexPeaks", -1); |
181 |
| - // alg->initialize(); |
182 |
| - // alg->setChild(true); |
183 |
| - // alg->setLogging(false); |
184 |
| - // alg->setProperty("PeaksWorkspace", inputP); |
185 |
| - // alg->setProperty("Tolerance", 0.15); |
186 |
| - // alg->execute(); |
| 181 | + auto inputP = |
| 182 | + Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<DataObjects::PeaksWorkspace, API::Workspace>( |
| 183 | + cloned); |
187 | 184 | auto inst = inputP->getInstrument();
|
188 | 185 | Geometry::OrientedLattice lattice = inputP->mutableSample().getOrientedLattice();
|
189 | 186 | for (int i = 0; i < inputP->getNumberPeaks(); i++) {
|
|
0 commit comments