3 TString iPathMC,iPathBkgd;
5 void prd2009WdataMCjacob(
bool x=
false,TString y=
"/star/u/stevens4/wAnalysis/efficXsec/outEmb/gainUp2/",TString z=
"/star/u/stevens4/wAnalysis/xSecPaper/background/",
float canvasScale=1.0) {
11 TCanvas *c=
new TCanvas(
"aa",
"bb",500*canvasScale,500*canvasScale);
12 if(!colorPlot) c->SetGrayscale();
14 TPad *cT =
new TPad(
"padT",
"padT",0,0.5,1.,1.); cT->Draw();
15 TPad *cB =
new TPad(
"padB",
"padB",0,0,1.,0.5); cB->Draw();
19 prd2009WdataMCjacobX(
"Wplus",
"pos",128.6,147.0,1,canvasScale);
21 prd2009WdataMCjacobX(
"Wminus",
"neg",385.0,74.0,2,canvasScale);
24 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots//color/wJacobColor.eps");
25 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/color/wJacobColor.png");
28 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/wJacobBW.eps");
29 c->Print(
"/star/u/stevens4/wAnalysis/xSecPaper/plots/bw/wJacobBW.png");
35 void prd2009WdataMCjacobX(
string charge,
string charge2,
float wlumi,
float max,
int pad,
float canvasScale) {
37 gStyle->SetOptStat(00000);
38 gStyle->SetOptDate(0);
42 f=
new TFile(Form(
"%sbkgd_histos_%s_final.root",iPathBkgd.Data(),charge2)); assert(f->IsOpen());
44 TFile *fmc =
new TFile(Form(
"%s%s.wana.hist.root",iPathMC.Data(),charge)); assert(fmc->IsOpen());
54 hTau = (TH1F*)f->Get(
"mcclustPtBal_2");
55 hZ = (TH1F*)f->Get(
"zsig_bkgd2");
56 hEemc= (TH1F*)f->Get(
"eemc_bkgd2");
57 hQcd = (TH1F*)f->Get(
"new_bkgd");
58 hData= (TH1F*)f->Get(
"signal2");
59 }
else if(charge==
"Wminus"){
62 hTau = (TH1F*)f->Get(
"tauhist_r");
63 hZ = (TH1F*)f->Get(
"zsig_bkgd2_r");
64 hEemc= (TH1F*)f->Get(
"eemc_bkgd2_r");
65 hQcd = (TH1F*)f->Get(
"new_bkgd_r");
66 hData= (TH1F*)f->Get(
"signal2_r");
69 if(colorPlot) {
int color[4]={kGreen,kBlue,kRed,kOrange}; }
70 else {
int color[4]={kYellow+2,kYellow+4,kYellow,kYellow+3}; }
72 hTau->SetFillColor(color[0]); hTau->SetLineColor(color[0]);
73 hZ->SetFillColor(color[1]); hZ->SetLineColor(color[1]);
74 hEemc->SetFillColor(color[2]); hEemc->SetLineColor(color[2]);
75 hQcd->SetFillColor(color[3]); hQcd->SetLineColor(color[3]);
77 hEemc->SetLineColor(color[3]);
78 hQcd->SetFillStyle(3344); hQcd->SetLineColor(1);
80 hData->SetLineWidth(2);
82 TH1F* hW = fmc->Get(
"muclustPtBal"); hW->Scale(13.18/wlumi);
83 TH1F *hW2 =
new TH1F(
"muclustPtBal_2",
"; E_{T}^{e} (GeV); Counts",49,1,99);
84 TH1F *hW4 =
new TH1F(
"muclustPtBal_4",
"; E_{T}^{e} (GeV); Counts",24,3,99);
86 hW2->GetYaxis()->SetTitleOffset(1.25);
87 hW2->GetXaxis()->SetRangeUser(10,60);
88 hW4->GetYaxis()->SetTitleOffset(1.25);
89 hW4->GetXaxis()->SetRangeUser(10,60);
91 for (
int i=1; i<=49; i++) {
92 hW2->SetBinContent(i,hW->GetBinContent(2*i)+hW->GetBinContent(2*i+1));
94 for (
int i=1; i<=24; i++) {
95 hW4->SetBinContent(i,hW2->GetBinContent(2*i)+hW2->GetBinContent(2*i+1));
97 hW2->SetLineColor(6); hW2->SetLineStyle(2); hW2->SetLineWidth(2);
98 hW4->SetLineColor(6); hW4->SetLineStyle(2); hW4->SetLineWidth(2);
102 gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.0);
103 gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.03);
106 gPad->SetTopMargin(0.0); gPad->SetBottomMargin(0.15);
107 gPad->SetLeftMargin(0.1); gPad->SetRightMargin(0.03);
109 gPad->SetGridy(
false); gPad->SetGridx(
false);
110 THStack *hs =
new THStack(
"hs",
";E_{T}^{e} (GeV);Counts");
111 hs->Add(hZ); hs->Add(hTau);
112 hs->Add(hEemc); hs->Add(hQcd);
117 if(pad==1) hs->SetMinimum(0.001);
120 hs->GetXaxis()->SetTitleOffset(0.9);
121 hs->GetXaxis()->SetRangeUser(10,60);
122 hs->GetXaxis()->SetTitleSize(0.07);
123 hs->GetXaxis()->SetLabelSize(0.06);
124 hs->GetXaxis()->CenterTitle();
125 hs->GetYaxis()->SetTitleOffset(0.65);
126 hs->GetYaxis()->SetTitleSize(0.07);
127 hs->GetYaxis()->SetLabelSize(0.06);
128 hs->GetYaxis()->CenterTitle();
130 hData->GetXaxis()->SetLabelSize(0.06);
131 hData->GetYaxis()->SetLabelSize(0.06);
132 hData->Draw(
"h e same");
138 gPad->SetGridy(
false); gPad->SetGridx(
false);
146 hDataBkgdSub= (TH1F*)f->Get(
"signal_final3_r");
147 hDataBkgdSub->SetLineWidth(2);
149 hDataBkgdSub->Draw(
"h e same");
153 float textSize=0.055;
if(canvasScale>1.0) textSize=0.05;
155 TLegend *leg =
new TLegend(0.7,0.63,0.95,0.9);
156 leg->SetEntrySeparation(0.01);
158 leg->SetFillColor(0);
159 leg->SetTextSize(textSize);
160 leg->SetLineColor(kWhite);
161 leg->SetHeader(
"#scale[1.3]{Positron |#eta_{e}| < 1}");
162 leg->AddEntry(hData,
" STAR 2009 Data",
"l");
163 leg->AddEntry(hW2,
" W #rightarrow e #nu MC",
"l");
164 leg->AddEntry(hQcd,
" Data-driven QCD",
"f");
168 TLegend *leg =
new TLegend(0.7,0.66,0.95,0.93);
169 leg->SetEntrySeparation(0.01);
171 leg->SetFillColor(0);
172 leg->SetTextSize(textSize);
173 leg->SetLineColor(kWhite);
174 leg->SetHeader(
"#scale[1.25]{Electron |#eta_{e}| < 1}");
175 leg->AddEntry(hEemc,
" Second EEMC",
"f");
176 leg->AddEntry(hTau,
" W #rightarrow #tau #nu MC",
"f");
177 leg->AddEntry(hZ,
" Z #rightarrow ee MC",
"f");
184 TLatex *lat0 =
new TLatex(0.13,0.945,
"Run 9 STAR #font[52]{p+p} #sqrt{#font[72]{s}}_{ }=_{ }500 GeV");
185 lat0->SetNDC(); lat0->SetTextSize(0.04); lat0->Draw(
"same");
186 TLatex *lat2 =
new TLatex(0.6,0.86,
"#sigma(#font[52]{W^{#scale[1.2]{#pm}} #rightarrow e^{#scale[1.2]{#pm}} + #nu_{e}})");