本文整理汇总了C++中TPad::SetFrameFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TPad::SetFrameFillColor方法的具体用法?C++ TPad::SetFrameFillColor怎么用?C++ TPad::SetFrameFillColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPad
的用法示例。
在下文中一共展示了TPad::SetFrameFillColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markerwarning
void markerwarning()
{
const int Nph = 14;
double np_ph[Nph] = {353.4,300.2,254.3,215.2,181.0,151.3,125.2,102.7, 83.3, 66.7, 52.5, 40.2, 30.2, 22.0};
double nc_ph[Nph] = {3.890,3.734,3.592,3.453,3.342,3.247,3.151,3.047,2.965,2.858,2.701,2.599,2.486,2.328};
double npe_ph[Nph] = {10.068,9.004,8.086,7.304,6.620,6.026,5.504,5.054,4.666,4.334,4.050,3.804,3.604,3.440};
double nce_ph[Nph] = {0.235,0.217,0.210,0.206,0.213,0.223,0.239,0.260,0.283,0.318,0.356,0.405,0.465,0.545};
const int Nbr = 6;
double np_br[Nbr] = {357.0,306.0,239.0,168.0,114.0, 73.0};
double nc_br[Nbr] = {3.501,3.275,3.155,3.060,3.053,3.014};
double npe_br[Nbr] = {8.000,11.000,10.000,9.000,9.000,8.000};
double nce_br[Nbr] = {0.318,0.311,0.306,0.319,0.370,0.429};
TGraphErrors *phUP = new TGraphErrors(Nph,np_ph,nc_ph,npe_ph,nce_ph);
TGraphErrors *phDN = new TGraphErrors(Nph,np_ph,nc_ph,npe_ph,nce_ph);
TGraphErrors *brUP = new TGraphErrors(Nbr,np_br,nc_br,npe_br,nce_br);
TGraphErrors *brDN = new TGraphErrors(Nbr,np_br,nc_br,npe_br,nce_br);
float Top_margin = 0.;
float Left_margin = 0.025;
float Right_margin = 0.005;
float maxPlotPart = 395;
float Marker_Size = 1.3;
int Marker_Style = 8;
float Et_200_Min = 0.71;
float Et_200_Max = 3.80;
float Et_130_Min = 1.21;
float Et_130_Max = 3.29;
float Nc_200_Min = 1.31;
float Nc_200_Max = 4.30;
float Nc_130_Min = 1.51;
float Nc_130_Max = 3.89;
TCanvas *canvasNc = new TCanvas("canvasNc", "Multiplicity",630,10,600,500);
gStyle->SetOptStat(0);
canvasNc->SetFillColor(10);
canvasNc->SetBorderSize(0);
// Primitives in Nc200 pad
TPad *padNcUP = new TPad("padNcUP","200 GeV",0.07,0.60,1.,1.00);
padNcUP->Draw();
padNcUP->cd();
padNcUP->SetFillColor(10);
padNcUP->SetFrameFillColor(10);
padNcUP->SetBorderSize(0);
padNcUP->SetLeftMargin(Left_margin);
padNcUP->SetRightMargin(Right_margin);
padNcUP->SetTopMargin(Top_margin+0.005);
padNcUP->SetBottomMargin(0.00);
TH1F* frameNcUP = new TH1F("frameNcUP","",100,0,maxPlotPart);
frameNcUP->GetYaxis()->SetLabelOffset(0.005);
frameNcUP->GetYaxis()->SetLabelSize(0.10);
frameNcUP->SetMinimum(Nc_200_Min);
frameNcUP->SetMaximum(Nc_200_Max);
frameNcUP->SetNdivisions(505,"Y");
frameNcUP->SetNdivisions(505,"X");
frameNcUP->Draw();
brUP->SetMarkerStyle(22);
brUP->SetMarkerSize (2.0);
brUP->Draw("P");
phDN->SetMarkerStyle(23);
phDN->SetMarkerSize (2);
phDN->Draw("P");
canvasNc->cd();
// Primitives in Nc130 pad
TPad *padNcDN = new TPad("padNcDN","130 GeV",0.07,0.02,1.,0.60);
padNcDN->Draw();
padNcDN->cd();
padNcDN->SetFillColor(10);
padNcDN->SetFrameFillColor(10);
padNcDN->SetBorderSize(0);
padNcDN->SetLeftMargin(Left_margin);
padNcDN->SetRightMargin(Right_margin);
padNcDN->SetTopMargin(Top_margin+0.005);
padNcDN->SetBottomMargin(0.30);
TH1F* frameNcDN = new TH1F("frameNcDN","",100,0,maxPlotPart);
frameNcDN->GetYaxis()->SetLabelOffset(0.005);
frameNcDN->GetYaxis()->SetLabelSize(0.07);
frameNcDN->GetXaxis()->SetLabelOffset(0.005);
frameNcDN->GetXaxis()->SetLabelSize(0.07);
frameNcDN->SetMinimum(Nc_200_Min);
frameNcDN->SetMaximum(Nc_200_Max);
frameNcDN->SetNdivisions(505,"Y");
frameNcDN->SetNdivisions(505,"X");
frameNcDN->Draw();
brDN->SetMarkerStyle(23);
brDN->SetMarkerSize (2.0);
brDN->Draw("P");
//.........这里部分代码省略.........
示例2: second
void second() {
TCanvas *nut = new TCanvas("nut", "Second Session",100,10,750,1000);
nut->Range(0,0,20,24);
nut->SetFillColor(18);
TPaveLabel *pl = new TPaveLabel(3,22,17,23.7,"My second 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,21,"Very large C/C++ files can be interpreted (50,000 lines+).");
t.DrawText(2,20,"Functions in macros can reference other functions, etc.");
t.DrawText(2,19,"Let's make a file \"graph.C\" with the following statements:");
TPaveText *macro = new TPaveText(2,11,18,18);
macro->SetFillColor(10);
macro->SetTextColor(kBlue);
macro->SetBorderSize(6);
macro->SetTextAlign(12);
macro->SetTextFont(61);
macro->AddText("{");
macro->AddText(" TCanvas *c1 = new TCanvas(\"c1\",\"A Simple Graph Example\",200,10,700,500);");
macro->AddText(" c1->Range(-0.5,-2,2.5,12);");
macro->AddText(" const Int_t n = 20");
macro->AddText(" Float_t x[n], y[n];");
macro->AddText(" for (Int_t i=0;i<n;i++) {");
macro->AddText(" x[i] = i*0.1;");
macro->AddText(" y[i] = 10*sin(x[i]+0.2);");
macro->AddText(" }");
macro->AddText(" gr = new TGraph(n,x,y);");
macro->AddText(" gr->Draw(\"AC*\");");
macro->AddText("}");
macro->AddText(" ");
macro->Draw();
t.SetTextFont(72);
t.SetTextColor(kRed);
t.SetTextSize(0.026);
t.DrawText(3,10,"Root > .x graph.C");
TPad *pad = new TPad("pad","pad",.15,.05,.85,.40);
pad->SetFillColor(41);
pad->SetFrameFillColor(33);
pad->Draw();
pad->cd();
pad->SetGrid();
pad->Range(-0.5,-2,2.5,12);
const Int_t n = 20;
Float_t x[n], y[n];
for (Int_t i=0;i<n;i++) {
x[i] = i*0.1;
y[i] = 10*sin(x[i]+0.2);
}
gr = new TGraph(n,x,y);
gr->Draw("AC*");
nut->cd();
}
示例3: Loop
//.........这里部分代码省略.........
hAccTimesEffEE->Divide(hGenEvts);
hAccTimesEffEle->Divide(hGenEvts);
hAccTimesEffEleEB->Divide(hGenEvts);
hAccTimesEffEleEE->Divide(hGenEvts);
hAccTimesEffMu->Divide(hGenEvts);
hAccTimesEffNoTrg->Divide(hGenEvts);
//hAccTimesEffNoTrgEB->Divide(hGenEvts);
//hAccTimesEffNoTrgEE->Divide(hGenEvts);
hAccTimesEffNoTrgEle->Divide(hGenEvts);
hAccTimesEffNoTrgEleEB->Divide(hGenEvts);
hAccTimesEffNoTrgEleEE->Divide(hGenEvts);
hAccTimesEffNoTrgMu->Divide(hGenEvts);
hEffAftTrg->Divide(hTrgEvts);
hEffAftTrgEle->Divide(hTrgEvts);
hEffAftTrgEleEB->Divide(hTrgEvts);
hEffAftTrgEleEE->Divide(hTrgEvts);
hEffAftTrgMu->Divide(hTrgEvts);
hTrgRecoVsReco->Divide(hRecoNoTrgEvts);
//hTrgRecoVsRecoEB->Divide(hRecoNoTrgEvtsEB);
//hTrgRecoVsRecoEE->Divide(hRecoNoTrgEvtsEE);
hTrgRecoVsRecoEle->Divide(hRecoNoTrgEleEvts);
hTrgRecoVsRecoEleEB->Divide(hRecoNoTrgEleEvtsEB);
hTrgRecoVsRecoEleEE->Divide(hRecoNoTrgEleEvtsEE);
hTrgRecoVsRecoMu->Divide(hRecoNoTrgMuEvts);
// plot
TCanvas *accTimesEffPlot = new TCanvas("accTimesEffPlot", "acc x eff", 100, 100, 600, 600);
TPad *accTimesEffPad = new TPad("accTimesEffPad", "acc x eff pad", 0., 0., 1., 1.);
accTimesEffPad->SetBottomMargin(0.12);
accTimesEffPad->SetBorderMode(0);
accTimesEffPad->SetBorderSize(2);
accTimesEffPad->SetFrameBorderMode(0);
accTimesEffPad->SetFillColor(0);
accTimesEffPad->SetFrameFillColor(0);
accTimesEffPad->SetLeftMargin(0.11);
accTimesEffPad->SetRightMargin(0.09);
accTimesEffPad->SetTopMargin(0.08);
accTimesEffPad->SetTickx(1);
accTimesEffPad->SetTicky(1);
accTimesEffPad->Draw();
accTimesEffPad->cd();
gStyle->SetTitleFont(font);
gStyle->SetLabelFont(font);
gStyle->SetLegendFont(font);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetOptFit(1111);
gStyle->SetTitleXOffset(1.);
gStyle->SetTitleYOffset(1.3);
gPad->SetTicks(1, 1);
gPad->SetGrid(1, 1);
TH1F* hAccTimesEff2 = (TH1F*)hAccTimesEff->Clone("hAccTimesEff2");
TF1 *fitFunc = new TF1("fitFunc", "[0] + [1]/ (x + [2]) + [3]*x", 10., 5010.);
//TF1 *fitFuncEB = new TF1("fitFuncEB", "[0] + [1]/ (x + [2])", 10., 5010.);
TF1 *fitFuncEB = new TF1("fitFuncEB", "[0] + [1]/ (x + [2]) + [3]*x", 10., 5010.);
TF1 *fitFuncEE = new TF1("fitFuncEE", "[0] + [1]/ (x*x + [2])", 10., 5010.);
fitFunc->SetLineColor(kBlue);
fitFuncEB->SetLineColor(kBlue);
fitFuncEE->SetLineColor(kBlue);
hAccTimesEff->Fit("fitFunc", "", "", 480., 5010.);
hAccTimesEffEB->Fit("fitFuncEB", "", "", 480., 5010.);
hAccTimesEffEE->Fit("fitFuncEE", "", "", 480., 5010.);
cout << "Chi^2 / NDF: " << fitFunc->GetChisquare() << " / " << fitFunc->GetNDF() << ", prob: " << fitFunc->GetProb() << endl;
示例4: vs_PlotQCDcomp
//.........这里部分代码省略.........
if ( hptFOR != 0 ) {
for (int b = 0; b < hptFOR->GetNbinsX(); b++) {
Double_t mainHistoContent = hptFOR->GetBinContent(b);
Double_t systUpHistoContent = hptSUR->GetBinContent(b);
Double_t systDnHistoContent = hptSDR->GetBinContent(b);
Double_t systDiffUp = fabs( (double) systUpHistoContent - mainHistoContent );
Double_t systDiffDn = fabs( (double) mainHistoContent - systDnHistoContent );
// use average error for histogram
Double_t systDiff = ( systDiffUp + systDiffDn ) / 2.;
Double_t statErr = hptFOR->GetBinError(b);
Double_t combError = sqrt( systDiff * systDiff + statErr * statErr );
hptFOR->SetBinError(b, combError);
} //for
}//if
cPt->SetLogy(1);
gPad->Update();
cPt->Update();
// hptR->Scale(1,"width");
// hptR->SetMinimum(0.02);
// hptR->SetMaximum(1000);
hptR->GetXaxis()->SetTitle("1^{st} photon p_{T} [GeV]");
hptR->GetYaxis()->SetTitle("Number of Events / GeV");
if(isMC) hptR->SetMarkerSize(0);
if(isMC) hptR->Draw("histE");
else hptR->Draw("E X0");
hptFOR->SetMarkerSize(0);
hptFOR->SetLineColor(2);
hptFOR->SetFillColor(2);
hptFOR->SetFillStyle(3004);
hptFOR->Draw("same hist ][ E2");
legend->Clear();
if(isMC) legend->SetHeader("#gamma/QCD (Sim)");
else legend->SetHeader("#gamma/QCD (Data)");
if(isMC) legend->AddEntry(hptR, "#gamma", "l");
else legend->AddEntry(hptR, "#gamma", "p");
legend->AddEntry(hptFOR, "Pred (from #gamma_{jet})", "f");
legend->Draw();
as->DrawLatex(0.17, 0.93, outLumi.c_str() );
cPt->Update();
cPt->SetBottomMargin(0.2 + 0.8 * cPt->GetBottomMargin() - 0.2 * cPt->GetTopMargin());
TPad *ratioPt = new TPad("BottomPad", "", 0, 0, 1, 1);
ratioPt->SetTopMargin(0.8 - 0.8 * ratioPt->GetBottomMargin() + 0.2 * ratioPt->GetTopMargin());
ratioPt->SetFillStyle(0);
ratioPt->SetFrameFillColor(10);
ratioPt->SetFrameBorderMode(0);
ratioPt->Draw();
ratioPt->cd();
ratioPt->SetLogy(0);
TH1F *hptRat = (TH1F*) divideHistosForRatio(hptR,hptFOR);
hptRat->SetMinimum(0.);
hptRat->SetMaximum(10.);
hptRat->GetXaxis()->SetNdivisions(505);
if(isMC) hptRat->GetYaxis()->SetTitle("Sim/Pred");
else hptRat->GetYaxis()->SetTitle("Data/Pred");
hptRat->GetYaxis()->SetTitleSize(0.04);
hptRat->GetYaxis()->SetLabelSize(0.03);
hptRat->GetYaxis()->SetTitleOffset(1.3);
hptRat->GetYaxis()->SetNdivisions(505);
hptRat->SetMarkerStyle(20);
hptRat->SetMarkerSize(1);
hptRat->SetMarkerColor(1);
hptRat->SetLineColor(1);
hptRat->Draw("E X0");
TH1F *hptFRat = (TH1F*) getSystErrForRatio(hptFOR);
hptFRat->SetLineColor(2);
hptFRat->SetFillColor(2);
hptFRat->SetFillStyle(3004);
hptFRat->Draw("same hist ][ E2");
TLine * line = new TLine( hptRat->GetXaxis()->GetXmin(), 1., hptRat->GetXaxis()->GetXmax(), 1. );
line->SetLineColor(1);
line->SetLineWidth(0.5);
line->SetLineStyle(1);
line->Draw("same");
hptR->GetXaxis()->SetLabelSize(0);
hptR->GetXaxis()->SetTitle("");
cPt->RedrawAxis();
gPad->Update();
cPt->Update();
return;
}
示例5: macro_MakeQcdClosureTest
//.........这里部分代码省略.........
// integrate from the right side
if (j == 1) {
// loop over bins
double error;
for (int i = 1; i < nBins + 1; ++i) {
emuMass_wjets.back()->SetBinContent(i, emuMass_wjets.back()->IntegralAndError(i, nBins, error));
emuMass_wjets.back()->SetBinError(i, error);
emuMass_qcd.back()->SetBinContent(i, emuMass_qcd.back()->IntegralAndError(i, nBins, error));
emuMass_qcd.back()->SetBinError(i, error);
emuMass_qcdFromFake.back()->SetBinContent(i, emuMass_qcdFromFake.back()->IntegralAndError(i, nBins, error));
emuMass_qcdFromFake.back()->SetBinError(i, error);
}
}
if (!plotSign[k]) continue;
if (!plotType[j]) continue;
TCanvas *emuPlot;
TPad *specPad;
if (plotPullBelowSpec && j == 0) {
emuPlot = new TCanvas("emuPlot" + histoSign[k] + nameSuffix[j], "emu Spectrum" + titleSuffix[j], 100, 100, 900, 900);
specPad = new TPad("specPad" + histoSign[k] + nameSuffix[j], "emu Spectrum" + titleSuffix[j], 0., 0.33, 1., 1.);
specPad->SetBottomMargin(0.06);
} else {
emuPlot = new TCanvas("emuPlot" + histoSign[k] + nameSuffix[j], "emu Spectrum" + titleSuffix[j], 100, 100, 900, 600);
specPad = new TPad("specPad" + histoSign[k] + nameSuffix[j], "emu Spectrum" + titleSuffix[j], 0., 0., 1., 1.);
specPad->SetBottomMargin(0.12);
}
specPad->SetBorderMode(0);
specPad->SetBorderSize(2);
specPad->SetFrameBorderMode(0);
specPad->SetFillColor(0);
specPad->SetFrameFillColor(0);
if (logPlotX) specPad->SetLogx();
if (logPlotY) specPad->SetLogy();
specPad->SetLeftMargin(0.11);
specPad->SetRightMargin(0.09);
specPad->SetTopMargin(0.08);
specPad->SetTickx(1);
specPad->SetTicky(1);
specPad->Draw();
specPad->cd();
gStyle->SetTitleFont(font);
gStyle->SetLabelFont(font);
gStyle->SetLegendFont(font);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetTitleXOffset(1.);
gStyle->SetTitleYOffset(1.3);
gPad->SetTicks(1, 1);
// make a histogram stack with the bg
THStack *bgStack = new THStack("bgStack" + histoSign[k] + nameSuffix[j], "Invariant Mass" + titleSuffix[j]);
bgStack->Add(emuMass_qcd.back());
bgStack->Add(emuMass_wjets.back());
// plot spectrum
emuMass_wjets.back()->SetFillColor(wjetColour);
emuMass_wjets.back()->SetMarkerColor(wjetColour);
emuMass_wjets.back()->SetLineColor(kBlack);
emuMass_wjets.back()->SetLineWidth(2);
//emuMass_wjets.back()->Draw("HISTsames");
emuMass_qcd.back()->SetFillColor(jetBkgColour);
emuMass_qcd.back()->SetMarkerColor(jetBkgColour);