本文整理汇总了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