本文整理汇总了C++中TCanvas::GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::GetTitle方法的具体用法?C++ TCanvas::GetTitle怎么用?C++ TCanvas::GetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCanvas
的用法示例。
在下文中一共展示了TCanvas::GetTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeToCanvas
void writeToCanvas(TCanvas& canvas, TH1D* hist1, TH1D* hist2, TLegend& legend)
{
setCanvasOptions(canvas);
hist1->Scale(1.0/hist1->Integral());
hist2->Scale(1.0/hist2->Integral());
hist1->SetLineColor(8);
hist2->SetLineColor(9);
hist1->SetLineWidth(2);
hist2->SetLineWidth(2);
hist1->SetFillStyle(0);
hist2->SetFillStyle(0);
string title(canvas.GetTitle());
size_t slashPos = title.find('/');
legend.AddEntry(hist1, title.substr(0, slashPos).c_str(), "L");
legend.AddEntry(hist2, title.substr(slashPos + 1, string::npos).c_str(), "L");
legend.SetTextFont(42);
legend.SetTextSize(0.02);
legend.SetShadowColor(0);
legend.SetLineColor(0);
legend.SetFillStyle(0);
canvas.cd();
hist1->Draw();
hist2->Draw("SAME");
legend.Draw();
}
示例2: makeEfficiency
//.........这里部分代码省略.........
if(bDo2D)
{
TLatex lx;
TCanvas *pcPtYPairEff = new TCanvas("pcPtYPairEff","pcPtYPairEff",1500,600);
pcPtYPairEff->Divide(3,1);
pcPtYPairEff->cd(1);
pcPtYPairEff->GetPad(1)->SetLeftMargin(0.16);
pcPtYPairEff->GetPad(1)->SetRightMargin(0.15);
phPtYTmp->Draw();
pgPtYEff_pp->GetZaxis()->SetRangeUser(0.0,1.0);
pgPtYEff_pp->Draw("colz same");
lx.DrawLatex(0.,2.,"Pp_reco");
gPad->Update();
pcPtYPairEff->cd(2);
pcPtYPairEff->GetPad(2)->SetLeftMargin(0.16);
pcPtYPairEff->GetPad(2)->SetRightMargin(0.15);
phPtYTmp->Draw();
pgPtYEff_std->GetZaxis()->SetRangeUser(0.0,1.0);
pgPtYEff_std->Draw("colz same");
lx.DrawLatex(0.,2.,"Std_reco");
gPad->Update();
pcPtYPairEff->cd(3);
pcPtYPairEff->GetPad(3)->SetLeftMargin(0.16);
pcPtYPairEff->GetPad(3)->SetRightMargin(0.15);
phPtYTmp->Draw();
pgPtYEff_regit->GetZaxis()->SetRangeUser(0.0,1.0);
pgPtYEff_regit->Draw("colz same");
lx.DrawLatex(0.,2,"Regit_reco");
if(bSavePlots)
{
TString outFileBase1(Form("%s/%s_%s",pOutFilePath,pcPtYPairEff->GetTitle(),pOutFileName));
TString outFileGif1 = outFileBase1+".gif";
pcPtYPairEff->Print(outFileGif1.Data(),"gifLandscape");
TString outFilePdf1 = outFileBase1+".pdf";
pcPtYPairEff->SaveAs(outFilePdf1.Data());
}
}
if(bSavePlots)
{
TString outFileBase(Form("%s/%s_%s",pOutFilePath,pcPairEff->GetTitle(),pOutFileName));
TString outFileGif = outFileBase+".gif";
pcPairEff->Print(outFileGif.Data(),"gifLandscape");
TString outFilePdf = outFileBase+".pdf";
pcPairEff->SaveAs(outFilePdf.Data());
}
}
// ##########--------------------- single plots!!!
if(bDoSinglePlots)
{
TChain *ptTrkPp = new TChain(Form("%s",pTupleTrkStd));
TChain *ptTrkStd = new TChain(Form("%s",pTupleTrkStd));
TChain *ptTrkRegit = new TChain(Form("%s",pTupleTrkRegit));
//nPtBins
for(int iptbin=1; iptbin<nPtBins; iptbin++)
{
const char* infileTrkPp = Form("%s%s.root",aInFileLocation[1],aPtSignalBins[iptbin]);
ptTrkPp->Add(infileTrkPp);
const char* infileTrkStd = Form("%s%s.root",aInFileLocation[2],aPtSignalBins[iptbin]);