本文整理汇总了C++中TLatex::SetLineWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TLatex::SetLineWidth方法的具体用法?C++ TLatex::SetLineWidth怎么用?C++ TLatex::SetLineWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLatex
的用法示例。
在下文中一共展示了TLatex::SetLineWidth方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Mbb_reg
int Mbb_reg(int type_int){
gROOT->ProcessLine(".x /afs/cern.ch/work/n/nchernya/setTDRStyle.C");
// int type_int; //double =0; single=1
TString type;
if (type_int==0) type = "_double";
if (type_int==1) type = "_single";
TString text_type;
if (type_int==0) text_type = "DoubleB";
if (type_int==1) text_type = "SingleB";
const int num_ss = 1;
// TString s_names[num_ss] = {"VBFHToBB_M-125_13TeV_powheg"};
TString s_names[num_ss] = {"vbf_76"};
TString tex_s_names[num_ss] = {"VBF powheg, m(H) = 125 GeV"};
TFile *file_s1 = new TFile("../output_hist/v14/golden/skimmed_tree_analysis"+type+s_names[0]+"_v14_final_74cmssw_woweight.root");
TH1F *hist_Mbb = (TH1F*)file_s1->Get("hMbb");
TH1F *hist_Mbb_reg = (TH1F*)file_s1->Get("hMbb_regVBF");
TH1F *hist_Mbb_reg_fsr = (TH1F*)file_s1->Get("hMbb_regVBF_fsr");
TF1 *gaus = new TF1("gaus","gaus",95,140);
gaus->SetLineColor(4);
gaus->SetLineWidth(1);
hist_Mbb->Sumw2(kFALSE);
hist_Mbb_reg->Sumw2(kFALSE);
hist_Mbb_reg_fsr->Sumw2(kFALSE);
hist_Mbb->Sumw2(kFALSE);
hist_Mbb->Fit(gaus,"R");
Float_t Mbb_mean = gaus->GetParameter(1);
Float_t Mbb_rms = gaus->GetParameter(2);
hist_Mbb_reg->Sumw2(kFALSE);
gaus->SetLineColor(2);
hist_Mbb_reg->Fit(gaus,"R");
Float_t Mbb_reg_mean = gaus->GetParameter(1);
Float_t Mbb_reg_rms = gaus->GetParameter(2);
hist_Mbb_reg_fsr->Sumw2(kFALSE);
gaus->SetLineColor(8);
hist_Mbb_reg_fsr->Fit(gaus,"R");
Float_t Mbb_reg_fsr_mean = gaus->GetParameter(1);
Float_t Mbb_reg_fsr_rms = gaus->GetParameter(2);
/////
/*
Float_t Mbb_mean = hist_Mbb->GetMean(1);
Float_t Mbb_rms = hist_Mbb->GetRMS(1);
Float_t Mbb_reg_mean = hist_Mbb_reg->GetMean(1);
Float_t Mbb_reg_rms = hist_Mbb_reg->GetRMS(1);
Float_t Mbb_reg_fsr_mean = hist_Mbb_reg_fsr->GetMean(1);
Float_t Mbb_reg_fsr_rms = hist_Mbb_reg_fsr->GetRMS(1);
*/
/////
TCanvas *c1 = new TCanvas();
c1->SetBottomMargin(.15);
c1->SetRightMargin(.25);
c1->cd();
TH1F *frame2 = new TH1F("frame2","",50,0.,230.);
frame2->SetMinimum(0.);
frame2->SetMaximum(hist_Mbb->GetMaximum()*1.6);
// if (type_int==1) frame2->SetMaximum(0.005);
frame2->SetStats(0);
frame2->SetYTitle("Events / 5 GeV");
frame2->SetXTitle("M_{bb} (GeV)");
frame2->GetYaxis()->SetNdivisions(505);
frame2->GetXaxis()->SetLabelSize(0.0);
frame2->GetXaxis()->SetTitleSize(0.05);
frame2->GetXaxis()->SetLabelSize(0.04);
frame2->Draw();
TLatex* tex = new TLatex(0.75,0.95,"13 TeV");
tex->SetNDC();
tex->SetTextAlign(35);
tex->SetTextFont(42);
tex->SetTextSize(0.035);
tex->SetLineWidth(2);
TLatex *tex1 = new TLatex(0.17,0.95,"CMS");
tex1->SetNDC();
tex1->SetTextAlign(20);
tex1->SetTextFont(61);
tex1->SetTextSize(0.04);
tex1->SetLineWidth(2);
TLatex* tex2 = new TLatex(0.25,0.89,"Work in progress");
tex2->SetNDC();
tex2->SetTextAlign(20);
tex2->SetTextFont(52);
tex2->SetTextSize(0.035);
tex2->SetLineWidth(2);
TLatex* tex_file = new TLatex(0.36,0.95,text_type);
tex_file->SetNDC();
tex_file->SetTextAlign(35);
tex_file->SetTextFont(42);
tex_file->SetTextSize(0.04);
tex_file->SetLineWidth(2);
//.........这里部分代码省略.........
示例2: TCanvas
//.........这里部分代码省略.........
mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2));
//mass->SetParError(0,f->GetParError(0));
//mass->SetParError(1,f->GetParError(1));
//mass->SetParError(2,f->GetParError(2));
mass->SetLineColor(2);
h->SetXTitle("m_{#mu#muK} (GeV/c^{2})");
h->SetYTitle("Entries / (5 MeV/c^{2})");
h->GetXaxis()->CenterTitle();
h->GetYaxis()->CenterTitle();
h->SetAxisRange(0,h->GetMaximum()*1.4*1.2,"Y");
h->GetXaxis()->SetTitleOffset(1.3);
h->GetYaxis()->SetTitleOffset(1.8);
h->GetXaxis()->SetLabelOffset(0.007);
h->GetYaxis()->SetLabelOffset(0.007);
h->GetXaxis()->SetTitleSize(0.045);
h->GetYaxis()->SetTitleSize(0.045);
h->GetXaxis()->SetTitleFont(42);
h->GetYaxis()->SetTitleFont(42);
h->GetXaxis()->SetLabelFont(42);
h->GetYaxis()->SetLabelFont(42);
h->GetXaxis()->SetLabelSize(0.04);
h->GetYaxis()->SetLabelSize(0.04);
h->SetMarkerSize(0.8);
h->SetMarkerStyle(20);
h->SetStats(0);
h->Draw("e");
background->Draw("same");
mass->SetRange(minhisto,maxhisto);
mass->Draw("same");
mass->SetLineStyle(2);
mass->SetFillStyle(3004);
mass->SetFillColor(2);
f->Draw("same");
Double_t yield = mass->Integral(minhisto,maxhisto)/binwidthmass;
Double_t yieldErr = mass->Integral(minhisto,maxhisto)/binwidthmass*mass->GetParError(0)/mass->GetParameter(0);
TLegend* leg = new TLegend(0.65,0.58,0.82,0.88,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextSize(0.04);
leg->SetTextFont(42);
leg->SetFillStyle(0);
leg->AddEntry(h,"Data","pl");
leg->AddEntry(f,"Fit","l");
leg->AddEntry(mass,"Peaking BG","f");
leg->AddEntry(background,"Combinatorial","l");
leg->Draw("same");
TLatex* texCms = new TLatex(0.18,0.93, "#scale[1.25]{CMS} Preliminary");
texCms->SetNDC();
texCms->SetTextAlign(12);
texCms->SetTextSize(0.04);
texCms->SetTextFont(42);
texCms->Draw();
TLatex* texCol;
if(collisionsystem=="pp"||collisionsystem=="PP") texCol= new TLatex(0.96,0.93, Form("%s #sqrt{s_{NN}} = 5.02 TeV","pp"));
else texCol= new TLatex(0.96,0.93, Form("%s #sqrt{s_{NN}} = 5.02 TeV","PbPb"));
texCol->SetNDC();
texCol->SetTextAlign(32);
texCol->SetTextSize(0.04);
texCol->SetTextFont(42);
texCol->Draw();
TLatex* tex;
tex = new TLatex(0.22,0.78,Form("%.1f < p_{T} < %.1f GeV/c",ptmin,ptmax));
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(0.04);
tex->SetLineWidth(2);
tex->Draw();
if(centMax>0){
TString texper="%";
tex = new TLatex(0.22,0.71,Form("Centrality %.0f-%.0f%s",centMin,centMax,texper.Data()));//0.2612903,0.8425793
tex->SetNDC();
tex->SetTextColor(1);
tex->SetTextFont(42);
tex->SetTextSize(0.045);
tex->SetLineWidth(2);
tex->Draw();
}
tex = new TLatex(0.22,0.83,"|y| < 2.4");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(0.04);
tex->SetLineWidth(2);
tex->Draw();
total=f;
h->Write();
f->Write();
if(!isPbPb) c->SaveAs(Form("plotNP/BMass%s_%d.pdf",collisionsystem.Data(),count));
else c->SaveAs(Form("plotNP/BMass%s_%.0f_%.0f_%d.pdf",collisionsystem.Data(),centMin,centMax,count));
return mass;
}
示例3: myPlot
//.........这里部分代码省略.........
h_data->Reset();
h_data->Add(h_data0);
h_data->Add(h_data1);
TH1D* h_DY = (TH1D*)h_DY100->Clone("h_DY");
h_DY->Reset();
h_DY->Add(h_DY100, scaleDY100);
h_DY->Add(h_DY200, scaleDY200);
h_DY->Add(h_DY400, scaleDY400);
h_DY->Add(h_DY600, scaleDY600);
h_DY->SetFillColor(kOrange-3);
h_DY->SetLineColor(kBlack);
h_TTbar->Scale(scaleTTbar);
h_TTbar->SetFillColor(kGreen);
h_TTbar->SetLineColor(kBlack);
h_WW->Scale(scaleWW);
h_WW->SetFillColor(kYellow);
h_WW->SetLineColor(kBlack);
h_WZ->Scale(scaleWZ);
h_WZ->SetFillColor(kCyan);
h_WZ->SetLineColor(kBlack);
h_ZZ->Scale(scaleZZ);
h_ZZ->SetFillColor(kPink);
h_ZZ->SetLineColor(kBlack);
h_bkg->Reset();
h_bkg->Add(h_DY);
h_bkg->Add(h_TTbar);
h_bkg->Add(h_WW);
h_bkg->Add(h_WZ);
h_bkg->Add(h_ZZ);
THStack *h_stack = new THStack("h_stack", "");
h_stack->Add(h_DY);
h_stack->Add(h_TTbar);
h_stack->Add(h_WW);
h_stack->Add(h_WZ);
h_stack->Add(h_ZZ);
h_data->SetLineColor(kBlack);
h_data->SetMarkerStyle(8);
h_data->SetMarkerSize(1.5);
h_data->GetYaxis()->SetTitleOffset(1.3);
h_data->GetXaxis()->SetTitle("");
h_data->GetXaxis()->SetLabelOffset(999);
h_data->GetXaxis()->SetLabelSize(0);
if( h_data->GetMaximum() < h_stack->GetMaximum() ){
h_stack->Draw("histe");
h_stack->GetHistogram()->GetYaxis()->SetTitle("Event Numbers");
h_stack->GetHistogram()->GetYaxis()->SetTitleSize(h_data->GetYaxis()->GetTitleSize());
h_stack->GetHistogram()->GetYaxis()->SetLabelSize(h_data->GetYaxis()->GetLabelSize());
h_stack->GetHistogram()->GetYaxis()->SetTitleOffset(1.3);
h_stack->GetHistogram()->GetXaxis()->SetTickLength(0);
h_stack->GetHistogram()->GetXaxis()->SetLabelOffset(999);
h_data->Draw("elsame");
}
else{
h_data->GetYaxis()->SetTitle("Event Numbers");
h_data->Draw("el");
h_stack->Draw("histesame");
h_data->Draw("elsame");
}
TLegend *leg = new TLegend(0.73, 0.60, 0.90, 0.87);
leg->SetBorderSize(0);
leg->SetFillColor(0);
leg->SetFillStyle(0);
leg->SetTextSize(0.04);
leg->AddEntry(h_DY, "DY+Jets", "f");
leg->AddEntry(h_TTbar, "t#bar{t}", "f");
leg->AddEntry(h_WW, "WW", "f");
leg->AddEntry(h_WZ, "WZ", "f");
leg->AddEntry(h_ZZ, "ZZ", "f");
leg->AddEntry(h_data, "Data", "lp");
leg->Draw();
TLatex *lar = new TLatex();
lar->SetNDC(kTRUE);
lar->SetTextSize(0.04);
lar->SetLineWidth(5);
lar->DrawLatex(0.14, 0.94, "CMS preliminary 2015");
lar->DrawLatex(0.63, 0.94, "L = 2.08 fb^{-1} at #sqrt{s} = 13 TeV");
}
示例4: Polarization
void Polarization(){
TGraph *gObs;
TGraph *gExp;
TGraph *gObsL;
TGraph *gExpL;
TGraph *gObsR;
TGraph *gExpR;
TFile *fc = TFile::Open("Limits2DHistograms_T2tt_postfit.root");
TFile *fl = TFile::Open("Limits2DHistograms_T2tt_lefthanded_postfit.root");
TFile *fr = TFile::Open("Limits2DHistograms_T2tt_righthanded_postfit.root");
TGraph *g;
fc->cd();
g = (TGraph*)fc->Get("gObs");
gObs = (TGraph*)g->Clone("Obs");
g = (TGraph*)fc->Get("gExp");
gExp = (TGraph*)g->Clone("Exp");
fl->cd();
g = (TGraph*)fl->Get("gObs_2");
gObsL = (TGraph*)g->Clone("ObsL");
g = (TGraph*)fl->Get("gExp_2");
gExpL = (TGraph*)g->Clone("ExpL");
fr->cd();
g = (TGraph*)fr->Get("gObs");
gObsR = (TGraph*)g->Clone("ObsR");
g = (TGraph*)fr->Get("gExp");
gExpR = (TGraph*)g->Clone("ExpR");
gObs->SetLineWidth(4);
gExp->SetLineWidth(4);
gObsL->SetLineWidth(2);
gExpL->SetLineWidth(2);
gObsR->SetLineWidth(2);
gExpR->SetLineWidth(2);
gObs->SetLineStyle(1);
gExp->SetLineStyle(7);
gObsL->SetLineStyle(1);
gExpL->SetLineStyle(7);
gObsR->SetLineStyle(1);
gExpR->SetLineStyle(7);
gObs->SetLineColor(kBlack);
gExp->SetLineColor(kBlack);
gObsL->SetLineColor(kBlue);
gExpL->SetLineColor(kBlue);
gObsR->SetLineColor(kRed);
gExpR->SetLineColor(kRed);
if(killlowdiag){
for( int i = gObs->GetN()-1; i>=0;--i){
double x,y;
gObs->GetPoint(i,x,y);
if(x-y<172.5) gObs->RemovePoint(i);
}
for( int i = gExp->GetN()-1; i>=0;--i){
double x,y;
gExp->GetPoint(i,x,y);
if(x-y<172.5) gExp->RemovePoint(i);
}
}
for( int i = gObsL->GetN()-1; i>=0;--i){
double x,y;
gObsL->GetPoint(i,x,y);
if(x-y<172.5) gObsL->RemovePoint(i);
}
for( int i = gObsR->GetN()-1; i>=0;--i){
double x,y;
gObsR->GetPoint(i,x,y);
if(x-y<172.5) gObsR->RemovePoint(i);
}
for( int i = gExpL->GetN()-1; i>=0;--i){
double x,y;
gExpL->GetPoint(i,x,y);
if(x-y<172.5) gExpL->RemovePoint(i);
}
for( int i = gExpR->GetN()-1; i>=0;--i){
double x,y;
gExpR->GetPoint(i,x,y);
if(x-y<172.5) gExpR->RemovePoint(i);
}
TCanvas *c1 = new TCanvas("c1", "c1",50,50,600,600);
gStyle->SetOptFit(1);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetErrorX(0.5);
//c1->Range(-6.311689,-1.891383,28.75325,4.56342);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
//c1->SetLogy();
c1->SetTickx(1);
c1->SetTicky(1);
c1->SetLeftMargin(0.15);
c1->SetRightMargin(0.05);
c1->SetTopMargin(0.07);
c1->SetBottomMargin(0.15);
c1->SetFrameFillStyle(0);
c1->SetFrameBorderMode(0);
//.........这里部分代码省略.........
示例5: SignfificanceT2tt
//.........这里部分代码省略.........
hSum->Draw();
hSum->GetYaxis()->SetRangeUser(0,500);
hSum->GetXaxis()->SetRangeUser(100,900);
Int_t ci; // for color index setting
ci = TColor::GetColor("#000099");
hSum->SetLineColor(ci);
hSum->SetLineStyle(0);
hSum->SetMarkerStyle(20);
hSum->GetXaxis()->SetTitle("m_{#tilde{t}} [GeV]");
//hSum->GetXaxis()->SetBit(TAxis::kLabelsVert);
hSum->GetXaxis()->SetLabelFont(42);
//hSum->GetXaxis()->SetLabelOffset(0.005);
hSum->GetXaxis()->SetLabelSize(0.035);
hSum->GetXaxis()->SetTitleSize(0.06);
hSum->GetXaxis()->SetTitleOffset(1.2);
hSum->GetXaxis()->SetTitleFont(42);
hSum->GetYaxis()->SetTitle("m_{#tilde{#chi}}_{1}^{0} [GeV]");
hSum->GetYaxis()->SetLabelFont(42);
//hSum->GetYaxis()->SetLabelOffset(0.007);
hSum->GetYaxis()->SetLabelSize(0.035);
hSum->GetYaxis()->SetTitleSize(0.05);
hSum->GetYaxis()->SetTitleOffset(1.3);
hSum->GetYaxis()->SetTitleFont(42);
/*
TLegend *legO = new TLegend(0.175,0.675,0.50,0.855,NULL,"brNDC");
//legO-> SetNColumns(2);
legO->SetBorderSize(0);
legO->SetTextSize(0.04);
legO->SetTextFont(42);
legO->SetLineColor(1);
legO->SetLineStyle(1);
legO->SetLineWidth(2);
legO->SetFillColor(0);
legO->SetFillStyle(1001);
legO->SetHeader("Observed");
legO->AddEntry(gObs, "unpolarized","l");
legO->AddEntry(gObsR, "right-handed","l");
legO->AddEntry(gObsL, "left-handed","l");
*/
TGraph* graphWhite = new TGraph(5);
graphWhite->SetName("white");
graphWhite->SetTitle("white");
graphWhite->SetFillColor(kWhite);
graphWhite->SetFillStyle(1001);
graphWhite->SetLineColor(kBlack);
graphWhite->SetLineStyle(1);
graphWhite->SetLineWidth(3);
graphWhite->SetPoint(0,100, 500);
graphWhite->SetPoint(1,900, 500);
graphWhite->SetPoint(2,900, 500*0.75);
graphWhite->SetPoint(3,100, 500*0.75);
graphWhite->SetPoint(4,100, 500);
Float_t diagX[4] = {175.+25.,175.+25.+5000,175.-25.+5000,175.-25.};
Float_t diagY[4] = {0,5000,5000,0};
TGraph *gdiagonal = new TGraph(4, diagX, diagY);
gdiagonal->SetName("MtopDiagonal");
gdiagonal->SetFillColor(kWhite);
//#gdiagonal->SetFillColor(18);
TLine* ldiagonal = new TLine(175,0.,650-25.,450);
//TLine* ldiagonal = new TLine(175.,25,175+500,500);
ldiagonal->SetLineColor(kGray);
ldiagonal->SetLineStyle(2);
示例6: postprocess
void postprocess(TCanvas* c2, const char* name, Int_t rWrite, Int_t rPerformance,const char* system) {
if (rPerformance){
TLatex *alice = new TLatex(0.22,0.57,"Pb-Pb #sqrt{s_{NN}} = 2.76 TeV");
alice->SetNDC();
alice->SetTextColor(myDarkRed);
// alice->SetTextFont(42);
alice->SetTextSize(0.05);
alice->SetLineWidth(2);
alice->Draw();
TLatex *alice2 = new TLatex(0.62,0.41,"LHC10h - Pass2");
alice2->SetNDC();
alice2->SetTextColor(myDarkRed);
// alice->SetTextFont(42);
alice2->SetTextSize(0.05);
alice2->SetLineWidth(2);
// alice2->Draw();
TDatime now;
int iDate = now.GetDate();
int iYear=iDate/10000;
int iMonth=(iDate%10000)/100;
int iDay=iDate%100;
char* cMonth[12]={"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"};
char cStamp1[25],cStamp2[25];
sprintf(cStamp1,"%i %s %i",iDay, cMonth[iMonth-1], iYear);
sprintf(cStamp2,"%i/%.2d/%i",iDay, iMonth, iYear);
TText *date = new TText(0.67,0.48,cStamp2);
date->SetNDC();
date->SetTextFont(42);
date->SetTextSize(0.04);
date->Draw();
// //Acquire canvas proportions
// Double_t AliLogo_LowX = 0.67;
// Double_t AliLogo_LowY = 0.53;
// Double_t AliLogo_Height = 0.22;
// //ALICE logo is a png file that is 821x798 pixels->should be wider than a square
// Double_t AliLogo_Width = (821./798.) * AliLogo_Height * gPad->GetWh() / gPad->GetWw();
// TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo",AliLogo_LowX,AliLogo_LowY,AliLogo_LowX+AliLogo_Width,AliLogo_LowY+AliLogo_Height);
// // myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
// myPadSetUp(myPadLogo,0,0,0,0);
// //myPadLogo->SetFixedAspectRatio(1);
// myPadLogo->Draw();
// myPadLogo->cd();
// // TASImage *myAliceLogo = new TASImage("alice_performance.png");
// TASImage *myAliceLogo = new TASImage("alice_performance.eps");
// // TASImage *myAliceLogo = new TASImage("alice_logo_transparent.png");
// myAliceLogo->Draw();
DrawALICELogo(0,0.65,0.52,0.8,0.8);
}
if (rWrite == 1){
c2->SaveAs(Form("%s_%s.png",name,system));
//}
//if (rWrite == 2)
c2->SaveAs(Form("%s.eps",name));
}
}
示例7: fit
TF1* fit(Double_t ptmin, Double_t ptmax)
{
TCanvas* c = new TCanvas(Form("c_%.0f_%.0f",ptmin,ptmax),"",600,600);
TFile* infile = new TFile(Form("%s_%s_%.0f_%.0f.root",infname.Data(),collisionsystem.Data(),ptmin,ptmax));
TH1D* h = (TH1D*)infile->Get("h"); h->SetName(Form("h_%.0f_%.0f",ptmin,ptmax));
TH1D* hMCSignal = (TH1D*)infile->Get("hMCSignal"); hMCSignal->SetName(Form("hMCSignal_%.0f_%.0f",ptmin,ptmax));
TH1D* hMCSwapped = (TH1D*)infile->Get("hMCSwapped"); hMCSwapped->SetName(Form("hMCSwapped_%.0f_%.0f",ptmin,ptmax));
TF1* f = new TF1(Form("f_%.0f_%.0f",ptmin,ptmax),"[0]*([7]*([9]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2])+(1-[9])*Gaus(x,[1],[10])/(sqrt(2*3.14159)*[10]))+(1-[7])*Gaus(x,[1],[8])/(sqrt(2*3.14159)*[8]))+[3]*exp([4]*x)", 1.7, 2.0);
f->SetParLimits(10,0.001,0.05);
f->SetParLimits(2,0.01,0.1);
f->SetParLimits(8,0.02,0.2);
f->SetParLimits(7,0,1);
f->SetParLimits(9,0,1);
f->SetParameter(0,setparam0);
f->SetParameter(1,setparam1);
f->SetParameter(2,setparam2);
f->SetParameter(10,setparam10);
f->SetParameter(9,setparam9);
f->FixParameter(8,setparam8);
f->FixParameter(7,1);
f->FixParameter(1,fixparam1);
f->FixParameter(3,0);
f->FixParameter(4,0);
h->GetEntries();
hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
f->ReleaseParameter(1);
hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
hMCSignal->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
f->FixParameter(1,f->GetParameter(1));
f->FixParameter(2,f->GetParameter(2));
f->FixParameter(10,f->GetParameter(10));
f->FixParameter(9,f->GetParameter(9));
f->FixParameter(7,0);
f->ReleaseParameter(8);
f->SetParameter(8,setparam8);
hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
hMCSwapped->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
f->SetParLimits(0,0,1.e+6);
f->FixParameter(7,hMCSignal->Integral(0,1000)/(hMCSwapped->Integral(0,1000)+hMCSignal->Integral(0,1000)));
f->FixParameter(8,f->GetParameter(8));
f->ReleaseParameter(3);
f->ReleaseParameter(4);
f->SetParLimits(3,0,1.e+10);
f->SetParameter(3,1.e+3);
f->SetLineColor(kRed);
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"q","",minhisto,maxhisto);
f->ReleaseParameter(1);
f->SetParLimits(1,1.85,1.90);
//f->ReleaseParameter(2); // you need to release these two parameters if you want to perform studies on the sigma shape
//f->ReleaseParameter(10); // you need to release these two parameters if you want to perform studies on the sigma shape
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L q","",minhisto,maxhisto);
h->Fit(Form("f_%.0f_%.0f",ptmin,ptmax),"L m","",minhisto,maxhisto);
TF1* background = new TF1(Form("background_%.0f_%.0f",ptmin,ptmax),"[0]*exp([1]*x)");
background->SetParameter(0,f->GetParameter(3));
background->SetParameter(1,f->GetParameter(4));
background->SetLineColor(4);
background->SetRange(minhisto,maxhisto);
background->SetLineStyle(2);
TF1* mass = new TF1(Form("fmass_%.0f_%.0f",ptmin,ptmax),"[0]*([3]*([4]*Gaus(x,[1],[2])/(sqrt(2*3.14159)*[2])+(1-[4])*Gaus(x,[1],[5])/(sqrt(2*3.14159)*[5])))");
mass->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(2),f->GetParameter(7),f->GetParameter(9),f->GetParameter(10));
mass->SetParError(0,f->GetParError(0));
mass->SetParError(1,f->GetParError(1));
mass->SetParError(2,f->GetParError(2));
mass->SetParError(3,f->GetParError(7));
mass->SetParError(4,f->GetParError(9));
mass->SetParError(5,f->GetParError(10));
mass->SetFillColor(kOrange-3);
mass->SetFillStyle(3002);
mass->SetLineColor(kOrange-3);
mass->SetLineWidth(3);
mass->SetLineStyle(2);
TF1* massSwap = new TF1(Form("fmassSwap_%.0f_%.0f",ptmin,ptmax),"[0]*(1-[2])*Gaus(x,[1],[3])/(sqrt(2*3.14159)*[3])");
massSwap->SetParameters(f->GetParameter(0),f->GetParameter(1),f->GetParameter(7),f->GetParameter(8));
massSwap->SetParError(0,f->GetParError(0));
massSwap->SetParError(1,f->GetParError(1));
massSwap->SetParError(2,f->GetParError(7));
massSwap->SetParError(3,f->GetParError(8));
massSwap->SetFillColor(kGreen+4);
massSwap->SetFillStyle(3005);
massSwap->SetLineColor(kGreen+4);
massSwap->SetLineWidth(3);
//.........这里部分代码省略.........
示例8: ZinvVisualization
//this makes Z(nunu) prediction vs. MC truth plots for the AN.
//at the moment all numbers are hard-coded and this code needs major revision, the mc truth numbers are loaded from a root file created by ZnunuNumbers.C
//furthermore the stored root file is used for both producing the final result plots/tables and also interpretation
void ZinvVisualization(){
const int gNMT2bins_2j0b_hHT = 6;
double gMT2bins_2j0b_hHT[gNMT2bins_2j0b_hHT+1] = {120, 150, 200, 260, 350, 550, 900};
const int gNMT2bins_2j1b_hHT = 2;
double gMT2bins_2j1b_hHT[gNMT2bins_2j1b_hHT+1] = {100, 180, 350};
const int gNMT2bins_3j0b_hHT = 7;
double gMT2bins_3j0b_hHT[gNMT2bins_3j0b_hHT+1] = {160, 185, 220, 270, 350, 450, 650, 1000};
const int gNMT2bins_3j1b_hHT = 4;
double gMT2bins_3j1b_hHT[gNMT2bins_3j1b_hHT+1] = {150, 180, 230, 350, 550};
const int gNMT2bins_3j2b_hHT = 2;
double gMT2bins_3j2b_hHT[gNMT2bins_3j2b_hHT+1] = {130, 200, 350};
const int gNMT2bins_6j0b_hHT = 3;
double gMT2bins_6j0b_hHT[gNMT2bins_6j0b_hHT+1] = {160, 200, 300, 500};
const int gNMT2bins_6j1b_hHT = 3;
double gMT2bins_6j1b_hHT[gNMT2bins_6j1b_hHT+1] = {150, 200, 300, 500};
const int gNMT2bins_6j2b_hHT = 2;
double gMT2bins_6j2b_hHT[gNMT2bins_6j2b_hHT+1] = {130, 200, 350};
const int gNMT2bins_3b_hHT = 1;
double gMT2bins_3b_hHT[gNMT2bins_3b_hHT+1] = {125, 300};
// HT > 750 && HT < 1200
const int gNMT2bins_2j0b_mHT = 9;
double gMT2bins_2j0b_mHT[gNMT2bins_2j0b_mHT+1] = {125, 150, 180, 220, 270, 325, 425, 580, 780, 1000};
const int gNMT2bins_2j1b_mHT = 5;
double gMT2bins_2j1b_mHT[gNMT2bins_2j1b_mHT+1] = {100, 135, 170, 260, 450, 700};
const int gNMT2bins_3j0b_mHT = 9;
double gMT2bins_3j0b_mHT[gNMT2bins_3j0b_mHT+1] = {160, 185, 215, 250, 300, 370, 480, 640, 800, 1000};
const int gNMT2bins_3j1b_mHT = 6;
double gMT2bins_3j1b_mHT[gNMT2bins_3j1b_mHT+1] = {150, 175, 210, 270, 380, 600, 900};
const int gNMT2bins_3j2b_mHT = 5;
double gMT2bins_3j2b_mHT[gNMT2bins_3j2b_mHT+1] = {130, 160, 200, 270, 370, 500};
const int gNMT2bins_6j0b_mHT = 5;
double gMT2bins_6j0b_mHT[gNMT2bins_6j0b_mHT+1] = {160, 200, 250, 325, 425, 600};
const int gNMT2bins_6j1b_mHT = 4;
double gMT2bins_6j1b_mHT[gNMT2bins_6j1b_mHT+1] = {150, 190, 250, 350, 500};
const int gNMT2bins_6j2b_mHT = 4;
double gMT2bins_6j2b_mHT[gNMT2bins_6j2b_mHT+1] = {130, 170, 220, 300, 450};
const int gNMT2bins_3b_mHT = 3;
double gMT2bins_3b_mHT[gNMT2bins_3b_mHT+1] = {125, 175, 275, 450};
// HT > 450 && HT < 750
const int gNMT2bins_2j0b_lHT = 8;
double gMT2bins_2j0b_lHT[gNMT2bins_2j0b_lHT+1] = {200, 240, 290, 350, 420, 490, 570, 650, 750};
const int gNMT2bins_2j1b_lHT = 6;
double gMT2bins_2j1b_lHT[gNMT2bins_2j1b_lHT+1] = {200, 250, 310, 380, 450, 550, 700};
const int gNMT2bins_3j0b_lHT = 8;
double gMT2bins_3j0b_lHT[gNMT2bins_3j0b_lHT+1] = {200, 240, 290, 350, 420, 490, 570, 650, 750};
const int gNMT2bins_3j1b_lHT = 6;
double gMT2bins_3j1b_lHT[gNMT2bins_3j1b_lHT+1] = {200, 250, 310, 380, 460, 550, 700};
const int gNMT2bins_3j2b_lHT = 4;
double gMT2bins_3j2b_lHT[gNMT2bins_3j2b_lHT+1] = {200, 250, 325, 425, 550};
const int gNMT2bins_6j0b_lHT = 3;
double gMT2bins_6j0b_lHT[gNMT2bins_6j0b_lHT+1] = {200, 280, 380, 520};
const int gNMT2bins_6j1b_lHT = 3;
double gMT2bins_6j1b_lHT[gNMT2bins_6j1b_lHT+1] = {200, 250, 325, 450};
const int gNMT2bins_6j2b_lHT = 3;
double gMT2bins_6j2b_lHT[gNMT2bins_6j2b_lHT+1] = {200, 250, 300, 400};
const int gNMT2bins_3b_lHT = 2;
double gMT2bins_3b_lHT [gNMT2bins_3b_lHT+1] = {200, 280, 400};
const int signalregionsize = 9;
string signal_region[signalregionsize] = {"2j0b", "2j1to2b", "3to5j0b", "3to5j1b", "3to5j2b", "6j0b", "6j1b", "6j2b", "3b"};
const int HTbinsize = 3;
string HT_bin[HTbinsize] = {"lowHT", "mediumHT", "highHT"};
gROOT->SetStyle("Plain");
gStyle->SetPalette(1);
gStyle->SetOptStat(0);
TLegend *leg = new TLegend(0.6551724,0.7299578,0.8706897,0.8987342,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextFont(62);
leg->SetTextSize(0.04575163);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
//load MC truth numbers
TFile *fmctruth = TFile::Open("../Results/Filtered/GammaJetsPrediction/20130617_test/ZnunuNumbers.root");
//define all histograms
map<string, TH1D*> histos;
for(int i3 = 0; i3<HTbinsize; ++i3){
for(int i2 = 0; i2<signalregionsize; ++i2){
int NMT2bins;
if(i3==0){
if(signal_region[i2]=="2j0b") NMT2bins = gNMT2bins_2j0b_lHT;
if(signal_region[i2]=="2j1to2b") NMT2bins = gNMT2bins_2j1b_lHT;
if(signal_region[i2]=="3to5j0b") NMT2bins = gNMT2bins_3j0b_lHT;
if(signal_region[i2]=="3to5j1b") NMT2bins = gNMT2bins_3j1b_lHT;
if(signal_region[i2]=="3to5j2b") NMT2bins = gNMT2bins_3j2b_lHT;
if(signal_region[i2]=="6j0b") NMT2bins = gNMT2bins_6j0b_lHT;
if(signal_region[i2]=="6j1b") NMT2bins = gNMT2bins_6j1b_lHT;
if(signal_region[i2]=="6j2b") NMT2bins = gNMT2bins_6j2b_lHT;
//.........这里部分代码省略.........
示例9: fitfunc
//.........这里部分代码省略.........
peak4g = new TGraph(hsim[3]);
peak5g = new TGraph(hsim[4]);
peak6g = new TGraph(hsim[5]);
/*TGraph *peak1g = new TGraph(hsim[0]);
TGraph *peak2g = new TGraph(hsim[1]);
TGraph *peak3g = new TGraph(hsim[2]);
TGraph *peak4g = new TGraph(hsim[3]);
TGraph *peak5g = new TGraph(hsim[4]);
*/
//******************Function Definition****************************************
//*****************************************************************************
const Double_t fitmin=300.;
const Double_t fitmax=(Double_t)maxBin;//4000.;
c_m->cd();
TF1 *whole = new TF1( "whole", ex_respf,fitmin,fitmax,10);
whole->SetParameters(0.0001,0.01,0.00,0.0001,0.001,0.001,3.,-1e-03,3,-1.e-3);
//whole->SetParameters(0.0001,0.0001,0.0001, 5.9,-0.00080 );
for(int i=0; i<6; i++){
if(gopt[i]==1){
whole->SetParLimits(i,0.0,parlimit[i]);
}else{
whole->FixParameter(i,0.0);
}
}
whole->SetParLimits(6,0,10);
whole->SetParLimits(7,-1e-02,0.);
whole->SetParLimits(8,0,5);
whole->SetParLimits(9,-1e-02,-1e-5);
//whole->FixParameter(8,1.426);
//whole->FixParameter(9,-8.1e-5);
whole->SetLineColor(1);
whole->SetLineWidth(2);
whole->SetNpx(200);
hexp[0]->Fit(whole,"R LL");
//hexp[0]->Fit(whole,"");
//cout<<"test"<<endl;
//hexp[0]->Draw("");
//hexp[0]->GetXaxis()->SetRangeUser(0,5000);
//fCanvas->Print(Form("%s.png",outname));
fpara<<"Chisquare\t"<< whole->GetChisquare()<<endl;
fpara<<"para\tvalue\terror\tfilename"<<endl;
for(int para=0;para<10;para++){
fpara<<para<<"\t"<<whole->GetParameter(para)<<"\t"<<whole->GetParError(para);
if(para<6) {
string strenergy =sim[para]->GetName();
int itr = strenergy.find_last_of("/");
strenergy.erase(0,itr+1);
fpara<<"\t"<<strenergy;
}
fpara<<endl;
}
// fitlist<<"E0, E1, E2, E3, E4, CS0, CS1, CS2, CS3, CS4, ER0, ER1, ER2, ER3, ER4, Chi-sq"<<endl;
for(int i=0; i<6; i++) gopt[i]==1? fitlist<<energy[i]<<", ": fitlist<<"0, ";
for(int i=0; i<6; i++) gopt[i]==1? fitlist<<genevts*whole->GetParameter(i)*CSincl/tot78Ni<<", ": fitlist<<"0, ";
for(int i=0; i<6; i++){gopt[i]==1?
fitlist<<sqrt(pow(whole->GetParError(i)*CSincl,2.) //Error from fitting
//+whole->GetParameter(i)*pow(CSincl,2) //Statistical error for the events (included?
//+pow(whole->GetParameter(i)*CSinclerr,2) // Inclusive cross section error
)*genevts/tot78Ni<<", "
示例10: ttbar_jet1CSV
//.........这里部分代码省略.........
h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTickLength(0.025);
h_jet1CSV_TopsPoPHFcP__246->GetZaxis()->SetTitleFont(42);
h->Add(h_jet1CSV_Top (HF),"");
h->Draw("hist");
TH1D *hsum__247 = new TH1D("hsum__247","",10,0,1);
hsum__247->SetBinContent(1,0.1251058);
hsum__247->SetBinContent(2,0.1975396);
hsum__247->SetBinContent(3,0.09541114);
hsum__247->SetBinContent(4,0.07007946);
hsum__247->SetBinContent(5,0.05750894);
hsum__247->SetBinContent(6,0.04655581);
hsum__247->SetBinContent(7,0.04603708);
hsum__247->SetBinContent(8,0.04751975);
hsum__247->SetBinContent(9,0.07399275);
hsum__247->SetBinContent(10,0.2402497);
hsum__247->SetBinError(1,0.002031146);
hsum__247->SetBinError(2,0.002198023);
hsum__247->SetBinError(3,0.001516888);
hsum__247->SetBinError(4,0.001566606);
hsum__247->SetBinError(5,0.00152726);
hsum__247->SetBinError(6,0.001177403);
hsum__247->SetBinError(7,0.001030461);
hsum__247->SetBinError(8,0.001036597);
hsum__247->SetBinError(9,0.001096172);
hsum__247->SetBinError(10,0.003099137);
hsum__247->SetEntries(45);
hsum__247->SetStats(0);
ci = 1200;
color = new TColor(ci, 0, 0, 0, " ", 0.99);
hsum__247->SetFillColor(ci);
hsum__247->SetFillStyle(3003);
hsum__247->SetLineWidth(0);
hsum__247->GetXaxis()->SetTitle("jet 1 CSV");
hsum__247->GetXaxis()->SetLabelFont(42);
hsum__247->GetXaxis()->SetLabelOffset(0.007);
hsum__247->GetXaxis()->SetTitleSize(0.05);
hsum__247->GetXaxis()->SetTickLength(0.025);
hsum__247->GetXaxis()->SetTitleFont(42);
hsum__247->GetYaxis()->SetTitle("a.u.");
hsum__247->GetYaxis()->SetLabelFont(42);
hsum__247->GetYaxis()->SetLabelOffset(0.007);
hsum__247->GetYaxis()->SetTitleSize(0.05);
hsum__247->GetYaxis()->SetTickLength(0.025);
hsum__247->GetYaxis()->SetTitleFont(42);
hsum__247->GetZaxis()->SetLabelFont(42);
hsum__247->GetZaxis()->SetLabelOffset(0.007);
hsum__247->GetZaxis()->SetTitleSize(0.05);
hsum__247->GetZaxis()->SetTickLength(0.025);
hsum__247->GetZaxis()->SetTitleFont(42);
hsum__247->Draw("e2 same");
TH1D *h_jet1CSV_Data__248 = new TH1D("h_jet1CSV_Data__248","",10,0,1);
h_jet1CSV_Data__248->SetBinContent(1,0.1217846);
h_jet1CSV_Data__248->SetBinContent(2,0.2002261);
h_jet1CSV_Data__248->SetBinContent(3,0.09935928);
h_jet1CSV_Data__248->SetBinContent(4,0.07382455);
h_jet1CSV_Data__248->SetBinContent(5,0.06336568);
h_jet1CSV_Data__248->SetBinContent(6,0.04781871);
h_jet1CSV_Data__248->SetBinContent(7,0.04861962);
h_jet1CSV_Data__248->SetBinContent(8,0.04786582);
h_jet1CSV_Data__248->SetBinContent(9,0.07109206);
h_jet1CSV_Data__248->SetBinContent(10,0.2260435);
h_jet1CSV_Data__248->SetBinError(1,0.002395312);
h_jet1CSV_Data__248->SetBinError(2,0.003071329);
示例11: combine
//.........这里部分代码省略.........
sysTot_SF->Draw("fSAME");
h_SF->Draw("e1p same");
TLegend *leg;
leg = new TLegend(0.35,0.45,0.70,0.20);
leg->SetFillColor(253);
leg->SetBorderSize(0);
TLatex *legl = new TLatex();
legl->SetNDC();
legl->SetTextAlign(22);
legl->SetTextFont(63);
legl->SetTextSizePixels(30);
legl->DrawLatex(0.55,0.82,csv.c_str());
leg->AddEntry(h_SF,"Scale factor","p");
leg->AddEntry(h_SF,"stat","l");
leg->AddEntry(sysTot_SF,"stat #oplus syst","f");
c1->RedrawAxis("g");
leg->Draw();
// c1->SetLogx(1);
// TLatex *lab = CMSLABEL();
// lab->Draw("same");
TLatex *tex = new TLatex(0.1969,0.906825,"CMS");
tex->SetNDC();
tex->SetTextAlign(13);
tex->SetTextFont(61);
tex->SetTextSize(0.07475);
tex->SetLineWidth(2);
tex->Draw();
TLatex *tex2 = new TLatex(0.1969,0.817125,"Preliminary");
tex2->SetNDC();
tex2->SetTextAlign(13);
tex2->SetTextFont(52);
tex2->SetTextSize(0.05681);
tex2->SetLineWidth(2);
tex2->Draw();
TLatex *text1 = new TLatex(0.98,0.95125,"#sqrt{s} = 13 TeV, 25 ns");
text1->SetNDC();
text1->SetTextAlign(31);
text1->SetTextFont(42);
text1->SetTextSize(0.04875);
text1->SetLineWidth(2);
text1->Draw();
std::string picname = "pics/SF_"+tag+".eps";
c1->Print(picname.c_str());
c1->Clear();
delete sysTot_SF;
delete c1;
delete leg;
delete legl;
// draw fractions noTag
TCanvas *c2 = new TCanvas("c2","c2",0,0,600,500);
c2->SetGrid(1);
示例12: plot_lj1lj2_pT
void plot_lj1lj2_pT()
{
gStyle -> SetStripDecimals(kFALSE);
gStyle -> SetPadTickX(1);
gStyle -> SetPadTickY(1);
gStyle -> SetOptTitle(0);
gStyle -> SetOptStat(0);
float y1=0. , y2=50000;
float y1=0. , y3=50000;
float x1=0, x2=1500.;
Double_t t1=0.4395973,t2=0.8;
Double_t t3=t1, t4=0.7302697;
TFile *data = new TFile("/Users/asifsaddique/CMS_BH/QCD_13TeV/output_qcd/QCD_madgraph.root", "READ");
TH1F *lj1_pT50 = (TH1F*)gDirectory -> Get("general/LJ1_pT50");
TH1F *lj2_pT50 = (TH1F*)gDirectory -> Get("general/LJ2_pT50");
lj1_pT50 ->GetSumw2()->Set(0);
lj2_pT50->GetSumw2()->Set(0);
lj1_pT50->Scale(1000);
lj2_pT50->Scale(1000);
TCanvas *c1 = new TCanvas("c1","c1",600,600);
c1->SetLeftMargin(0.1442953);
TCanvas *c2 = new TCanvas("c2","c2",600,600);
c2->SetLeftMargin(0.1442953);
c1->cd();
lj1_pT50 -> GetYaxis()->SetTitle("# Entries"); lj1_pT50 -> GetXaxis()->SetTitle("1st Leading Jet p_{T}");
lj1_pT50 -> GetYaxis()->SetTitleSize(0.04);
lj1_pT50 -> GetXaxis()->SetTitleSize(0.04);
lj1_pT50 -> GetXaxis()->SetTitleOffset(1.1);
lj1_pT50 -> GetYaxis()->SetTitleOffset(1.75);
lj1_pT50 -> SetLineWidth(2);
lj1_pT50 -> GetXaxis()->SetRangeUser(x1,x2);
lj1_pT50 -> GetYaxis()->SetRangeUser(y1,y3);
lj1_pT50 -> Draw("");
float tsize = 0.04;
tex = new TLatex(t1,t2,"#sqrt[]{s} = 13 TeV, #intLdt = 1000 pb^{-1}");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(tsize);
tex->SetLineWidth(2);
tex->Draw();
TLatex * tex = new TLatex(t3,t4,"Jets: p_{T} > 20 GeV, |#eta| < 2.4");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(tsize);
tex->SetLineWidth(2);
tex->Draw();
c2->cd();
lj2_pT50 -> GetYaxis()->SetTitle("# Entries");
lj2_pT50 -> GetXaxis()->SetTitle("Second Leading Jet p_{T} ");
lj2_pT50 -> GetYaxis()->SetTitleSize(0.04);
lj2_pT50 -> GetXaxis()->SetTitleSize(0.04);
lj2_pT50 -> GetXaxis()->SetTitleOffset(1.1);
lj2_pT50 -> GetYaxis()->SetTitleOffset(1.75);
lj2_pT50 -> SetLineWidth(2);
lj2_pT50 -> GetXaxis()->SetRangeUser(x1,x2);
lj2_pT50 -> GetYaxis()->SetRangeUser(y1,y2);
lj2_pT50 -> Draw("");
tex = new TLatex(t1,t2,"#sqrt[]{s} = 13 TeV, #intLdt = 1000 pb^{-1}");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(tsize);
tex->SetLineWidth(2);
tex->Draw();
TLatex * tex = new TLatex(t3,t4,"Jets: p_{T} > 50 GeV, |#eta| < 2.4");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(tsize);
tex->SetLineWidth(2);
tex->Draw();
c1->SaveAs("/Users/asifsaddique/CMS_BH/QCD_13TeV/Macros/bh_plots/pTeT/lj1_pT50.eps");
c2->SaveAs("/Users/asifsaddique/CMS_BH/QCD_13TeV/Macros/bh_plots/pTeT/lj2_pT50.eps");
}
示例13: VHPlotter
//.........这里部分代码省略.........
TH1F* h_data_runD = (TH1F*)gDirectory->Get(title.c_str());
TH1F* h_data = (TH1F*)h_data_runB ->Clone("h_data");
h_data->Reset();
h_data->Add( h_data_runB );
h_data->Add( h_data_runC );
h_data->Add( h_data_runD );
h_mc2 -> SetLineColor(kBlack);
h_mc2 -> SetFillColor(kBlue);
//h_mc2 -> SetFillStyle(3004);
h_mc3 -> SetLineColor(kBlack);
h_mc3 -> SetFillColor(kGray+2);
//h_mc3 -> SetFillStyle(3004);
//h_mc4 -> SetLineColor(kBlack);
//h_mc4 -> SetFillColor(kGray+3);
//h_mc4 -> SetFillStyle(3004);
//h_mc6 -> SetLineColor(kBlack);
//h_mc6 -> SetFillColor(kRed+2);
//h_mc6 -> SetFillStyle(3004);
h_mc7 -> SetLineColor(kBlack);
h_mc7 -> SetFillColor(kMagenta);
//h_mc7 -> SetFillStyle(3004);
h_mc8 -> SetLineColor(kGreen);
//h_mc8 -> SetLineColor(kBlack);
//h_mc8 -> SetFillColor(kPink);
//h_mc8 -> SetFillStyle(3004);
h_mc8 ->SetLineWidth(3);
h_mc11->Scale(norm11);
h_mc12->Scale(norm12);
h_mc13->Scale(norm13);
h_mc14->Scale(norm14);
h_mc2->Scale(norm2);
h_mc3->Scale(norm3);
h_mc4->Scale(norm4);
h_mc6->Scale(norm6);
h_mc7->Scale(norm7);
h_mc8->Scale(norm8);
TH1F* h_mcDY = (TH1F*)h_mc11->Clone("h_mcDY");
h_mcDY->Reset();
h_mcDY->Add(h_mc14);
h_mcDY->Add(h_mc13);
h_mcDY->Add(h_mc12);
h_mcDY->Add(h_mc11);
h_mcDY -> SetLineColor(kBlack);
h_mcDY -> SetFillColor(kYellow-4);
//h_mcDY -> SetFillStyle(3004);
TH1F* h_mcDiboson = (TH1F*)h_mc3->Clone("h_mcDiboson");
h_mcDiboson->Reset();
h_mcDiboson->Add(h_mc3);
h_mcDiboson->Add(h_mc4);
h_mcDiboson->Add(h_mc6);
TH1F *ht = (TH1F*)h_mcDY->Clone("ht");
ht->Reset();
//ht->Add(h_mc8);
示例14: Final_av_Lambda_VarCoupling_40Percent
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//========= (Mon Feb 22 19:41:13 2016) by ROOT version6.04/06
TCanvas *c = new TCanvas("c", "c",0,0,800,700);
c->SetHighLightColor(2);
c->Range(-0.4813593,1.111111,3.148656,8.518519);
c->SetFillColor(0);
c->SetBorderMode(0);
c->SetBorderSize(2);
c->SetLogx();
c->SetLogy();
c->SetTickx(1);
c->SetTicky(1);
c->SetLeftMargin(0.12);
c->SetRightMargin(0.04);
c->SetTopMargin(0.07);
c->SetBottomMargin(0.12);
c->SetFrameBorderMode(0);
c->SetFrameBorderMode(0);
TMultiGraph *multigraph = new TMultiGraph();
multigraph->SetName("");
multigraph->SetTitle("");
Double_t Graph_fx1[12] = {
1,
10,
100,
400,
700,
1000,
1000,
700,
400,
100,
10,
1};
Double_t Graph_fy1[12] = {
881.525,
896.549,
871.907,
667.806,
471.744,
308.777,
382.832,
584.437,
826.374,
1079.16,
1110.85,
1092.23};
TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
graph->SetName("Graph");
graph->SetTitle("");
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#ffcc00");
graph->SetFillColor(ci);
ci = TColor::GetColor("#ff6666");
graph->SetLineColor(ci);
graph->SetLineWidth(3);
TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
Graph_Graph1->SetMinimum(228.5697);
Graph_Graph1->SetMaximum(1191.057);
Graph_Graph1->SetDirectory(0);
Graph_Graph1->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph1->SetLineColor(ci);
Graph_Graph1->GetXaxis()->SetLabelFont(42);
Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
Graph_Graph1->GetXaxis()->SetTitleFont(42);
Graph_Graph1->GetYaxis()->SetLabelFont(42);
Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
Graph_Graph1->GetYaxis()->SetTitleFont(42);
Graph_Graph1->GetZaxis()->SetLabelFont(42);
Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
Graph_Graph1->GetZaxis()->SetTitleFont(42);
graph->SetHistogram(Graph_Graph1);
multigraph->Add(graph,"");
multigraph->Draw("af");
multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
multigraph->GetXaxis()->SetRange(0,96);
multigraph->GetXaxis()->SetLabelFont(42);
multigraph->GetXaxis()->SetTitleSize(0.05);
multigraph->GetXaxis()->SetTitleOffset(1.1);
multigraph->GetXaxis()->SetTitleFont(42);
multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
multigraph->GetYaxis()->SetLabelFont(42);
multigraph->GetYaxis()->SetTitleSize(0.05);
multigraph->GetYaxis()->SetTitleOffset(1.05);
multigraph->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........