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


C++ Selection::findCategory方法代码示例

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


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

示例1: plotZMuMu


//.........这里部分代码省略.........
 
  for(UInt_t isample=0; isample<samples.size(); isample++) {
    char hname[100];    
    sprintf(hname,"hZMass_%i",isample); hZMassv.push_back(new TH1F(hname,"",150,50,200)); hZMassv[isample]->Sumw2();
    sprintf(hname,"hNJets_%i",isample); hNJetsv.push_back(new TH1F(hname,"",20,-0.5,19.5)); hNJetsv[isample]->Sumw2();
  }


  // flag for if there is a data sample to process
  Bool_t hasData = samples[0]->isInputSourceSetup();
  
  // loop over samples
  for(UInt_t isample=0; isample<samples.size(); isample++) {  
    SampleMIT *s = samples[isample];
    cout << endl << "Process sample " << s->getLabel() << endl;
    cout << "total events "     << s->getNEvents() << endl;
    cout << "total candidates " << s->getNCandidates() << endl;
    for( int ientry=0; ientry<s->getNCandidates(); ientry++){
      if(ientry%10000 == 0) {
	printf("."); fflush(stdout);
      }
      //
      // Apply canidate selection
      //
      // General cuts
      if( ! selection.passBaselineSelection( s->triggerBits(ientry),
					     s->mass(ientry),
					     s->mu1pt(ientry),
					     s->mu2pt(ientry),
					     s->mu1eta(ientry),
					     s->mu2eta(ientry)) )
	  continue;
      // Apply category cuts
      int foundCategory = selection.findCategory( s->mu1typeBits(ientry),
						  s->mu2typeBits(ientry),
						  s->mu1trkIso(ientry),
						  s->mu2trkIso(ientry),
						  s->mu1hltMatchBits(ientry),
						  s->mu2hltMatchBits(ientry),
						  s->mu1charge(ientry),
						  s->mu2charge(ientry) );
      if( category == ZGolden1or2HLT && 
	  !(foundCategory == ZGolden2HLT || foundCategory == ZGolden1HLT) ) 
	continue;
      else if ( category != 0 && ! (category == foundCategory) )
	continue;	   

      // Tests and additional cuts if needed:
      double pt1 = s->mu1pt(ientry);
      double pt2 = s->mu2pt(ientry);
      int nJets = s->nJets(ientry);
      int mu1iso = s->mu1trkIso(ientry);
      int mu2iso = s->mu2trkIso(ientry);
      int mu1type = s->mu1typeBits(ientry);
      int mu2type = s->mu2typeBits(ientry);
      //if( ! (pt1 > 30 && pt2 > 30) ) continue;
      //if( (mu1iso > 3 && mu2iso > 3) ) continue;
      //if(nJets>0) continue;
      //if( !(mu1type == mNoMuon || mu2type == mNoMuon) )continue;

//       // Require opposite charge (if not using categories, otherwise
//       // the cut is applied in the category requirements)
//       if( s->mu1charge(ientry)*s->mu2charge(ientry) >0 )
// 	continue;

      // Fill histograms
开发者ID:ikrav,项目名称:usercode,代码行数:67,代码来源:plotZMuMu.C


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