当前位置: 首页>>代码示例>>C++>>正文


C++ EventWorkspace_sptr::YUnit方法代码示例

本文整理汇总了C++中EventWorkspace_sptr::YUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ EventWorkspace_sptr::YUnit方法的具体用法?C++ EventWorkspace_sptr::YUnit怎么用?C++ EventWorkspace_sptr::YUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventWorkspace_sptr的用法示例。


在下文中一共展示了EventWorkspace_sptr::YUnit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: validateInputsForEventWorkspaces

/** Validate the input event workspaces
 *
 *  @param  inputWorkspaces The names of the input workspaces
 *  @throw invalid_argument if there is an incompatibility.
 *  @return true if all workspaces are event workspaces and valid. False if any
 *are not found,
 */
bool MergeRuns::validateInputsForEventWorkspaces(
    const std::vector<std::string> &inputWorkspaces) {
    std::string xUnitID;
    std::string YUnit;
    bool dist(false);

    m_inEventWS.clear();

    // Going to check that name of instrument matches - think that's the best
    // possible at the moment
    //   because if instrument is created from raw file it'll be a different
    //   object
    std::string instrument;

    for (size_t i = 0; i < inputWorkspaces.size(); ++i) {
        // Fetch the next input workspace as an - throw an error if it's not there
        EventWorkspace_sptr ws =
            AnalysisDataService::Instance().retrieveWS<EventWorkspace>(
                inputWorkspaces[i]);

        if (!ws) { // Either it is not found, or it is not an EventWorkspace
            return false;
        }
        m_inEventWS.push_back(ws);

        // Check a few things are the same for all input workspaces
        if (i == 0) {
            xUnitID = ws->getAxis(0)->unit()->unitID();
            YUnit = ws->YUnit();
            dist = ws->isDistribution();
            instrument = ws->getInstrument()->getName();
        } else {
            testCompatibility(ws, xUnitID, YUnit, dist, instrument);
        }
    } // for each input WS name

    // We got here: all are event workspaces
    return true;
}
开发者ID:mducle,项目名称:mantid,代码行数:46,代码来源:MergeRuns.cpp


注:本文中的EventWorkspace_sptr::YUnit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。