1 /////////////////////////////////////////////////
\r
3 // Macro for plotting rates of identified Non-photonic electrons
\r
6 // J.L. Klay (Cal Poly)
\r
8 /////////////////////////////////////////////////
\r
12 void plotNPERates(const char* which = "EMC") {
\r
14 gROOT->LoadMacro("makeCombinedData.C");
\r
15 makeData("data/scaled25Oct09/TOTALhistosscaled-LHC09b2-0.root",
\r
16 "data/scaled25Oct09/histosscaledLHC09b4AODc.root",
\r
17 "data/scaled25Oct09/histosWboson.root");
\r
19 //define common legend
\r
20 leg = new TLegend(0.5,0.6,0.9,0.9);
\r
21 leg->SetFillColor(0);
\r
22 leg->SetTextSize(leg->GetTextSize()*1.2);
\r
23 //leg->AddEntry(alltte,"All N-P e candidates","l");
\r
24 leg->AddEntry(sumtte,"All N-P electrons","l");
\r
25 leg->AddEntry(btte,"Bottom e","l");
\r
26 leg->AddEntry(ctte,"Charm e","l");
\r
27 leg->AddEntry(cbtte,"B-->C e","l");
\r
28 leg->AddEntry(daltte,"Dalitz e","l");
\r
29 leg->AddEntry(convtte,"Conversion e","l");
\r
30 leg->AddEntry(wztte,"W Boson e","l");
\r
31 // leg->AddEntry(htte,"Misidentified hadrons","l");
\r
33 gStyle->SetOptStat(0);
\r
34 // drawAnnualYields(which);
\r
35 // drawPtCutRates(which);
\r
36 //drawCompareTruth();
\r
40 void drawAnnualYields(char* which = "EMC") {
\r
42 TCanvas* crates = new TCanvas();
\r
43 crates->SetFillColor(0);
\r
44 crates->SetBorderMode(0);
\r
45 crates->SetBorderSize(2);
\r
46 crates->SetFrameBorderMode(0);
\r
47 crates->SetFrameBorderMode(0);
\r
52 if(strcmp(which,"EMC")==0) {
\r
53 allemc->SetXTitle("p_{T} (GeV/c)");
\r
54 allemc->SetYTitle("Annual yield");
\r
55 allemc->SetTitle("Annual yield of non-phot. electron candidates (EMCAL pid)");
\r
56 allemc->Rebin(5); allemc->Scale(0.2);
\r
58 sumemc->SetXTitle("p_{T} (GeV/c)");
\r
59 sumemc->SetYTitle("Annual yield");
\r
60 sumemc->SetTitle("Annual yield of non-phot. electrons (EMCAL pid)");
\r
61 sumemc->Rebin(5); sumemc->Scale(0.2);
\r
63 bemc->Rebin(5); bemc->Scale(0.2);
\r
64 cemc->Rebin(5); cemc->Scale(0.2);
\r
65 cbemc->Rebin(5); cbemc->Scale(0.2);
\r
66 convemc->Rebin(5); convemc->Scale(0.2);
\r
67 dalemc->Rebin(5); dalemc->Scale(0.2);
\r
68 wzemc->Rebin(5); wzemc->Scale(0.2);
\r
69 hemc->Rebin(5); hemc->Scale(0.2);
\r
71 allemc->GetYaxis()->SetRangeUser(1.,2.e6);
\r
72 allemc->GetXaxis()->SetRangeUser(10.,49.);
\r
74 sumemc->GetYaxis()->SetRangeUser(1.,2.e6);
\r
75 sumemc->GetXaxis()->SetRangeUser(10.,49.);
\r
79 cbemc->Draw("same");
\r
80 convemc->Draw("same");
\r
81 dalemc->Draw("same");
\r
82 wzemc->Draw("same");
\r
83 // hemc->Draw("same");
\r
85 crates->Print("NPERates_EMC_all.pdf");
\r
87 if(strcmp(which,"TRK")==0) {
\r
88 alltrk->SetXTitle("p_{T} (GeV/c)");
\r
89 alltrk->SetYTitle("Annual yield");
\r
90 alltrk->SetTitle("Annual yield of non-phot. electron candidates (TPC+TRD pid)");
\r
91 alltrk->Rebin(5); alltrk->Scale(0.2);
\r
92 sumtrk->SetXTitle("p_{T} (GeV/c)");
\r
93 sumtrk->SetYTitle("Annual yield");
\r
94 sumtrk->SetTitle("Annual yield of non-phot. electrons (TPC+TRD pid)");
\r
95 sumtrk->Rebin(5); sumtrk->Scale(0.2);
\r
97 btrk->Rebin(5); btrk->Scale(0.2);
\r
98 ctrk->Rebin(5); ctrk->Scale(0.2);
\r
99 cbtrk->Rebin(5); cbtrk->Scale(0.2);
\r
100 convtrk->Rebin(5); convtrk->Scale(0.2);
\r
101 daltrk->Rebin(5); daltrk->Scale(0.2);
\r
102 wztrk->Rebin(5); wztrk->Scale(0.2);
\r
103 htrk->Rebin(5); htrk->Scale(0.2);
\r
105 alltrk->GetYaxis()->SetRangeUser(1.,6.e6);
\r
106 alltrk->GetXaxis()->SetRangeUser(10.,49.);
\r
108 sumtrk->GetYaxis()->SetRangeUser(1.,6.e6);
\r
109 sumtrk->GetXaxis()->SetRangeUser(10.,49.);
\r
111 btrk->Draw("same");
\r
112 ctrk->Draw("same");
\r
113 cbtrk->Draw("same");
\r
114 convtrk->Draw("same");
\r
115 daltrk->Draw("same");
\r
116 wztrk->Draw("same");
\r
117 // htrk->Draw("same");
\r
119 crates->Print("NPERates_TRK_all.pdf");
\r
121 if(strcmp(which,"TTE")==0) {
\r
122 alltte->SetXTitle("p_{T} (GeV/c)");
\r
123 alltte->SetYTitle("Annual yield");
\r
124 alltte->SetTitle("Annual yield of non-phot. electron candidates (Tracking+EMCAL pid)");
\r
125 alltte->Rebin(5); alltte->Scale(0.2);
\r
126 sumtte->SetXTitle("p_{T} (GeV/c)");
\r
127 sumtte->SetYTitle("Annual yield");
\r
128 sumtte->SetTitle("Annual yield of non-phot. electrons (Tracking+EMCAL pid)");
\r
129 sumtte->Rebin(5); sumtte->Scale(0.2);
\r
131 btte->Rebin(5); btte->Scale(0.2);
\r
132 ctte->Rebin(5); ctte->Scale(0.2);
\r
133 cbtte->Rebin(5); cbtte->Scale(0.2);
\r
134 convtte->Rebin(5); convtte->Scale(0.2);
\r
135 daltte->Rebin(5); daltte->Scale(0.2);
\r
136 wztte->Rebin(5); wztte->Scale(0.2);
\r
137 htte->Rebin(5); htte->Scale(0.2);
\r
139 alltte->GetYaxis()->SetRangeUser(1.,2.e6);
\r
140 alltte->GetXaxis()->SetRangeUser(10.,49.);
\r
142 sumtte->GetYaxis()->SetRangeUser(1.,2.e6);
\r
143 sumtte->GetXaxis()->SetRangeUser(10.,49.);
\r
145 btte->Draw("same");
\r
146 ctte->Draw("same");
\r
147 cbtte->Draw("same");
\r
148 convtte->Draw("same");
\r
149 daltte->Draw("same");
\r
150 wztte->Draw("same");
\r
151 htte->Draw("same");
\r
153 crates->Print("NPERates_TTE_all.pdf");
\r
158 void drawPtCutRates(char* which = "EMC") {
\r
160 TCanvas* cptcut = new TCanvas();
\r
161 cptcut->SetFillColor(0);
\r
162 cptcut->SetBorderMode(0);
\r
163 cptcut->SetBorderSize(2);
\r
164 cptcut->SetFrameBorderMode(0);
\r
165 cptcut->SetFrameBorderMode(0);
\r
168 if(strcmp(which,"EMC")==0) {
\r
169 // TH1F* alleptcut = GetPtCutHisto(allemc);
\r
170 TH1F* alleptcut = GetPtCutHisto(sumemc);
\r
171 TH1F* beleptcut = GetPtCutHisto(bemc);
\r
172 TH1F* celeptcut = GetPtCutHisto(cemc);
\r
173 TH1F* cbeleptcut = GetPtCutHisto(cbemc);
\r
174 TH1F* dalitzptcut = GetPtCutHisto(dalemc);
\r
175 TH1F* convptcut = GetPtCutHisto(convemc);
\r
176 TH1F* wzptcut = GetPtCutHisto(wzemc);
\r
177 TH1F* misidptcut = GetPtCutHisto(hemc);
\r
178 alleptcut->SetXTitle("p_{T}^{cut} (GeV/c)");
\r
179 alleptcut->SetYTitle("Annual Yield in EMCAL for p_{T}>p_{T}^{cut}");
\r
180 alleptcut->SetTitle("Pb+Pb, 5.5 TeV reconstructed N-P electrons (EMCAL pid)");
\r
181 alleptcut->GetXaxis()->SetRangeUser(10.,49.);
\r
182 alleptcut->GetYaxis()->SetRangeUser(1,4.e5);
\r
184 beleptcut->Draw("same");
\r
185 celeptcut->Draw("same");
\r
186 cbeleptcut->Draw("same");
\r
187 dalitzptcut->Draw("same");
\r
188 convptcut->Draw("same");
\r
189 wzptcut->Draw("same");
\r
190 //misidptcut->Draw("same");
\r
192 cptcut->Print("NPERates_EMC_ptcut_all.pdf");
\r
194 if(strcmp(which,"TRK")==0) {
\r
195 // TH1F* alleptcut = GetPtCutHisto(alltrk);
\r
196 TH1F* alleptcut = GetPtCutHisto(sumtrk);
\r
197 TH1F* beleptcut = GetPtCutHisto(btrk);
\r
198 TH1F* celeptcut = GetPtCutHisto(ctrk);
\r
199 TH1F* cbeleptcut = GetPtCutHisto(cbtrk);
\r
200 TH1F* dalitzptcut = GetPtCutHisto(daltrk);
\r
201 TH1F* convptcut = GetPtCutHisto(convtrk);
\r
202 TH1F* wzptcut = GetPtCutHisto(wztrk);
\r
203 TH1F* misidptcut = GetPtCutHisto(htrk);
\r
204 alleptcut->SetXTitle("p_{T}^{cut} (GeV/c)");
\r
205 alleptcut->SetYTitle("Annual Yield in EMCAL for p_{T}>p_{T}^{cut}");
\r
206 alleptcut->SetTitle("Pb+Pb, 5.5 TeV reconstructed N-P electrons (TPC+TRD pid)");
\r
207 alleptcut->GetXaxis()->SetRangeUser(10.,49.);
\r
208 alleptcut->GetYaxis()->SetRangeUser(1,6.e6);
\r
210 beleptcut->Draw("same");
\r
211 celeptcut->Draw("same");
\r
212 cbeleptcut->Draw("same");
\r
213 dalitzptcut->Draw("same");
\r
214 convptcut->Draw("same");
\r
215 wzptcut->Draw("same");
\r
216 //misidptcut->Draw("same");
\r
218 cptcut->Print("NPERates_TRK_ptcut_all.pdf");
\r
220 if(strcmp(which,"TTE")==0) {
\r
221 // TH1F* alleptcut = GetPtCutHisto(alltte);
\r
222 TH1F* alleptcut = GetPtCutHisto(sumtte);
\r
223 TH1F* beleptcut = GetPtCutHisto(btte);
\r
224 TH1F* celeptcut = GetPtCutHisto(ctte);
\r
225 TH1F* cbeleptcut = GetPtCutHisto(cbtte);
\r
226 TH1F* dalitzptcut = GetPtCutHisto(daltte);
\r
227 TH1F* convptcut = GetPtCutHisto(convtte);
\r
228 TH1F* wzptcut = GetPtCutHisto(wztte);
\r
229 TH1F* misidptcut = GetPtCutHisto(htte);
\r
230 alleptcut->SetXTitle("p_{T}^{cut} (GeV/c)");
\r
231 alleptcut->SetYTitle("Annual Yield in EMCAL for p_{T}>p_{T}^{cut}");
\r
232 alleptcut->SetTitle("Pb+Pb, 5.5 TeV reconstructed N-P electrons (Tracking+EMCAL pid)");
\r
233 alleptcut->GetXaxis()->SetRangeUser(10.,49.);
\r
234 alleptcut->GetYaxis()->SetRangeUser(1,4.e5);
\r
236 beleptcut->Draw("same");
\r
237 celeptcut->Draw("same");
\r
238 cbeleptcut->Draw("same");
\r
239 dalitzptcut->Draw("same");
\r
240 convptcut->Draw("same");
\r
241 wzptcut->Draw("same");
\r
242 misidptcut->Draw("same");
\r
245 cptcut->Print("NPERates_TTE_ptcut_all.pdf");
\r
250 TH1F* drawCompareTruth() {
\r
252 TH1F* mctruth = (TH1F*)belemc->Clone();
\r
253 mctruth->SetName("mctruth");
\r
254 mctruth->Add(celemc);
\r
255 mctruth->Add(candbmc);
\r
256 mctruth->Add(wzmc);
\r
257 mctruth->Rebin(2); mctruth->Scale(0.5);
\r
259 TFile* effic = new TFile("elec_eff.root");
\r
260 TH1F* heff = (TH1F*)effic->Get("h111");
\r
262 TH1F* hcorr = (TH1F*)sumHFemc->Clone();
\r
263 hcorr->SetName("hcorr");
\r
264 for(Int_t i = 1; i < heff->GetNbinsX(); i++) {
\r
265 Double_t pt = heff->GetBinCenter(i);
\r
266 Double_t eff = heff->GetBinContent(i);
\r
267 Double_t corr = 0.;
\r
268 if(eff > 0.) corr = hcorr->GetBinContent(i)/eff;
\r
269 hcorr->SetBinContent(i,corr);
\r
271 hcorr->Rebin(2); hcorr->Scale(0.5);
\r
272 sumHFemc->Rebin(2); sumHFemc->Scale(0.5);
\r
274 Double_t efinal = 0.258;
\r
275 TGraphErrors* eerr = new TGraphErrors();
\r
276 eerr->SetName("emcErr");
\r
277 for(Int_t i = 1; i <= hcorr->GetNbinsX(); i++) {
\r
278 eerr->SetPoint(i-1,hcorr->GetBinCenter(i),hcorr->GetBinContent(i));
\r
279 eerr->SetPointError(i-1,0.,efinal*hcorr->GetBinContent(i));
\r
281 eerr->SetFillColor(kRed-8);
\r
283 TCanvas* ctruth = new TCanvas();
\r
284 ctruth->SetFillColor(0);
\r
285 ctruth->SetBorderMode(0);
\r
286 ctruth->SetBorderSize(2);
\r
287 ctruth->SetFrameBorderMode(0);
\r
288 ctruth->SetFrameBorderMode(0);
\r
292 mctruth->SetTitle("Comparison of MC and reco HF+W electrons");
\r
293 mctruth->SetMarkerColor(kBlack); mctruth->SetLineColor(kBlack);
\r
294 mctruth->SetYTitle("Annual yield in EMCAL dN/dp_{T} (GeV/c)^{-1}");
\r
295 mctruth->SetXTitle("p_{T} (GeV/c)");
\r
296 mctruth->GetXaxis()->SetRangeUser(10.,49.);
\r
298 eerr->Draw("3same");
\r
299 hcorr->SetMarkerColor(kRed);
\r
300 hcorr->SetLineColor(kRed);
\r
301 hcorr->Draw("same");
\r
302 sumHFemc->SetMarkerColor(kBlue);
\r
303 sumHFemc->SetLineColor(kBlue);
\r
304 sumHFemc->Draw("same");
\r
305 TLegend *legy = new TLegend(0.3,0.7,0.9,0.9);
\r
306 legy->SetFillColor(0);
\r
307 legy->AddEntry(mctruth,"MC HF+W electrons","l");
\r
308 legy->AddEntry(sumHFemc,"Rec (EMCAL) HF+W electrons","l");
\r
309 legy->AddEntry(hcorr,"Eff. corrected reco HF+W electrons","l");
\r
310 legy->AddEntry(eerr,"Systematic uncertainty","f");
\r
313 ctruth->Print("NPERates_TruthComparison.pdf");
\r