本文整理汇总了C++中THStack::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ THStack::SetName方法的具体用法?C++ THStack::SetName怎么用?C++ THStack::SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THStack
的用法示例。
在下文中一共展示了THStack::SetName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ttbar_looseLep2Pt_logy
void ttbar_looseLep2Pt_logy()
{
//=========Macro generated from canvas: c1/c1
//========= (Sun Dec 11 15:16:17 2016) by ROOT version6.06/01
TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->SetHighLightColor(2);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.15);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.07);
c1->SetBottomMargin(0.13);
c1->SetFrameFillStyle(0);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad1
TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
pad1->Draw();
pad1->cd();
pad1->Range(-93.75,-6.459411,531.25,2.538922);
pad1->SetFillColor(0);
pad1->SetBorderMode(0);
pad1->SetBorderSize(2);
pad1->SetLogy();
pad1->SetTickx(1);
pad1->SetTicky(1);
pad1->SetLeftMargin(0.15);
pad1->SetRightMargin(0.05);
pad1->SetTopMargin(0.07);
pad1->SetBottomMargin(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
THStack *h = new THStack();
h->SetName("h");
h->SetTitle("");
h->SetMinimum(1.61613e-06);
h->SetMaximum(32.94396);
TH1F *h_stack_8 = new TH1F("h_stack_8","",20,0,500);
h_stack_8->SetMinimum(3.472076e-07);
h_stack_8->SetMaximum(81.10342);
h_stack_8->SetDirectory(0);
h_stack_8->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
h_stack_8->SetLineColor(ci);
h_stack_8->GetXaxis()->SetLabelFont(42);
h_stack_8->GetXaxis()->SetLabelOffset(0.007);
h_stack_8->GetXaxis()->SetTitleSize(0.05);
h_stack_8->GetXaxis()->SetTickLength(0.025);
h_stack_8->GetXaxis()->SetTitleFont(42);
h_stack_8->GetYaxis()->SetTitle("a.u./25 GeV");
h_stack_8->GetYaxis()->SetLabelFont(42);
h_stack_8->GetYaxis()->SetLabelOffset(0.007);
h_stack_8->GetYaxis()->SetTitleSize(0.05);
h_stack_8->GetYaxis()->SetTickLength(0.025);
h_stack_8->GetYaxis()->SetTitleOffset(1.5);
h_stack_8->GetYaxis()->SetTitleFont(42);
h_stack_8->GetZaxis()->SetLabelFont(42);
h_stack_8->GetZaxis()->SetLabelOffset(0.007);
h_stack_8->GetZaxis()->SetTitleSize(0.05);
h_stack_8->GetZaxis()->SetTickLength(0.025);
h_stack_8->GetZaxis()->SetTitleFont(42);
h->SetHistogram(h_stack_8);
TH1D *h_looseLep2Pt_QCD__85 = new TH1D("h_looseLep2Pt_QCD__85","",20,0,500);
h_looseLep2Pt_QCD__85->SetBinContent(1,0.004168645);
h_looseLep2Pt_QCD__85->SetBinContent(2,0.004299542);
h_looseLep2Pt_QCD__85->SetBinContent(3,0.001765161);
h_looseLep2Pt_QCD__85->SetBinContent(4,0.0008868067);
h_looseLep2Pt_QCD__85->SetBinContent(6,0.0004026872);
h_looseLep2Pt_QCD__85->SetBinContent(7,6.27175e-05);
h_looseLep2Pt_QCD__85->SetBinError(1,0.001669574);
h_looseLep2Pt_QCD__85->SetBinError(2,0.002080688);
h_looseLep2Pt_QCD__85->SetBinError(3,0.001425843);
h_looseLep2Pt_QCD__85->SetBinError(4,0.0005754946);
h_looseLep2Pt_QCD__85->SetBinError(6,0.0004026872);
h_looseLep2Pt_QCD__85->SetBinError(7,4.443558e-05);
h_looseLep2Pt_QCD__85->SetEntries(25);
h_looseLep2Pt_QCD__85->SetStats(0);
ci = TColor::GetColor("#cccccc");
h_looseLep2Pt_QCD__85->SetFillColor(ci);
h_looseLep2Pt_QCD__85->GetXaxis()->SetTitle("Sub-leading lep p_{T} [GeV]");
h_looseLep2Pt_QCD__85->GetXaxis()->SetLabelFont(42);
h_looseLep2Pt_QCD__85->GetXaxis()->SetLabelOffset(0.007);
h_looseLep2Pt_QCD__85->GetXaxis()->SetTitleSize(0.05);
h_looseLep2Pt_QCD__85->GetXaxis()->SetTickLength(0.025);
//.........这里部分代码省略.........
示例2: ttbar_isojet1CSV
void ttbar_isojet1CSV()
{
//=========Macro generated from canvas: c1/c1
//========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01
TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->SetHighLightColor(2);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.15);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.07);
c1->SetBottomMargin(0.13);
c1->SetFrameFillStyle(0);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad1
TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
pad1->Draw();
pad1->cd();
pad1->Range(-0.1875,0,1.0625,0.6289089);
pad1->SetFillColor(0);
pad1->SetBorderMode(0);
pad1->SetBorderSize(2);
pad1->SetTickx(1);
pad1->SetTicky(1);
pad1->SetLeftMargin(0.15);
pad1->SetRightMargin(0.05);
pad1->SetTopMargin(0.07);
pad1->SetBottomMargin(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
THStack *h = new THStack();
h->SetName("h");
h->SetTitle("");
h->SetMinimum(0);
h->SetMaximum(0.5570336);
TH1F *h_stack_23 = new TH1F("h_stack_23","",10,0,1);
h_stack_23->SetMinimum(0);
h_stack_23->SetMaximum(0.5848853);
h_stack_23->SetDirectory(0);
h_stack_23->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
h_stack_23->SetLineColor(ci);
h_stack_23->GetXaxis()->SetLabelFont(42);
h_stack_23->GetXaxis()->SetLabelOffset(0.007);
h_stack_23->GetXaxis()->SetTitleSize(0.05);
h_stack_23->GetXaxis()->SetTickLength(0.025);
h_stack_23->GetXaxis()->SetTitleFont(42);
h_stack_23->GetYaxis()->SetTitle("a.u.");
h_stack_23->GetYaxis()->SetLabelFont(42);
h_stack_23->GetYaxis()->SetLabelOffset(0.007);
h_stack_23->GetYaxis()->SetTitleSize(0.05);
h_stack_23->GetYaxis()->SetTickLength(0.025);
h_stack_23->GetYaxis()->SetTitleOffset(1.5);
h_stack_23->GetYaxis()->SetTitleFont(42);
h_stack_23->GetZaxis()->SetLabelFont(42);
h_stack_23->GetZaxis()->SetLabelOffset(0.007);
h_stack_23->GetZaxis()->SetTitleSize(0.05);
h_stack_23->GetZaxis()->SetTickLength(0.025);
h_stack_23->GetZaxis()->SetTitleFont(42);
h->SetHistogram(h_stack_23);
TH1D *h_isojet1CSV_QCD__265 = new TH1D("h_isojet1CSV_QCD__265","",10,0,1);
h_isojet1CSV_QCD__265->SetBinContent(1,0.002129117);
h_isojet1CSV_QCD__265->SetBinContent(2,0.001248327);
h_isojet1CSV_QCD__265->SetBinContent(3,0.0006205357);
h_isojet1CSV_QCD__265->SetBinContent(4,0.001430306);
h_isojet1CSV_QCD__265->SetBinContent(5,0.001031553);
h_isojet1CSV_QCD__265->SetBinContent(6,0.0005098467);
h_isojet1CSV_QCD__265->SetBinContent(7,0.0002095089);
h_isojet1CSV_QCD__265->SetBinContent(8,9.216642e-05);
h_isojet1CSV_QCD__265->SetBinContent(10,0.004314199);
h_isojet1CSV_QCD__265->SetBinError(1,0.001510477);
h_isojet1CSV_QCD__265->SetBinError(2,0.0006911766);
h_isojet1CSV_QCD__265->SetBinError(3,0.0004578373);
h_isojet1CSV_QCD__265->SetBinError(4,0.0008388365);
h_isojet1CSV_QCD__265->SetBinError(5,0.0008715622);
h_isojet1CSV_QCD__265->SetBinError(6,0.0005098467);
h_isojet1CSV_QCD__265->SetBinError(7,0.0002095089);
h_isojet1CSV_QCD__265->SetBinError(8,9.216642e-05);
h_isojet1CSV_QCD__265->SetBinError(10,0.002213733);
h_isojet1CSV_QCD__265->SetEntries(25);
h_isojet1CSV_QCD__265->SetStats(0);
ci = TColor::GetColor("#cccccc");
h_isojet1CSV_QCD__265->SetFillColor(ci);
//.........这里部分代码省略.........
示例3: plot_config_combsignal_category_monojet
void plot_config_combsignal_category_monojet()
{
//=========Macro generated from canvas: c_0/c_0
//========= (Wed Mar 2 17:34:36 2016) by ROOT version6.07/03
TCanvas *c_0 = new TCanvas("c_0", "c_0",0,0,800,800);
gStyle->SetOptStat(0);
c_0->SetHighLightColor(2);
c_0->Range(0,0,1,1);
c_0->SetFillColor(0);
c_0->SetBorderMode(0);
c_0->SetBorderSize(2);
c_0->SetFrameBorderMode(0);
// ------------>Primitives in pad: p1
TPad *p1 = new TPad("p1", "p1",0,0.28,1,1);
p1->Draw();
p1->cd();
p1->Range(99.99999,-1.766386,1100,4.975187);
p1->SetFillColor(0);
p1->SetBorderMode(0);
p1->SetBorderSize(2);
p1->SetLogy();
p1->SetBottomMargin(0.01);
p1->SetFrameBorderMode(0);
p1->SetFrameBorderMode(0);
Double_t xAxis1[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000};
TH1F *QCD_FITTY__1 = new TH1F("QCD_FITTY__1","",16, xAxis1);
QCD_FITTY__1->SetBinContent(1,5.692051);
QCD_FITTY__1->SetBinContent(2,0.6079234);
QCD_FITTY__1->SetBinContent(3,0.1364834);
QCD_FITTY__1->SetBinContent(5,0.1015811);
QCD_FITTY__1->SetBinError(1,4.740265);
QCD_FITTY__1->SetBinError(2,0.2887402);
QCD_FITTY__1->SetBinError(3,0.1318165);
QCD_FITTY__1->SetBinError(5,0.1015811);
QCD_FITTY__1->SetMinimum(0.02);
QCD_FITTY__1->SetMaximum(20000);
QCD_FITTY__1->SetEntries(93114);
TF1 *func1 = new TF1("func","[0]*(TMath::Exp(-[1]*x))",200,1000);
func1->SetFillColor(19);
func1->SetFillStyle(0);
func1->SetLineColor(2);
func1->SetLineWidth(2);
func1->SetChisquare(1.944907);
func1->SetNDF(14);
func1->GetXaxis()->SetLabelFont(42);
func1->GetXaxis()->SetLabelSize(0.035);
func1->GetXaxis()->SetTitleSize(0.035);
func1->GetXaxis()->SetTitleFont(42);
func1->GetYaxis()->SetLabelFont(42);
func1->GetYaxis()->SetLabelSize(0.035);
func1->GetYaxis()->SetTitleSize(0.035);
func1->GetYaxis()->SetTitleFont(42);
func1->SetParameter(0,18385.94);
func1->SetParError(0,68314.65);
func1->SetParLimits(0,0,0);
func1->SetParameter(1,0.03609646);
func1->SetParError(1,0.01573978);
func1->SetParLimits(1,0,0);
QCD_FITTY__1->GetListOfFunctions()->Add(func1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
QCD_FITTY__1->SetLineColor(ci);
QCD_FITTY__1->GetXaxis()->SetLabelFont(42);
QCD_FITTY__1->GetXaxis()->SetLabelSize(0);
QCD_FITTY__1->GetXaxis()->SetTitleSize(0.035);
QCD_FITTY__1->GetXaxis()->SetTitleFont(42);
QCD_FITTY__1->GetYaxis()->SetTitle("Events/GeV");
QCD_FITTY__1->GetYaxis()->SetLabelFont(42);
QCD_FITTY__1->GetYaxis()->SetLabelSize(0.045);
QCD_FITTY__1->GetYaxis()->SetTitleSize(0.05);
QCD_FITTY__1->GetYaxis()->SetTitleOffset(0.9);
QCD_FITTY__1->GetYaxis()->SetTitleFont(42);
QCD_FITTY__1->GetZaxis()->SetLabelFont(42);
QCD_FITTY__1->GetZaxis()->SetLabelSize(0.035);
QCD_FITTY__1->GetZaxis()->SetTitleSize(0.035);
QCD_FITTY__1->GetZaxis()->SetTitleFont(42);
QCD_FITTY__1->Draw("");
THStack *bkg = new THStack();
bkg->SetName("bkg");
bkg->SetTitle("");
Double_t xAxis2[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000};
TH1F *bkg_stack_1 = new TH1F("bkg_stack_1","",16, xAxis2);
bkg_stack_1->SetMinimum(0.4825172);
bkg_stack_1->SetMaximum(1930.069);
bkg_stack_1->SetDirectory(0);
bkg_stack_1->SetStats(0);
ci = TColor::GetColor("#000099");
bkg_stack_1->SetLineColor(ci);
bkg_stack_1->GetXaxis()->SetLabelFont(42);
bkg_stack_1->GetXaxis()->SetLabelSize(0.035);
bkg_stack_1->GetXaxis()->SetTitleSize(0.035);
bkg_stack_1->GetXaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
示例4: plot
//.........这里部分代码省略.........
hFrame->SetDirectory(0);
hFrame->SetStats(0);
hFrame->SetLineStyle(0);
hFrame->SetMarkerStyle(20);
hFrame->SetXTitle("Transverse mass (#tau jet, E_{T}^{miss}), (GeV/c^{2})");
if (paperStatus)
hFrame->SetXTitle("Transverse mass (#tau_{h}, E_{T}^{miss}), (GeV/c^{2})");
hFrame->SetYTitle("Events / 20 GeV/c^{2}");
hFrame->GetXaxis()->SetTitleSize(0);
hFrame->GetXaxis()->SetLabelSize(0);
hFrame->GetYaxis()->SetTitleFont(43);
hFrame->GetYaxis()->SetTitleSize(27);
hFrame->GetYaxis()->SetTitleOffset(1.3);
// signal
hh->Scale(br*br);
hw->Scale(2*br*(1.0-br));
TH1* signal = (TH1*)hh->Clone();
signal->Add(hw);
ci = TColor::GetColor("#ff3399");
signal->SetLineColor(ci);
signal->SetLineStyle(2);
signal->SetLineWidth(2);
// Fakes
TH1* fakes = (TH1*)(fakett->Clone());
fakes->Add(fakeW);
fakes->Add(faket);
// stacked backgrounds
THStack *exp = new THStack();
exp->SetName("exp");
exp->SetTitle("exp");
exp->Add(fakes);
exp->Add(ewktau);
exp->Add(qcd);
exp->Add(signal);
TH1* hExpBkg = (TH1*)fakes->Clone();
hExpBkg->Add(ewktau);
hExpBkg->Add(qcd);
// uncertainty
TH1* uncert = (TH1*)fakeW->Clone();
uncert->Add(fakett);
uncert->Add(ewktau);
uncert->Add(qcd);
uncert->SetFillColor(1);
uncert->SetFillStyle(3344);
uncert->SetLineColor(0);
uncert->SetLineStyle(0);
uncert->SetLineWidth(0);
TH1* hExpBkgTotalUncert = (TH1*)uncert->Clone();
hExpBkgTotalUncert->SetFillStyle(3354);
TH1* hAgreement = (TH1*)data->Clone();
hAgreement->Divide(hExpBkg);
TGraphErrors* hAgreementRelUncert = new TGraphErrors(hAgreement->GetNbinsX());
hAgreementRelUncert->SetLineWidth(2);
hAgreementRelUncert->SetLineColor(kBlack);
for (int i = 1; i <= hFrame->GetNbinsX(); ++i) {
double myQCDTotalUncert = TMath::Power(qcd->GetBinError(i), 2)
+ TMath::Power(qcd->GetBinContent(i)*myQCDRelUncert, 2);
示例5: plotStack
void stackPlotter::plotStack(const TString& key, legendposition legpos) {
if(debug)
std::cout << "stackPlotter::plotStack" << std::endl;
std::vector<std::pair<Int_t,TH1*> > legEntries = stacksLegEntries_[key];
if(legEntries.size()<1) return;
TCanvas *c = new TCanvas(key,key,800,600);
TLegend *leg = new TLegend(0.75,0.75,0.95,0.95); //will be overwritten by style!
THStack *stack = new THStack();
//determine legend position TBI (add all histos, look at mean and max values etc)
//float max=stack->GetMaximum(); //unfortunately no mean function also not filled, yet.
//needs another loop on histos
TH1 * h=(TH1 *) legEntries.at(0).second->Clone();
for(size_t i=1;i<legEntries.size();i++){
h->Add(legEntries.at(i).second);
}
// int maxbin=h->GetMaximumBin();
//int minbin=h->GetMinimumBin();
// float ymax=h->GetBinContent(maxbin);
//float ymin=h->GetBinContent(minbin);
//pass this to the style functions
delete h;
//gStyle->SetOptTitle(0);//no title
for(size_t i=0; i < legEntries.size(); i++) {
TString legName = legEntries.at(i).second->GetName();
if(legName == "") continue;
applyStyleToTH1(legEntries.at(i).second,legpos);
stack->Add(legEntries.at(i).second,"HIST");
stack->SetTitle("");//legEntries.at(i).second->GetTitle());
stack->SetName(legEntries.at(i).second->GetTitle());
//mirror entry for legend
leg->AddEntry(legEntries.at(legEntries.size()-1-i).second,
legEntries.at(legEntries.size()-1-i).second->GetName(),
"F");
}
// draw plot and legend
c->cd();
applyStyleToCanvas(c,legpos);
stack->Draw();
stack->GetXaxis()->SetTitle(legEntries.at(0).second->GetXaxis()->GetTitle());
stack->GetYaxis()->SetTitle(legEntries.at(0).second->GetYaxis()->GetTitle());
applyStyleToAxis(stack,legpos);
applyStyleToLegend(leg,legpos);
stack->Draw();
leg->Draw();
//c->BuildLegend();
// save and exit
if(saveplots_) {
c->SaveAs(outdir_+"/"+key+".pdf");
c->SaveAs(outdir_+"/"+key+".png");
}
if(savecanvases_ && outfile_) {
outfile_->cd();
c->Write();
}
delete stack;
delete leg;
delete c;
}
示例6: ttbar_nJet
void ttbar_nJet()
{
//=========Macro generated from canvas: c1/c1
//========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01
TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->SetHighLightColor(2);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.15);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.07);
c1->SetBottomMargin(0.13);
c1->SetFrameFillStyle(0);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad1
TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
pad1->Draw();
pad1->cd();
pad1->Range(-2.1875,0,9.0625,0.5878968);
pad1->SetFillColor(0);
pad1->SetBorderMode(0);
pad1->SetBorderSize(2);
pad1->SetTickx(1);
pad1->SetTicky(1);
pad1->SetLeftMargin(0.15);
pad1->SetRightMargin(0.05);
pad1->SetTopMargin(0.07);
pad1->SetBottomMargin(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
THStack *h = new THStack();
h->SetName("h");
h->SetTitle("");
h->SetMinimum(0);
h->SetMaximum(0.5207086);
TH1F *h_stack_19 = new TH1F("h_stack_19","",9,-0.5,8.5);
h_stack_19->SetMinimum(0);
h_stack_19->SetMaximum(0.546744);
h_stack_19->SetDirectory(0);
h_stack_19->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
h_stack_19->SetLineColor(ci);
h_stack_19->GetXaxis()->SetLabelFont(42);
h_stack_19->GetXaxis()->SetLabelOffset(0.007);
h_stack_19->GetXaxis()->SetTitleSize(0.05);
h_stack_19->GetXaxis()->SetTickLength(0.025);
h_stack_19->GetXaxis()->SetTitleFont(42);
h_stack_19->GetYaxis()->SetTitle("a.u.");
h_stack_19->GetYaxis()->SetLabelFont(42);
h_stack_19->GetYaxis()->SetLabelOffset(0.007);
h_stack_19->GetYaxis()->SetTitleSize(0.05);
h_stack_19->GetYaxis()->SetTickLength(0.025);
h_stack_19->GetYaxis()->SetTitleOffset(1.5);
h_stack_19->GetYaxis()->SetTitleFont(42);
h_stack_19->GetZaxis()->SetLabelFont(42);
h_stack_19->GetZaxis()->SetLabelOffset(0.007);
h_stack_19->GetZaxis()->SetTitleSize(0.05);
h_stack_19->GetZaxis()->SetTickLength(0.025);
h_stack_19->GetZaxis()->SetTitleFont(42);
h->SetHistogram(h_stack_19);
TH1D *h_nJet_QCD__217 = new TH1D("h_nJet_QCD__217","",9,-0.5,8.5);
h_nJet_QCD__217->SetBinContent(2,0.001991738);
h_nJet_QCD__217->SetBinContent(3,0.0005078625);
h_nJet_QCD__217->SetBinContent(4,0.006489724);
h_nJet_QCD__217->SetBinContent(5,0.001899386);
h_nJet_QCD__217->SetBinContent(6,0.000696849);
h_nJet_QCD__217->SetBinError(2,0.001424948);
h_nJet_QCD__217->SetBinError(3,0.0005078625);
h_nJet_QCD__217->SetBinError(4,0.00246407);
h_nJet_QCD__217->SetBinError(5,0.001037545);
h_nJet_QCD__217->SetBinError(6,0.0004566736);
h_nJet_QCD__217->SetEntries(25);
h_nJet_QCD__217->SetStats(0);
ci = TColor::GetColor("#cccccc");
h_nJet_QCD__217->SetFillColor(ci);
h_nJet_QCD__217->GetXaxis()->SetTitle("N_{jet}");
h_nJet_QCD__217->GetXaxis()->SetLabelFont(42);
h_nJet_QCD__217->GetXaxis()->SetLabelOffset(0.007);
h_nJet_QCD__217->GetXaxis()->SetTitleSize(0.05);
h_nJet_QCD__217->GetXaxis()->SetTickLength(0.025);
h_nJet_QCD__217->GetXaxis()->SetTitleFont(42);
h_nJet_QCD__217->GetYaxis()->SetTitle("a.u.");
h_nJet_QCD__217->GetYaxis()->SetLabelFont(42);
//.........这里部分代码省略.........
示例7: ttbar_jet1CSV
void ttbar_jet1CSV()
{
//=========Macro generated from canvas: c1/c1
//========= (Sun Dec 11 15:16:19 2016) by ROOT version6.06/01
TCanvas *c1 = new TCanvas("c1", "c1",1,1,1200,1416);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
c1->SetHighLightColor(2);
c1->Range(0,0,1,1);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.15);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.07);
c1->SetBottomMargin(0.13);
c1->SetFrameFillStyle(0);
c1->SetFrameBorderMode(0);
// ------------>Primitives in pad: pad1
TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
pad1->Draw();
pad1->cd();
pad1->Range(-0.1875,0,1.0625,0.5424993);
pad1->SetFillColor(0);
pad1->SetBorderMode(0);
pad1->SetBorderSize(2);
pad1->SetTickx(1);
pad1->SetTicky(1);
pad1->SetLeftMargin(0.15);
pad1->SetRightMargin(0.05);
pad1->SetTopMargin(0.07);
pad1->SetBottomMargin(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
pad1->SetFrameFillStyle(0);
pad1->SetFrameBorderMode(0);
THStack *h = new THStack();
h->SetName("h");
h->SetTitle("");
h->SetMinimum(0);
h->SetMaximum(0.4804993);
TH1F *h_stack_21 = new TH1F("h_stack_21","",10,0,1);
h_stack_21->SetMinimum(0);
h_stack_21->SetMaximum(0.5045243);
h_stack_21->SetDirectory(0);
h_stack_21->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
h_stack_21->SetLineColor(ci);
h_stack_21->GetXaxis()->SetLabelFont(42);
h_stack_21->GetXaxis()->SetLabelOffset(0.007);
h_stack_21->GetXaxis()->SetTitleSize(0.05);
h_stack_21->GetXaxis()->SetTickLength(0.025);
h_stack_21->GetXaxis()->SetTitleFont(42);
h_stack_21->GetYaxis()->SetTitle("a.u.");
h_stack_21->GetYaxis()->SetLabelFont(42);
h_stack_21->GetYaxis()->SetLabelOffset(0.007);
h_stack_21->GetYaxis()->SetTitleSize(0.05);
h_stack_21->GetYaxis()->SetTickLength(0.025);
h_stack_21->GetYaxis()->SetTitleOffset(1.5);
h_stack_21->GetYaxis()->SetTitleFont(42);
h_stack_21->GetZaxis()->SetLabelFont(42);
h_stack_21->GetZaxis()->SetLabelOffset(0.007);
h_stack_21->GetZaxis()->SetTitleSize(0.05);
h_stack_21->GetZaxis()->SetTickLength(0.025);
h_stack_21->GetZaxis()->SetTitleFont(42);
h->SetHistogram(h_stack_21);
TH1D *h_jet1CSV_QCD__241 = new TH1D("h_jet1CSV_QCD__241","",10,0,1);
h_jet1CSV_QCD__241->SetBinContent(1,0.001669958);
h_jet1CSV_QCD__241->SetBinContent(2,0.001297151);
h_jet1CSV_QCD__241->SetBinContent(3,0.0001985037);
h_jet1CSV_QCD__241->SetBinContent(4,0.001317617);
h_jet1CSV_QCD__241->SetBinContent(5,0.001460061);
h_jet1CSV_QCD__241->SetBinContent(6,0.0005098467);
h_jet1CSV_QCD__241->SetBinContent(8,9.216642e-05);
h_jet1CSV_QCD__241->SetBinContent(10,0.005040257);
h_jet1CSV_QCD__241->SetBinError(1,0.001015339);
h_jet1CSV_QCD__241->SetBinError(2,0.0006375418);
h_jet1CSV_QCD__241->SetBinError(3,0.0001985037);
h_jet1CSV_QCD__241->SetBinError(4,0.0007758122);
h_jet1CSV_QCD__241->SetBinError(5,0.0009604397);
h_jet1CSV_QCD__241->SetBinError(6,0.0005098467);
h_jet1CSV_QCD__241->SetBinError(8,9.216642e-05);
h_jet1CSV_QCD__241->SetBinError(10,0.002524985);
h_jet1CSV_QCD__241->SetEntries(25);
h_jet1CSV_QCD__241->SetStats(0);
ci = TColor::GetColor("#cccccc");
h_jet1CSV_QCD__241->SetFillColor(ci);
h_jet1CSV_QCD__241->GetXaxis()->SetTitle("jet 1 CSV");
h_jet1CSV_QCD__241->GetXaxis()->SetLabelFont(42);
//.........这里部分代码省略.........