本文整理汇总了C++中api::ITableWorkspace_sptr::getVector方法的典型用法代码示例。如果您正苦于以下问题:C++ ITableWorkspace_sptr::getVector方法的具体用法?C++ ITableWorkspace_sptr::getVector怎么用?C++ ITableWorkspace_sptr::getVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api::ITableWorkspace_sptr
的用法示例。
在下文中一共展示了ITableWorkspace_sptr::getVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exec
/** Executes the algorithm. Moving detectors of input workspace to positions indicated in table workspace
*
* @throw FileError Thrown if unable to get instrument from workspace,
* table workspace is incompatible with instrument
*/
void ApplyCalibration::exec()
{
// Get pointers to the workspace, parameter map and table
API::MatrixWorkspace_sptr inputWS = getProperty("Workspace");
m_pmap = &(inputWS->instrumentParameters()); // Avoids a copy if you get the reference before the instrument
API::ITableWorkspace_sptr PosTable = getProperty("PositionTable");
Geometry::Instrument_const_sptr instrument = inputWS->getInstrument();
if(!instrument)
{
throw std::runtime_error("Workspace to apply calibration to has no defined instrument");
}
size_t numDetector = PosTable->rowCount();
ColumnVector<int> detID = PosTable->getVector("Detector ID");
ColumnVector<V3D> detPos = PosTable->getVector("Detector Position");
// numDetector needs to be got as the number of rows in the table and the detID got from the (i)th row of table.
for (size_t i = 0; i < numDetector; ++i)
{
setDetectorPosition(instrument, detID[i], detPos[i], false );
}
// Ensure pointer is only valid for execution
m_pmap = NULL;
}