本文整理汇总了C++中mantid::api::MatrixWorkspace_sptr::sample方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixWorkspace_sptr::sample方法的具体用法?C++ MatrixWorkspace_sptr::sample怎么用?C++ MatrixWorkspace_sptr::sample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid::api::MatrixWorkspace_sptr
的用法示例。
在下文中一共展示了MatrixWorkspace_sptr::sample方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invalid_argument
/*
* Add parameter logs and convert to MD for a single run
*
* @param input_workspace :: datasource workspace
* @param emode :: analysis mode "Elastic", "Direct" or "Indirect"
* @param efix :: datasource energy values in meV
* @param psi :: goniometer rotation in degrees
* @param gl :: goniometer rotation in degrees
* @param gs :: goniometer rotation in degrees
* @param in_place :: do merge step at the same time as converting to
*MDWorkspace
* @param alatt :: length of crystal lattice parameter in angstroms
* @param angdeg :: lattice angle
* @param u :: lattice vector parallel to incident neutron beam
* @param v :: lattice vector perpendicular to u in the horizontal plane
* @param out_mdws :output workspace to use if merge step is carried out
*/
Mantid::API::IMDEventWorkspace_sptr CreateMD::single_run(
Mantid::API::MatrixWorkspace_sptr input_workspace, const std::string &emode,
double efix, double psi, double gl, double gs, bool in_place,
const std::vector<double> &alatt, const std::vector<double> &angdeg,
const std::vector<double> &u, const std::vector<double> &v,
const std::string &filebackend_filename, const bool filebackend,
Mantid::API::IMDEventWorkspace_sptr out_mdws) {
std::vector<std::vector<double>> ub_params{alatt, angdeg, u, v};
if (any_given(ub_params) && !all_given(ub_params)) {
throw std::invalid_argument(
"Either specify all of alatt, angledeg, u, v or none of them");
} else {
if (input_workspace->sample().hasOrientedLattice()) {
g_log.warning() << "Sample already has a UB. This will not be "
"overwritten. Use ClearUB and re-run.\n";
} else {
setUB(input_workspace, alatt[0], alatt[1], alatt[2], angdeg[0], angdeg[1],
angdeg[2], u, v);
}
if (efix > 0.0) {
addSampleLog(input_workspace, "Ei", efix);
}
addSampleLog(input_workspace, "gl", gl);
addSampleLog(input_workspace, "gs", gs);
addSampleLog(input_workspace, "psi", psi);
setGoniometer(input_workspace);
return convertToMD(input_workspace, emode, in_place, filebackend_filename,
filebackend, out_mdws);
}
}