本文整理汇总了C++中TPaveText::SetBorderSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::SetBorderSize方法的具体用法?C++ TPaveText::SetBorderSize怎么用?C++ TPaveText::SetBorderSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::SetBorderSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPrelimLabel
// Draw label for Decay Channel in upper left corner of plot
void DrawPrelimLabel(int cmsprelim, double textSize) {
TPaveText *cms = new TPaveText();
cms->AddText("CMS");
cms->SetX1NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() );
cms->SetY1NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() - 0.05 );
cms->SetX2NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
cms->SetY2NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() );
cms->SetFillStyle(0);
cms->SetBorderSize(0);
if (textSize!=0) cms->SetTextSize(textSize*1.1);
cms->SetTextAlign(12);
cms->SetTextFont(61);
cms->Draw("same");
if(cmsprelim > 0) {
TPaveText *extra = new TPaveText();
if(cmsprelim == 2) { extra->AddText("Private Work"); }
else { extra->AddText("Preliminary"); }
extra->SetX1NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() );
extra->SetY1NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() - 0.10 );
extra->SetX2NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
extra->SetY2NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() - 0.05 );
extra->SetFillStyle(0);
extra->SetBorderSize(0);
if (textSize!=0) extra->SetTextSize(textSize);
extra->SetTextAlign(12);
extra->SetTextFont(52);
extra->Draw("same");
}
}
示例2: prnt
void prnt(){
string run[13] = {"183544","183581","183780","183963","184066","184074","184130","183580","183602","184022","184072","184088","184169","periodH"};
for(i=0;i<14;i++)
{
string MCfilename ="root/"+run[i]+".root";
cout << MCfilename << endl;
string plot = "lb_roi/"+run[i]+".eps" ;
cout << plot <<endl;
string event = "lb_event/"+run[i]+".eps" ;
cout << event <<endl;
string tex = "2011 periodH "+run[i];
cout <<tex <<endl;
TFile* f = new TFile(MCfilename.c_str());
f->TFile::Open();
TH1F *h1 = (TH1F*)f->Get("J10_lbn_vs_n_rois");
h1->Sumw2();
TH1F *h2 = (TH1F*)f->Get("J10_lbn_vs_n_events");
h2->Sumw2();
h1->Draw();
h1->SetMarkerStyle(1);
TPaveText *pt = new TPaveText(.4,0.3290678,0.8406322,0.3695,"blNDC");
pt->SetBorderSize(0);
pt->SetFillColor(0);
text = pt->AddText(tex.c_str());
pt->Draw();
c1->SaveAs(plot.c_str());
h2->Draw();
h2->SetMarkerStyle(1);
TPaveText *pt = new TPaveText(.4,0.3290678,0.8406322,0.3695,"blNDC");
pt->SetBorderSize(0);
pt->SetFillColor(0);
text = pt->AddText(tex.c_str());
pt->Draw();
c1->SaveAs(event.c_str());
}
}
示例3: formatForCmsPublic
void formatForCmsPublic(TPad * c, TLegend *leg, TString title, int nsamp, float legx, float legy, float legw, float legh, TString legopt)
{
if(title.Length()!=0)
{
TPaveText *pave = new TPaveText(0.5,0.96,0.94,0.99,"NDC");
pave->SetBorderSize(0);
pave->SetFillStyle(0);
pave->SetTextAlign(32);
pave->SetTextFont(42);
TObjArray * tokens = title.Tokenize("\\\\");
int nt = tokens->GetEntries();
for(int it=0; it<nt; ++it)
{
TObjString * t = (TObjString *)tokens->At(it);
pave->AddText(t->GetString());
}
pave->Draw("same");
}
float legx1=legx, legx2=legx+legw;
float legy1 = legy, legy2 = legy-legh*(float)(nsamp);
if(leg==0) leg = ((TPad *)c)->BuildLegend(legx1,legy1,legx2,legy2);
leg->SetBorderSize(0);
leg->SetFillColor(0);
leg->SetFillStyle(0);
leg->SetLineWidth(1);
leg->SetTextFont(42);
leg->SetEntryOption(legopt);
leg->SetX1NDC(legx1);
leg->SetY1NDC(legy1);//-nsamp*legh);
leg->SetX2NDC(legx2);
leg->SetY2NDC(legy2);
}
示例4: DrawStatBox
void DrawStatBox(TObject** Histos, std::vector<char*> legend, bool Mean, double X, double Y, double W, double H)
{
int N = legend.size();
char buffer[255];
if(Mean)H*=3;
for(int i=0;i<N;i++){
TPaveText* stat = new TPaveText(X,Y-(i*H), X+W, Y-(i+1)*H, "NDC");
TH1* Histo = (TH1*)Histos[i];
sprintf(buffer,"Entries : %i\n",(int)Histo->GetEntries());
stat->AddText(buffer);
if(Mean){
sprintf(buffer,"Mean : %6.2f\n",Histo->GetMean());
stat->AddText(buffer);
sprintf(buffer,"RMS : %6.2f\n",Histo->GetRMS());
stat->AddText(buffer);
}
stat->SetFillColor(0);
stat->SetLineColor(Color[i]);
stat->SetTextColor(Color[i]);
stat->SetBorderSize(0);
stat->SetMargin(0.05);
stat->SetTextAlign(12);
stat->Draw();
}
}
示例5: makeScaleFactorHist
void makeScaleFactorHist(TCanvas* canvas, const std::string& name, const std::string& tag)
{
TMultiGraph* multigraph = NULL;
std::stringstream graphName;
graphName << name << "ScaleFactorMultigraph";
multigraph = (TMultiGraph*)canvas->GetPrimitive(graphName.str().c_str());
if (multigraph == NULL) {
std::cerr << "Error: no object of TCanvas " << canvas->GetName() << " with name ";
std::cerr << graphName.str() << std::endl;
return;
}
multigraph->GetYaxis()->SetRangeUser(0.3, 1.7);
multigraph->GetYaxis()->SetLabelSize(0.03);
canvas->Draw();
canvas->SetCanvasSize(600,600);
canvas->SetWindowSize(610,630);
TPaveText* label = new TPaveText(0.25, 0.8, 0.55, 0.9, "NDC");
label->SetTextFont(62);
label->SetTextSize(0.03);
label->SetBorderSize(0);
label->SetFillColor(0);
label->AddText("CMS 2011");
label->AddText("");
label->AddText("#int L dt = 204 pb^{-1}");
label->SetTextAlign(11);
label->Draw();
std::stringstream file;
file << "/data2/yohay/scaleFactor_" << tag << "_" << name << ".pdf";
canvas->SaveAs(file.str().c_str());
}
示例6: DrawCMSLabels
// Draw statistics info above plot
void DrawCMSLabels(double lumi, double energy, double textSize) {
//const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
const char *text;
if(lumi > 10000000) {
lumi /= 10000000;
text = "%2.1f #times 10^{7} tracks (%1.1f GeV)";
}
else {
lumi /= 1000000;
text = "%2.1f #times 10^{6} tracks (%1.1f GeV)";
}
TPaveText *label = new TPaveText();
label->SetX1NDC(gStyle->GetPadLeftMargin());
label->SetY1NDC(1.0-gStyle->GetPadTopMargin());
label->SetX2NDC(1.0-gStyle->GetPadRightMargin());
label->SetY2NDC(1.0);
label->SetTextFont(42);
label->AddText(Form(text, lumi, energy));
label->SetFillStyle(0);
label->SetBorderSize(0);
if (textSize!=0) label->SetTextSize(textSize);
label->SetTextAlign(32);
label->Draw("same");
}
示例7: DrawCell
void DrawCell( TMVA::PDEFoamCell *cell, TMVA::PDEFoam *foam,
Double_t x, Double_t y,
Double_t xscale, Double_t yscale )
{
// recursively draw cell and it's daughters
Float_t xsize = xscale*1.5;
Float_t ysize = yscale/3;
if (xsize > 0.15) xsize=0.1; //xscale/2;
if (cell->GetDau0() != NULL) {
TLine *a1 = new TLine(x-xscale/4, y-ysize, x-xscale, y-ysize*2);
a1->SetLineWidth(2);
a1->Draw();
DrawCell(cell->GetDau0(), foam, x-xscale, y-yscale, xscale/2, yscale);
}
if (cell->GetDau1() != NULL){
TLine *a1 = new TLine(x+xscale/4, y-ysize, x+xscale, y-ysize*2);
a1->SetLineWidth(2);
a1->Draw();
DrawCell(cell->GetDau1(), foam, x+xscale, y-yscale, xscale/2, yscale);
}
TPaveText *t = new TPaveText(x-xsize, y-ysize, x+xsize, y+ysize, "NDC");
t->SetBorderSize(1);
t->SetFillStyle(1);
// draw all cell elements
t->AddText( Form("Intg=%.5f", cell->GetIntg()) );
t->AddText( Form("Var=%.5f", cell->GetDriv()) );
TVectorD *vec = (TVectorD*) cell->GetElement();
if (vec != NULL){
for (Int_t i = 0; i < vec->GetNrows(); ++i) {
t->AddText( Form("E[%i]=%.5f", i, vec(i)) );
}
}
if (cell->GetStat() != 1) {
// cell is inactive --> draw split point
t->SetFillColor( TColor::GetColor("#BBBBBB") );
t->SetTextColor( TColor::GetColor("#000000") );
// cell position and size
TMVA::PDEFoamVect cellPosi(foam->GetTotDim()), cellSize(foam->GetTotDim());
cell->GetHcub(cellPosi, cellSize);
Int_t kBest = cell->GetBest(); // best division variable
Double_t xBest = cell->GetXdiv(); // best division point
t->AddText( Form("dim=%i", kBest) );
t->AddText( Form("cut=%.5g", foam->VarTransformInvers(kBest,cellPosi[kBest] + xBest*cellSize[kBest])) );
} else {
t->SetFillColor( TColor::GetColor("#DD0033") );
t->SetTextColor( TColor::GetColor("#FFFFFF") );
}
t->Draw();
return;
}
示例8: TPaveText
TPaveText *text(const char *txt, float x1, float y1, float x2, float y2) {
TPaveText *text = new TPaveText(x1,y1,x2,y2,"brNDC");
text->AddText(txt);
text->SetBorderSize(0);
text->SetFillStyle(0);
text->SetTextAlign(12);
text->SetTextFont(42);
text->SetTextSize(0.05);
return text;
}
示例9: PostDrawMultiGraph
void OverlayAnalysis::PostDrawMultiGraph(GraphName graphName, TMultiGraph *pMultiGraph) const
{
if(NULL == pMultiGraph)
return;
// base customize
pMultiGraph->GetXaxis()->SetTitle("Distance between showers [cm]");
pMultiGraph->GetXaxis()->SetLabelFont(42);
pMultiGraph->GetXaxis()->SetTitleSize(0.05);
pMultiGraph->GetXaxis()->SetTitleOffset(1.);
pMultiGraph->GetXaxis()->SetTitleFont(42);
pMultiGraph->GetXaxis()->SetRangeUser(std::max(static_cast<int>(m_startDistance) - 5, 0), m_endDistance + 5);
pMultiGraph->GetYaxis()->SetTitle("");
pMultiGraph->GetYaxis()->SetLabelFont(42);
pMultiGraph->GetYaxis()->SetTitleSize(0.045);
pMultiGraph->GetYaxis()->SetTitleOffset(1.3);
pMultiGraph->GetYaxis()->SetTitleFont(42);
pMultiGraph->GetYaxis()->SetLabelSize(0.035);
TPaveText *pt = new TPaveText(0.3, 0.2, 0.93, 0.3, "tbNDC");
pt->SetTextSize(0.05);
pt->SetTextColor(kGray+2);
pt->SetFillColor(0);
pt->SetLineWidth(0);
pt->SetBorderSize(0);
pt->AddText("CALICE SDHCAL");
pt->SetTextFont(62);
pt->Draw();
// plot per plot customize
switch(graphName)
{
case N_PFOS:
pMultiGraph->GetYaxis()->SetTitle("<N_{pfos}>");
pMultiGraph->GetYaxis()->SetRangeUser(1, 3);
break;
case NEUTRAL_PURITY:
pMultiGraph->GetYaxis()->SetTitle("#rho_{neutral}");
pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
break;
case NEUTRAL_EFFICIENCY:
pMultiGraph->GetYaxis()->SetTitle("#varepsilon_{neutral}");
pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
break;
case NEUTRAL_RECOVER_PROBA:
pMultiGraph->GetYaxis()->SetTitle("P_{n>0}");
pMultiGraph->GetYaxis()->SetRangeUser(0, 1);
break;
case NEUTRAL_ENERGY_DIFFERENCE_EFFICIENT:
pMultiGraph->GetYaxis()->SetTitle("<E_{n,rec} - E_{n,meas}>, n>0");
pMultiGraph->GetYaxis()->SetRangeUser(-5, 5);
break;
}
}
示例10: plot
TCanvas * plot (TH1F* histoDataIn, TString legendData, TH1F* histoSimulationIn, TString legendSimulation,
TString & canvasName, Float_t maximum = 0.15, TString xAxisTitle = "#eta",
TString yAxisTitle = "Number of Clusters", TString error = "", bool useLegend = true,
TString text = "", Float_t textX = 0.7, Float_t textY = 0.4, Float_t rebin = 0 ) {
TH1F * histoData = (TH1F*)histoDataIn->Clone();
TH1F * histoSimulation = (TH1F*)histoSimulationIn->Clone();
// histoData->Sumw2();
histoData->Scale(1/(histoData->Integral()));
histoSimulation->Scale(1/(histoSimulation->Integral()));
// Create also the legend and add the histograms
TLegend * legend = new TLegend( 0.55, 0.65, 0.76, 0.82 );
legend->AddEntry( histoData, xAxisTitle );
legend->AddEntry( histoSimulation, yAxisTitle, "F" );
cout << "histoData = " << histoData << endl;
cout << "histoSimulation = " << histoSimulation << endl;
TCanvas * c = new TCanvas( canvasName, canvasName, 1000, 800 );
c->Draw();
histoSimulation->SetMaximum(maximum);
histoSimulation->SetFillColor(kRed);
// histoSimulation->SetLineWidth(0);
histoSimulation->SetLineColor(kRed);
histoSimulation->SetXTitle(xAxisTitle);
histoSimulation->SetYTitle(yAxisTitle);
histoSimulation->SetTitleOffset(1.6,"Y");
histoSimulation->SetTitle();
histoData->SetLineStyle(1);
histoData->SetLineWidth(2.5);
histoSimulation->Draw();
histoData->Draw("same");
legend->SetFillColor(kWhite);
if (useLegend) legend->Draw("same");
if ( text != "" ) {
TPaveText * pt = new TPaveText(textX, textY, textX+0.2, textY+0.17, "NDC" ); // "NDC" option sets coords relative to pad dimensions
pt->SetFillColor(0); // text is black on white
pt->SetTextSize(0.08);
pt->SetBorderSize(0);
pt->SetTextAlign(12);
pt->AddText(text);
pt->Draw("same"); //to draw your text object
}
return c;
};
示例11: TPaveText
void
CMSPrelim(const char* dataset, const char* channel,const char* cat)
{
double lowX=0.16;
double lowY=0.835;
int color=1; int font = 62;
TPaveText* cmsprel = new TPaveText(lowX, lowY+0.06, lowX+0.30, lowY+0.16, "NDC");
cmsprel->SetBorderSize( 0 );
cmsprel->SetFillStyle( 0 );
cmsprel->SetTextAlign( 12 );
cmsprel->SetTextColor( color );
cmsprel->SetTextFont ( font );
//cmsprel->SetTextSize ( 0.035 );
//cmsprel->SetTextSize ( 0.027 );
cmsprel->SetTextSize ( 0.030 );
cmsprel->AddText(dataset);
cmsprel->Draw();
TPaveText* chan = new TPaveText(lowX+0.05, lowY-0.002, lowX+0.45, lowY+0.028, "NDC");
chan->SetBorderSize( 0 );
chan->SetFillStyle( 0 );
chan->SetTextAlign( 12 );
chan->SetTextSize ( 0.035 );
chan->SetTextColor( color );
chan->SetTextFont ( font );
chan->AddText(channel);
chan->Draw();
TPaveText* category = new TPaveText(lowX+0.05, lowY-0.002-0.06, lowX+0.45, lowY+0.028-0.06, "NDC");
category->SetBorderSize( 0 );
category->SetFillStyle( 0 );
category->SetTextAlign( 12 );
category->SetTextSize ( 0.035 );
category->SetTextColor( color );
category->SetTextFont ( font );
category->AddText(cat);
category->Draw();
}
示例12: addLHCbLabel
TPaveText* addLHCbLabel(TString footer){
TPaveText * label = new TPaveText(0.70,0.12,0.9,0.32,"BRNDC");
//TPaveText * label = new TPaveText(0.12, 0.58, 0.12, 0.43,"BRNDC");
//label->SetFillColor(0);
label->SetFillStyle(0);
label->SetBorderSize(0);
label->SetTextAlign(11);
label->SetTextSize(Float_t(0.04));
TText * labeltext = 0;
labeltext = label->AddText("LHC#font[12]{b} 2011 Data");
labeltext = label->AddText("#sqrt{s} = 7TeV");
labeltext = label->AddText(footer);
return label;
}
示例13: BadDraw
void OnlineGUI::BadDraw(TString errMessage) {
// Routine to display (in Pad) why a particular draw method has
// failed.
TPaveText *pt = new TPaveText(0.1,0.1,0.9,0.9,"brNDC");
pt->SetBorderSize(3);
pt->SetFillColor(10);
pt->SetTextAlign(22);
pt->SetTextFont(72);
pt->SetTextColor(2);
pt->AddText(errMessage.Data());
pt->Draw();
// cout << errMessage << endl;
}
示例14: addLHCbLabel
// Originally Written by Conor Fitzpatrick
TPaveText* addLHCbLabel(TString footer, bool DATA){
//
TPaveText * label = new TPaveText(0.18, 0.73, 0.18, 0.88,"BRNDC");
label->SetFillStyle(0); //Transparent i.e. Opacity of 0 :D
label->SetBorderSize(0);
label->SetTextAlign(11);
label->SetTextSize(Float_t(0.04));
TText * labeltext = 0;
TString labeltstring( "LHC#font[12]{b} 2011" );
if( DATA ) labeltstring.Append( " Data" );
if( !DATA ) labeltstring.Append( " Simulation" );
labeltext = label->AddText( labeltstring );
labeltext = label->AddText("#sqrt{s} = 7TeV");
labeltext = label->AddText(footer);
(void) labeltext;
return label;
}
示例15: DrawDecayChLabel
// Draw label for Decay Channel in upper left corner of plot
void DrawDecayChLabel(TString decaychannel, double textSize) {
TPaveText *decch = new TPaveText();
decch->AddText(decaychannel);
decch->SetX1NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() );
decch->SetY1NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() - 0.05 );
decch->SetX2NDC( gStyle->GetPadLeftMargin() + gStyle->GetTickLength() + 0.15 );
decch->SetY2NDC(1.0 - gStyle->GetPadTopMargin() - gStyle->GetTickLength() );
decch->SetFillStyle(0);
decch->SetBorderSize(0);
if (textSize!=0) decch->SetTextSize(textSize);
decch->SetTextAlign(12);
decch->Draw("same");
}