本文整理汇总了C++中TLegend::GetX1NDC方法的典型用法代码示例。如果您正苦于以下问题:C++ TLegend::GetX1NDC方法的具体用法?C++ TLegend::GetX1NDC怎么用?C++ TLegend::GetX1NDC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLegend
的用法示例。
在下文中一共展示了TLegend::GetX1NDC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wjetsPrint
//.........这里部分代码省略.........
h_data[p][v]->SetMarkerStyle(data_marker_style);
h_data[p][v]->SetMarkerSize(data_marker_size);
h_data[p][v]->Draw("sames PE");
cout<<vars[v]<<endl;
if(vars[v].find("avg_int_per_xing") == string::npos &&
vars[v].find("dijet_m")==string::npos){
plot_pads[c]->SetLogy();
}
canvases[c]->Update();
//////////////////////////////////////////////////
// make legend
//////////////////////////////////////////////////
TLegend* lgnd = new TLegend(0.63,0.7,0.9,0.9);
lgnd->SetFillColor(0);
lgnd->SetTextSize(0.045);
lgnd->AddEntry(h_data[p][v],"data","F");
lgnd->AddEntry(h_sherpa_bkgd[p][v],"SHERPA (qcd,v+jets)","F");
lgnd->AddEntry(h_alpgen_bkgd[p][v],"ALPGEN (qcd,v+jets)","F");
lgnd->AddEntry(top_hist,"mc.mcatnlo.top","F");
lgnd->AddEntry(vv_hist,"mc.herwig.vv","F");
lgnd->Draw();
//////////////////////////////////////////////////
// Do ratio
//////////////////////////////////////////////////
ratio_pads[c]->cd();
ratio_pads[c]->SetGrid();
TAxis* alpgen_ratio_xaxis= h_alpgen_ratio[p][v]->GetXaxis();
TAxis* alpgen_ratio_yaxis= h_alpgen_ratio[p][v]->GetYaxis();
h_alpgen_ratio[p][v]->SetMarkerStyle(20);
h_alpgen_ratio[p][v]->SetMarkerSize(2);
h_alpgen_ratio[p][v]->SetLineWidth(1);
h_alpgen_ratio[p][v]->SetLineColor(alpgen_color);
alpgen_ratio_xaxis->SetLabelSize(0.08);
alpgen_ratio_yaxis->SetLabelSize(0.08);
alpgen_ratio_xaxis->SetTitle(plot_vars[v].c_str());
alpgen_ratio_xaxis->SetTitleSize(0.16);
alpgen_ratio_xaxis->SetTitleOffset(0.7);
alpgen_ratio_yaxis->SetNdivisions(4,4,4);
alpgen_ratio_yaxis->SetTitle("(data-MC)/MC");
alpgen_ratio_yaxis->SetTitleSize(0.07);
alpgen_ratio_yaxis->SetTitleOffset(0.36);
alpgen_ratio_yaxis->SetRangeUser(-0.5,0.5);
h_alpgen_ratio[p][v]->Draw("PE");
canvases[c]->Update();
TAxis* sherpa_ratio_yaxis= h_sherpa_ratio[p][v]->GetYaxis();
h_sherpa_ratio[p][v]->SetMarkerStyle(20);
h_sherpa_ratio[p][v]->SetMarkerSize(2);
h_sherpa_ratio[p][v]->SetLineColor(sherpa_color);
sherpa_ratio_yaxis->SetRangeUser(-0.5,0.5);
h_sherpa_ratio[p][v]->Draw("PE sames");
canvases[c]->Update();
plot_pads[c]->cd();
canvases[c]->RedrawAxis();
double leg_x1 = lgnd->GetX1NDC();
double leg_y1 = lgnd->GetY1NDC();
double offset_x1 = -0.02;
double offset_y1 = 0.08;
// If you want to write text on the plot (e.g. integrated luminosity)
//string atlas_text = "ATLAS pre-approval";
string sqrts_text = "#sqrt{s}= 7 TeV";
string lumi_text = "#int Ldt = 4.701 fb^{-1}";
myText(leg_x1-offset_x1, leg_y1-offset_y1, 1, sqrts_text.c_str());
myText(leg_x1-offset_x1 + 0.1, leg_y1-offset_y1,1, lumi_text.c_str());
string cur_saveas = plot_loc+hist_name+save_ext;
canvases[c]->SaveAs(cur_saveas.c_str());
++c;
}
}
sherpa_wjets->Close();
sherpa_zjets->Close();
vv->Close();
alpgen_qcd->Close();
sherpa_qcd->Close();
top->Close();
alpgen_zjets->Close();
sherpa_zjets->Close();
gROOT->ProcessLine(".q");
}