Mantid
Loading...
Searching...
No Matches
Functions
Mantid::Crystal::CalibrationHelpers Namespace Reference

CalibrationHelpers : This contains helper methods to move source, sample and detector positions/rotations for an instrument according to some calibration information. More...

Functions

MANTID_CRYSTAL_DLL void adjustBankPositionsAndSizes (const std::vector< std::string > &bankNames, const V3D &pos, const Quat &rot, const double detWScale, const double detHtScale, ComponentInfo &componentInfo)
 Updates ComponentInfo to reflect the changes in the associated panel information.
 
MANTID_CRYSTAL_DLL void adjustUpSampleAndSourcePositions (const double L0, const V3D &newSampPos, ComponentInfo &componentInfo)
 Updates the ComponentInfo for the workspace containing newInstrument to reflect the position of the source.
 

Detailed Description

CalibrationHelpers : This contains helper methods to move source, sample and detector positions/rotations for an instrument according to some calibration information.

Function Documentation

◆ adjustBankPositionsAndSizes()

void Mantid::Crystal::CalibrationHelpers::adjustBankPositionsAndSizes ( const std::vector< std::string > &  bankNames,
const V3D &  pos,
const Quat &  rot,
const double  detWScale,
const double  detHtScale,
ComponentInfo &  componentInfo 
)

Updates ComponentInfo to reflect the changes in the associated panel information.

Parameters
bankNamesThe names of the banks (panels) that will be updated
posThe quantity to be added to the current relative position of the banks in bankNames.
rotThe quantity to be added to the current relative rotations of the banks in bankNames.
detWScaleThe factor to multiply the current detector width by to get the new detector width for the banks in bankNames.
detHtScaleThe factor to multiply the current detector height by to get the new detector height for the banks in bankNames.
componentInfoComponentInfo object for the modifications

Definition at line 59 of file CalibrationHelpers.cpp.

References Mantid::Geometry::ComponentInfo::addDouble(), Mantid::API::applyRectangularDetectorScaleToComponentInfo(), Mantid::Geometry::ComponentInfo::getNumberParameter(), Mantid::Geometry::ComponentInfo::indexOfAny(), Mantid::Geometry::ComponentInfo::parent(), Mantid::Geometry::ComponentInfo::position(), Mantid::Geometry::ComponentInfo::relativeRotation(), Mantid::Kernel::Quat::rotate(), Mantid::Geometry::ComponentInfo::rotation(), Mantid::Geometry::ComponentInfo::setPosition(), and Mantid::Geometry::ComponentInfo::setRotation().

◆ adjustUpSampleAndSourcePositions()

void Mantid::Crystal::CalibrationHelpers::adjustUpSampleAndSourcePositions ( const double  L0,
const V3D &  newSampPos,
ComponentInfo &  componentInfo 
)

Updates the ComponentInfo for the workspace containing newInstrument to reflect the position of the source.

reflect the new source position

Parameters
L0The new distance from source to sample (should be positive)
newSampPosThe relative shift for the new sample position
componentInfoComponentInfo for the workspace being updated

Definition at line 25 of file CalibrationHelpers.cpp.

References Mantid::Geometry::ComponentInfo::l1(), Mantid::Geometry::ComponentInfo::sample(), Mantid::Geometry::ComponentInfo::samplePosition(), Mantid::Geometry::ComponentInfo::setPosition(), Mantid::Geometry::ComponentInfo::source(), and Mantid::Geometry::ComponentInfo::sourcePosition().

Referenced by Mantid::Crystal::OptimizeCrystalPlacement::exec(), and Mantid::Crystal::SetCrystalLocation::exec().