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


C++ Timing::getCharSeparatedList方法代码示例

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


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

示例1: printClassMethodMsg

void ParameterLoaderAnaysis::loadAnalysisParametersFits(ifstream & inputFileStream, HistoSetup &hSetup){
    //Variable Declaration
    bool bExitSuccess = false;
    
    pair<string,string> pair_strParam; //Input file is setup in <Field, Value> pairs; not used here yet but placeholder
    
    string strLine = "";    //Line taken from the input file
    
    vector<string> vec_strList; //For storing char separated input; not used here yet but placeholder
    
    if (bVerboseMode_IO) { //Case: User Requested Verbose Error Messages - I/O
        printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits", "Found Fit Heading");
    } //End Case: User Requested Verbose Error Messages - I/O
    
    while ( getlineNoSpaces(inputFileStream, strLine) ) {
        //Does the user want to comment out this line?
        if ( 0 == strLine.compare(0,1,"#") ) continue;
        
        //Do we reach the end of the section?
        if ( 0 == strLine.compare(strSecEnd_Uniformity_Fit ) ) break;
        
        //Debugging
        cout<<"strLine: = " << strLine.c_str() << endl;
        
        //Parse the line
        pair_strParam = getParsedLine(strLine,bExitSuccess);
        
        if (bExitSuccess) { //Case: Parameter Fetched Correctly
            //transform(pair_strParam.first.begin(), pair_strParam.second.end(),pair_strParam.first.begin(),toupper);
            
            string strTmp = pair_strParam.first;
            transform(strTmp.begin(), strTmp.end(), strTmp.begin(), toupper);
            
            pair_strParam.first = strTmp;
            
            //cout<<pair_strParam.first<<"\t"<<pair_strParam.second;
            
            if( 0 == pair_strParam.first.compare("FIT_FORMULA") ){ //Case: ADC Spectrum Fit Equation
                hSetup.strFit_Formula = pair_strParam.second;
            } //End Case: ADC Spectrum Fit Equation
            else if( 0 == pair_strParam.first.compare("FIT_OPTION") ){ //Case: ADC Spectrum Fit Equation
                hSetup.strFit_Option = pair_strParam.second;
                
                //Ensure that the result of the fit is returned in the TFitResultPtr by included the option "S" by default
                if (hSetup.strFit_Option.find("S") == std::string::npos ) {
                    hSetup.strFit_Option = hSetup.strFit_Option + "S";
                }
            } //End Case: ADC Spectrum Fit Equation
            else if( 0 == pair_strParam.first.compare("FIT_PARAM_IGUESS") ){
                hSetup.vec_strFit_ParamIGuess = getCharSeparatedList(pair_strParam.second,',');
            }
            else if( 0 == pair_strParam.first.compare("FIT_PARAM_LIMIT_MAX") ){
                hSetup.vec_strFit_ParamLimit_Max = getCharSeparatedList(pair_strParam.second, ',');
            }
            else if( 0 == pair_strParam.first.compare("FIT_PARAM_LIMIT_MIN") ){
                hSetup.vec_strFit_ParamLimit_Min = getCharSeparatedList(pair_strParam.second, ',');
            }
            else if( 0 == pair_strParam.first.compare("FIT_PARAM_MAP") ){
                hSetup.vec_strFit_ParamMeaning = Timing::getCharSeparatedList(pair_strParam.second,',');
            }
            else if( 0 == pair_strParam.first.compare("FIT_RANGE") ){
                hSetup.vec_strFit_Range = getCharSeparatedList(pair_strParam.second, ',');
            }
            else{ //Case: Parameter Not Recognized
                printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits","Error!!! Parameter Not Recognizd:\n");
                //printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersUniformity",( "\t(Field,Value) = (" + pair_strParam.first "," + pair_strParam.second + ")\n" ).c_str() );
                printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits",( "\tField = " + pair_strParam.first + "\n" ).c_str() );
                printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits",( "\tValue = " + pair_strParam.second + "\n" ).c_str() );
            } //End Case: Parameter Not Recognized
        } //End Case: Parameter Fetched Correctly
        else{ //Case: Parameter Failed to fetch correctly
            printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits","Error!!!  I didn't parse parameter correctly\n");
            printClassMethodMsg("ParameterLoaderAnaysis","loadAnalysisParametersFits",("\tCurrent line: " + strLine).c_str() );
        } //End Case: Parameter Failed to fetch correctly
    } //End Loop through Fit Heading
} //End ParameterLoaderAnaysis::loadAnalysisParametersFits
开发者ID:jhallan,项目名称:CMS_GEM_Analysis_Framework,代码行数:76,代码来源:ParameterLoaderAnaysis.cpp


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