本文整理汇总了C++中TPaveText::SetTextFont方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::SetTextFont方法的具体用法?C++ TPaveText::SetTextFont怎么用?C++ TPaveText::SetTextFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::SetTextFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plot_golfcourse_Graviton
//.........这里部分代码省略.........
grthSM10->SetLineStyle(1);
grthSM10->SetFillColor(kRed);
grthSM10->SetFillStyle(3344);
grthSM->Draw("L3");
grthSM10->Draw("L3");
grmedian_cls->Draw("L");
grobslim_cls->Draw("LP");
//draw grid on top of limits
gStyle->SetOptStat(0);
TH1D* postGrid = new TH1D("postGrid","",1,fr_left,fr_right);
postGrid->GetYaxis()->SetRangeUser(fr_down,fr_up);
postGrid->Draw("AXIGSAME");
TLine *l1=new TLine();
l1->SetLineStyle(1);
l1->SetLineWidth(2.0);
l1->SetLineColor(kRed);
// l1->DrawLine(200.0,1.0,600.0,1.0);
// cMCMC->Update();
cMCMC->RedrawAxis("");
gPad->RedrawAxis("");
// hr->GetYaxis()->DrawClone();
cMCMC->Update();
//more graphics
TLegend *leg = new TLegend(.50,.75,.94,.90);
// TLegend *leg = new TLegend(.35,.71,.90,.90);
leg->SetFillColor(0);
leg->SetShadowColor(0);
leg->SetTextFont(42);
leg->SetTextSize(0.027);
// leg->SetBorderMode(0);
leg->AddEntry(grobslim_cls, "Bayesian MCMC Observed", "LP");
leg->AddEntry(gr68_cls, "Bayesian MCMC Expected #pm 1#sigma", "LF");
leg->AddEntry(gr95_cls, "Bayesian MCMC Expected #pm 2#sigma", "LF");
// leg->AddEntry(grthSM, "#sigma(pp#rightarrow RSG) x BR(G #rightarrow ZZ), c=0.05", "LF");// #rightarrow 2l2q
// leg->AddEntry(grthSM10, "#sigma(pp#rightarrow RSG) x BR(G #rightarrow ZZ), c=0.10", "LF");// #rightarrow 2l2q
leg->AddEntry(grthSM, "#sigma_{th} x BR, c=0.05", "LF");// #rightarrow 2l2q
leg->AddEntry(grthSM10, "#sigma_{th} x BR, c=0.10", "LF");// #rightarrow 2l2q
leg->Draw();
if(useNewStyle){
TPaveText* cmslabel = new TPaveText( 0.145, 0.953, 0.6, 0.975, "brNDC");
cmslabel->SetFillColor(kWhite);
cmslabel->SetTextSize(0.038);
cmslabel->SetTextAlign(11);
cmslabel->SetTextFont(62);
cmslabel->SetBorderSize(0);
// std::string leftText = "CMS Preliminary 2011";
std::string leftText = "CMS";
std::string units = "fb ^{-1}";
char lumiText[300];
sprintf( lumiText, "%.1f %s", intLumi, units.c_str());
cmslabel->AddText(Form("%s, #sqrt{s} = 7 TeV, %s", leftText.c_str(), lumiText));
//cmslabel->Draw();
TPaveText* label_sqrt = new TPaveText(0.4,0.953,0.96,0.975, "brNDC");
label_sqrt->SetFillColor(kWhite);
label_sqrt->SetBorderSize(0);
label_sqrt->SetTextSize(0.038);
label_sqrt->SetTextFont(62);
label_sqrt->SetTextAlign(31); // align right
示例2: draw_obj
//.........这里部分代码省略.........
vardraw = var+">>"+"HH";
sigtree->Draw(vardraw.c_str(),hhcut.c_str());
InitSignal(sig);
sig->SetLineColor(kBlack);
TH1F *ttbar = new TH1F("TTbar","",nbins,xmin,xmax);
vardraw = var+">>"+"TTbar";
ttbartree->Draw(vardraw.c_str(),ttbarcut.c_str());
InitHist(ttbar, xtitle.c_str(), ytitle.c_str(), TColor::GetColor(155,152,204), 1001);
TH1F *hbg = new TH1F("H","",nbins,xmin,xmax);
vardraw = var+">>"+"H";
htree->Draw(vardraw.c_str(),hcut.c_str());
InitHist(hbg, xtitle.c_str(), ytitle.c_str(), TColor::GetColor(141,201,159), 1001);
TH1F *zjet = new TH1F("Zjets","",nbins,xmin,xmax);
vardraw = var+">>"+"Zjets";
ewktree->Draw(vardraw.c_str(),zjetcut.c_str());
InitHist(zjet, xtitle.c_str(), ytitle.c_str(), TColor::GetColor(222,90,106), 1001);
TH1F *ewk = new TH1F("EWK","",nbins,xmin,xmax);
vardraw = var+">>"+"EWK";
ewktree->Draw(vardraw.c_str(),ewkcut.c_str());
InitHist(ewk, xtitle.c_str(), ytitle.c_str(), TColor::GetColor(248,206,104), 1001);
cout << sig->GetEntries() << endl;
cout << ttbar->GetEntries() << endl;
cout << hbg->GetEntries() << endl;
cout << zjet->GetEntries() << endl;
cout << ewk->GetEntries() << endl;
delete canv0;
//-----------------------------------------------------------------------
//Draw the histograms
TCanvas *canv = MakeCanvas("canv", "histograms", 600, 600);
canv->cd();
zjet->Add(ewk); hbg->Add(zjet); ttbar->Add(hbg);
//Error band stat
TH1F* errorBand = (TH1F*)sig ->Clone("errorBand");
errorBand ->SetMarkerSize(0);
errorBand ->SetFillColor(13);
errorBand ->SetFillStyle(3013);
errorBand ->SetLineWidth(1);
// for(int idx=0; idx<errorBand->GetNbinsX(); ++idx){
// if(errorBand->GetBinContent(idx)>0){
// std::cout << "Uncertainties on summed background samples: " << errorBand->GetBinError(idx)/errorBand->GetBinContent(idx) << std::endl;
// break;
// }
//}
ttbar->SetMaximum(1.2*std::max(maximum(ttbar, 0), maximum(ewk, 0)));
//blind(sig,75,150);
ttbar->Draw("hist");
hbg->Draw("histsame");
zjet->Draw("histsame");
ewk->Draw("histsame");
sig->Draw("histsame");
//errorBand->Draw("e2same");
canv->RedrawAxis();
//---------------------------------------------------------------------------
//Adding a legend
TLegend* leg = new TLegend(0.53, 0.73, 0.95, 0.90);
SetLegendStyle(leg);
leg->AddEntry(sig , TString::Format("%.0f#timeshh#rightarrow#tau#tau bb", sigscale) , "L");
leg->AddEntry(ttbar, "t#bar{t}" , "F" );
leg->AddEntry(hbg , "H" , "F" );
leg->AddEntry(zjet , "Z+jets" , "F" );
leg->AddEntry(ewk , "EWK" , "F" );
//leg->AddEntry(errorBand,"bkg. uncertainty","F");
leg->Draw();
//---------------------------------------------------------------------------
//CMS preliminary
const char* dataset = "CMS Preliminary, HH#rightarrow bb#tau#tau, 3.0 ab^{-1} at 14 TeV";
char category[50];
if (chan_cat==0) sprintf(category,"#tau_{h}#tau_{h}");
if (chan_cat==1) sprintf(category,"#mu#tau_{h}");
if (chan_cat==2) sprintf(category,"e#tau_{h}");
if (chan_cat==3) sprintf(category,"e#mu");
//CMSPrelim(dataset, "#tau_{h}#tau_{h}", 0.17, 0.835);
//CMSPrelim(dataset, "#tau_{h}#tau_{h}", 0.17, 0.835);
CMSPrelim(dataset, "", 0.16, 0.835);
TPaveText* chan = new TPaveText(0.26, 0.77, 0.37, 0.85, "tlbrNDC");
chan->SetBorderSize( 0 );
chan->SetFillStyle( 0 );
chan->SetTextAlign( 12 );
chan->SetTextSize ( 0.05 );
chan->SetTextColor( 1 );
chan->SetTextFont ( 62 );
chan->AddText(category);
chan->Draw();
//-------------------------------------------------------------------------
//Save histograms
char outfile[50];
if (chan_cat==0) sprintf(outfile, "%s_tt.png", var.c_str());
if (chan_cat==1) sprintf(outfile, "%s_mt.png", var.c_str());
if (chan_cat==2) sprintf(outfile, "%s_et.png", var.c_str());
if (chan_cat==3) sprintf(outfile, "%s_em.png", var.c_str());
canv->Print(outfile);
}
示例3: METopt
//.........这里部分代码省略.........
METopt40->SetEntries(1);
ci = TColor::GetColor("#0000ff");
METopt40->SetFillColor(ci);
ci = TColor::GetColor("#0000ff");
METopt40->SetLineColor(ci);
ci = TColor::GetColor("#0000ff");
METopt40->SetMarkerColor(ci);
METopt40->SetMarkerStyle(21);
METopt40->GetXaxis()->SetTitle("METopt");
METopt40->GetXaxis()->SetLabelFont(42);
METopt40->GetXaxis()->SetLabelSize(0.035);
METopt40->GetXaxis()->SetTitleSize(0.035);
METopt40->GetXaxis()->SetTitleFont(42);
METopt40->GetYaxis()->SetTitle("Events/pb");
METopt40->GetYaxis()->SetLabelFont(42);
METopt40->GetYaxis()->SetLabelSize(0.035);
METopt40->GetYaxis()->SetTitleSize(0.035);
METopt40->GetYaxis()->SetTitleFont(42);
METopt40->GetZaxis()->SetLabelFont(42);
METopt40->GetZaxis()->SetLabelSize(0.035);
METopt40->GetZaxis()->SetTitleSize(0.035);
METopt40->GetZaxis()->SetTitleFont(42);
METopt->Add(METopt,"");
METopt->Draw("nostack");
TPaveText *pt = new TPaveText(0.398046,0.9342857,0.601954,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
TText *AText = pt->AddText("METopt");
pt->Draw();
TLegend *leg = new TLegend(0.54023,0.639881,0.938218,0.924107,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetTextSize(0.034965);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
TLegendEntry *entry=leg->AddEntry("METopt","METopt_QCD","lp");
ci = TColor::GetColor("#00cc00");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00cc00");
entry->SetMarkerColor(ci);
entry->SetMarkerStyle(22);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
entry=leg->AddEntry("METopt","METopt_WJetsToLNu","lp");
ci = TColor::GetColor("#00ffff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00ffff");
entry->SetMarkerColor(ci);
示例4: MultiHistoOverlap
void MultiHistoOverlap(TString namesandlabels, Int_t nOfFiles, const TString& outDir="./") {
gROOT->Reset();
gROOT->ProcessLine(".L tdrstyle.C");
gROOT->ProcessLine("setTDRStyle()");
// gSystem->Load("libRooFit");
// using namespace RooFit;
// preamble
TPaveText *cmsprel = new TPaveText(0.19, 0.95, 0.95, 0.99, "NDC");
cmsprel->SetTextSize(0.03);
cmsprel->SetTextFont(42);
cmsprel->SetFillColor(0);
cmsprel->SetBorderSize(0);
cmsprel->SetMargin(0.01);
cmsprel->SetTextAlign(12); // align left
TString text = "CMS Preliminary 2011";
cmsprel->AddText(0.0, 0.5,text);
TString text2 = "#sqrt{s} = 7 TeV |#eta_{#mu}|<2.4";
cmsprel->AddText(0.8, 0.5, text2);
TList* FileList = new TList();
TList* LabelList = new TList();
TObjArray *nameandlabelpairs = namesandlabels.Tokenize(",");
for (Int_t i = 0; i < nameandlabelpairs->GetEntries(); ++i) {
TObjArray *aFileLegPair = TString(nameandlabelpairs->At(i)->GetName()).Tokenize("=");
if(aFileLegPair->GetEntries() == 2) {
FileList->Add( TFile::Open(aFileLegPair->At(0)->GetName()) );
LabelList->Add( aFileLegPair->At(1) );
} else {
std::cout << "Please give file name and legend entry in the following form:\n" << " filename1=legendentry1,filename2=legendentry2\n";
}
}
Int_t NOfFiles = FileList->GetSize();
if ( NOfFiles!=nOfFiles ) {
std::cout<<"&MSG-e: NOfFiles = "<<nOfFiles<<std::endl;
return;
}
TString LegLabels[nOfFiles];
for(Int_t j=0; j < nOfFiles; j++) {
TObjString* legend = (TObjString*)LabelList->At(j);
LegLabels[j] = legend->String();
std::cout<<"LegLabels["<<j<<"]"<<LegLabels[j]<<std::endl;
}
TLegend *leg=0;
TCanvas* c0 = new TCanvas("c0", "c0",50, 20, 800,600);
TCanvas* c1 = new TCanvas("c1", "c1",50, 20, 800,600);
TCanvas* c2 = new TCanvas("c2", "c2",50, 20, 800,600);
TCanvas* c3 = new TCanvas("c3", "c3",50, 20, 800,600);
TCanvas* c4 = new TCanvas("c4", "c4",50, 20, 800,600);
TCanvas* c5 = new TCanvas("c5", "c5",50, 20, 1200,800);
TCanvas* c6 = new TCanvas("c6", "c6",50, 20, 1200,800);
TCanvas* c0s = new TCanvas("c0s", "c0s",50, 20, 800,600);
TCanvas* c1s = new TCanvas("c1s", "c1s",50, 20, 800,600);
TCanvas* c2s = new TCanvas("c2s", "c2s",50, 20, 800,600);
TCanvas* c3s = new TCanvas("c3s", "c3s",50, 20, 800,600);
TCanvas* cFit = new TCanvas("cFit", "cFit",50, 20, 1600, 800);
//----------------- CANVAS C0 --------------//
c0->SetFillColor(0);
c0->cd();
leg = new TLegend(0.50,0.25,0.90,0.40);
leg->SetBorderSize(1);
leg->SetFillColor(0);
leg->SetTextFont(42);
// Mass VS muon phi plus -------------------------------
TH1D *histoMassVsPhiPlus[nOfFiles];
for(Int_t j=0; j < nOfFiles; j++) {
TFile *fin = (TFile*)FileList->At(j);
if ( histoMassVsPhiPlus[j] = (TH1D*)fin->Get("MassVsPhiPlus/allHistos/meanHisto")) {
histoMassVsPhiPlus[j]->SetLineStyle(linestylelist[j]);
histoMassVsPhiPlus[j]->SetMarkerColor(colorlist[j]);
histoMassVsPhiPlus[j]->SetLineColor(colorlist[j]);
histoMassVsPhiPlus[j]->SetMarkerStyle(markerstylelist[j]);
// histoMassVsPhiPlus[j]->SetMarkerSize(0.75);
if ( j == 0 ) {
histoMassVsPhiPlus[j]->GetXaxis()->SetTitle("positive muon #phi (rad)");
histoMassVsPhiPlus[j]->GetYaxis()->SetTitle("M_{#mu#mu} (GeV)");
// histoMassVsPhiPlus[j]->GetYaxis()->SetRangeUser(88.5,93.5);
histoMassVsPhiPlus[j]->GetYaxis()->SetRangeUser(90.0,91.5);
histoMassVsPhiPlus[j]->GetXaxis()->SetRangeUser(-3.14,3.14);
histoMassVsPhiPlus[j]->Draw();
} else {
histoMassVsPhiPlus[j]->Draw("SAME");
}
leg->AddEntry(histoMassVsPhiPlus[j],LegLabels[j],"PL");
}
//.........这里部分代码省略.........
示例5: SetStyle
//.........这里部分代码省略.........
TH1F* ttbar = refill((TH1F*)exampleFile->Get("muTau_SM0/TT" )) ; InitHist(ttbar, "", "", kBlue - 8, 1001);
TH1F* Ztt = refill((TH1F*)exampleFile->Get("muTau_SM0/ZTT")) ; InitHist(Ztt , "", "", kOrange - 4, 1001);
TH1F* ggH = refill((TH1F*)exampleFile->Get("muTau_SM0/SM120" )) ; InitSignal(ggH); ggH ->Scale(10*1);
TH1F* qqH = refill((TH1F*)exampleFile->Get("muTau_SM0/VBF120")) ; InitSignal(qqH); qqH ->Scale(10*1);
if(scaled){
rescale(Fakes, 2);
rescale(EWK1 , 3);
rescale(EWK2 , 4);
rescale(EWK3 , 5);
rescale(EWK , 7);
rescale(ttbar, 6);
rescale(Ztt , 1);
rescale(ggH , 8);
rescale(qqH , 9);
}
if(log){
qqH ->Add(ggH );
Fakes->Add(qqH );
EWK1 ->Add(Fakes);
EWK2 ->Add(EWK1 );
EWK3 ->Add(EWK2 );
EWK ->Add(EWK3 );
ttbar->Add(EWK );
Ztt ->Add(ttbar);
}
else{
EWK1 ->Add(Fakes);
EWK2 ->Add(EWK1 );
EWK3 ->Add(EWK2 );
EWK ->Add(EWK3 );
ttbar->Add(EWK );
Ztt ->Add(ttbar);
ggH ->Add(Ztt );
qqH ->Add(ggH );
}
// define canvas
TCanvas *canv = MakeCanvas("canv", "histograms", 600, 600);
canv->cd();
if(log){
canv->SetLogy(1);
data->SetMinimum(5.0);
data->SetMaximum(10000000.);
}
else{
data->SetMaximum(14000.);
}
data->SetNdivisions(505);
data->Draw("e");
if(log){
Ztt->Draw("same");
ttbar->Draw("same");
EWK->Draw("same");
Fakes->Draw("same");
qqH->Draw("same");
}
else{
qqH->Draw("same");
Ztt->Draw("same");
ttbar->Draw("same");
EWK->Draw("same");
Fakes->Draw("same");
}
data->Draw("esame");
canv->RedrawAxis();
CMSPrelim("#tau_{#mu}#tau_{h}", 0.45, 0.75);
TLegend* leg = new TLegend(0.45, 0.45, 0.9, 0.75);
SetLegendStyle(leg);
leg->AddEntry(qqH , "(10x) H#rightarrow#tau#tau" , "L" );
leg->AddEntry(data , "Observed" , "LP");
leg->AddEntry(Ztt , "Z#rightarrow#tau#tau" , "F" );
leg->AddEntry(ttbar, "t#bar{t}" , "F" );
leg->AddEntry(EWK , "Electroweak" , "F" );
leg->AddEntry(Fakes, "QCD" , "F" );
leg->Draw();
TPaveText* mssm = new TPaveText(0.78, 0.70, 0.90, 0.74, "NDC");
mssm->SetBorderSize( 0 );
mssm->SetFillStyle( 0 );
mssm->SetTextAlign( 12 );
mssm->SetTextSize ( 0.04 );
mssm->SetTextColor( 1 );
mssm->SetTextFont ( 62 );
mssm->AddText("m_{H}=120");
mssm->Draw();
if(log){
if(scaled) canv->Print("mutau_rescaled_novbf_LOG.pdf"); else canv->Print("mutau_unscaled_novbf_LOG.pdf");
if(scaled) canv->Print("mutau_rescaled_novbf_LOG.png"); else canv->Print("mutau_unscaled_novbf_LOG.png");
}
else{
if(scaled) canv->Print("mutau_rescaled_novbf.pdf"); else canv->Print("mutau_unscaled_novbf.pdf");
if(scaled) canv->Print("mutau_rescaled_novbf.png"); else canv->Print("mutau_unscaled_novbf.png");
}
}
示例6: SetStyle
//.........这里部分代码省略.........
}
}
if(log){
Ztt ->Draw("histsame");
ttbar->Draw("histsame");
EWK ->Draw("histsame");
Fakes->Draw("histsame");
$DRAW_ERROR
#ifndef DROP_SIGNAL
ggH ->Draw("histsame");
#endif
}
else{
#ifndef DROP_SIGNAL
ggH ->Draw("histsame");
#endif
Ztt ->Draw("histsame");
ttbar->Draw("histsame");
EWK ->Draw("histsame");
Fakes->Draw("histsame");
$DRAW_ERROR
}
data->Draw("esame");
canv->RedrawAxis();
//CMSPrelim(dataset, "#tau_{#mu}#tau_{h}", 0.17, 0.835);
CMSPrelim(dataset, "", 0.16, 0.835);
TPaveText* chan = new TPaveText(0.20, 0.74+0.061, 0.32, 0.74+0.161, "NDC");
chan->SetBorderSize( 0 );
chan->SetFillStyle( 0 );
chan->SetTextAlign( 12 );
chan->SetTextSize ( 0.05 );
chan->SetTextColor( 1 );
chan->SetTextFont ( 62 );
chan->AddText("#mu#tau_{h}");
chan->Draw();
TPaveText* cat = new TPaveText(0.20, 0.68+0.061, 0.32, 0.68+0.161, "NDC");
cat->SetBorderSize( 0 );
cat->SetFillStyle( 0 );
cat->SetTextAlign( 12 );
cat->SetTextSize ( 0.05 );
cat->SetTextColor( 1 );
cat->SetTextFont ( 62 );
cat->AddText(category_extra);
cat->Draw();
#ifdef MSSM
TPaveText* massA = new TPaveText(0.75, 0.48+0.061, 0.85, 0.48+0.161, "NDC");
massA->SetBorderSize( 0 );
massA->SetFillStyle( 0 );
massA->SetTextAlign( 12 );
massA->SetTextSize ( 0.03 );
massA->SetTextColor( 1 );
massA->SetTextFont ( 62 );
massA->AddText("m_{A}=160GeV");
massA->Draw();
TPaveText* tanb = new TPaveText(0.75, 0.44+0.061, 0.85, 0.44+0.161, "NDC");
tanb->SetBorderSize( 0 );
tanb->SetFillStyle( 0 );
tanb->SetTextAlign( 12 );
tanb->SetTextSize ( 0.03 );
tanb->SetTextColor( 1 );
tanb->SetTextFont ( 62 );
tanb->AddText("tan#beta=20");
示例7: mass4Chan
//.........这里部分代码省略.........
Graph_Graph1->SetDirectory(0);
Graph_Graph1->SetStats(0);
Graph_Graph1->SetLineStyle(0);
Graph_Graph1->SetMarkerStyle(20);
Graph_Graph1->GetXaxis()->SetLabelFont(42);
Graph_Graph1->GetXaxis()->SetLabelOffset(0.01);
Graph_Graph1->GetXaxis()->SetLabelSize(0.045);
Graph_Graph1->GetXaxis()->SetTitleSize(0.055);
Graph_Graph1->GetXaxis()->SetTitleOffset(0.9);
Graph_Graph1->GetXaxis()->SetTitleFont(42);
Graph_Graph1->GetYaxis()->SetLabelFont(42);
Graph_Graph1->GetYaxis()->SetLabelOffset(0.01);
Graph_Graph1->GetYaxis()->SetLabelSize(0.045);
Graph_Graph1->GetYaxis()->SetTitleSize(0.055);
Graph_Graph1->GetYaxis()->SetTitleOffset(1.25);
Graph_Graph1->GetYaxis()->SetTitleFont(42);
Graph_Graph1->GetZaxis()->SetLabelFont(42);
Graph_Graph1->GetZaxis()->SetLabelOffset(0.01);
Graph_Graph1->GetZaxis()->SetLabelSize(0.045);
Graph_Graph1->GetZaxis()->SetTitleSize(0.055);
Graph_Graph1->GetZaxis()->SetTitleFont(42);
Graph_Graph1->GetXaxis()->SetNdivisions(510);
graph->SetHistogram(Graph_Graph1);
graph->Draw("cx");
graph1->Draw("cx");
graph2->Draw("cx");
graph3->Draw("cx");
TPaveText *pt = new TPaveText(0.1577181,0.95,0.9580537,0.99,"brNDC");
pt->SetBorderSize(0);
pt->SetFillStyle(0);
pt->SetTextAlign(12);
pt->SetTextFont(42);
pt->SetTextSize(0.03);
TText *text = pt->AddText(0.01,0.5,"CMS Preliminary");
text = pt->AddText(0.3,0.6,"#sqrt{s} = 7 TeV, L = 5.1 fb^{-1} #sqrt{s} = 8 TeV, L = 19.7 fb^{-1}");
pt->Draw();
TLegend *leg = new TLegend(0.73,0.77,0.94,0.94);
leg->SetTextSize(0.035);
leg->SetTextFont(42);
leg->SetFillColor(kWhite);
//leg->SetBorderSize(0);
//leg->SetFillStyle(0);
leg->AddEntry(graph3,"Combined","L");
leg->AddEntry(graph,"Z#rightarrow 4e","L");
leg->AddEntry(graph2,"Z#rightarrow 4#mu","L");
leg->AddEntry(graph1,"Z#rightarrow 2e2#mu","L");
double yLow = 0.5;
pt = new TPaveText(0.11,yLow,0.4,yLow+0.04,"brNDC");
pt->SetBorderSize(0);
pt->SetFillStyle(0);
pt->SetTextAlign(12);
pt->SetTextFont(42);
示例8: initial_z_diff
//.........这里部分代码省略.........
hist__1->SetBinContent(52,21828);
hist__1->SetBinContent(53,17254);
hist__1->SetBinContent(54,13388);
hist__1->SetBinContent(55,10171);
hist__1->SetBinContent(56,7452);
hist__1->SetBinContent(57,5752);
hist__1->SetBinContent(58,4452);
hist__1->SetBinContent(59,3522);
hist__1->SetBinContent(60,2826);
hist__1->SetBinContent(61,2449);
hist__1->SetBinContent(62,2170);
hist__1->SetBinContent(63,1855);
hist__1->SetBinContent(64,1635);
hist__1->SetBinContent(65,1515);
hist__1->SetBinContent(66,1393);
hist__1->SetBinContent(67,1344);
hist__1->SetBinContent(68,1279);
hist__1->SetBinContent(69,1232);
hist__1->SetBinContent(70,1248);
hist__1->SetBinContent(71,1277);
hist__1->SetBinContent(72,1226);
hist__1->SetBinContent(73,1247);
hist__1->SetBinContent(74,1229);
hist__1->SetBinContent(75,1187);
hist__1->SetBinContent(76,1265);
hist__1->SetBinContent(77,1253);
hist__1->SetBinContent(78,1269);
hist__1->SetBinContent(79,1210);
hist__1->SetBinContent(80,1055);
hist__1->SetBinContent(81,914);
hist__1->SetBinContent(82,761);
hist__1->SetBinContent(83,632);
hist__1->SetBinContent(84,515);
hist__1->SetBinContent(85,450);
hist__1->SetBinContent(86,356);
hist__1->SetBinContent(87,264);
hist__1->SetBinContent(88,227);
hist__1->SetBinContent(89,176);
hist__1->SetBinContent(90,127);
hist__1->SetBinContent(91,134);
hist__1->SetBinContent(92,85);
hist__1->SetBinContent(93,60);
hist__1->SetBinContent(94,47);
hist__1->SetBinContent(95,29);
hist__1->SetBinContent(96,31);
hist__1->SetBinContent(97,18);
hist__1->SetBinContent(98,14);
hist__1->SetBinContent(99,12);
hist__1->SetBinContent(100,12);
hist__1->SetBinContent(101,63);
hist__1->SetEntries(289897);
TPaveStats *ptstats = new TPaveStats(0.78,0.775,0.98,0.935,"brNDC");
ptstats->SetName("stats");
ptstats->SetBorderSize(1);
ptstats->SetFillColor(0);
ptstats->SetTextAlign(12);
ptstats->SetTextFont(42);
TText *AText = ptstats->AddText("hist");
AText->SetTextSize(0.0368);
AText = ptstats->AddText("Entries = 289897 ");
AText = ptstats->AddText("Mean = 0.6888");
AText = ptstats->AddText("Std Dev = 33.12");
ptstats->SetOptStat(1111);
ptstats->SetOptFit(0);
ptstats->Draw();
hist__1->GetListOfFunctions()->Add(ptstats);
ptstats->SetParent(hist__1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
hist__1->SetLineColor(ci);
hist__1->GetXaxis()->SetTitle("#DeltaZ [cm]");
hist__1->GetXaxis()->SetLabelFont(42);
hist__1->GetXaxis()->SetLabelSize(0.035);
hist__1->GetXaxis()->SetTitleSize(0.035);
hist__1->GetXaxis()->SetTitleFont(42);
hist__1->GetYaxis()->SetLabelFont(42);
hist__1->GetYaxis()->SetLabelSize(0.035);
hist__1->GetYaxis()->SetTitleSize(0.035);
hist__1->GetYaxis()->SetTitleFont(42);
hist__1->GetZaxis()->SetLabelFont(42);
hist__1->GetZaxis()->SetLabelSize(0.035);
hist__1->GetZaxis()->SetTitleSize(0.035);
hist__1->GetZaxis()->SetTitleFont(42);
hist__1->Draw("");
TPaveText *pt = new TPaveText(0.15,0.9368947,0.85,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
AText = pt->AddText("Difference in PMT-constructed position and mc-truth start position");
pt->Draw();
c->Modified();
c->cd();
c->SetSelected(c);
}
示例9: compareBestFit
//.........这里部分代码省略.........
}
else{
x_title = std::string("best fit for #sigma/#sigma_{SM}");
}
gr->GetXaxis()->SetTitle(x_title.c_str());
gr->GetXaxis()->SetLabelFont(62);
gr->GetXaxis()->SetTitleFont(62);
gr->GetXaxis()->SetTitleColor(1);
gr->GetXaxis()->SetTitleOffset(1.05);
gr->GetXaxis()->SetLimits(minimum, maximum);
BAND->GetXaxis()->SetTitle(x_title.c_str());
BAND->GetXaxis()->SetLabelFont(62);
BAND->GetXaxis()->SetTitleFont(62);
BAND->GetXaxis()->SetTitleColor(1);
BAND->GetXaxis()->SetTitleOffset(1.05);
BAND->GetXaxis()->SetLimits(minimum, maximum);
// format y-axis
//BAND->GetYaxis()->Set(hexp.size(), 0, hexp.size());
gr ->GetYaxis()->Set(hexp.size(), 0, hexp.size());
//std::cout<<gr->GetYaxis()->GetBinCenter(hexp.size()-i)<<std::endl;
//BAND->GetYaxis()->SetBinLabel(hexp.size()-1, legendEntry(channels[hexp.size()-1]).c_str());
for(unsigned int j=0; j<hexp.size(); ++j){
gr ->GetYaxis()->SetBinLabel(hexp.size()-j, legendEntry(channels[j]).c_str());
}
gr->GetYaxis()->SetTickLength(0);
gr->GetYaxis()->SetLabelFont(62);
gr->GetYaxis()->SetTitleFont(62);
gr->GetYaxis()->SetLabelSize(0.07);
gr->GetYaxis()->SetTitle("");
gr->GetYaxis()->SetLabelFont(62);
gr->GetYaxis()->SetTitleOffset(1.05);
gr->GetYaxis()->SetLabelSize(0.03);
gr->GetYaxis()->SetLabelOffset(-0.32);
BAND->GetYaxis()->SetLabelFont(62);
BAND->GetYaxis()->SetTitleFont(62);
BAND->GetYaxis()->SetLabelSize(0.07);
BAND->GetYaxis()->SetTitle("");
BAND->GetYaxis()->SetLabelFont(62);
BAND->GetYaxis()->SetTitleOffset(1.05);
BAND->GetYaxis()->SetLabelSize(0.03);
BAND->GetYaxis()->SetLabelOffset(-0.32);
}
BAND->GetYaxis()->SetLabelSize(0.07);
BAND->SetTitle("");
gr ->GetYaxis()->SetLabelSize(0.07);
gr->SetTitle("");
gr->SetLineStyle( 1.);
gr->SetLineWidth( 2.);
//gr->SetLineColor(colorzxs.find(channels[i])->second);
gr->SetLineColor(kBlack);
gr->SetMarkerStyle(kFullCircle);
gr->SetMarkerSize(MARKER_SIZE);
//gr->SetMarkerColor(colors.find(channels[i])->second);
gr->SetMarkerColor(kBlack);
cout << "===> " << gr->GetErrorYhigh(0) << endl;
//cout << "==> "<< BAND->GetYaxis()->GetMaximum() << endl;
if(firstPlot) gr->Draw("AP");
if(firstPlot) {
BAND->Draw("Fsame");
BEST->Draw("l");
TLine *lLine = new TLine(minimum,1.0,maximum,1.0); lLine->SetLineWidth(3); lLine->SetLineColor(kBlue+2);
lLine->Draw();
SM->SetLineWidth(3);
SM->SetLineColor(kGreen+3);
if(std::string(type).find("mssm")==std::string::npos) SM->Draw("same");
}
gr->Draw(firstPlot ? "Psame" : "Psame");
//gr->Draw(firstPlot ? "AL" : "Lsame");
firstPlot=false;
}
ZERO->SetLineWidth(3);
ZERO->SetLineColor(kBlue);
ZERO->SetLineStyle(11);
//ZERO->Draw("same");
//TPaveText *pt = new TPaveText(2*(maximum+minimum)/3,hexp.size()-0.3,maximum,hexp.size()-0.02);
TPaveText *pt = new TPaveText(0.76, 0.88, 1.0, 1.0, "NDC");
if(std::string(type).find("mssm")!=std::string::npos) pt->AddText(TString::Format("m_{A} = %0.0f GeV" , mass));
else pt->AddText(TString::Format("m_{H} = %0.0f GeV" , mass));
pt->SetBorderSize( 0 );
pt->SetFillStyle( 0 );
pt->SetTextAlign( 12 );
pt->SetTextSize ( 0.03 );
pt->SetTextColor( 1 );
pt->SetTextFont ( 62 );
pt->Draw("same");
canv1->RedrawAxis();
CMSPrelim(label, "", 0.15, 0.835);
canv1->Print(std::string("BestFit").append(std::string(type).find("mssm")!=std::string::npos ? "_mssm.png" : "_sm.png").c_str());
canv1->Print(std::string("BestFit").append(std::string(type).find("mssm")!=std::string::npos ? "_mssm.pdf" : "_sm.pdf").c_str());
canv1->Print(std::string("BestFit").append(std::string(type).find("mssm")!=std::string::npos ? "_mssm.pdf" : "_sm.eps").c_str());
return;
}
示例10: effvsdR
void effvsdR(){
const char* title = ";gen #Delta R;Efficiency";
TFile *f = new TFile("tree_BulkGravToZZToZlepZhad.root");
TTree *t;
f->GetObject("ana/t", t);
TH1F *pass0 = new TH1F("pass0", title,20,0.,0.4);
TH1F *pass1 = new TH1F("pass1", title,20,0.,0.4);
TH1F *pass2 = new TH1F("pass2", title,20,0.,0.4);
TH1F *total = new TH1F("total", title,20,0.,0.4);
TCut A = "medium1==1 && medium2==1";
TCut B = "highPt1==1 && highPt2==1";
TCut C = "(highPt1==1 && tracker2==1) ||\
(highPt2==1 && tracker1==1)";
t->Project("pass0", "dRGenGen", A );
t->Project("pass1", "dRGenGen", B );
t->Project("pass2", "dRGenGen", C );
t->Project("total", "dRGenGen" );
TEfficiency *eff0 = new TEfficiency(*pass0,*total);
TEfficiency *eff1 = new TEfficiency(*pass1,*total);
TEfficiency *eff2 = new TEfficiency(*pass2,*total);
eff0->SetLineColor(2); eff0->SetMarkerSize(0.8); eff0->SetMarkerStyle(20); eff0->SetMarkerColor(2);
eff1->SetLineColor(4); eff1->SetMarkerSize(0.8); eff1->SetMarkerStyle(20); eff1->SetMarkerColor(4);
eff2->SetLineColor(6); eff2->SetMarkerSize(0.8); eff2->SetMarkerStyle(20); eff2->SetMarkerColor(6);
TCanvas *c1 = new TCanvas("c1","c1",900,900);
c1->cd();
gPad->SetGridy();
gPad->SetGridx();
eff0->Draw("aZ");
eff1->Draw("Zsame");
eff2->Draw("Zsame");
gPad->Update();
eff0->GetPaintedGraph()->GetYaxis()->SetRangeUser(0.,1.06);
eff0->GetPaintedGraph()->GetXaxis()->SetRangeUser(0.063,0.36);
eff0->GetPaintedGraph()->GetYaxis()->CenterTitle();
eff0->GetPaintedGraph()->GetYaxis()->SetTitleSize(0.06);
eff0->GetPaintedGraph()->GetXaxis()->SetTitleSize(0.06);
eff0->GetPaintedGraph()->GetYaxis()->SetTitleOffset(0.72);
eff0->GetPaintedGraph()->GetXaxis()->SetTitleOffset(0.72);
TLegend *leg = new TLegend(0.35,0.32,0.8,0.58);
leg->SetLineColor(1);
leg->SetTextSize(0.035);
leg->AddEntry(eff0,"Medium #plus Medium", "p");
leg->AddEntry(eff1,"High-pt #plus High-pt", "p");
leg->AddEntry(eff2,"High-pt #plus custom tracker", "p");
leg->Draw();
TPaveText *pave = new TPaveText(0.05,0.93,0.5,0.98,"NDCNB");
pave->SetFillColor(0); pave->SetTextFont(42);
pave->AddText("#bf{CMS} Preliminary #sqrt{s} = 13 TeV");
pave->Draw();
}
示例11: ptBestFit
//.........这里部分代码省略.........
pad->cd(0);
hUnc2H->GetXaxis()->SetTitle("m_{bb} (GeV)");
hUnc2H->GetYaxis()->SetTitle("Data - Bkg");
//hUnc2H->GetYaxis()->SetTitle("Data - Fit");
double YMAX = 1.1*frame2->GetMaximum();
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();
示例12: METJets
//.........这里部分代码省略.........
METJets30->SetEntries(61);
ci = TColor::GetColor("#0000ff");
METJets30->SetFillColor(ci);
ci = TColor::GetColor("#0000ff");
METJets30->SetLineColor(ci);
ci = TColor::GetColor("#0000ff");
METJets30->SetMarkerColor(ci);
METJets30->SetMarkerStyle(21);
METJets30->GetXaxis()->SetTitle("METJets");
METJets30->GetXaxis()->SetLabelFont(42);
METJets30->GetXaxis()->SetLabelSize(0.035);
METJets30->GetXaxis()->SetTitleSize(0.035);
METJets30->GetXaxis()->SetTitleFont(42);
METJets30->GetYaxis()->SetTitle("Events/pb");
METJets30->GetYaxis()->SetLabelFont(42);
METJets30->GetYaxis()->SetLabelSize(0.035);
METJets30->GetYaxis()->SetTitleSize(0.035);
METJets30->GetYaxis()->SetTitleFont(42);
METJets30->GetZaxis()->SetLabelFont(42);
METJets30->GetZaxis()->SetLabelSize(0.035);
METJets30->GetZaxis()->SetTitleSize(0.035);
METJets30->GetZaxis()->SetTitleFont(42);
METJets->Add(METJets,"");
METJets->Draw("nostack");
TPaveText *pt = new TPaveText(0.3872701,0.94,0.6127299,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
TText *AText = pt->AddText("METJets");
pt->Draw();
TLegend *leg = new TLegend(0.54023,0.639881,0.938218,0.924107,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetTextSize(0.034965);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
TLegendEntry *entry=leg->AddEntry("METJets","METJets_QCD","lp");
ci = TColor::GetColor("#00cc00");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00cc00");
entry->SetMarkerColor(ci);
entry->SetMarkerStyle(22);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
entry=leg->AddEntry("METJets","METJets_WJetsToLNu","lp");
ci = TColor::GetColor("#00ffff");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#00ffff");
entry->SetMarkerColor(ci);
示例13: single
//.........这里部分代码省略.........
ci = TColor::GetColor("#000099");
hFitTauL2__9__1->SetLineColor(ci);
hFitTauL2__9__1->GetXaxis()->SetTitle("mus");
hFitTauL2__9__1->GetXaxis()->CenterTitle(true);
hFitTauL2__9__1->GetXaxis()->SetNdivisions(505);
hFitTauL2__9__1->GetXaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetXaxis()->SetLabelOffset(-0.005);
hFitTauL2__9__1->GetXaxis()->SetLabelSize(0.07);
hFitTauL2__9__1->GetXaxis()->SetTitleSize(0.07);
hFitTauL2__9__1->GetXaxis()->SetTitleOffset(0.7);
hFitTauL2__9__1->GetXaxis()->SetTitleFont(42);
hFitTauL2__9__1->GetYaxis()->SetNdivisions(506);
hFitTauL2__9__1->GetYaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetYaxis()->SetLabelSize(0.07);
hFitTauL2__9__1->GetYaxis()->SetTitleSize(0.035);
hFitTauL2__9__1->GetYaxis()->SetTitleFont(42);
hFitTauL2__9__1->GetZaxis()->SetLabelFont(42);
hFitTauL2__9__1->GetZaxis()->SetLabelSize(0.035);
hFitTauL2__9__1->GetZaxis()->SetTitleSize(0.035);
hFitTauL2__9__1->GetZaxis()->SetTitleFont(42);
hFitTauL2__9__1->Draw("");
TLine *line = new TLine(2.197175,0,2.197175,60);
ci = TColor::GetColor("#006600");
line->SetLineColor(ci);
line->SetLineWidth(3);
line->Draw();
TPaveText *pt = new TPaveText(0.4700392,0.94,0.5299608,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
pt->SetTextSize(0.1009779);
TText *AText = pt->AddText("#tau_{+}");
pt->Draw();
METODO2_1->Modified();
METODO2->cd();
// ------------>Primitives in pad: METODO2_2
TPad *METODO2_2 = new TPad("METODO2_2", "METODO2_2",0.26,0.51,0.49,0.99);
METODO2_2->Draw();
METODO2_2->cd();
METODO2_2->Range(0.7088825,-8.793751,1.086034,79.14375);
METODO2_2->SetFillColor(0);
METODO2_2->SetBorderMode(0);
METODO2_2->SetBorderSize(2);
METODO2_2->SetFrameBorderMode(0);
METODO2_2->SetFrameBorderMode(0);
TH1D *hFitTauShortL2__10__2 = new TH1D("hFitTauShortL2__10__2","#tau_{-}",40,0.7465977,1.048319);
hFitTauShortL2__10__2->SetBinContent(1,2);
hFitTauShortL2__10__2->SetBinContent(2,6);
hFitTauShortL2__10__2->SetBinContent(3,8);
hFitTauShortL2__10__2->SetBinContent(4,11);
hFitTauShortL2__10__2->SetBinContent(5,12);
hFitTauShortL2__10__2->SetBinContent(6,15);
hFitTauShortL2__10__2->SetBinContent(7,20);
hFitTauShortL2__10__2->SetBinContent(8,28);
hFitTauShortL2__10__2->SetBinContent(9,21);
hFitTauShortL2__10__2->SetBinContent(10,32);
hFitTauShortL2__10__2->SetBinContent(11,30);
hFitTauShortL2__10__2->SetBinContent(12,35);
hFitTauShortL2__10__2->SetBinContent(13,32);
hFitTauShortL2__10__2->SetBinContent(14,46);
示例14: zj_dphi_8TeV_log
//.........这里部分代码省略.........
grae->SetTitle("");
grae->SetFillColor(1);
grae->SetLineWidth(2);
grae->SetMarkerStyle(20);
TH1F *Graph_Graph3046 = new TH1F("Graph_Graph3046","",100,0,3.063053);
Graph_Graph3046->SetMinimum(0.2520099);
Graph_Graph3046->SetMaximum(9.372245);
Graph_Graph3046->SetDirectory(0);
Graph_Graph3046->SetStats(0);
Graph_Graph3046->SetLineWidth(2);
Graph_Graph3046->SetMarkerStyle(0);
Graph_Graph3046->GetXaxis()->SetNdivisions(4);
Graph_Graph3046->GetXaxis()->SetLabelFont(132);
Graph_Graph3046->GetXaxis()->SetLabelOffset(999);
Graph_Graph3046->GetXaxis()->SetLabelSize(0);
Graph_Graph3046->GetXaxis()->SetTitleSize(0.06);
Graph_Graph3046->GetXaxis()->SetTitleFont(132);
Graph_Graph3046->GetYaxis()->SetTitle("d#sigma(#it{Zj})/d|#Delta#it{#phi} [pb/rad]");
Graph_Graph3046->GetYaxis()->SetLabelFont(132);
Graph_Graph3046->GetYaxis()->SetLabelSize(0.05);
Graph_Graph3046->GetYaxis()->SetTitleSize(0.06);
Graph_Graph3046->GetYaxis()->SetTitleFont(132);
Graph_Graph3046->GetZaxis()->SetLabelFont(132);
Graph_Graph3046->GetZaxis()->SetLabelSize(0.05);
Graph_Graph3046->GetZaxis()->SetTitleSize(0.06);
Graph_Graph3046->GetZaxis()->SetTitleFont(132);
grae->SetHistogram(Graph_Graph3046);
grae->Draw("p1p");
TLegend *leg = new TLegend(0.2,0.57,0.5,0.82,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextFont(132);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(2);
leg->SetFillColor(10);
leg->SetFillStyle(0);
TLegendEntry *entry=leg->AddEntry("data_stat","Data_{stat}","f");
ci = TColor::GetColor("#ff9933");
entry->SetFillColor(ci);
entry->SetFillStyle(1001);
entry->SetLineStyle(1);
entry->SetLineWidth(2);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(132);
entry=leg->AddEntry("data_tot","Data_{tot}","f");
ci = TColor::GetColor("#ffff00");
entry->SetFillColor(ci);
entry->SetFillStyle(1001);
entry->SetLineStyle(1);
entry->SetLineWidth(2);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(132);
entry=leg->AddEntry("powheg_temp","POWHEG","p");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
示例15: proj_npe_7
//.........这里部分代码省略.........
2371.061,
2594.067,
2630.891,
2704.654,
2727.792,
2773.388,
2784.73,
2845.592,
2924.958,
3198.695};
Double_t _fy8[40] = {
2.75,
2.65,
2.65,
2.7,
2.35,
2.45,
140.25,
2.65,
2.15,
2.55,
2.35,
2.45,
2.3,
2.5,
2.65,
4.05,
2.55,
2.5,
2.35,
2.25,
2.6,
2.7,
2.7,
2.6,
2.4,
2.35,
2.8,
2.55,
2.35,
2.8,
2.4,
2.35,
2.6,
2.6,
2.45,
2.45,
2.65,
2.55,
2.55,
2.65};
TGraph *graph = new TGraph(40,_fx8,_fy8);
graph->SetName("");
graph->SetTitle("npe values of flashes in event: 7");
graph->SetFillColor(1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#0000ff");
graph->SetMarkerColor(ci);
graph->SetMarkerStyle(20);
TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","npe values of flashes in event: 7",100,-2006.917,3671.932);
Graph_Graph8->SetMinimum(0);
Graph_Graph8->SetMaximum(154.06);
Graph_Graph8->SetDirectory(0);
Graph_Graph8->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph8->SetLineColor(ci);
Graph_Graph8->GetXaxis()->SetTitle("flash_t");
Graph_Graph8->GetXaxis()->SetLabelFont(42);
Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
Graph_Graph8->GetXaxis()->SetTitleFont(42);
Graph_Graph8->GetYaxis()->SetTitle("flash_npe");
Graph_Graph8->GetYaxis()->SetLabelFont(42);
Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
Graph_Graph8->GetYaxis()->SetTitleFont(42);
Graph_Graph8->GetZaxis()->SetLabelFont(42);
Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
Graph_Graph8->GetZaxis()->SetTitleFont(42);
graph->SetHistogram(Graph_Graph8);
graph->Draw("ap");
TPaveText *pt = new TPaveText(0.1823077,0.9368947,0.8176923,0.995,"blNDC");
pt->SetName("title");
pt->SetBorderSize(0);
pt->SetFillColor(0);
pt->SetFillStyle(0);
pt->SetTextFont(42);
TText *AText = pt->AddText("npe values of flashes in event: 7");
pt->Draw();
c->Modified();
c->cd();
c->SetSelected(c);
}