5 void prd2009Wstack(
bool x=
false,TString y=
"/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/data/",
float canvasScale=1.0){
10 gStyle->SetOptStat(00000);
11 gStyle->SetOptDate(0);
15 f=
new TFile(Form(
"%srun9setABCD.wana.hist.root",iPathData.Data())); assert(f->IsOpen());
22 int lineColor[mxHist]={kBlack,kOrange,kRed,kGreen,kBlue};
23 int fillColor[mxHist]={0,kOrange,kRed,kGreen,kBlue};
26 int lineColor[mxHist]={1,kGray,kGray+1,kGray+2,kGray+3};
27 int fillColor[mxHist]={0,kGray,kGray+1,kGray+2,kGray+3};
30 for(
int i=0; i<mxHist; i++){
31 h[i]=(TH1F*)f->Get(Form(
"muETlive%d",i));
34 h2[i]=
new TH1F(Form(
"muETliveRebin%d",i),
"; E_{T}^{e} (GeV); Counts ",49,1,99);
35 for (
int j=1; j<=49; j++)
36 h2[i]->SetBinContent(j,h[i]->GetBinContent(2*j)+h[i]->GetBinContent(2*j+1));
38 h[i]->GetXaxis()->SetRangeUser(10,70);
39 h[i]->GetXaxis()->CenterTitle();
40 h[i]->SetFillColor(fillColor[i]); h[i]->SetLineColor(lineColor[i]);
41 h[i]->GetYaxis()->SetTitleOffset(0.9);
42 h[i]->GetYaxis()->CenterTitle();
44 h2[i]->GetXaxis()->SetRangeUser(10,70);
45 h2[i]->GetXaxis()->CenterTitle();
46 h2[i]->SetFillColor(fillColor[i]); h2[i]->SetLineColor(lineColor[i]);
47 h2[i]->GetYaxis()->SetTitleOffset(0.9);
48 h2[i]->GetYaxis()->CenterTitle();
52 TCanvas *c=
new TCanvas(
"aa",
"bb",500*canvasScale,300*canvasScale);
53 c->SetTopMargin(0.05); c->SetBottomMargin(0.13);
54 c->SetLeftMargin(0.09); c->SetRightMargin(0.04);
55 gPad->SetGridy(
false); gPad->SetGridx(
false);
56 if(!colorPlot) c->SetGrayscale();
59 h2[0]->SetMaximum(70000.);
60 h2[0]->GetXaxis()->SetTitleOffset(0.9);
61 h2[0]->GetXaxis()->CenterTitle();
62 h2[0]->GetXaxis()->SetTitleSize(0.06);
63 h2[0]->GetXaxis()->SetLabelSize(0.05);
64 h2[0]->GetYaxis()->SetTitleOffset(0.67);
65 h2[0]->GetYaxis()->CenterTitle();
66 h2[0]->GetYaxis()->SetTitleSize(0.06);
67 h2[0]->GetYaxis()->SetLabelSize(0.05);
68 for(
int i=1; i<mxHist; i++){
69 h2[i]->GetXaxis()->SetLabelSize(0.06);
70 h2[i]->GetYaxis()->SetLabelSize(0.06);
74 TLegend *leg =
new TLegend(0.55,0.56,0.90,0.93);
75 leg->SetEntrySeparation(0.04);
78 leg->SetTextSize(0.045);
80 leg->AddEntry(h[0],
" #splitline{Candidate track and BEMC}{ cluster reconstructed}",
"l");
81 leg->AddEntry(h[1],
" E_{T}^{e} > 15 GeV and |#Deltar| < 0.7 cm",
"f");
82 leg->AddEntry(h[2],
" E_{T}^{e}/E_{T}^{4#times4} > 0.95",
"f");
83 leg->AddEntry(h[3],
" E_{T}^{e}/E_{T}^{#DeltaR<0.7} > 0.88",
"f");
84 leg->AddEntry(h[4],
" Signed P_{T}- balance > 15 GeV/c",
"f");
88 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/color/wStackColor.eps");
89 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/color/wStackColor.png");
92 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/wStackBW.eps");
93 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/wStackBW.png");