Skip to content

Commit

Permalink
Revert "Merge branch 'tube_calibration_1' into develop re #6344"
Browse files Browse the repository at this point in the history
This reverts commit a00da7c, reversing
changes made to 804e126.
  • Loading branch information
KarlPalmen committed Mar 7, 2013
1 parent f1efc44 commit a374e1d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 383 deletions.
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ set ( TEST_FILES
AlphaCalcTest.h
AnyShapeAbsorptionTest.h
AppendSpectraTest.h
ApplyCalibrationTest.h
ApplyDeadTimeCorrTest.h
ApplyDetailedBalanceTest.h
ApplyTransmissionCorrectionTest.h
Expand Down
37 changes: 27 additions & 10 deletions Code/Mantid/Framework/Algorithms/src/ApplyCalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ The PositionTable must have columns ''Detector ID'' and ''Detector Position''. T
#include "MantidGeometry/Instrument/Component.h"
#include "MantidAPI/FileProperty.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidGeometry/Instrument/ComponentHelper.h"
#include <boost/scoped_ptr.hpp>

namespace Mantid
Expand All @@ -34,7 +33,7 @@ namespace Mantid
using Geometry::Instrument;
using Geometry::Instrument_sptr;
using Geometry::IDetector_sptr;
using Geometry::IComponent_const_sptr;
using Kernel::V3D;

/// Empty default constructor
ApplyCalibration::ApplyCalibration()
Expand Down Expand Up @@ -92,14 +91,32 @@ namespace Mantid
*/
void ApplyCalibration::setDetectorPosition(const Geometry::Instrument_const_sptr & instrument, int detID, V3D pos, bool /*sameParent*/ )
{

IComponent_const_sptr det =instrument->getDetector(detID); ;
// Do the move
using namespace Geometry::ComponentHelper;
TransformType positionType = Absolute;
// TransformType positionType = Relative;
Geometry::ComponentHelper::moveComponent(*det, *m_pmap, pos, positionType);

Geometry::IDetector_const_sptr det = instrument->getDetector(detID);
// Then find the corresponding relative position
boost::shared_ptr<const Geometry::IComponent> parent = det->getParent();
if (parent)
{
pos -= parent->getPos();
Quat rot = parent->getRelativeRot();
rot.inverse();
rot.rotate(pos);
}
boost::shared_ptr<const Geometry::IComponent>grandparent = parent->getParent();
if (grandparent)
{
Quat rot = grandparent->getRelativeRot();
rot.inverse();
rot.rotate(pos);
boost::shared_ptr<const Geometry::IComponent>greatgrandparent = grandparent->getParent();
if (greatgrandparent) {
Quat rot2 = greatgrandparent->getRelativeRot();
rot2.inverse();
rot2.rotate(pos);
}
}

// Add a parameter for the new position
m_pmap->addV3D(det.get(), "pos", pos);
}

} // namespace Algorithms
Expand Down
155 changes: 0 additions & 155 deletions Code/Mantid/Framework/Algorithms/test/ApplyCalibrationTest.h

This file was deleted.

73 changes: 0 additions & 73 deletions Code/Mantid/scripts/Calibration/Examples/TubeCalibDemoMaps_All.py

This file was deleted.

72 changes: 0 additions & 72 deletions Code/Mantid/scripts/Calibration/Examples/TubeCalibDemoMaps_B1.py

This file was deleted.

0 comments on commit a374e1d

Please sign in to comment.