本文整理汇总了C++中TLine::SetLineWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TLine::SetLineWidth方法的具体用法?C++ TLine::SetLineWidth怎么用?C++ TLine::SetLineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLine
的用法示例。
在下文中一共展示了TLine::SetLineWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvasRAAPbPb_0_100
void canvasRAAPbPb_0_100()
{
//=========Macro generated from canvas: canvasRAA/canvasRAA
//========= (Mon Nov 21 04:10:29 2016) by ROOT version6.02/10
TCanvas *canvasRAA = new TCanvas("canvasRAA", "canvasRAA",0,0,600,600);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
canvasRAA->SetHighLightColor(2);
canvasRAA->Range(0.5519499,-0.2310559,1.777118,1.69441);
canvasRAA->SetFillColor(0);
canvasRAA->SetBorderMode(0);
canvasRAA->SetBorderSize(2);
canvasRAA->SetLogx();
canvasRAA->SetLeftMargin(0.12);
canvasRAA->SetRightMargin(0.03);
canvasRAA->SetTopMargin(0.075);
canvasRAA->SetBottomMargin(0.12);
canvasRAA->SetFrameBorderMode(0);
canvasRAA->SetFrameBorderMode(0);
TH2F *hemptyEff1 = new TH2F("hemptyEff1","",50,5,55,10,0,1.55);
hemptyEff1->SetMinimum(0);
hemptyEff1->SetMaximum(2);
hemptyEff1->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
hemptyEff1->SetLineColor(ci);
hemptyEff1->SetMarkerStyle(20);
hemptyEff1->GetXaxis()->SetTitle("p_{T} (GeV/c)");
hemptyEff1->GetXaxis()->CenterTitle(true);
hemptyEff1->GetXaxis()->SetLabelFont(42);
hemptyEff1->GetXaxis()->SetTitleSize(0.05);
hemptyEff1->GetXaxis()->SetTitleFont(42);
hemptyEff1->GetYaxis()->SetTitle("R_{AA}");
hemptyEff1->GetYaxis()->CenterTitle(true);
hemptyEff1->GetYaxis()->SetLabelFont(42);
hemptyEff1->GetYaxis()->SetTitleSize(0.05);
hemptyEff1->GetYaxis()->SetTitleOffset(1.1);
hemptyEff1->GetYaxis()->SetTitleFont(42);
hemptyEff1->GetZaxis()->SetLabelFont(42);
hemptyEff1->GetZaxis()->SetLabelSize(0.035);
hemptyEff1->GetZaxis()->SetTitleSize(0.035);
hemptyEff1->GetZaxis()->SetTitleFont(42);
hemptyEff1->Draw("");
TLine *line = new TLine(5,1,55,1);
line->SetLineStyle(2);
line->SetLineWidth(2);
line->Draw();
TBox *box = new TBox(5,0.8492652,5.35,1.150735);
box->SetFillColor(16);
box->SetLineColor(16);
box->Draw();
TLatex * tex = new TLatex(0.38,0.595,"Centrality 0-100%");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.13,0.936,"25.8 pb^{-1} (5.02 TeV pp) + 350.68 #mub^{-1} (5.02 TeV PbPb)");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(0.038);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.15,0.9,"CMS");
tex->SetNDC();
tex->SetTextAlign(13);
tex->SetTextSize(0.06);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.15,0.84,"Preliminary");
tex->SetNDC();
tex->SetTextAlign(13);
tex->SetTextFont(52);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.23,0.7,"T_{AA} and lumi.");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(0.04);
tex->SetLineWidth(2);
tex->Draw();
tex = new TLatex(0.23,0.65,"uncertainty");
tex->SetNDC();
tex->SetTextFont(42);
tex->SetTextSize(0.04);
tex->SetLineWidth(2);
tex->Draw();
Double_t gNuclearModification_fx3001[5] = {
8.5,
12.5,
17.5,
25,
40};
Double_t gNuclearModification_fy3001[5] = {
0.2588925,
0.3541164,
0.4248931,
//.........这里部分代码省略.........
示例2: 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);
//.........这里部分代码省略.........
示例3: Fig1Rec_now4j
//.........这里部分代码省略.........
825., 875., 925., 975.};
Double_t dxpt[npt]
= { 25., 25., 25., 25., 25., 25., 25., 25., 25., 25.,
25., 25., 25., 25.};
Double_t ypt_ttx[npt];
Double_t dypt_ttx[npt] = { 0. };;
Double_t ypt_w4j[npt];
Double_t dypt_w4j[npt] = { 0. };
*/
const Int_t npt = 4;
// const Int_t npt = 7;
Double_t xpt[npt];
// = {300., 400., 500., 600., 700., 800., 900.};
// = {400., 500., 600., 700., 800.};
Double_t dxpt[npt];
// = { 50., 50., 50., 50., 50.};
Double_t ypt_ttx[npt];
Double_t dypt_ttx[npt];
Double_t ypt_Wmjjjj[npt];
Double_t dypt_Wmjjjj[npt];
Double_t ypt_Wmjjbbx[npt];
Double_t dypt_Wmjjbbx[npt];
c1->cd(2);
gPad->SetLogy(1);
gPad->SetLeftMargin(0.12);
gPad->SetBottomMargin(0.);
// ymax = 9.6;
ymax = 16.;
ymin = 4.e-4;
h_ttx_MttRec->SetMaximum(ymax);
h_ttx_MttRec->SetMinimum(ymin);
h_ttx_MttRec->SetLineWidth(2);
h_ttx_MttRec->SetLineStyle(1);
h_ttx_MttRec->SetLineColor(kRed+1);
h_Wmjjbbx_MttRec->SetLineWidth(2);
h_Wmjjbbx_MttRec->SetLineStyle(2);
h_Wmjjbbx_MttRec->SetLineColor(kBlue+1);
/*
h_Wmjjjj_MttRec->SetMaximum(ymax);
h_Wmjjjj_MttRec->SetMinimum(ymin);
h_Wmjjjj_MttRec->SetLineWidth(2);
h_Wmjjjj_MttRec->SetLineStyle(3);
h_Wmjjjj_MttRec->SetLineColor(kGreen+1);
*/
h_ttx_MttRec->GetXaxis()
->SetTitle("M_{t#bar{t}} [GeV]");
h_ttx_MttRec->GetYaxis()
->SetTitle("d#sigma / d M_{t#bar{t}} [fb/GeV]");
h_ttx_MttRec->GetYaxis()->SetTitleOffset(1.2);
// h_Wmjjjj_MttRec->Draw();
h_ttx_MttRec->Draw();
h_Wmjjbbx_MttRec->Draw("same");
legend = new TLegend(x1leg,y1leg,x2leg,y2leg);
legend->AddEntry(h_ttx_MttRec,"t#bar{t}","l");
legend->AddEntry(h_Wmjjbbx_MttRec,"W+b#bar{b}+2j","l");
// legend->AddEntry(h_Wmjjjj_MttRec,"W+4j","l");
legend->SetTextSize(0.035);
legend->SetBorderSize(0);
legend->SetFillColor(0);
legend->Draw();
示例4: validation
//.........这里部分代码省略.........
it->second->SetMaximum(1.8);
}
else
{
it->second->SetMinimum(-5.);
it->second->SetMaximum(+5.);
}
it->second->SetTitle("");
if(!doResiduals) it->second->GetYaxis()->SetTitle("ratio");
else it->second->GetYaxis()->SetTitle("residuals");
}
TMapTSP2TGAE poissonGraphMap;
TMapTSP2TLeg legMap;
_INFO("");
oldDir->cd();
fD->cd();
TH1D* h1Template = (TH1D*)fD->Get("hMass_DYmumu"+suffix)->Clone();
h1Template->Reset();
TObjArray* toarr = new TObjArray();
if(doTruth) toarr->Read("truth_template2d");
else toarr->Read("template2d");
TH2D* h2SSM2000 = (TH2D*)((TObjArray*)toarr->At(0))->Clone("hMass"+suffix+"_Zprime_SSM2000_template2d");
for(Int_t bin=1 ; bin<=h2SSM2000->GetNbinsX() ; bin++)
{
h1Template->SetBinContent(bin, h2SSM2000->GetBinContent(bin,g4bin));
h1Template->SetBinError(bin, h2SSM2000->GetBinError(bin,g4bin));
}
h1Template->SetLineColor(kViolet);
h1Template->SetLineWidth(1);
h1Template->SetMarkerStyle(20);
h1Template->SetMarkerSize(0.3);
h1Template->SetMarkerColor(kViolet);
// the functions
h2Template = (TH2D*)h2SSM2000->Clone();
vector<TF1*> vfunc;
unsigned int nmllbins = h2Template->GetNbinsX();
for(unsigned int mll=1 ; mll<=(nmllbins-bins2chop) ; mll++) // 1...(56-9 = 47)
{
TString mllname = (TString)_s(mll);
TString mllval = (TString)_s(h2Template->GetXaxis()->GetBinCenter(mll+bins2chop));
TF1* f = new TF1("fNominal_mll"+mllname,fTH1toTF1,g4min,g4max,1);
f->SetParameter(0,mll);
f->SetParNames("mll");
// f->SetLineColor(kBlue);
// f->SetLineWidth(1);
f->SetNpx(400);
vfunc.push_back(f);
}
TGraph* graphDY = new TGraph();
graphDY->SetMarkerStyle(25);
graphDY->SetMarkerSize(0.6);
graphDY->SetMarkerColor(kGreen+2);
TGraph* graphSSM = new TGraph();
graphSSM->SetMarkerStyle(24);
graphSSM->SetMarkerSize(0.6);
graphSSM->SetMarkerColor(kOrange+8);
for(unsigned int i=0 ; i<vfunc.size() ; i++)
{
double DY = vfunc[i]->Eval(0.0);
double SSM = vfunc[i]->Eval(1.0);
示例5: PIDEnergy
//______________________________________________________________________________
void PIDEnergy()
{
// Main method.
Char_t tmp[256];
// load CaLib
gSystem->Load("libCaLib.so");
// general configuration
Bool_t watch = kTRUE;
const Char_t* data = "Data.PID.E1";
const Char_t* hName = "CaLib_PID_dE_E_013";
Double_t yMin = 0;
Double_t yMax = 2000;
gMin = 500;
gMax = 1100;
// configuration (December 2007)
//const Char_t calibration[] = "LD2_Dec_07";
//const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Dec_07/AR/out/droop";
// configuration (February 2009)
//const Char_t calibration[] = "LD2_Feb_09";
//const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Feb_09/AR/out/droop";
// configuration (May 2009)
const Char_t calibration[] = "LD2_May_09";
const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/May_09/AR/out/droop";
// create histogram
gHOverview = new TH1F("Overview", "Overview", 40000, 0, 40000);
TCanvas* cOverview = new TCanvas();
gHOverview->GetYaxis()->SetRangeUser(yMin, yMax);
gHOverview->Draw("E1");
// create line
gLine = new TLine();
gLine->SetLineColor(kBlue);
gLine->SetLineWidth(2);
// init fitting function
gFitFunc = 0;
// create fitting canvas
gCFit = new TCanvas();
// get number of sets
Int_t nSets = TCMySQLManager::GetManager()->GetNsets(data, calibration);
// total number of runs
Int_t nTotRuns = 0;
// first and last runs
Int_t first_run, last_run;
// loop over sets
for (Int_t i = 0; i < nSets; i++)
{
// get runs of set
Int_t nRuns;
Int_t* runs = TCMySQLManager::GetManager()->GetRunsOfSet(data, calibration, i, &nRuns);
// loop over runs
for (Int_t j = 0; j < nRuns; j++)
{
// save first and last runs
if (i == 0 && j == 0) first_run = runs[j];
if (i == nSets-1 && j == nRuns-1) last_run = runs[j];
// clean-up
if (gH) delete gH;
if (gH3) delete gH3;
if (gFile) delete gFile;
gH = 0;
gH3 = 0;
gFile = 0;
// load ROOT file
sprintf(tmp, "%s/ARHistograms_CB_%d.root", fLoc, runs[j]);
gFile = new TFile(tmp);
// check file
if (!gFile) continue;
if (gFile->IsZombie()) continue;
// load histogram
gH3 = (TH3*) gFile->Get(hName);
if (!gH3) continue;
if (!gH3->GetEntries()) continue;
if (gH3->GetEntries() < 5000) continue;
// project histogram
gH3->GetXaxis()->SetRangeUser(40, 60);
sprintf(tmp, "Proj_%d_y", runs[j]);
gH = (TH1D*) gH3->Project3D(tmp);
gH->Rebin(3);
// fit the histogram
//.........这里部分代码省略.........
示例6: continuum_test2
//.........这里部分代码省略.........
TGraph* gr_ksfw1 = new TGraph(dots,sig_eff_lh1,back_reg_lh1);
gr_ksfw1->SetMarkerSize(1);
gr_ksfw1->SetMarkerColor(kRed);
gr_ksfw1->SetMarkerStyle(22);
TGraph* gr_ksfw0 = new TGraph(dots,sig_eff_lh0,back_reg_lh0);
gr_ksfw0->SetMarkerSize(1.4);
gr_ksfw0->SetMarkerColor(kBlue);
gr_ksfw0->SetMarkerStyle(22);
gr_ksfw0->SetTitle("Background Rejection");
gr_ksfw0->GetXaxis()->SetRangeUser(eff_min,eff_max);
gr_ksfw0->GetXaxis()->SetTitle("Signal Efficiency");
gr_ksfw0->GetXaxis()->SetTitleSize(0.06);
gr_ksfw0->GetXaxis()->SetTitleOffset(0.75);
gr_ksfw0->GetYaxis()->SetRangeUser(rej_min,rej_max);
if(bdt_flag)mg->Add(gr_bdt);
if(bdtg_flag)mg->Add(gr_bdtg);
if(lh1_flag)mg->Add(gr_ksfw1);
if(lh0_flag)mg->Add(gr_ksfw0);
if(bdt_flag && !bdtg_flag && !lh1_flag && !lh0_flag) {
gr_bdt->Draw("AP");
} else if(lh0_flag && !bdtg_flag && !lh1_flag && !bdt_flag) {
gr_ksfw0->Draw("AP");
} else {
mg->Draw("AP");
}
if(type<15) {
TLine* cutline = new TLine(bdt_best_eff,rej_min,bdt_best_eff,rej_max);
cutline->SetLineColor(kRed);
cutline->SetLineWidth(2);
cutline->Draw("AP");
} else {
TLine* cutline = new TLine(lh0_best_eff,rej_min,lh0_best_eff,rej_max);
cutline->SetLineColor(kRed);
cutline->SetLineWidth(2);
cutline->Draw("AP");
}
TPaveText *pt = new TPaveText(0.7,0.75,0.98,0.9,"brNDC");
pt->SetFillColor(0);
pt->SetTextAlign(12);
pt->AddText(label.c_str());
out.str("");
out << "Input S = " << nsig;
pt->AddText(out.str().c_str());
out.str("");
out << "Input B = " << (int)gen;
pt->AddText(out.str().c_str());
pt->Draw();
TPaveText *pt2 = new TPaveText(0.3,0.25,0.6,0.5,"brNDC");
pt2->SetFillColor(0);
pt2->SetTextAlign(12);
pt2->AddText("Best cut:");
if(type<15) {
out.str("");
out << setprecision(3);
out << "Pur = " << bdt_best_pur*100;
pt2->AddText(out.str().c_str());
out.str("");
out << "Eff = " << bdt_best_eff*100;
pt2->AddText(out.str().c_str());
示例7: JERJES
//.........这里部分代码省略.........
// }else{
// MakeHistMean(hArM [nj][ic],1.058,0.955);
// MakeHistRMS (hRMS [nj][ic],0.43,0.001);
// MakeHistMean(hMean [nj][ic],1.058,0.955);
// MakeHistRMS (hSigma[nj][ic],0.43,0.001);
// MakeHistMean(hArM_r [nj][ic],1.058,0.955);
// MakeHistRMS (hRMS_r [nj][ic],0.43,0.001);
// MakeHistMean(hMean_r [nj][ic],1.058,0.955);
// MakeHistRMS (hSigma_r[nj][ic],0.43,0.001);
// }
}
}
TCanvas *c3[knj];
TLegend *l3[knj];
int maxc=ncen-1;
maxr=2;
for(int nj=0;nj<knj;nj++){
//if(nj!=1)continue;
c3[nj] = new TCanvas(Form("c3_%d",nj),Form("%s JES JER",calgo[nj]),97,118,1739,479);
makeMultiPanelCanvas(c3[nj],maxc,maxr,0.0,0.0,0.22,0.22,0.02,0);
//std::cout<<std::endl;
ipad=0;
l3[nj] = new TLegend(0.2453033,0.6247655,0.4838159,0.9399625,NULL,"BRNDC");
l3[nj]->SetHeader("");
l3[nj]->SetBorderSize(0);
l3[nj]->SetTextFont(42);
l3[nj]->SetTextSize(0.09);
l3[nj]->SetLineColor(1);
l3[nj]->SetLineStyle(1);
l3[nj]->SetLineWidth(1);
l3[nj]->SetFillColor(10);
l3[nj]->SetFillStyle(1001);
l3[nj]->SetHeader("");
for(int ic=ncen-2;ic>=0;ic--){
if(iSigma){
hSigma[nj][ic]->SetMarkerStyle(24);
hSigma[nj][ic]->SetMarkerColor(1);
hSigma[nj][ic]->SetLineColor(1);
hSigma[nj][ic]->SetMarkerSize(1.3);
hSigma[nj][ncen-1]->SetMarkerStyle(20);
hSigma[nj][ncen-1]->SetMarkerColor(1);
hSigma[nj][ncen-1]->SetLineColor(1);
hSigma[nj][ncen-1]->SetMarkerSize(1.1);
hMean[nj][ic]->SetMarkerStyle(24);
hMean[nj][ic]->SetMarkerColor(1);
hMean[nj][ic]->SetLineColor(1);
hMean[nj][ic]->SetMarkerSize(1.3);
hMean[nj][ncen-1]->SetMarkerStyle(20);
hMean[nj][ncen-1]->SetMarkerColor(1);
hMean[nj][ncen-1]->SetLineColor(1);
hMean[nj][ncen-1]->SetMarkerSize(1.1);
hMean_r[nj][ic]->SetMarkerStyle(25);
hMean_r[nj][ic]->SetMarkerColor(1);
hMean_r[nj][ic]->SetLineColor(1);
hMean_r[nj][ic]->SetMarkerSize(1.3);
hMean_r[nj][ncen-1]->SetMarkerStyle(21);
hMean_r[nj][ncen-1]->SetMarkerColor(1);
hMean_r[nj][ncen-1]->SetLineColor(1);
示例8: bdtout_etaR9bins
//.........这里部分代码省略.........
hist_MC_down[i]->Rebin(4);
}
hist_MC_up[i]->SetLineColor(2);
hist_MC_down[i]->SetLineColor(2);
hist_Data[i]->GetYaxis()->SetTitle("");
hist_Data[i]->GetXaxis()->SetTitle("diphoMVA output ("+r9_str+", "+eta_str[i]+")");
hist_Data[i]->GetXaxis()->SetTitleSize(0.05);
hist_MC[i]->SetFillColor(38);
hist_Data[i]->SetMarkerStyle(20);
hist_Data[i]->SetMarkerSize(.5);
hist_syst[i] = (TH1*)hist_MC_up[i]->Clone();
hist_syst[i]->Add(hist_MC_down[i]);
hist_syst[i]->Scale(0.5);
for (int j=1; j<hist_syst[i]->GetNbinsX()+1; j++) {
float up = hist_MC_up[i]->GetBinContent(j);
float down = hist_MC_down[i]->GetBinContent(j);
hist_syst[i]->SetBinError(j,fabs(up-down)/2.);
}
}
TLegend *leg;
leg = new TLegend(.6,.65,.87,.87);
leg->SetBorderSize(0);
leg->SetFillColor(10);
leg->SetTextSize(.035);
leg->AddEntry(hist_Data[0],"Data (19.6fb^{-1})");
leg->AddEntry(hist_MC[0],"DYJetsToLL MC","F");
leg->AddEntry(hist_syst[0],"MC with idmva�01","F");
TLegend *leg2;
leg2 = new TLegend(.2,.65,.52,.87);
leg2->SetBorderSize(0);
leg2->SetFillColor(10);
leg2->SetTextSize(.035);
leg2->AddEntry(hist_Data[0],"Data (19.6fb^{-1})");
leg2->AddEntry(hist_MC[0],"DYJetsToLL MC","F");
leg2->AddEntry(hist_syst[0],"MC with idmva�01","F");
TLine *line;
if (passcut) {
line = new TLine(-0.05,1.,1.,1.);
} else {
line = new TLine(-1.,1.,1.,1.);
}
line->SetLineColor(4);
line->SetLineWidth(2);
TCanvas *c = new TCanvas("c","",2200,800);
c->Divide(4,2);
c->cd(1);
plotDataMC(hist_Data[0],hist_MC[0],hist_MC_up[0],hist_MC_down[0], hist_syst[0],passcut,preselNorm,sf_presel);
gPad->RedrawAxis();
if (r9bin=="highR9" || !passcut) leg2->Draw();
c->cd(2);
plotDataMC(hist_Data[1],hist_MC[1],hist_MC_up[1],hist_MC_down[1], hist_syst[1],passcut,preselNorm,sf_presel);
gPad->RedrawAxis();
if (r9bin=="highR9" || !passcut) leg2->Draw();
c->cd(3);
plotDataMC(hist_Data[2],hist_MC[2],hist_MC_up[2],hist_MC_down[2], hist_syst[2],passcut,preselNorm,sf_presel);
gPad->RedrawAxis();
leg->Draw();
c->cd(4);
plotDataMC(hist_Data[3],hist_MC[3],hist_MC_up[3],hist_MC_down[3], hist_syst[3],passcut,preselNorm,sf_presel);
gPad->RedrawAxis();
leg->Draw();
c->cd(5);
gPad->SetGrid();
plotRatio(hist_Data[0],hist_MC[0],hist_MC_up[0],hist_MC_down[0],passcut);
line->Draw();
c->cd(6);
gPad->SetGrid();
plotRatio(hist_Data[1],hist_MC[1],hist_MC_up[1],hist_MC_down[1],passcut);
line->Draw();
c->cd(7);
gPad->SetGrid();
plotRatio(hist_Data[2],hist_MC[2],hist_MC_up[2],hist_MC_down[2],passcut);
line->Draw();
c->cd(8);
gPad->SetGrid();
plotRatio(hist_Data[3],hist_MC[3],hist_MC_up[3],hist_MC_down[3],passcut);
line->Draw();
if (preselNorm) {
c->SaveAs("bdtout_"+r9bin+passcut_str+"_preselNorm.png");
} else {
c->SaveAs("bdtout_"+r9bin+passcut_str+"_equalArea.png");
}
}
示例9: makePlots_vdm_ls
//.........这里部分代码省略.........
// if(type[n]=="X")
// h_length_scale->GetXaxis()->SetRangeUser(193000000,202000000);
// else
// h_length_scale->GetXaxis()->SetRangeUser(203000000,211000000);
// h_length_scale->GetYaxis()->SetRangeUser(0.00,0.15);
h_length_scale->Draw("COLZ");
#ifdef __CINT__
CMSText(1,1,1,string("#Delta")+type[n]+string(" length scale"),"","pp, #sqrt{s}=2.76 TeV");
#endif
//FIT EACH SECTION
TCanvas* canFit = new TCanvas;
canFit->Divide(TMath::Nint(nSec/2.),2);
for (int i=0; i<nSec; i++)
{
int binStartNotSkipped,binStart, binEnd, helper;
double x1,x2,xend;
h_length_scale->GetBinXYZ(h_length_scale->FindBin(sectionBegin[i]),binStartNotSkipped,helper,helper); binStartNotSkipped++;
h_length_scale->GetBinXYZ(h_length_scale->FindBin(sectionBegin[i]+skip),binStart,helper,helper); binStart++;
h_length_scale->GetBinXYZ(h_length_scale->FindBin(sectionEnd[i]),binEnd,helper,helper); binEnd--;
x1=h_length_scale->GetBinLowEdge(binStartNotSkipped);
x2=h_length_scale->GetBinLowEdge(binStart);
xend=h_length_scale->GetBinLowEdge(binEnd+1);
if(binStart >= binEnd)
{
cerr << "MAJOR WARNING Chosen skipping value too large for section " << i << "(" << binStart << "," << binEnd << ")" << endl;
}
ostringstream funcTitle;
funcTitle << "section" << type[n] << "Func_" << i;
sectionFunc[i] = new TF1(funcTitle.str().c_str(),"gaus");
sectionFunc[i]->SetLineWidth(2);
sectionFunc[i]->SetLineColor(kRed);
sectionFunc[i]->SetLineStyle(1);
funcTitle << "_Prof";
TH1D* helperProfile = h_length_scale->ProjectionY(funcTitle.str().c_str(),binStart,binEnd);
canFit->cd(i+1);
helperProfile->Draw();
sectionFuncPtr[i] = helperProfile->Fit(sectionFunc[i],"QS");
if(Int_t(sectionFuncPtr[i]) !=0)
{
cerr << " !!! MAJOR WARNING." << endl
<< "in section " << i << " fit did not converge: " << gMinuit->fCstatu.Data() << endl;
}
sectionFunc[i]->SetLineWidth(2);
sectionFunc[i]->Draw("SAME");
sectionMean[i] = helperProfile->GetMean();
sectionMeanE[i] = helperProfile->GetMeanError();
if(x1<x2)
{
//can1->cd();
TBox* box1 = new TBox(x1,0.1,x2,0.105);
box1->SetFillColor(kRed);
box1->SetFillStyle(3001);
box1->DrawClone();
TBox* box2 = new TBox(x2,0.1,xend,0.105);
box2->SetFillColor(kGreen);
box2->SetFillStyle(3001);
示例10: FwBwRatio_rap
//.........这里部分代码省略.........
}
}
}
double xaxis[nRap-nBW][nCent] = {{0}};
double xaxis2[nCent+1] = {0};
double yaxis[nCent] = {0};
double yaxis2[nCent+1] = {0};
for (int i=0; i<nCent; i++) {
for (int j=0; j<nRap-nBW; j++) {
xaxis[j][i] = i+0.35+(j*0.05);
}
yaxis[i] = 1;
}
for (int i=0; i<nCent+1; i++) {
xaxis2[i] = i;
yaxis2[i] = 1;
}
gROOT->Macro("~/JpsiStyle.C");
TCanvas canv; canv.Draw();
TH1D *gr = new TH1D("ghost",";;",nCent,0,nCent);
gr->GetYaxis()->SetRangeUser(0.5,3);
gr->GetXaxis()->LabelsOption("h");
gr->GetXaxis()->SetLabelSize(0.055);
for (int i=0; i<nCent; i++) {
gr->GetXaxis()->SetBinLabel(i+1,Form("%s%%",str_cent[i].c_str()));
}
gr->GetYaxis()->SetTitle("Forward R_{cp}");
TLegend *leg;
TLine *gline = new TLine();
gline->SetLineWidth(1.2);
gline->SetLineColor(kGray+1);
TGraphErrors *gr_forwardRcp[nSig][nRap-nBW];
for (int sig=0; sig<nSig; sig++) {
// leg = new TLegend(0.15,0.58,0.93,0.93);
leg = new TLegend(0.15,0.7,0.93,0.93);
SetLegendStyle(leg);
leg->SetHeader(str_sig[sig].c_str());
gr->Draw("l");
gline->DrawLine(0,1,nCent,1);
for (int rap=0; rap<nRap-nBW; rap++) {
gr_forwardRcp[sig][rap] = new TGraphErrors(nCent,xaxis[rap],forwardRcp[sig][rap],0,forwardRcpErr[sig][rap]);
SetGraphStyle(gr_forwardRcp[sig][rap],sig,rap);
char name[512];
sprintf(name,"y: %s",str_rap[rap+nBW].c_str());
leg->AddEntry(gr_forwardRcp[sig][rap],name,"lp");
gr_forwardRcp[sig][rap]->Draw("[lp]");
}
leg->Draw();
canv.SaveAs(Form("Ratio_Rcp_rap_fw_%s.pdf",str_sig_filename[sig].c_str()));
delete leg;
canv.Clear();
}
gr->GetYaxis()->SetTitle("Backward R_{cp}");
TGraphErrors *gr_backwardRcp[nSig][nBW];
for (int sig=0; sig<nSig; sig++) {
示例11: raaExpOpen_pt
void raaExpOpen_pt(const char* inputDir = "../macro_raa/outRoot", // the place where the input root files, with the histograms are
bool bSavePlots = true,
bool bDrawCh = true,
double xMax = 30 // x-axis range limit (ALICE D has x-range maximum value at 36, CMS has it at 30)
)
{
// set the style
gSystem->mkdir(Form("./figs/png"), kTRUE);
gSystem->mkdir(Form("./figs/pdf"), kTRUE);
setTDRStyle();
// read CMS graphs
TFile *pgRaaCms_pt = new TFile(Form("%s/makeRaa_pt.root",inputDir));
// ##################### HIGH PT ############################
TGraphErrors *pgCms = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsi");
TGraphErrors *pgCmsP = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiP");
TGraphErrors *pgCmsSyst = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiSyst");
pgCmsSyst->SetFillColorAlpha(kOrange-9,0.5);
pgCms->SetName("gNonPrJpsi");
TBox *lumi = (TBox*)pgRaaCms_pt->Get("lumi");
lumi->SetFillColor(kOrange-9);
lumi->SetFillStyle(1001);
lumi->SetX1(xMax-0.75); lumi->SetX2(xMax);
TBox *lumi_lowpt = (TBox*)lumi->Clone("lumi_lowpt");
lumi_lowpt->SetFillColor(kViolet-9);
lumi_lowpt->SetFillStyle(1001);
lumi_lowpt->SetX1(xMax-1.5); lumi_lowpt->SetX2(xMax-0.75);
// ##################### LOW PT ############################
TGraphErrors *pgCms_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsi_pt365y1624");
TGraphErrors *pgCmsP_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiP_pt365y1624");
TGraphErrors *pgCmsSyst_lowpt = (TGraphErrors *)pgRaaCms_pt->Get("gNonPrJpsiSyst_pt365y1624");
pgCmsSyst_lowpt->SetFillColorAlpha(kViolet-9,0.5);
pgCms_lowpt->SetName("gNonPrJpsi_pt365y1624");
//--------------------------------------------------------------------
// *********** CMS Charged particle RAA
TGraphAsymmErrors *p8165_d5x1y1 = new TGraphAsymmErrors(p8165_d5x1y1_numpoints, p8165_d5x1y1_xval, p8165_d5x1y1_yval, p8165_d5x1y1_xerrminus, p8165_d5x1y1_xerrplus, p8165_d5x1y1_ystatminus, p8165_d5x1y1_ystatplus);
TGraphAsymmErrors *p8165_d5x1y1_syst = new TGraphAsymmErrors(p8165_d5x1y1_numpoints, p8165_d5x1y1_xval, p8165_d5x1y1_yval, p8165_d5x1y1_xerrminus, p8165_d5x1y1_xerrplus, p8165_d5x1y1_yerrminus, p8165_d5x1y1_yerrplus);
p8165_d5x1y1->SetName("cms_ch_raa");
// X-axis errors will be discarded
for (int i=0; i<p8165_d5x1y1_numpoints; i++) {
p8165_d5x1y1->SetPointEXlow(i,0);
p8165_d5x1y1->SetPointEXhigh(i,0);
p8165_d5x1y1_syst->SetPointEXlow(i,0.5);
p8165_d5x1y1_syst->SetPointEXhigh(i,0.5);
}
// *********** ALICE D RAA vs. pT
TGraphAsymmErrors *p9059_d15x1y1 = new TGraphAsymmErrors(p9059_d15x1y1_numpoints, p9059_d15x1y1_xval, p9059_d15x1y1_yval, p9059_d15x1y1_xerrminus, p9059_d15x1y1_xerrplus, p9059_d15x1y1_yerrminus, p9059_d15x1y1_yerrplus);
TGraphAsymmErrors *p9059_d15x1y1_syst = new TGraphAsymmErrors(p9059_d15x1y1_numpoints, p9059_d15x1y1_xval, p9059_d15x1y1_yval, p9059_d15x1y1_xerrminus, p9059_d15x1y1_xerrplus, p9059_d15x1y1_yerrminus, p9059_d15x1y1_yerrplus);
p9059_d15x1y1->SetName("alice_d_raa");
// X-axis errors will be discarded
for (int i=0; i<p9059_d15x1y1_numpoints; i++) {
p9059_d15x1y1->SetPointEXlow(i,0);
p9059_d15x1y1->SetPointEXhigh(i,0);
p9059_d15x1y1_syst->SetPointEXlow(i,0.5);
p9059_d15x1y1_syst->SetPointEXhigh(i,0.5);
if (xMax<=30 && (i+1)==p9059_d15x1y1_numpoints) {
double x,y;
p9059_d15x1y1->GetPoint(i,x,y);
p9059_d15x1y1->SetPoint(i,x+5,y);
p9059_d15x1y1_syst->GetPoint(i,x,y);
p9059_d15x1y1_syst->SetPoint(i,x+5,y);
}
}
// Style for graphs
p9059_d15x1y1->SetMarkerStyle(kOpenSquare);
p9059_d15x1y1->SetMarkerSize(1.3);
p9059_d15x1y1->SetMarkerColor(kBlack);
p9059_d15x1y1->SetLineColor(kBlack);
p9059_d15x1y1_syst->SetFillColorAlpha(kGray+1,0.5);
p8165_d5x1y1->SetMarkerStyle(20);
p8165_d5x1y1->SetMarkerSize(1.3);
p8165_d5x1y1->SetMarkerColor(kTeal+3);
p8165_d5x1y1->SetLineColor(kTeal+4);
p8165_d5x1y1_syst->SetFillColorAlpha(kTeal-1,0.5);
//---------------------------------------------------------
TLine *line = new TLine(0.,1,xMax,1);
line->SetLineStyle(1);
line->SetLineWidth(1);
TCanvas *pc = new TCanvas("pc","pc");
TF1 *f4 = new TF1("f4","1",0,xMax);
f4->SetLineWidth(1);
f4->GetXaxis()->SetTitle("p_{T} (GeV/c)");
f4->GetYaxis()->SetTitle("R_{AA}");
f4->GetXaxis()->SetRangeUser(0.0,xMax);
f4->GetYaxis()->SetRangeUser(0.0,1.5);
f4->GetXaxis()->CenterTitle(kTRUE);
f4->Draw();
lumi->Draw();
//.........这里部分代码省略.........
示例12: myRatio
void myRatio(TH1D* h_DY100,
TH1D* h_DY200,
TH1D* h_DY400,
TH1D* h_DY600,
TH1D* h_TTbar,
TH1D* h_WW,
TH1D* h_WZ,
TH1D* h_ZZ,
TH1D* h_data0,
TH1D* h_data1,
Double_t scaleDY100,
Double_t scaleDY200,
Double_t scaleDY400,
Double_t scaleDY600,
Double_t scaleTTbar,
Double_t scaleWW,
Double_t scaleWZ,
Double_t scaleZZ){
TH1D* h_data = (TH1D*)h_data0->Clone("h_data");
h_data->Reset();
h_data->Add(h_data0);
h_data->Add(h_data1);
TH1D *h_bkg = (TH1D*)h_data->Clone("h_bkg");
h_bkg->Reset();
h_bkg->Add(h_DY100, scaleDY100);
h_bkg->Add(h_DY200, scaleDY200);
h_bkg->Add(h_DY400, scaleDY400);
h_bkg->Add(h_DY600, scaleDY600);
h_bkg->Add(h_TTbar, scaleTTbar);
h_bkg->Add(h_WW, scaleWW);
h_bkg->Add(h_WZ, scaleWZ);
h_bkg->Add(h_ZZ, scaleZZ);
TH1D* h_ratio = (TH1D*)h_data->Clone("h_ratio");
h_ratio->Reset();
Int_t nbin = h_ratio->GetNbinsX();
Double_t ratio[nbin];
Double_t error[nbin];
Double_t numer_nbincontent[nbin];
Double_t denom_nbincontent[nbin];
Double_t numer_binerror[nbin];
Double_t denom_binerror[nbin];
for(Int_t i=1; i<=nbin; i++){
numer_nbincontent[i] = h_data->GetBinContent(i);
denom_nbincontent[i] = h_bkg->GetBinContent(i);
numer_binerror[i] = h_data->GetBinError(i);
denom_binerror[i] = h_bkg->GetBinError(i);
if( denom_nbincontent[i] <= 0 || numer_nbincontent[i] <= 0 ) continue;
if( denom_binerror[i] <= 0 || numer_binerror[i] <= 0 ) continue;
ratio[i] = (Double_t)numer_nbincontent[i]/denom_nbincontent[i];
error[i] = (ratio[i])*sqrt(pow(numer_binerror[i]/numer_nbincontent[i],2)+pow(denom_binerror[i]/denom_nbincontent[i],2));
h_ratio->SetBinContent(i,ratio[i]);
h_ratio->SetBinError(i,error[i]);
}
h_ratio->SetLineColor(kBlack);
h_ratio->SetTitle("");
h_ratio->GetYaxis()->SetTitle("data/MC");
h_ratio->GetYaxis()->SetTitleOffset(0.3);
h_ratio->GetXaxis()->SetLabelSize(0.1);
h_ratio->GetXaxis()->SetTitleSize(0.125);
h_ratio->GetYaxis()->SetLabelSize(0.1);
h_ratio->GetYaxis()->SetTitleSize(0.1);
h_ratio->GetYaxis()->SetNdivisions(505);
h_ratio->GetYaxis()->SetRangeUser(0,2);
h_ratio->Draw();
Double_t x0 = h_bkg->GetXaxis()->GetXmin();
Double_t x1 = h_bkg->GetXaxis()->GetXmax();
Double_t y0 = 1.;
Double_t y1 = 1.;
TLine* one = new TLine(x0,y0,x1,y1);
one->SetLineColor(2);
one->SetLineStyle(1);
one->SetLineWidth(2);
one->Draw("same");
h_ratio->Draw("same");
}
示例13: diphomva_inputs
//.........这里部分代码省略.........
sf = bdtoutEBEE_cat0_Data->Integral(48,100)/bdtoutEBEE_cat0_DYJetsToLL->Integral(48,100);
} else {
sf = bdtoutEBEE_cat0_Data->Integral()/bdtoutEBEE_cat0_DYJetsToLL->Integral();
if (!equalArea) sf = sf_presel;
}
bdtoutEBEE_cat0_DYJetsToLL->Scale(sf);
bdtoutEBEE_cat0_Data->Draw("e");
leg->Draw();
bdtoutEBEE_cat0_DYJetsToLL->Draw("hist,same");
bdtoutEBEE_cat0_Data->Draw("e,same");
gPad->RedrawAxis();
c_bdtout->cd(4);
if (passMVAcut) {
sf = bdtoutEE_cat0_Data->Integral(48,100)/bdtoutEE_cat0_DYJetsToLL->Integral(48,100);
} else {
sf = bdtoutEE_cat0_Data->Integral()/bdtoutEE_cat0_DYJetsToLL->Integral();
if (!equalArea) sf = sf_presel;
}
bdtoutEE_cat0_DYJetsToLL->Scale(sf);
bdtoutEE_cat0_Data->Draw("e");
leg->Draw();
bdtoutEE_cat0_DYJetsToLL->Draw("hist,same");
bdtoutEE_cat0_Data->Draw("e,same");
gPad->RedrawAxis();
TLine *line;
if (passMVAcut) {
line = new TLine(-0.06,1.,1.,1.);
} else {
line = new TLine(-1.,1.,1.,1.);
}
line->SetLineColor(4);
line->SetLineWidth(2);
c_bdtout->cd(5);
plotRatio(bdtout_cat0_Data,bdtout_cat0_DYJetsToLL);
line->Draw();
c_bdtout->cd(6);
plotRatio(bdtoutEB_cat0_Data,bdtoutEB_cat0_DYJetsToLL);
line->Draw();
c_bdtout->cd(7);
plotRatio(bdtoutEBEE_cat0_Data,bdtoutEBEE_cat0_DYJetsToLL);
line->Draw();
c_bdtout->cd(8);
plotRatio(bdtoutEE_cat0_Data,bdtoutEE_cat0_DYJetsToLL);
line->Draw();
c_bdtout->SaveAs("bdtout"+preselNorm_str+".png");
//------------------------------------------------------------------------------
TCanvas *c_bdtout_basecat = new TCanvas("c_bdtout_basecat","BDT output in CiC categories",2200,800);
c_bdtout_basecat->Divide(4,2);
c_bdtout_basecat->cd(1);
if (passMVAcut) {
sf = bdtout_cat1_Data->Integral(48,100)/bdtout_cat1_DYJetsToLL->Integral(48,100);
} else {
sf = bdtout_cat1_Data->Integral()/bdtout_cat1_DYJetsToLL->Integral();
if (!equalArea) sf = sf_presel;
}
bdtout_cat1_DYJetsToLL->Scale(sf);
示例14: myRatio
void myRatio(TH1D* h_data, TH1D *h_bkg,string xtitle="",int option=0){
cout<<h_bkg->Integral()/h_data->Integral()<<endl;
TH1D* h_ratio = (TH1D*)h_bkg->Clone("h_ratio");
h_ratio->Reset();
Int_t nbin = h_ratio->GetNbinsX();
Float_t ratio[nbin];
Float_t error[nbin];
Float_t numer_nbincontent[nbin];
Float_t denom_nbincontent[nbin];
Float_t numer_binerror[nbin];
Float_t denom_binerror[nbin];
for(Int_t i = 1; i <= nbin; i++){
numer_nbincontent[i] = h_data->GetBinContent(i);
denom_nbincontent[i] = h_bkg ->GetBinContent(i);
numer_binerror[i] = h_data->GetBinError(i);
denom_binerror[i] = h_bkg ->GetBinError(i);
if( denom_nbincontent[i] <= 0 || numer_nbincontent[i] <= 0 ) continue;
if( denom_binerror[i] <= 0 || numer_binerror[i] <= 0 ) continue;
ratio[i] = (Float_t)numer_nbincontent[i]/denom_nbincontent[i];
error[i] = (ratio[i])*sqrt(pow(numer_binerror[i]/numer_nbincontent[i],2)+pow(denom_binerror[i]/denom_nbincontent[i],2));
h_ratio->SetBinContent(i,ratio[i]);
h_ratio->SetBinError(i,error[i]);
}
h_ratio->SetLineColor(kBlack);
h_ratio->SetMarkerStyle(8);
h_ratio->SetMarkerSize(1.5);
h_ratio->SetTitle("");
h_ratio->SetXTitle(xtitle.data());
h_ratio->GetYaxis()->SetTitle("Data/MC");
h_ratio->GetYaxis()->SetTitleOffset(0.45);
h_ratio->GetXaxis()->SetLabelSize(0.125);
h_ratio->GetXaxis()->SetLabelOffset(0.005);
h_ratio->GetXaxis()->SetTitleSize(0.125);
h_ratio->GetXaxis()->SetTitleOffset(0.92);
h_ratio->GetYaxis()->SetLabelSize(0.1);
h_ratio->GetYaxis()->SetTitleSize(0.1);
h_ratio->GetYaxis()->SetNdivisions(505);
h_ratio->GetYaxis()->SetRangeUser(0,2);
if(option==1){
h_ratio->GetXaxis()->SetLabelSize(0.18);
h_ratio->GetXaxis()->SetBinLabel(1,"0b");
h_ratio->GetXaxis()->SetBinLabel(2,"1b");
h_ratio->GetXaxis()->SetBinLabel(3,"2b");
h_ratio->GetXaxis()->SetBinLabel(4,"3b");
h_ratio->GetXaxis()->SetBinLabel(5,"4b");
//h_ratio->GetXaxis()->SetBinLabel(6,"3bHPHP");
}
h_ratio->Draw();
Float_t x0 = h_bkg->GetXaxis()->GetXmin();
Float_t x1 = h_bkg->GetXaxis()->GetXmax();
Float_t y0 = 1.;
Float_t y1 = 1.;
if(isSetRange){
x0=rangeUserDown;
x1=rangeUserUp;
}
TLine* one = new TLine(x0,y0,x1,y1);
one->SetLineColor(2);
one->SetLineStyle(1);
one->SetLineWidth(2);
one->Draw("same");
if(isSetRange)h_ratio->GetXaxis()->SetRangeUser(rangeUserDown,rangeUserUp);
h_ratio->Draw("same");
}
示例15: vnpt_5panels_ratio
//.........这里部分代码省略.........
//tex->Draw();
}
//if (iw < 4) tex=new TLatex(ptit[iw][0]+2,0.27,htit[iw]);
tex=new TLatex(2.1,1.4,htit[iw]);
if ( iw == 0) tex->SetTextSize(textsize);
else if (iw == 8) tex->SetTextSize(textsize);
else tex->SetTextSize(textsize);
tex->Draw();
//
// Legend
//
TLegend *leg = new TLegend(lxmin[iw]*1.2,lymin[iw]*1.*0.75*0.1,lxmax[iw]*0.8,lymax[iw]*1.02*0.4*0.92);
leg->SetFillColor(0);
leg->SetTextSize(textsize);
TLegend *leg2 = new TLegend(lxmin[iw]*1.2,lymin[iw]*1.*0.75*0.52,lxmax[iw]*0.8,lymax[iw]*1.02*0.56*0.92);
leg2->SetFillColor(0);
leg2->SetTextSize(textsize);
//
// Read data
//
for (int im=0;im<1;im++)
{
int j=im*5+iw;
int col=2;
//if (ndp[j]==0) continue;
ge=new TGraphErrors(19,&nARxa[j][0],&nARya[j][0],&nARxe[j][0],&nARye[j][0]);
ge->SetTitle("");
ge->SetMarkerStyle(24);
// ge->SetMarkerStyle(msty[im]);
ge->SetMarkerSize(msiz[im]);
ge->SetMarkerColor(col);
ge->SetLineWidth(1.2);
ge->SetLineColor(col);
//ge->Draw("pe");
leg->AddEntry(ge,"HF(3,4)/HF(3,5)","pl");
}
for (int im=0;im<1;im++)
{
int j=im*5+iw;
int col=4;
//if (ndp[j]==0) continue;
ge2=new TGraphErrors(19,&nBRxa[j][0],&nBRya[j][0],&nBRxe[j][0],&nBRye[j][0]);
ge2->SetTitle("");
ge2->SetMarkerStyle(25);
// ge2->SetMarkerStyle(msty[im]);
ge2->SetMarkerSize(msiz[im]);
ge2->SetMarkerColor(col);
ge2->SetLineWidth(1.2);
ge2->SetLineColor(col);
//ge2->Draw("pe");
leg->AddEntry(ge2,"HF(4,5)/HF(3,5)","pl");
//drawSysBox(ge2,16,0.2, sysXYZ[j]);
}
ge2->Draw("pe");
ge->Draw("pe");
if (iw==0) leg->Draw();
TLine *lines = new TLine(0,1,4.0,1);
lines->SetLineStyle(2);
lines->SetLineWidth(1);
lines->Draw();
if(iw==0||iw<6){
TF1 *fitFun = new TF1("fitFun","pol1", 0, 4);
fitFun->SetLineColor(2);