本文整理汇总了C++中TPaveText::SetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::SetTextSize方法的具体用法?C++ TPaveText::SetTextSize怎么用?C++ TPaveText::SetTextSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::SetTextSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s_union
void s_union()
{
gROOT->GetListOfCanvases()->Delete();
TCanvas *c = new TCanvas("composite shape", "Union boolean operation", 700, 1000);
c->Divide(1,2,0,0);
c->cd(2);
gPad->SetPad(0,0,1,0.4);
c->cd(1);
gPad->SetPad(0,0.4,1,1);
if (gGeoManager) delete gGeoManager;
new TGeoManager("xtru", "poza12");
TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMedium *med = new TGeoMedium("MED",1,mat);
TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
gGeoManager->SetTopVolume(top);
// define shape components with names
TGeoPgon *pgon = new TGeoPgon("pg",0.,360.,6,2);
pgon->DefineSection(0,0,0,20);
pgon->DefineSection(1, 30,0,20);
TGeoSphere *sph = new TGeoSphere("sph", 40., 45., 5., 175., 0., 340.);
// define named geometrical transformations with names
TGeoTranslation *tr = new TGeoTranslation(0., 0., 45.);
tr->SetName("tr");
// register all used transformations
tr->RegisterYourself();
// create the composite shape based on a Boolean expression
TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph:tr + pg");
TGeoVolume *vol = new TGeoVolume("COMP1",cs);
top->AddNode(vol,1);
gGeoManager->CloseGeometry();
gGeoManager->SetNsegments(100);
top->Draw();
MakePicture();
c->cd(2);
TPaveText *pt = new TPaveText(0.01,0.01,0.99,0.99);
pt->SetLineColor(1);
TText *text = pt->AddText("TGeoCompositeShape - composite shape class");
text->SetTextColor(2);
pt->AddText("----- It's an example of boolean union operation : A + B");
pt->AddText("----- A == part of sphere (5-175, 0-340), B == pgon");
pt->AddText(" ");
pt->SetAllWith("-----","color",4);
pt->SetAllWith("-----","font",72);
pt->SetAllWith("-----","size",0.04);
pt->SetTextAlign(12);
pt->SetTextSize(.044);
pt->Draw();
c->cd(1);
}
示例2: CreateDrawAndSaveHistogramFWHM
void CreateDrawAndSaveHistogramFWHM(TH1* &histo, TString outputdir, TString outputname, bool saveoutput, bool close, bool log=false){
/** @brief saves Histogramm as *.root and *.png and if wanted closes the histograms at the end
* @details This mehtod create a histogramm and save it as root and png file. If you choose close, the canvas is closed after the histogram was saved
*/
setPandaStyle();
// gStyle->SetOptStat(1111);
TString name = TString(histo->GetName());
TString title = TString(histo->GetTitle());
TCanvas * canvas = new TCanvas("c_"+name, title, 0,0,1500,1000);
histo->Draw();
//***** FWHM ******
double max = histo->GetMaximum();
int bin1 = histo->FindFirstBinAbove(max/2);
int bin2 = histo->FindLastBinAbove(max/2);
double lowerbin = histo->GetBinCenter(bin1);
double upperbin = histo->GetBinCenter(bin2) ;
double FWHM = upperbin - lowerbin;
TPaveText * text = new TPaveText(0.2,1500,1,3500);
TString name = TString::Format("FWHM %.4f", FWHM);
text->InsertText(name);
text->SetFillColor(kWhite);
text->SetTextFont(4);
text->SetTextSize(30);
text->SetTextAlign(12);
text->Draw("SAME");
if(log) canvas->SetLogy();
PandaSmartLabel("L");
if (saveoutput){
canvas->Print(outputdir + "root-files/" + outputname + ".root");
canvas->Print(outputdir + "png-files/" + outputname + ".png");
canvas->Print(outputdir + "pdf-files/" + outputname + ".pdf");
}
if (close) canvas->Close();
}
示例3: Plot10Mu
void Plot10Mu(const char* text,float X, float Y, float size)
{
TPaveText* atext = new TPaveText(X,Y,X+size,Y+size);
atext->AddText(text);
atext->SetLineColor(0);
atext->SetFillColor(0);
atext->SetTextFont(42);
atext->SetTextSize(0.04);
atext->Draw();
}
示例4: 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;
}
示例5: 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;
}
}
示例6: 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;
};
示例7: s_difference
void s_difference()
{
gROOT->GetListOfCanvases()->Delete();
TCanvas *c = new TCanvas("composite shape", "Difference boolean operation", 700, 1000);
c->Divide(1,2,0,0);
c->cd(2);
gPad->SetPad(0,0,1,0.4);
c->cd(1);
gPad->SetPad(0,0.4,1,1);
if (gGeoManager) delete gGeoManager;
new TGeoManager("xtru", "poza12");
TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
TGeoMedium *med = new TGeoMedium("MED",1,mat);
TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
gGeoManager->SetTopVolume(top);
// define shape components with names
TGeoTorus *tor = new TGeoTorus("tor", 45., 15., 20., 45., 145.);
TGeoSphere *sph = new TGeoSphere("sph", 20., 45., 0., 180., 0., 270.);
// create the composite shape based on a Boolean expression
TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph - tor");
TGeoVolume *vol = new TGeoVolume("COMP3",cs);
top->AddNode(vol,1);
gGeoManager->CloseGeometry();
gGeoManager->SetNsegments(60);
top->Draw();
MakePicture();
c->cd(2);
TPaveText *pt = new TPaveText(.01, .01, .99, .99);
pt->SetLineColor(1);
TText *text = pt->AddText("TGeoCompositeShape - composite shape class");
text->SetTextColor(2);
pt->AddText("----- It's an example of boolean difference: A - B");
pt->AddText("----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
pt->AddText(" ");
pt->SetAllWith("-----","color",4);
pt->SetAllWith("-----","font",72);
pt->SetAllWith("-----","size",0.04);
pt->SetTextAlign(12);
pt->SetTextSize(0.044);
pt->Draw();
c->cd(1);
}
示例8: 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();
}
示例9: banner4Plot
void banner4Plot (){
TPaveText* pt ;
pt = new TPaveText(.14,0.91,.25,.94,"NDC");
pt->AddText("Preliminary");
pt->SetFillColor(0);
pt->SetTextSize(0.035);
pt->SetFillStyle(0);
pt->SetLineColor(0);
pt->SetLineWidth(0);
pt->SetMargin(0);
pt->SetShadowColor(0);
pt->Draw();
}
示例10: TPaveText
TPaveText *GetAveragepavetext(Int_t identifier){
//TPaveText* pvAverage = new TPaveText(0.012/gPad->GetWNDC()+gPad->GetLeftMargin(),0.26/gPad->GetHNDC()+gPad->GetBottomMargin(),0.3/gPad->GetWNDC()+gPad->GetLeftMargin(),0.25/gPad->GetHNDC()+gPad->GetBottomMargin(),"NDC");
TPaveText *pvAverage = new TPaveText(0.005/gPad->GetWNDC()+gPad->GetLeftMargin(),0.255/gPad->GetHNDC()+gPad->GetBottomMargin(),0.17/gPad->GetWNDC()+gPad->GetLeftMargin(),0.28/gPad->GetHNDC()+gPad->GetBottomMargin(),"NDC");
// TPaveText * pvAverage= new TPaveText(0.22,0.77,0.64,0.83,"NDC");
//0.21,0.83,0.5,0.863,"NDC");
SetPaveStyle(pvAverage);
pvAverage->SetTextFont(43);
// pvAverage->SetTextSize(0.07/(gPad->GetHNDC())*scaleHeightPads);
pvAverage->SetTextSize(30*innerPadHeight/referencePadHeight*resizeTextFactor);
pvAverage->AddText("Average D^{0},D^{+},D^{*+}");
pvAverage->SetName(Form("paveAverage_%d",identifier));
return pvAverage;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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");
}
示例14: DrawFreeCMSLabels
void DrawFreeCMSLabels(char* text, double textSize) {
//const char *text = "%2.1f #times 10^{6} clusters (fiducial) (%1.1f GeV)";
//char *text = "%2.1f #times 10^{6} clusters (fiducial)";
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(text);
label->SetFillStyle(0);
label->SetBorderSize(0);
if (textSize!=0) label->SetTextSize(textSize);
label->SetTextAlign(32);
label->Draw("same");
}
示例15: makeZPhiArrowPlot
int makeZPhiArrowPlot( TTree* data, const char* name, double zLim, double phiLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){
TCanvas* OBPCanvas = new TCanvas(name,name,1050,875);
OBPCanvas->DrawFrame(-zLim, -phiLim, 1.2*zLim, phiLim, ";module position z [cm];module position r*phi [cm]");
OBPCanvas->SetFillColor(0);
OBPCanvas->SetFrameBorderMode(0);
TFrame* aFrame = OBPCanvas->GetFrame();
aFrame->SetFillColor(0);
int passcut = 0;
for(int entry = 0;entry<data->GetEntries(); entry++)
{
data->GetEntry(entry);
if ((level_ == level)&&(((sublevel_ == sublevel)&&(sublevel != 0))||(sublevel == 0))){
if ((z_ <= zMax)&&(z_ > zMin)&&(r_ <= rMax)&&(r_ > rMin)){
TArrow* aArraw = new TArrow( z_, r_*phi_ , z_ + barrelRPhiRescale*dz_, r_*phi_+barrelRPhiRescale*r_*dphi_,0.0075,">");
aArraw->Draw();
passcut++;
}
}
}
DrawRPhiLegend( zLim, phiLim, barrelRPhiRescale );
char sliceLeg[192];
sprintf( sliceLeg, "%s: %f < r <= %f", name, rMin, rMax );
//Plot10Mu( name, xLim/2, yLim, 0.2*xLim );
TPaveText* atext = new TPaveText(0.2*zLim,0.85*phiLim,0.66*zLim,0.99*phiLim);
atext->AddText(sliceLeg);
atext->SetLineColor(0);
atext->SetFillColor(0);
atext->SetTextFont(42);
atext->SetTextSize(0.04);
atext->Draw();
char outfile[192];
sprintf( outfile, "%s/%s.png", outputDir_, name );
OBPCanvas->Print( outfile );
return passcut;
}