本文整理汇总了C++中TPad::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ TPad::Print方法的具体用法?C++ TPad::Print怎么用?C++ TPad::Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPad
的用法示例。
在下文中一共展示了TPad::Print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makePlot
//.........这里部分代码省略.........
label->SetFillStyle(0);
label->SetBorderSize(0);
label->Draw();
}
TPad* bottomPad = new TPad("bottomPad", "bottomPad", 0.00, 0.00, 1.00, 0.35);
bottomPad->SetFillColor(10);
bottomPad->SetTopMargin(0.02);
bottomPad->SetLeftMargin(0.15);
bottomPad->SetBottomMargin(0.24);
bottomPad->SetRightMargin(0.05);
bottomPad->SetGridx();
bottomPad->SetGridy();
canvas->cd();
bottomPad->Draw();
bottomPad->cd();
TH1* dummyHistogram_bottom = new TH1D("dummyHistogram_bottom", "dummyHistogram_bottom", 10, 0., 100.);
dummyHistogram_bottom->SetMinimum(-1.0);
dummyHistogram_bottom->SetMaximum(+1.0);
TAxis* xAxis_bottom = dummyHistogram_bottom->GetXaxis();
xAxis_bottom->SetTitle("calo-E_{T}^{miss} / GeV");
xAxis_bottom->SetTitleOffset(1.20);
xAxis_bottom->SetLabelColor(1);
xAxis_bottom->SetTitleColor(1);
xAxis_bottom->SetTitleSize(0.08);
xAxis_bottom->SetLabelOffset(0.02);
xAxis_bottom->SetLabelSize(0.08);
xAxis_bottom->SetTickLength(0.055);
TAxis* yAxis_bottom = dummyHistogram_bottom->GetYaxis();
yAxis_bottom->SetTitle("#frac{Data-Simulation}{Simulation}");
yAxis_bottom->SetTitleOffset(0.85);
yAxis_bottom->SetNdivisions(505);
yAxis_bottom->CenterTitle();
yAxis_bottom->SetTitleSize(0.08);
yAxis_bottom->SetLabelSize(0.08);
yAxis_bottom->SetTickLength(0.04);
dummyHistogram_bottom->SetTitle("");
dummyHistogram_bottom->SetStats(false);
dummyHistogram_bottom->Draw("axis");
TGraphAsymmErrors* graph_Data_div_mc_passed = makeGraph_data_div_mc(graph_Data_passed, graph_mcSum_passed);
graph_Data_div_mc_passed->SetLineColor(graph_Data_passed->GetLineColor());
graph_Data_div_mc_passed->SetMarkerColor(graph_Data_passed->GetMarkerColor());
graph_Data_div_mc_passed->SetMarkerStyle(graph_Data_passed->GetMarkerStyle());
graph_Data_div_mc_passed->Draw("p");
TF1* fit_Data_div_mc_passed =
new TF1("fit_Data_div_mc_passed", &integralCrystalBall_f_div_f,
fit_mcSum_passed->GetMinimumX(), fit_mcSum_passed->GetMaximumX(), 2*fit_mcSum_passed->GetNpar());
for ( int iPar = 0; iPar < fit_mcSum_passed->GetNpar(); ++iPar ) {
fit_Data_div_mc_passed->SetParameter(iPar, fit_Data_passed->GetParameter(iPar));
fit_Data_div_mc_passed->SetParameter(iPar + fit_mcSum_passed->GetNpar(), fit_mcSum_passed->GetParameter(iPar));
}
fit_Data_div_mc_passed->SetLineColor(graph_Data_div_mc_passed->GetLineColor());
fit_Data_div_mc_passed->SetLineWidth(2);
fit_Data_div_mc_passed->Draw("same");
TGraphAsymmErrors* graph_Data_div_mc_failed = makeGraph_data_div_mc(graph_Data_failed, graph_mcSum_failed);
graph_Data_div_mc_failed->SetLineColor(graph_Data_failed->GetLineColor());
graph_Data_div_mc_failed->SetMarkerColor(graph_Data_failed->GetMarkerColor());
graph_Data_div_mc_failed->SetMarkerStyle(graph_Data_failed->GetMarkerStyle());
graph_Data_div_mc_failed->Draw("p");
TF1* fit_Data_div_mc_failed =
new TF1("fit_Data_div_mc_failed", &integralCrystalBall_f_div_f,
fit_mcSum_failed->GetMinimumX(), fit_mcSum_failed->GetMaximumX(), 2*fit_mcSum_failed->GetNpar());
for ( int iPar = 0; iPar < fit_mcSum_failed->GetNpar(); ++iPar ) {
fit_Data_div_mc_failed->SetParameter(iPar, fit_Data_failed->GetParameter(iPar));
fit_Data_div_mc_failed->SetParameter(iPar + fit_mcSum_failed->GetNpar(), fit_mcSum_failed->GetParameter(iPar));
}
fit_Data_div_mc_failed->SetLineColor(graph_Data_div_mc_failed->GetLineColor());
fit_Data_div_mc_failed->SetLineWidth(2);
fit_Data_div_mc_failed->Draw("same");
topPad->RedrawAxis();
bottomPad->RedrawAxis();
canvas->Update();
size_t idx = outputFileName.Last('.');
std::string outputFileName_plot = std::string(outputFileName.Data(), 0, idx);
if ( idx != std::string::npos ) canvas->Print(std::string(outputFileName_plot).append(std::string(outputFileName.Data(), idx)).data());
//canvas->Print(std::string(outputFileName_plot).append(".png").data());
//canvas->Print(std::string(outputFileName_plot).append(".pdf").data());
topPad->Print(std::string(outputFileName_plot).append(".png").data());
topPad->Print(std::string(outputFileName_plot).append(".pdf").data());
delete legend;
delete label;
delete dummyHistogram_top;
delete topPad;
delete dummyHistogram_bottom;
delete bottomPad;
delete canvas;
}