本文整理汇总了C++中TPaveText::GetListOfLines方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::GetListOfLines方法的具体用法?C++ TPaveText::GetListOfLines怎么用?C++ TPaveText::GetListOfLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::GetListOfLines方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memstat
//.........这里部分代码省略.........
rest = nbytes-nb*dv-dbin;
if (rest > 0) h->AddBinContent(bin+nb+1,100*rest/dv);
//we save nbytes at pos. This info will be used when we free this slot
if (nbold[ipos] > 0) printf("reallocating %d bytes (was %lld) at %lld, entry=%d\n",nbytes,nbold[ipos],ipos,i);
if (nbold[ipos] == 0) {
nleaks++;
//save the Tree entry number where we made this allocation
ientry[ipos] = i;
}
nbold[ipos] = nbytes;
} else {
hfree->Fill(pos);
nbytes = nbold[ipos];
if (bin+nb >nbins) nb = nbins-bin;
nbold[ipos] = 0; nleaks--;
if (nbytes <= 0) continue;
//fill bytes free in the first page
if (dbin > nbytes) dbin = nbytes;
h->AddBinContent(bin,-100*dbin/dv);
//fill bytes free in full following pages
nb = Int_t((nbytes-dbin)/dv);
if (bin+nb >nbins) nb = nbins-bin;
for (j=1;j<=nb;j++) h->AddBinContent(bin+j,-100);
//fill the bytes free in in last page
rest = nbytes-nb*dv-dbin;
if (rest > 0) h->AddBinContent(bin+nb+1,-100*rest/dv);
}
if (time -updateLast > update) {
//update canvas at regular intervals
updateLast = time;
h->SetEntries(i);
c1->Modified();
pvt->GetListOfLines()->Delete();
Double_t mbytes = 0;
Int_t nonEmpty = 0;
Double_t w;
for (Int_t k=1;k<nbins;k++) {
w = h->GetBinContent(k);
if (w > 0) {
nonEmpty++;
mbytes += 0.01*w*dv;
}
}
Double_t occupancy = mbytes/(nonEmpty*0.01*dv);
pvt->AddText(Form("memory used = %g Mbytes",mbytes*1e-6));
pvt->AddText(Form("page occupancy = %f per cent",occupancy));
pvt->AddText("(for non empty pages only)");
ptime->SetLabel(Form("%g sec",time));
c1->Update();
gSystem->ProcessEvents();
}
}
h->SetEntries(nsel);
Int_t nlmax = nleaks;
nleaks += 1000;
Int_t *lindex = new Int_t[nleaks];
Int_t *entry = new Int_t[nleaks];
Int_t *ileaks = new Int_t[nleaks];
nleaks =0;
for (Int_t ii=0;ii<nvm;ii++) {
if (nbold[ii] > 0) {
ileaks[nleaks] = (Int_t)nbold[ii];
entry[nleaks] = ientry[ii];
示例2: ptBestFit
//.........这里部分代码省略.........
double YMIN = -1.1*frame2->GetMaximum();
hUnc2H->GetYaxis()->SetRangeUser(YMIN,YMAX);
hUnc2H->GetYaxis()->SetNdivisions(507);
// hUnc2H->GetXaxis()->SetTitleOffset(0.9);
// hUnc2H->GetYaxis()->SetTitleOffset(1.0);
hUnc2H->GetYaxis()->SetTickLength(0.0);
// hUnc2H->GetYaxis()->SetTitleSize(0.05);
// hUnc2H->GetYaxis()->SetLabelSize(0.04);
hUnc2H->GetYaxis()->CenterTitle(kTRUE);
hUnc2H->SetFillColor(kGreen);
hUnc2L->SetFillColor(kGreen);
hUncH->SetFillColor(kYellow);
hUncL->SetFillColor(kYellow);
hUncC->SetLineColor(kBlack);
hUncC->SetLineStyle(7);
hUnc2H->Draw("HIST");
hUnc2L->Draw("same HIST");
hUncH->Draw("same HIST");
hUncL->Draw("same HIST");
hUncC->Draw("same HIST");
frame2->GetYaxis()->SetTickLength(0.03/0.4);
frame2->Draw("same");
TList *list1 = (TList*)gPad->GetListOfPrimitives();
//list1->Print();
RooCurve *gSigFit = (RooCurve*)list1->FindObject("shapeSig_qqH_"+ds_name+"_Norm[mbbReg_"+ds_name+"]");
TLegend *leg = new TLegend(0.70,0.61,0.94,1.-gStyle->GetPadTopMargin()-0.01);
leg->SetTextFont(42);
leg->SetFillStyle(-1);
//leg->SetHeader(ds_name+" (m_{H}="+MASS+")");
leg->SetHeader(TString::Format("Category %d",atoi(ds_name(3,1).Data())+1));
leg->AddEntry(hBlind,"Data","P");
if (!BLIND) {
leg->AddEntry(gSigFit,"Fitted signal","L");
}
TLine *gEmpty = new TLine(0.0,0.0,0.0,0.0);
gEmpty->SetLineWidth(0);
TLegendEntry *l1 = leg->AddEntry(gEmpty,"(m_{H} = "+MASS+" GeV)","");
l1->SetTextSize(0.038*0.97*0.85);
leg->AddEntry(gFit,"Bkg. + signal","L");
leg->AddEntry(gBkgFit,"Bkg.","L");
leg->AddEntry(gQCDFit,"QCD","L");
leg->AddEntry(hUnc2H,"2#sigma bkg. unc.","F");
leg->AddEntry(hUncH,"1#sigma bkg. unc.","F");
leg->SetFillColor(0);
leg->SetBorderSize(0);
leg->SetTextFont(42);
leg->SetTextSize(0.038*0.98);
leg->Draw();
leg->SetY1(leg->GetY2()-leg->GetNRows()*0.045*0.96);
TPaveText *paveCMS = new TPaveText(gStyle->GetPadLeftMargin()+0.02,0.7,gStyle->GetPadLeftMargin()+0.15,1.-gStyle->GetPadTopMargin()-0.01,"NDC");
paveCMS->SetTextFont(62);
paveCMS->SetTextSize(gStyle->GetPadTopMargin()*3./4.);
paveCMS->SetBorderSize(0);
paveCMS->SetFillStyle(-1);
paveCMS->SetTextAlign(12);
paveCMS->AddText("CMS");
paveCMS->Draw();
gPad->Update();
paveCMS->SetY1NDC(paveCMS->GetY2NDC()-paveCMS->GetListOfLines()->GetSize()*gStyle->GetPadTopMargin());
TPaveText *paveLumi = new TPaveText(0.5,1.-gStyle->GetPadTopMargin(),0.98,1.00,"NDC");
paveLumi->SetTextFont(42);
paveLumi->SetTextSize(gStyle->GetPadTopMargin()*3./4.);
paveLumi->SetBorderSize(0);
paveLumi->SetFillStyle(-1);
paveLumi->SetTextAlign(32);
paveLumi->AddText(TString::Format("%.1f fb^{-1} (8TeV)",(atoi(ds_name(3,1).Data())<4 ? 19.8 : 18.3)).Data());//+ 18.2 ;
paveLumi->Draw();
TString path=".";
//TString path="BiasV10_limit_BRN5p4_dX0p1_B80-200_CAT0-6/output/";
system(TString::Format("[ ! -d %s/plot ] && mkdir %s/plot",path.Data(),path.Data()).Data());
system(TString::Format("[ ! -d %s/plot/fits ] && mkdir %s/plot/fits",path.Data(),path.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.pdf",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.png",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s.eps",path.Data(),MASS.Data(),ds_name.Data()).Data());
TText *l = (TText*)paveCMS->AddText("Preliminary");
l->SetTextFont(52);
paveCMS->Draw();
gPad->Update();
paveCMS->SetY1NDC(paveCMS->GetY2NDC()-paveCMS->GetListOfLines()->GetSize()*gStyle->GetPadTopMargin());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.pdf",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.png",path.Data(),MASS.Data(),ds_name.Data()).Data());
canFit->SaveAs(TString::Format("%s/plot/fits/Fit_mH%s_%s_prelim.eps",path.Data(),MASS.Data(),ds_name.Data()).Data());
delete ds;
}
cout << "chi2sumS: " << chi2sumS << endl;
cout << "chi2sumB: " << chi2sumB << endl;
cout << "nparS: " << nparS << endl;
cout << "nparB: " << nparB << endl;
cout << "nbinsum: " << nparsum << endl;
cout << "chi2sumS/(nbinsum - nparS): " << chi2sumS / (float)(nparsum - nparS) << endl;
cout << "chi2sumB/(nbinsum - nparB): " << chi2sumB / (float)(nparsum - nparB) << endl;
delete datasets;
}