本文整理汇总了C++中Plotter::AddBg方法的典型用法代码示例。如果您正苦于以下问题:C++ Plotter::AddBg方法的具体用法?C++ Plotter::AddBg怎么用?C++ Plotter::AddBg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plotter
的用法示例。
在下文中一共展示了Plotter::AddBg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
MyAnalysis *N = new MyAnalysis(1,1,118.7,lumi,hN->GetBinContent(1));
TChain* ch10 = new TChain("TopTree/events");
ch10->Add(Form("%s/hep_WW.root",dir.Data()),nevt);
ch10->Process(N);
MyAnalysis *O = new MyAnalysis(1,1,47.13,lumi,hO->GetBinContent(1));
TChain* ch11 = new TChain("TopTree/events");
ch11->Add(Form("%s/hep_WZ.root",dir.Data()),nevt);
ch11->Process(O);
MyAnalysis *M = new MyAnalysis(1,1,16.523,lumi,hM->GetBinContent(1));
TChain* ch12 = new TChain("TopTree/events");
ch12->Add(Form("%s/hep_ZZ.root",dir.Data()),nevt);
ch12->Process(M);
Plotter P;
for (int i=0; i < 6 ;i++) {
//for (int i=0; i < D->histograms.size() ;i++) {
//merge for DY
D->histograms[i]->Add(E->histograms[i]);
//merge for SingleTop
I->histograms[i]->Add(J->histograms[i]);
I->histograms[i]->Add(K->histograms[i]);
I->histograms[i]->Add(L->histograms[i]);
//////merge for VV
N->histograms[i]->Add(O->histograms[i]);
N->histograms[i]->Add(M->histograms[i]);
////tt bkg
// B->histograms[i]->Add(Bhad->histograms[i]);
}
P.SetData(A->histograms, std::string("Data"));
P.AddBg(Bsemi->histograms, std::string("TTbar"));
P.AddBg(C->histograms, std::string("Wjets"));
P.AddBg(D->histograms, std::string("DY"));
P.AddBg(I->histograms, std::string("Single Top"));
P.AddBg(N->histograms, std::string("VV"));
P.AddBg(B->histograms, std::string("TTOthers"));
P.Plot(string("results_ABCD.pdf"));
TFile * outA = TFile::Open("hist_data.root","RECREATE");
for(int i=0; i < A->histograms.size(); i++){
TH1F * tmp = (TH1F *) A->histograms[i];
tmp->Write();
}
for(int i=0; i < A->histograms_2D.size(); i++){
TH2D * tmp = (TH2D *) A->histograms_2D[i];
tmp->Write();
}
outA->Write();
outA->Close();
TFile * outB = TFile::Open("hist_TT_others.root","RECREATE");
for(int i=0; i < B->histograms.size(); i++){
TH1F * tmp = (TH1F *) B->histograms[i];
tmp->Write();
}
for(int i=0; i < B->histograms_2D.size(); i++){
TH2D * tmp = (TH2D *) B->histograms_2D[i];
tmp->Write();
}
outB->Write();
outB->Close();