本文整理汇总了C++中Events::XS方法的典型用法代码示例。如果您正苦于以下问题:C++ Events::XS方法的具体用法?C++ Events::XS怎么用?C++ Events::XS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::XS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Introduce cutflow histogram to monior event yields for early preselection
TH1D* cutflow_preselection = new TH1D("cutflow_preselection","cutflow_preselectoion",
11,0.,11.);
cutflow_preselection->GetXaxis()->SetBinLabel(1,"All Events");
cutflow_preselection->GetXaxis()->SetBinLabel(2,"Sample based gen-selection");
cutflow_preselection->GetXaxis()->SetBinLabel(3,"HBHEIsoNoiseFilter");
cutflow_preselection->GetXaxis()->SetBinLabel(4,"eeBadScFilter");
cutflow_preselection->GetXaxis()->SetBinLabel(5,"HBHENoiseFilter");
cutflow_preselection->GetXaxis()->SetBinLabel(6,"GoodVtx");
cutflow_preselection->GetXaxis()->SetBinLabel(7,"JetID Cleaning");
int sampletype=-1;
if(subSampleKey.find("TTbar_Inclusive")!=string::npos)sampletype=0; //TTbar_Inclusive
else if(subSampleKey.find("TTbar_Tbar_SingleLep")!=string::npos || subSampleKey.find("TTbar_T_SingleLep")!=string::npos)sampletype=1;
else if(subSampleKey.find("TTbar_DiLept")!=string::npos)sampletype=2;
else if(subSampleKey.find("TTbar_HT_600_800")!=string::npos)sampletype=3;
else if(subSampleKey.find("TTbar_HT_800_1200")!=string::npos)sampletype=4;
else if(subSampleKey.find("TTbar_HT_1200_2500")!=string::npos)sampletype=5;
else if(subSampleKey.find("TTbar_HT_2500_Inf")!=string::npos)sampletype=6;
else if(subSampleKey.find("TTbar")!=string::npos){
cout << " TT sample is not known. Please check the second input \n " ;
return 2;
}
int TotNEve_ = utils2::TotNEve(subSampleKey);
// Loop over the events (tree entries)
int eventN=0;
while( evt->loadNext() ){
//if(eventN>1000)break;
// Total weight
//double totWeight = evt->weight()*1.;
double totWeight = 10000.*evt->XS()/TotNEve_;
//printf(" XS: %g NEvents: %d weight: %g \n ",evt->XS(),TotNEve_,totWeight);
cutflow_preselection->Fill(0.,totWeight); // keep track of all events processed
if(!evt->DataBool_()){
if(sampletype==0){
if(evt->gen_ht()>600||evt->GenElecPtVec_().size()>0||evt->GenMuPtVec_().size()>0||evt->GenTauPtVec_().size()>0)continue;
}
if(sampletype==1){
if(evt->gen_ht()>600)continue;
}
if(sampletype==2){
if(evt->gen_ht()>600)continue;
}
}
cutflow_preselection->Fill(1.,totWeight);
if(evt->HBHEIsoNoiseFilter_()==0)continue;
cutflow_preselection->Fill(2.,totWeight);
if(evt->eeBadScFilter_()==0)continue;
cutflow_preselection->Fill(3.,totWeight);
if(evt->HBHENoiseFilter_()==0)continue;
cutflow_preselection->Fill(4.,totWeight);
if(!(evt->NVtx_() >0))continue;
cutflow_preselection->Fill(5.,totWeight);
// Through out an event that contains HTjets with bad id
if(evt->JetId()==0)continue;
cutflow_preselection->Fill(6.,totWeight); // events passing JetID event cleaning