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


C++ RooRealVar::readFromStream方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
  RooHistPdf * ZmmNoIsoPdf = createHistPdf( "ZmmNoIsoPdf", zmm, mass, rebinZMuMuNoIso/ rebinZMuMu   );
  // creating a pdf for Zms from zmsta!!!
  RooHistPdf * ZmsPdf = createHistPdf( "ZmsPdf", zmsta, mass, rebinZMuSa/ rebinZMuMu  );
  // creating a pdf for Zmmhlt
  RooHistPdf * ZmmHltPdf = createHistPdf( "ZmmHltPdf", zmm, mass, rebinZMuMuHlt/ rebinZMuMu  );
  
  // creating the variable with random init values
  
  RooRealVar Yield("Yield","Yield", 15000.,345.,3567890.)  ;
  RooRealVar nbkg_mutrk("nbkg_mutrk","background _mutrk fraction",500,0.,100000.) ; 
  RooRealVar nbkg_mumuNotIso("nbkg_mumuNotIso","background fraction",500,0.,100000.) ;
  RooRealVar nbkg_musa("nbkg_musa","background fraction",50,0.,100000.) ;
  RooRealVar eff_tk("eff_tk","signal _mutrk fraction",.99,0.8,1.0) ;
  RooRealVar eff_sa("eff_sa","eff musta",0.99,0.8,1.0) ;
  RooRealVar eff_iso("eff_iso","eff mumuNotIso",.99,0.8,1.0) ;
  RooRealVar eff_hlt("eff_hlt","eff 1hlt",0.99, 0.8,1.0) ;
  RooRealVar alpha  ("alpha","coefficient alpha", -0.01 , -1000, 1000.) ;
  RooRealVar a0 ("a0","coefficient 0", 1,-1000.,1000.) ;
  RooRealVar a1 ("a1","coefficient 1", -0.001,-1000,1000.) ;
  RooRealVar a2 ("a2","coefficient 2", 0.0,-1000.,1000.) ;
  RooRealVar beta ("beta","coefficient beta", -0.01,-1000 , 1000. ) ;
  RooRealVar b0 ("b0","coefficient 0", 1,-1000.,1000.) ;
  RooRealVar b1 ("b1","coefficient 1", -0.001,-1000,1000.) ;
  RooRealVar b2("b2","coefficient 2", 0.0,-1000.,1000.) ;
  RooRealVar gamma ("gamma","coefficient gamma", -0.01,-1000 , 1000. ) ;
  RooRealVar c0 ("c0","coefficient 0", 1,-1000.,1000.) ;
  RooRealVar c1 ("c1","coefficient 1", -0.001,-1000,1000.) ;
  // fit parameters setted from datacard 
  filebuf fb;
  fb.open ("zMuMuRooFit.txt",ios::in);
  istream is(&fb);
  char line[1000];
  
  Yield.readFromStream(is.getline(line, 1000), kFALSE);  
  nbkg_mutrk.readFromStream(is.getline(line,1000), kFALSE);
  nbkg_mumuNotIso.readFromStream(is.getline(line,1000),  kFALSE);
  nbkg_musa.readFromStream(is.getline(line,1000),  kFALSE);
  eff_tk.readFromStream(is.getline(line,1000),  kFALSE);
  eff_sa.readFromStream(is.getline(line,1000),  kFALSE);
  eff_iso.readFromStream(is.getline(line,1000),  kFALSE);
  eff_hlt.readFromStream(is.getline(line,1000),  kFALSE);
  alpha.readFromStream(is.getline(line,1000),  kFALSE);
  a0.readFromStream(is.getline(line,1000),  kFALSE);  
  a1.readFromStream(is.getline(line,1000), kFALSE );  
  a2.readFromStream(is.getline(line,1000), kFALSE);  
  beta.readFromStream(is.getline(line,1000), kFALSE);
  b0.readFromStream(is.getline(line,1000), kFALSE);  
  b1.readFromStream(is.getline(line,1000), kFALSE);  
  b2.readFromStream(is.getline(line,1000), kFALSE);  
  gamma.readFromStream(is.getline(line,1000), kFALSE);
  c0.readFromStream(is.getline(line,1000), kFALSE);  
  c1.readFromStream(is.getline(line,1000), kFALSE);  
  fb.close();
  
  // scaling to lumi if toy is enabled...
  if (vm.count("toy")) {
    Yield.setVal(scaleLumi * (Yield.getVal()));
    nbkg_mutrk.setVal(scaleLumi * (nbkg_mutrk.getVal()));
    nbkg_mumuNotIso.setVal(scaleLumi * (nbkg_mumuNotIso.getVal()));
  }   
  
  
  //efficiency term
  
  //zMuMuEff1HLTTerm = _2 * (effTk ^ _2) *  (effSa ^ _2) * (effIso ^ _2) * effHLT * (_1 - effHLT); 
  RooFormulaVar zMuMu1HLTEffTerm("zMuMu1HLTEffTerm", "Yield * (2.* (eff_tk)^2 * (eff_sa)^2 * (eff_iso)^2 * eff_hlt *(1.- eff_hlt))", 
开发者ID:12345ieee,项目名称:cmg-cmssw,代码行数:67,代码来源:zMuMuRooFit.cpp


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