本文整理汇总了C++中TPaveLabel::SetFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveLabel::SetFillColor方法的具体用法?C++ TPaveLabel::SetFillColor怎么用?C++ TPaveLabel::SetFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveLabel
的用法示例。
在下文中一共展示了TPaveLabel::SetFillColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: help
void help()
{
new TCanvas("chelp","Help on gldemos",200,10,700,600);
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98, "These demos show different gl painters.");
title->SetFillColor(32);
title->Draw();
TPaveText *hdemo = new TPaveText(0.04, 0.04, 0.96, 0.8);
hdemo->SetTextAlign(12);
hdemo->SetTextFont(52);
hdemo->SetTextColor(kBlue);
hdemo->AddText("1. Glsurfaces demo shows glsurf4, glsurf1, glsurf3, glsurf1cyl, glsurfpol, gltf3 options.");
hdemo->AddText("2. Glrose demontrates \"glsurf2pol\" drawing option and user-defined palette.");
hdemo->AddText("3. Gltf3 demo shows \"gltf3\" option.");
hdemo->AddText("4. Glbox demo shows \"glbox\" and \"glbox1\" options for TH3.");
hdemo->AddText("5. Glparametric demo shows how to define and display parametric surfaces.");
hdemo->AddText("You can zoom any plot: press 'J', 'K', 'j', 'k' keys, or use mouse wheel.");
hdemo->AddText("Rotate any plot:");
hdemo->AddText(" ---select plot with mouse cursor,");
hdemo->AddText(" ---move mouse cursor, pressing and holding left mouse button ");
hdemo->AddText("Pan plot:");
hdemo->AddText(" ---select with mouse cursor a part of a plot, other than back box planes ,");
hdemo->AddText(" ---move mouse cursor, pressing and holding middle mouse button ");
hdemo->AddText("Selected part of a plot is higlighted (TF3 higlighting is not implemented yet.)");
hdemo->AddText("You can select one of back box planes, press middle mouse button and move cursor-");
hdemo->AddText("this will create \"slice\" (TF does not support yet).");
hdemo->AddText("After the slice was created, you can project it on a back box");
hdemo->AddText(" ---press key 'p' (now implemented only for surf options ).");
hdemo->AddText("Left double click removes all slices/projections.");
hdemo->Draw();
}
示例2: TCanvas
TCanvas *ellipse(){
TCanvas *c1 = new TCanvas("c1");
c1->Range(0,0,1,1);
TPaveLabel *pel = new TPaveLabel(0.1,0.8,0.9,0.95,"Examples of Ellipses");
pel->SetFillColor(42);
pel->Draw();
TEllipse *el1 = new TEllipse(0.25,0.25,.1,.2);
el1->Draw();
TEllipse *el2 = new TEllipse(0.25,0.6,.2,.1);
el2->SetFillColor(6);
el2->SetFillStyle(3008);
el2->Draw();
TEllipse *el3 = new TEllipse(0.75,0.6,.2,.1,45,315);
el3->SetFillColor(2);
el3->SetFillStyle(1001);
el3->SetLineColor(4);
el3->Draw();
TEllipse *el4 = new TEllipse(0.75,0.25,.2,.15,45,315,62);
el4->SetFillColor(5);
el4->SetFillStyle(1001);
el4->SetLineColor(4);
el4->SetLineWidth(6);
el4->Draw();
return c1;
}
示例3: draw_input_labels
void draw_input_labels(Int_t nInputs, Double_t* cy,
Double_t rad, Double_t layerWidth)
{
const Double_t LABEL_HEIGHT = 0.03;
const Double_t LABEL_WIDTH = 0.20;
Double_t width = LABEL_WIDTH + (layerWidth-4*rad);
Double_t margX = 0.01;
Double_t effHeight = 0.8*LABEL_HEIGHT;
TString *varNames = get_var_names(nInputs);
if (varNames == 0) exit(1);
TString input;
for (Int_t i = 0; i < nInputs; i++) {
if (i != nInputs-1) input = varNames[i];
else input = "Bias node";
Double_t x1 = margX;
Double_t x2 = margX + width;
Double_t y1 = cy[i] - effHeight;
Double_t y2 = cy[i] + effHeight;
TPaveLabel *p = new TPaveLabel(x1, y1, x2, y2, input+"", "br");
p->SetFillColor(gStyle->GetTitleFillColor());
p->SetFillStyle(1001);
p->Draw();
if (i == nInputs-1) p->SetTextColor( TMVAGlob::c_NovelBlue );
}
delete[] varNames;
}
示例4: TCanvas
//Draw arrows
//Author: Rene Brun
TCanvas *arrow(){
TCanvas *c1 = new TCanvas("c1");
c1->Range(0,0,1,1);
TPaveLabel *par = new TPaveLabel(0.1,0.8,0.9,0.95,"Examples of various arrow formats");
par->SetFillColor(42);
par->Draw();
TArrow *ar1 = new TArrow(0.1,0.1,0.1,0.7);
ar1->Draw();
TArrow *ar2 = new TArrow(0.2,0.1,0.2,0.7,0.05,"|>");
ar2->SetAngle(40);
ar2->SetLineWidth(2);
ar2->Draw();
TArrow *ar3 = new TArrow(0.3,0.1,0.3,0.7,0.05,"<|>");
ar3->SetAngle(40);
ar3->SetLineWidth(2);
ar3->Draw();
TArrow *ar4 = new TArrow(0.46,0.7,0.82,0.42,0.07,"|>");
ar4->SetAngle(60);
ar4->SetLineWidth(2);
ar4->SetFillColor(2);
ar4->Draw();
TArrow *ar5 = new TArrow(0.4,0.25,0.95,0.25,0.15,"<|>");
ar5->SetAngle(60);
ar5->SetLineWidth(4);
ar5->SetLineColor(4);
ar5->SetFillStyle(3008);
ar5->SetFillColor(2);
ar5->Draw();
return c1;
}
示例5: glbox
void glbox()
{
gStyle->SetCanvasPreferGL(kTRUE);
TCanvas *c = new TCanvas("glc","TH3 Drawing", 100, 10, 850, 400);
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
"\"glbox\" and \"glbox1\" options for TH3.");
title->SetFillColor(32);
title->Draw();
TPad *boxPad = new TPad("box", "box", 0.02, 0.02, 0.48, 0.82);
TPad *box1Pad = new TPad("box1", "box1", 0.52, 0.02, 0.98, 0.82);
boxPad->Draw();
box1Pad->Draw();
TH3F *h31 = new TH3F("h31", "h31", 10, -1, 1, 10, -1, 1, 10, -1, 1);
h31->FillRandom("gaus");
h31->SetFillColor(2);
boxPad->cd();
h31->Draw("glbox");
TH3F *h32 = new TH3F("h32", "h32", 10, -2, 2, 10, -1, 1, 10, -3, 3);
h32->FillRandom("gaus");
h32->SetFillColor(4);
box1Pad->cd();
h32->Draw("glbox1");
}
示例6: testRoot
void testRoot() {
//Fill a 1-D histogram from a parametric function
// To see the output of this macro, click begin_html <a href="gif/fillrandom.gif">here</a>. end_html
//Author: Rene Brun
TCanvas *c1 = new TCanvas("c1","The FillRandom example",200,10,700,900);
c1->SetFillColor(18);
TPad* pad1 = new TPad("pad1","The pad with the function",0.05,0.50,0.95,0.95,21);
TPad* pad2 = new TPad("pad2","The pad with the histogram",0.05,0.05,0.95,0.45,21);
pad1->Draw();
pad2->Draw();
pad1->cd();
gBenchmark->Start("fillrandom");
//
// A function (any dimension) or a formula may reference
// an already defined formula
//
TFormula* form1 = new TFormula("form1","abs(sin(x)/x)");
TF1* sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10);
sqroot->SetParameters(10,4,1,20);
pad1->SetGridx();
pad1->SetGridy();
pad1->GetFrame()->SetFillColor(42);
pad1->GetFrame()->SetBorderMode(-1);
pad1->GetFrame()->SetBorderSize(5);
sqroot->SetLineColor(4);
sqroot->SetLineWidth(6);
sqroot->Draw();
TPaveLabel* lfunction = new TPaveLabel(5,39,9.8,46,"The sqroot function");
lfunction->SetFillColor(41);
lfunction->Draw();
c1->Update();
//
// Create a one dimensional histogram (one float per bin)
// and fill it following the distribution in function sqroot.
//
pad2->cd();
pad2->GetFrame()->SetFillColor(42);
pad2->GetFrame()->SetBorderMode(-1);
pad2->GetFrame()->SetBorderSize(5);
TH1F* h1f = new TH1F("h1f","Test random numbers",200,0,10);
h1f->SetFillColor(45);
h1f->FillRandom("sqroot",10000);
h1f->Draw();
c1->Update();
//
// Open a ROOT file and save the formula, function and histogram
//
TFile myfile("fillrandom.root","RECREATE");
form1->Write();
sqroot->Write();
h1f->Write();
gBenchmark->Show("fillrandom");
}
示例7: KolmogorovTest
////////////////////////////////////////////////////////////
//
// This function performs a compatibility test between two
// histogram based on the Kolmogorov-Smirnof algorithm. It
// also prints the value in a TPaveLabel at the upper-right
// corner.
// The return value contains the result of the test
//
double KolmogorovTest(TH1 *h1, TH1 *h2){
double mya_array[1300], myb_array[1300];
vector<double> mya;
vector<double> myb;
for (int i=0; i<h1->GetNbinsX(); i++){
mya.push_back(h1->GetBinContent(i+1));
myb.push_back(h2->GetBinContent(i+1));
}
sort(mya.begin(),mya.end());
sort(myb.begin(),myb.end());
copy(mya.begin(),mya.end(),mya_array);
copy(myb.begin(),myb.end(),myb_array);
const int nbinsa = h1->GetNbinsX();
const int nbinsb = h2->GetNbinsX();
double kstest = TMath::KolmogorovTest(nbinsa, mya_array,
nbinsb, myb_array,
"UOX");
if (DEBUGP) cout << " + KS value = " << kstest << endl;
// Create text with the value
TString legend = Form("KS=%4.2f", kstest);
// Create a pave text to put the value inside
TPaveLabel* pl = new TPaveLabel(0.79,0.91,0.93,0.96, legend.Data(), "NDC");
// Tune style
//pl->SetTextSize(0.04);
pl->SetLineColor(41);
pl->SetLineWidth(1);
pl->SetLineStyle(1);
pl->SetFillColor(41);
pl->SetBorderSize(3);
if (kstest < 0.7)
pl->SetTextColor(kRed);
pl->Draw();
return kstest;
}
示例8: first
void first() {
TCanvas *nut = new TCanvas("nut", "FirstSession",100,10,700,900);
nut->Range(0,0,20,24);
nut->SetFillColor(10);
nut->SetBorderSize(2);
TPaveLabel *pl = new TPaveLabel(3,22,17,23.7,
"My first ROOT interactive session","br");
pl->SetFillColor(18);
pl->Draw();
TText t(0,0,"a");
t.SetTextFont(62);
t.SetTextSize(0.025);
t.SetTextAlign(12);
t.DrawText(2,20.3,"ROOT is based on CINT, a powerful C/C++ interpreter.");
t.DrawText(2,19.3,"Blocks of lines can be entered within {...}.");
t.DrawText(2,18.3,"Previous typed lines can be recalled.");
t.SetTextFont(72);
t.SetTextSize(0.026);
t.DrawText(3,17,"Root > float x=5; float y=7;");
t.DrawText(3,16,"Root > x*sqrt(y)");
t.DrawText(3,14,
"Root > for (int i=2;i<7;i++) printf(\"sqrt(%d) = %f\\n\",i,sqrt(i));");
t.DrawText(3,10,"Root > TF1 f1(\"f1\",\"sin(x)/x\",0,10)");
t.DrawText(3, 9,"Root > f1.Draw()");
t.SetTextFont(81);
t.SetTextSize(0.018);
t.DrawText(4,15,"(float) 13.2288f");
t.DrawText(4,13.3,"sqrt(2) = 1.414214");
t.DrawText(4,12.7,"sqrt(3) = 1.732051");
t.DrawText(4,12.1,"sqrt(4) = 2.000000");
t.DrawText(4,11.5,"sqrt(5) = 2.236068");
t.DrawText(4,10.9,"sqrt(6) = 2.449490");
TPad *pad = new TPad("pad","pad",.2,.05,.8,.35);
pad->Draw();
pad->cd();
pad->SetGrid();
TF1 *f1 = new TF1("f1","sin(x)/x",0,10);
f1->Draw();
}
示例9: glrose
// Render a TF2 looking like a rose.
// Author: Timur Pocheptsov
void glrose()
{
//Define and set user's palette,
//use polar system.
const Int_t paletteSize = 10;
Float_t rgb[paletteSize * 3] =
{0.80f, 0.55f, 0.40f,
0.85f, 0.60f, 0.45f,
0.90f, 0.65f, 0.50f,
0.95f, 0.70f, 0.55f,
1.f, 0.75f, 0.60f,
1.f, 0.80f, 0.65f,
1.f, 0.85f, 0.70f,
1.f, 0.90f, 0.75f,
1.f, 0.95f, 0.80f,
1.f, 1.f, 0.85f};
Int_t palette[paletteSize] = {0};
for (Int_t i = 0; i < paletteSize; ++i)
palette[i] = TColor::GetColor(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]);
gStyle->SetPalette(paletteSize, palette);
gStyle->SetCanvasPreferGL(1);
TCanvas *cnv = new TCanvas("glc", "Surface sample", 200, 10, 600, 550);
TPaveLabel *title = new TPaveLabel(0.04, 0.86, 0.96, 0.98,
"\"glsurf2pol\" option + user defined palette.");
title->SetFillColor(32);
title->Draw();
TPad *rosePad = new TPad("box", "box", 0.04, 0.04, 0.96, 0.8);
rosePad->Draw();
TF2 *fun = new TF2("a", "cos(y)*sin(x)+cos(x)*sin(y)", -6, 6, -6, 6);
fun->SetContour(paletteSize);
fun->SetNpx(30);
fun->SetNpy(30);
rosePad->cd();
fun->Draw("glsurf2pol");
}
示例10: draw_layer_labels
void draw_layer_labels(Int_t nLayers)
{
const Double_t LABEL_HEIGHT = 0.03;
const Double_t LABEL_WIDTH = 0.20;
Double_t effWidth = 0.8*(1.0-LABEL_WIDTH)/nLayers;
Double_t height = 0.8*LABEL_HEIGHT;
Double_t margY = LABEL_HEIGHT - height;
for (Int_t i = 0; i < nLayers; i++) {
TString label = Form("Layer %i", i);
Double_t cx = i*(1.0-LABEL_WIDTH)/nLayers+1.0/(2.0*nLayers)+LABEL_WIDTH;
Double_t x1 = cx-0.8*effWidth/2.0;
Double_t x2 = cx+0.8*effWidth/2.0;
Double_t y1 = margY;
Double_t y2 = margY + height;
TPaveLabel *p = new TPaveLabel(x1, y1, x2, y2, label+"", "br");
p->SetFillColor(gStyle->GetTitleFillColor());
p->SetFillStyle(1001);
p->Draw();
}
}
示例11: qa2
void qa2() {
//Fill a 1-D histogram from a parametric function
TCanvas *c1 = new TCanvas("c1","The FillRandom example",0,0,700,500);
c1->SetFillColor(18);
gBenchmark->Start("fillrandom");
//
// A function (any dimension) or a formula may reference
// an already defined formula
//
TFormula *form1 = new TFormula("form1","abs(sin(x)/x)");
TF1 *sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10);
sqroot->SetParameters(10,4,1,20);
//
// Create a one dimensional histogram (one float per bin)
// and fill it following the distribution in function sqroot.
//
TH1F *h1f = new TH1F("h1f","Test random numbers",200,0,10);
h1f->SetFillColor(45);
h1f->FillRandom("sqroot",100000);
h1f->Draw();
TPaveLabel *lfunction = new TPaveLabel(5,39,9.8,46,"The sqroot function");
lfunction->SetFillColor(41);
c1->SetGridx();
c1->SetGridy();
c1->GetFrame()->SetFillColor(42);
c1->GetFrame()->SetBorderMode(-1);
c1->GetFrame()->SetBorderSize(5);
h1f->SetDirectory(0);
c1->Update();
sqroot->SetParameters(200,4,1,20);
}
示例12: h1draw
void h1draw()
{
// We attach (or generate) the ROOT file in $ROOTSYS/tutorials/hsimple.root
// or $PWD/hsimple.root
// We draw one histogram in different formats
//Author: Rene Brun
TFile *example = TFile::Open("hsimple.root");
if (!example) return;
example->ls();
TH1 *hpx = (TH1*)example->Get("hpx");
TCanvas *c1 = new TCanvas("c1","Histogram Drawing Options",200,10,700,900);
TPad *pad1 = new TPad("pad1",
"The pad with the function",0.03,0.62,0.50,0.92,21);
TPad *pad2 = new TPad("pad2",
"The pad with the histogram",0.51,0.62,0.98,0.92,21);
TPad *pad3 = new TPad("pad3",
"The pad with the histogram",0.03,0.02,0.97,0.57,21);
pad1->Draw();
pad2->Draw();
pad3->Draw();
// Draw a global picture title
TPaveLabel *title = new TPaveLabel(0.1,0.94,0.9,0.98,
"Drawing options for one dimensional histograms");
title->SetFillColor(16);
title->SetTextFont(52);
title->Draw();
// Draw histogram hpx in first pad with the default option.
pad1->cd();
pad1->GetFrame()->SetFillColor(18);
hpx->SetFillColor(45);
hpx->DrawCopy();
TPaveLabel *label1 = new TPaveLabel(-3.5,700,-1,800,"Default option");
label1->SetFillColor(42);
label1->Draw();
// Draw hpx as a lego. Clicking on the lego area will show
// a "transparent cube" to guide you rotating the lego in real time.
pad2->cd();
hpx->DrawCopy("lego1");
TPaveLabel *label2 = new TPaveLabel(-0.72,0.74,-0.22,0.88,"option Lego1");
label2->SetFillColor(42);
label2->Draw();
TPaveLabel *label2a = new TPaveLabel(-0.93,-1.08,0.25,-0.92,
"Click on lego to rotate");
label2a->SetFillColor(42);
label2a->Draw();
// Draw hpx with its errors and a marker.
pad3->cd();
pad3->SetGridx();
pad3->SetGridy();
pad3->GetFrame()->SetFillColor(18);
hpx->SetMarkerStyle(21);
hpx->Draw("e1p");
TPaveLabel *label3 = new TPaveLabel(2,600,3.5,650,"option e1p");
label3->SetFillColor(42);
label3->Draw();
// The following illustrates how to add comments using a PaveText.
// Attributes of text/lines/boxes added to a PaveText can be modified.
// The AddText function returns a pointer to the added object.
TPaveText *pave = new TPaveText(-3.78,500,-1.2,750);
pave->SetFillColor(42);
TText *t1=pave->AddText("You can move");
t1->SetTextColor(4);
t1->SetTextSize(0.05);
pave->AddText("Title and Stats pads");
pave->AddText("X and Y axis");
pave->AddText("You can modify bin contents");
pave->Draw();
c1->Update();
}
示例13: file
void file(){
TCanvas *c1 = new TCanvas("c1","ROOT File description",200,10,700,550);
c1->Range(0,-0.25,21,14);
TPaveLabel *title = new TPaveLabel(5,12,15,13.7,c1->GetTitle());
title->SetFillColor(16);
title->Draw();
// horizonthal file layout
TPave *file = new TPave(1,8.5,20,11);
file->SetFillColor(11);
file->Draw();
TPave *fileh = new TPave(1,8.5,2.5,11);
fileh->SetFillColor(44);
fileh->Draw();
TPave *lrh = new TPave(2.5,8.5,3.3,11,1);
lrh->SetFillColor(33);
lrh->Draw();
lrh->DrawPave(6.9,8.5,7.7,11,1);
lrh->DrawPave(10.5,8.5,11.3,11,1);
lrh->DrawPave(14.5,8.5,15.3,11,1);
TLine *ldot = new TLine(1,8.5,0.5,6.5);
ldot->SetLineStyle(2);
ldot->Draw();
ldot->DrawLine(2.5, 8.5, 9.4, 6.5);
ldot->DrawLine(10.5, 8.5, 10, 6.5);
ldot->DrawLine(11.3, 8.5, 19.5, 6.5);
TLine *line = new TLine(2.6,11,2.6,11.5);
line->Draw();
line->DrawLine(2.6,11.5,7,11.5);
TArrow *arrow = new TArrow(7,11.5,7,11.1,0.01,"|>");
arrow->SetFillStyle(1001);
arrow->Draw();
line->DrawLine( 7, 8.5, 7, 8.0);
line->DrawLine( 7, 8.0, 10.6, 8);
arrow->DrawArrow( 10.6,8, 10.6, 8.4,0.01,"|>");
line->DrawLine( 10.6, 11, 10.6, 11.5);
line->DrawLine( 10.6, 11.5, 14.6, 11.5);
arrow->DrawArrow( 14.6,11.5, 14.6,11.1,0.01,"|>");
line->DrawLine( 14.6, 8.5, 14.6, 8.0);
line->DrawLine( 14.6, 8.0, 16, 8);
ldot->DrawLine(16, 8, 19, 8);
TText *vert = new TText(1.5,9.75,"File");
vert->SetTextAlign(21);
vert->SetTextAngle(90);
vert->SetTextSize(0.025);
vert->Draw();
vert->DrawText(2.0, 9.75,"Header");
vert->DrawText(2.9, 9.75,"Logical Record");
vert->DrawText(3.2, 9.75,"Header");
vert->DrawText(7.3, 9.75,"Logical Record");
vert->DrawText(7.6, 9.75,"Header");
vert->DrawText(10.9,9.75,"Logical Record");
vert->DrawText(11.2,9.75,"Header");
vert->DrawText(14.9,9.75,"Logical Record");
vert->DrawText(15.2,9.75,"Header");
TText *hori = new TText(4.75,10,"Object");
hori->SetTextAlign(22);
hori->SetTextSize(0.035);
hori->Draw();
hori->DrawText(4.75, 9.5,"Data");
hori->DrawText(9.2, 10,"Deleted");
hori->DrawText(9.2, 9.5,"Object");
line->DrawLine( 6.9, 8.5, 10.5, 11);
line->DrawLine( 6.9, 11, 10.5, 8.5);
TText *tbig = new TText(17,9.75,"............");
tbig->SetTextAlign(22);
tbig->SetTextSize(0.03);
tbig->Draw();
tbig->DrawText(2.6, 7, "fBEGIN");
tbig->DrawText(20., 7, "fEND");
arrow->DrawArrow( 2.6,7, 2.6,8.4,0.01,"|>");
arrow->DrawArrow( 20,7, 20,8.4,0.01,"|>");
//file header
TPaveText *header = new TPaveText(0.5,.2,9.4,6.5);
header->SetFillColor(44);
header->Draw();
TText *fh=header->AddText("File Header");
fh->SetTextAlign(22);
fh->SetTextSize(0.04);
header->SetTextSize(0.027);
header->SetTextAlign(12);
header->AddText(" ");
header->AddLine(0,0,0,0);
header->AddText("\"root\": Root File Identifier");
header->AddText("fVersion: File version identifier");
header->AddText("fBEGIN: Pointer to first data record");
header->AddText("fEND: Pointer to first free word at EOF");
header->AddText("fSeekFree: Pointer to FREE data record");
header->AddText("fNbytesFree: Number of bytes in FREE");
header->AddText("fNfree: Number of free data records");
header->AddText("fNbytesName: Number of bytes in name/title");
header->AddText("fUnits: Number of bytes for pointers");
header->AddText("fCompress: Compression level");
//logical record header
TPaveText *lrecord = new TPaveText(10,0.2,19.5,6.5);
lrecord->SetFillColor(33);
//.........这里部分代码省略.........
示例14: ClassTree
void ClassTree()
{
TCanvas *ClassTree = new TCanvas("ClassTree", "",186,135,594,449);
ClassTree->SetHighLightColor(2);
ClassTree->Range(0,5,20,20);
ClassTree->SetFillColor(33);
ClassTree->SetBorderSize(2);
TLine *line = new TLine(0.5,18.15,4.4,18.15);
line->Draw();
line = new TLine(4.4,17.725,4.4,18.575);
line->Draw();
TPaveLabel *pl = new TPaveLabel(1,17.895,4.205,18.405,"TArray","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(0.5,16.875,1,16.875);
line->Draw();
pl = new TPaveLabel(1,16.62,4.205,17.13,"TAttFill","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(0.5,16.025,1,16.025);
line->Draw();
pl = new TPaveLabel(1,15.77,4.205,16.28,"TAttLine","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(0.5,15.175,1,15.175);
line->Draw();
pl = new TPaveLabel(1,14.92,4.205,15.43,"TAttMarker","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(0.5,9.775,4.4,9.775);
line->Draw();
line = new TLine(4.4,7.65,4.4,12.325);
line->Draw();
pl = new TPaveLabel(1,9.52,4.205,10.03,"TObject","br");
pl->SetFillColor(5);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,12.325,4.9,12.325);
line->Draw();
pl = new TPaveLabel(4.9,12.07,8.105,12.58,"AliArrayI","br");
pl->SetFillColor(18);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,11.475,4.9,11.475);
line->Draw();
pl = new TPaveLabel(4.9,11.22,8.105,11.73,"AliArrayS","br");
pl->SetFillColor(18);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,18.575,4.9,18.575);
line->Draw();
pl = new TPaveLabel(4.9,18.32,8.105,18.83,"TArrayI","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,17.725,4.9,17.725);
line->Draw();
pl = new TPaveLabel(4.9,17.47,8.105,17.98,"TArrayS","br");
pl->SetFillColor(30);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,10.2,8.3,10.2);
line->Draw();
pl = new TPaveLabel(4.9,9.945,8.105,10.455,"TCollection","br");
pl->SetFillColor(18);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(4.4,7.65,8.3,7.65);
line->Draw();
line = new TLine(8.3,6.8,8.3,8.075);
line->Draw();
pl = new TPaveLabel(4.9,7.395,8.105,7.905,"TNamed","br");
pl->SetFillColor(18);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(8.3,8.075,12.2,8.075);
line->Draw();
pl = new TPaveLabel(8.8,7.82,12.005,8.33,"AliSegmentArray","br");
pl->SetFillColor(18);
pl->SetTextSize(0.9);
pl->Draw();
line = new TLine(8.3,10.2,12.2,10.2);
line->Draw();
//.........这里部分代码省略.........
示例15: EpEd
void EpEd()
{
TCanvas *c1 = new TCanvas("c1","multipads",700,700);
gStyle->SetPadBorderMode(0);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetFrameLineWidth(1);
c1->Divide(1,2,0.001,0.000001);
c1->cd(1);
gPad->SetTopMargin(0.2);
gPad->SetBottomMargin(0.0);
gPad->SetRightMargin(0.15);
/// Near site
{
TFile f("../../data/Sample/P12e_1.5MeV/H/Near.root");
h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);
//h2dAccSum->GetZaxis()->SetRangeUser(-20,1.5308177e+03);
h2dAccSum->GetYaxis()->SetLabelSize(0.06);
h2dAccSum->GetYaxis()->SetTitleSize(0.06);
h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
h2dAccSum->GetZaxis()->SetLabelSize(0.05);
h2dAccSum->GetZaxis()->SetTitleSize(0.05);
//h2dAccSum->SetMinimum(0);
// What is this principle?
h2dAccSum->DrawCopy("col");
TExec *ex1 = new TExec("ex1","Pal1();");
ex1->Draw();
h2dAccSum->SetContour(500);
h2dAccSum->DrawCopy("colz same");
h2dAccSum->DrawCopy("same axis");
// top frame is blocked. Now redraw it.
TLine *line = new TLine;
line->DrawLine(1.3,10.6, 10.1,10.6);
line->DrawLine(10.1,10.6, 10.1,1.3);
TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Near site");
label->SetFillColor(0);
label->SetShadowColor(0);
label->SetTextSize(0.5);
label->Draw();
f.Close();
}
c1->cd(2);
gPad->SetTopMargin(0.0);
gPad->SetRightMargin(0.15);
gPad->SetBottomMargin(0.2);
/// Far site
{
TFile ff("../../data/Sample/P12e_1.5MeV/H/EH3.root");
h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);
h2dAccSum->GetXaxis()->SetLabelSize(0.06);
h2dAccSum->GetXaxis()->SetTitleSize(0.06);
h2dAccSum->GetYaxis()->SetLabelSize(0.06);
h2dAccSum->GetYaxis()->SetTitleSize(0.06);
h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
h2dAccSum->GetZaxis()->SetLabelSize(0.05);
h2dAccSum->GetZaxis()->SetTitleSize(0.05);
// What is this principle?
h2dAccSum->DrawCopy("col");
TExec *ex2 = new TExec("ex2","Pal2();");
ex2->Draw();
h2dAccSum->SetContour(500);
h2dAccSum->DrawCopy("same colz");
h2dAccSum->DrawCopy("same axis");
// top frame is blocked. Now redraw it.
TLine *line = new TLine;
line->DrawLine(1.3,10.6, 10.1,10.6);
line->DrawLine(10.1,10.6, 10.1,1.3);
TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Far site");
label->SetFillColor(0);
label->SetShadowColor(0);
label->SetTextSize(0.5);
label->Draw();
ff.Close();
}
}