本文整理汇总了C++中TPaveText::GetX1NDC方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::GetX1NDC方法的具体用法?C++ TPaveText::GetX1NDC怎么用?C++ TPaveText::GetX1NDC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::GetX1NDC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw_Time_Hists
void Draw_Time_Hists(TTree* t) {
// Draw processing time, CPU time, and latency per packet
// distributions from the input tree
if (!t) {
cout << "Invalid input tree" << endl;
return;
}
gROOT->SetStyle("Plain");
gStyle->SetOptStat(0);
gStyle->SetNdivisions(505);
gStyle->SetTitleFontSize(0.1);
if(!TString(gSystem->GetLibraries()).Contains("Proof"))
gSystem->Load("libProof.so");
TCanvas* canvas = new TCanvas("ProfHists","Profile Histograms",800,600);
canvas->Divide(3,1);
canvas->cd(1);
gPad->SetLogy();
t->Draw("fProcTime");
TH1* h = dynamic_cast<TH1*>(gROOT->FindObject("htemp"));
h->SetTitle("Processing Time per Packet");
h->GetXaxis()->SetTitle("Processing Time [s]");
gPad->Update();
TPaveText* titlepave = 0;
titlepave = dynamic_cast<TPaveText*>(gPad->GetListOfPrimitives()->FindObject("title"));
if (titlepave) {
Double_t x1ndc = titlepave->GetX1NDC();
Double_t x2ndc = titlepave->GetX2NDC();
titlepave->SetX1NDC((1.0-x2ndc+x1ndc)/2.);
titlepave->SetX2NDC((1.0+x2ndc-x1ndc)/2.);
titlepave->SetBorderSize(0);
gPad->Update();
}
gPad->Modified();
canvas->cd(2);
gPad->SetLogy();
t->Draw("fCpuTime");
h = dynamic_cast<TH1*>(gROOT->FindObject("htemp"));
h->SetTitle("CPU Time per Packet");
h->GetXaxis()->SetTitle("CPU Time [s]");
gPad->Update();
titlepave = dynamic_cast<TPaveText*>(gPad->GetListOfPrimitives()->FindObject("title"));
if (titlepave) {
Double_t x1ndc = titlepave->GetX1NDC();
Double_t x2ndc = titlepave->GetX2NDC();
titlepave->SetX1NDC((1.0-x2ndc+x1ndc)/2.);
titlepave->SetX2NDC((1.0+x2ndc-x1ndc)/2.);
titlepave->SetBorderSize(0);
gPad->Update();
}
gPad->Modified();
canvas->cd(3);
gPad->SetLogy();
t->Draw("fLatency");
h = dynamic_cast<TH1*>(gROOT->FindObject("htemp"));
h->SetTitle("Request Packet Latency");
h->GetXaxis()->SetTitle("Latency [s]");
gPad->Update();
titlepave = dynamic_cast<TPaveText*>(gPad->GetListOfPrimitives()->FindObject("title"));
if (titlepave) {
Double_t x1ndc = titlepave->GetX1NDC();
Double_t x2ndc = titlepave->GetX2NDC();
titlepave->SetX1NDC((1.0-x2ndc+x1ndc)/2.);
titlepave->SetX2NDC((1.0+x2ndc-x1ndc)/2.);
titlepave->SetBorderSize(0);
gPad->Update();
}
gPad->Modified();
}