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


C++ RooFitResult::floatParsInit方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
                  ((RooRealVar*)inWS_Zee->allVars().find(Form("ftest_Zee_DCB_%s_cat%d_alphaCB1_p0",ext.c_str(),cat)))->setConstant(true);
                  voialphaCB1 = ((RooRealVar*)inWS_Zee->allVars().find(Form("ftest_Zee_DCB_%s_cat%d_alphaCB1_p0",ext.c_str(),cat)))->getValV();

                  ((RooRealVar*)inWS_Zee->allVars().find(Form("ftest_Zee_DCB_%s_cat%d_alphaCB2_p0",ext.c_str(),cat)))->setConstant(true);
                  voialphaCB2 = ((RooRealVar*)inWS_Zee->allVars().find(Form("ftest_Zee_DCB_%s_cat%d_alphaCB2_p0",ext.c_str(),cat)))->getValV();
              }
         }
    }
    else{
         pdfVoiFix = 0;
    }
 
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Get Zee Params Done +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl; 

    RooAbsPdf *bkgPdf;
    if(orderBre == 0){
        bkgPdf = getPdf(pdfsModel, funcType, orderOff, Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat), LaurentConstant); 
        bkgPdf->SetName(Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat));
    }
    else{ 
        if(functionName == "Voi"){
            if(!useDoubleCB){
                  bkgPdf = getPdfSumVoigtianFixNew(pdfsModel, funcType, orderOff, voiMean, voiMeanErrorL, voiMeanErrorH, voiSigma, voiSigmaErrorL, voiSigmaErrorH, voiWidth, voiWidthErrorL, voiWidthErrorH, ErrorRange, Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat), LaurentConstant, bernDownBound, bernUpBound).first;   
            }else{
                  bkgPdf = getPdfSumVoigtianFixNewDouleCB(pdfsModel, funcType, orderOff, voiMean, voiMeanErrorL, voiMeanErrorH, voiSigma, voiSigmaErrorL, voiSigmaErrorH, voinCB1, voinCB1ErrorL, voinCB1ErrorH, voinCB2, voinCB2ErrorL, voinCB2ErrorH, voialphaCB1, voialphaCB2, ErrorRange, Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat), LaurentConstant, bernDownBound, bernUpBound).first;     
            }
        }
        bkgPdf->SetName(Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat));
    }

    RooArgSet *params = bkgPdf->getParameters(*data);
    params->Print("v");

cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Prepare Final Pdf Done +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl; 

    RooFitResult *fitRes = bkgPdf->fitTo(*data,Save(true),Range(mhLow,mhHigh));
   
    fitRes->floatParsInit().Print("v"); 
    fitRes->floatParsFinal().Print("v"); 
    


    if(voiMean != 0){
         if(!useDoubleCB){
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_Fvoimean",cat)))->setConstant(false);
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_Fvoisigma",cat)))->setConstant(false);
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_Fvoiwidth",cat)))->setConstant(false);
         }else{
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_Fdcbmean",cat)))->setConstant(false);
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_Fdcbsigma",cat)))->setConstant(false);
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_FdcbnCB1",cat)))->setConstant(false);
              ((RooRealVar*)params->find(Form("pdf_data_pol_model_8TeV_cat%d_FdcbnCB2",cat)))->setConstant(false);
         }

         params->Print("v");

         
         float BernFrac = ((RooRealVar*)fitRes->floatParsFinal().find(Form("pdf_data_pol_model_8TeV_cat%d_frac_sum1",cat)))->getValV();
         if(!useDoubleCB){
              outfile << Form("cat %d   ",cat) << data->sumEntries()*(1.0-BernFrac) << "   Mean " << voiMean << "   voiMeanErrorL  " << voiMeanErrorL << " voiMeanErrorH  "<< voiMeanErrorH << "  voiSigma  " << voiSigma << "  voiSigmaErrorL  " << voiSigmaErrorL << " voiSigmaErrorH  " << voiSigmaErrorH << "  voiWidth  " << voiWidth << "  voiWidthErrorL  " << voiWidthErrorL << " voiWidthErrorH  " << voiWidthErrorH << endl;
              outfile << endl;
         }else{
              outfile << Form("cat %d    ",cat) << data->sumEntries()*(1.0-BernFrac) << "    Mean " << voiMean << "   voiMeanErrorL  " << voiMeanErrorL << " voiMeanErrorH  "<< voiMeanErrorH << "  voiSigma  " << voiSigma << "  voiSigmaErrorL  " << voiSigmaErrorL << " voiSigmaErrorH  " << voiSigmaErrorH << "    nCB1  " << voinCB1 << "    nCB1ErrorL   " << voinCB1ErrorL << "   nCB1ErrorH  " << voinCB1ErrorH << "   nCB2  " << voinCB2 << "   nCB2ErrorL  " << voinCB2ErrorL << "    nCB2ErrorH   " << voinCB2ErrorH << "bernfrac "<<BernFrac<< endl;

         }
         

    }

    outputws->pdf(Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat))->SetName(Form("pdf_data_pol_model_%dTeV_cat%d_OLD",sqrts,cat));
    outputws->import(*bkgPdf);
    //outputws->import(*data);

    outputws->pdf(Form("pdf_data_pol_model_%dTeV_cat%d",sqrts,cat))->Print();



    outputws->data(Form("data_mass_cat%d",cat))->Print("v");
   

    outputws->data(Form("roohist_data_mass_cat%d",cat))->Print("v");




 

    
  }




  
  outputfile->cd();
  outputws->Write();
  outputfile->Close();   


}
开发者ID:bcourbon,项目名称:h2gglobe,代码行数:101,代码来源:ImportBkgModel.cpp


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