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 Instrument &newInstrument, const V3D &pos, const Quat &rot, const double detWScale, const double detHtScale, ComponentInfo &componentInfo)
 Updates ComponentInfo for newInstrument to reflect the changes in the associated panel information. More...
 
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. More...
 

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 Instrument newInstrument,
const V3D pos,
const Quat rot,
const double  detWScale,
const double  detHtScale,
ComponentInfo componentInfo 
)

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

Parameters
bankNamesThe names of the banks (panels) that will be updated
newInstrumentThe instrument whose parameter map will be changed to reflect the new values below
posThe quantity to be added to the current relative position, from old NewInstrument, of the banks in bankNames.
rotThe quantity to be added to the current relative rotations, from old NewInstrument, of the banks in bankNames.
detWScaleThe factor to multiply the current detector width, from old NewInstrument, by to get the new detector width for the banks in bankNames.
detHtScaleThe factor to multiply the current detector height, from old NewInstrument, by to get the new detector height for the banks in bankNames.
componentInfoComponentInfo object for the modifications

Definition at line 63 of file CalibrationHelpers.cpp.

References Mantid::API::applyRectangularDetectorScaleToComponentInfo(), Mantid::Geometry::CompAssembly::getComponentByName(), Mantid::Geometry::Instrument::getParameterMap(), Mantid::Kernel::Quat::getRotation(), Mantid::Geometry::ComponentInfo::indexOf(), 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 26 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().