ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/plot.cc
Revision: 1.11
Committed: Sat Jan 29 11:00:19 2011 UTC (14 years, 3 months ago) by auterman
Content type: text/plain
Branch: MAIN
Changes since 1.10: +74 -44 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 auterman 1.1 #include "plot.h"
2     #include "SusyScan.h"
3 auterman 1.2 #include "GeneratorMasses.h"
4 auterman 1.4 #include "PlotTools.h"
5 auterman 1.2 #include "TheLimits.h"
6 auterman 1.6 #include "GlobalFunctions.h"
7 auterman 1.1
8     #include "TRint.h"
9     #include "TROOT.h"
10     #include "TObjArray.h"
11     #include "TStyle.h"
12    
13     #include "TChain.h"
14     #include "TFile.h"
15 auterman 1.2 #include "TGraph.h"
16 auterman 1.1 #include "TH1.h"
17     #include "TH2.h"
18     #include "TH2F.h"
19     #include "TTree.h"
20     #include "TKey.h"
21     #include "Riostream.h"
22     #include "TCanvas.h"
23 auterman 1.8 #include "TLegend.h"
24 auterman 1.9 #include "TLatex.h"
25 auterman 1.10 #include "TMarker.h"
26 auterman 1.1
27     #include <string>
28 auterman 1.2 #include <cmath>
29 auterman 1.9 #include <stdio.h>
30 auterman 1.1
31     int plot(int argc, char** argv)
32     {
33 auterman 1.6 //interactive root session
34 auterman 1.7 //TApplication theApp("App", 0, 0);
35 auterman 1.2 if (gROOT->IsBatch()) {
36     fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]);
37     return 1;
38     }
39    
40 auterman 1.6 //Style stuff
41 auterman 1.1 gStyle->SetHistFillColor(0);
42     gStyle->SetPalette(1);
43     gStyle->SetCanvasColor(0);
44     gStyle->SetCanvasBorderMode(0);
45     gStyle->SetPadColor(0);
46     gStyle->SetPadBorderMode(0);
47     gStyle->SetFrameBorderMode(0);
48    
49     gStyle->SetTitleFillColor(0);
50     gStyle->SetTitleBorderSize(0);
51     gStyle->SetTitleX(0.10);
52     gStyle->SetTitleY(0.98);
53     gStyle->SetTitleW(0.8);
54     gStyle->SetTitleH(0.06);
55    
56     gStyle->SetErrorX(0);
57     gStyle->SetStatColor(0);
58     gStyle->SetStatBorderSize(0);
59     gStyle->SetStatX(0);
60     gStyle->SetStatY(0);
61     gStyle->SetStatW(0);
62     gStyle->SetStatH(0);
63    
64     gStyle->SetTitleFont(22);
65     gStyle->SetLabelFont(22,"X");
66     gStyle->SetLabelFont(22,"Y");
67     gStyle->SetLabelFont(22,"Z");
68     gStyle->SetLabelSize(0.03,"X");
69     gStyle->SetLabelSize(0.03,"Y");
70     gStyle->SetLabelSize(0.03,"Z");
71    
72     //gROOT->SetStyle("MyStyle");
73     TCanvas * c1 = new TCanvas("c1","c1",600,600);
74     c1->SetFillStyle ( 4000 );
75     c1->SetLeftMargin ( 0.15 );
76     c1->SetRightMargin ( 0.15 );
77     c1->SetBottomMargin( 0.10 );
78     c1->cd();
79    
80 auterman 1.6 //Get limits and generator masses ---------------------------------------------------
81 auterman 1.4 TheLimits * genpoints = new TheLimits();
82 auterman 1.11 //genpoints->Fill(argc, argv);
83     genpoints->Fill("limits_MHT/filelist.txt");
84    
85     TheLimits * genpointsHT = new TheLimits();
86     genpointsHT->Fill("limits_HT/filelist.txt");
87     //genpointsHT->Fill("limits_MHT_20110127/filelist.txt");
88    
89 auterman 1.10
90     //Replace read limits with specific numbers
91     //genpoints->OverwriteLimits("ABCD_MHT");
92    
93 auterman 1.5 genpoints->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
94     genpoints->match();
95 auterman 1.11 genpointsHT->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
96     genpointsHT->match();
97 auterman 1.2
98 auterman 1.6 //the plotting ----------------------------------------------------------------------
99 auterman 1.7 //plotting helper functions
100 auterman 1.4 PlotTools<SusyScan> * plotTools = new PlotTools<SusyScan>(genpoints->GetScan());
101 auterman 1.11 PlotTools<SusyScan> * plotToolsHT = new PlotTools<SusyScan>(genpointsHT->GetScan());
102 auterman 1.6 PlotTools<GeneratorMasses> * plotMasses = new PlotTools<GeneratorMasses>(genpoints->GetGeneratorMasses());
103 auterman 1.2
104 auterman 1.7 //iso mass lines
105     TGraph * gl500 = plotMasses->Line(Mzero, Mhalf, MGluino, 500);
106     TGraph * sq500 = plotMasses->Line(Mzero, Mhalf, MSquarkL, 500, 10);
107     sq500->SetLineWidth(2); sq500->SetLineColor(7);
108    
109     TGraph * chi100 = plotMasses->Line(Mzero, Mhalf, MChi1, 50, 20);
110     TGraph * cha200 = plotMasses->Line(Mzero, Mhalf, MCha1, 200, 20);
111     cha200->SetLineColor(2);
112    
113     //the histograms
114     c1->SetLogz(1);
115     //h->SetMaximum(27);
116     //h->SetMinimum(0.01);
117 auterman 1.10
118     /**/
119 auterman 1.7 // cross-section in M0 - M1/2
120     TH2F*hxsec = new TH2F("xsec",";m_{0} [GeV]; m_{1/2} [GeV]; cross section [pb]",
121     100,0,1009.9,50,0,500);
122     plotTools->Area(hxsec, Mzero, Mhalf, Xsection);
123     hxsec->SetMinimum(0.01);
124     //sq500->Draw();
125     //gl500->Draw();
126     hxsec->Draw("colz");
127 auterman 1.10 c1->SaveAs("results/Xsection_m0_m12_tb10.pdf");
128 auterman 1.7 std::string wait;
129     //std::cin>>wait;
130 auterman 1.10
131 auterman 1.7 // Observed Limit in M0 - M1/2
132     TH2F*hobslimit = new TH2F("obslimit",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Limit [pb]",
133     100,0,1009.9,50,0,500);
134     plotTools->Area(hobslimit, Mzero, Mhalf, ObsXsecLimit);
135     hobslimit->SetMinimum(0.01);
136     hobslimit->Draw("colz");
137 auterman 1.10 c1->SaveAs("results/ObsLimit_m0_m12_tb10.pdf");
138 auterman 1.7
139     // Expected Limit in M0 - M1/2
140     TH2F*hexplimit = new TH2F("explimit",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Limit [pb]",
141     100,0,1009.9,50,0,500);
142     plotTools->Area(hexplimit, Mzero, Mhalf, ExpXsecLimit);
143     hexplimit->SetMinimum(0.01);
144     hexplimit->Draw("colz");
145 auterman 1.10 c1->SaveAs("results/ExpLimit_m0_m12_tb10.pdf");
146 auterman 1.7
147     // Signal Acceptance in M0 - M1/2
148     TH2F*hsigacc = new TH2F("sigacc",";m_{0} [GeV]; m_{1/2} [GeV]; Signal Acceptance",
149     100,0,1009.9,50,0,500);
150     plotTools->Area(hsigacc, Mzero, Mhalf, SignalAcceptance);
151     hsigacc->SetMinimum(0.01);
152     hsigacc->SetMaximum(1.0);
153     hsigacc->Draw("colz");
154     chi100->Draw();
155     cha200->Draw();
156     gl500 ->Draw();
157     sq500 ->Draw();
158 auterman 1.10 c1->SaveAs("results/SigAcc_m0_m12_tb10.pdf");
159 auterman 1.7
160     // Exp. Limit on Number of Signal Events in M0 - M1/2
161 auterman 1.8 c1->SetLogz(0);
162 auterman 1.7 TH2F*hexplimitnsig = new TH2F("explimitnsig",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL exp. limit signal events [# ]",
163     100,0,1009.9,50,0,500);
164     plotTools->Area(hexplimitnsig, Mzero, Mhalf, ExpNSignLimit);
165 auterman 1.10 hexplimitnsig->SetMinimum(0.0);
166     hexplimitnsig->SetMaximum(20);
167 auterman 1.7 hexplimitnsig->Draw("colz");
168 auterman 1.10 c1->SaveAs("results/ExpLimitOnNSig_m0_m12_tb10.pdf");
169 auterman 1.7
170     // Obs. Limit on Number of Signal Events in M0 - M1/2
171     TH2F*hobslimitnsig = new TH2F("obslimitnsig",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL obs. limit signal events [# ]",
172 auterman 1.2 100,0,1009.9,50,0,500);
173 auterman 1.7 plotTools->Area(hobslimitnsig, Mzero, Mhalf, ObsNSignLimit);
174 auterman 1.10 hobslimitnsig->SetMinimum(0.0);
175     hobslimitnsig->SetMaximum(20);
176 auterman 1.7 hobslimitnsig->Draw("colz");
177 auterman 1.10 c1->SaveAs("results/ObsLimitOnNSig_m0_m12_tb10.pdf");
178 auterman 1.7
179     c1->SetLogz(0);
180     // Expected Exclusion in M0 - M1/2
181     TH2F*hexpexcl = new TH2F("expexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
182 auterman 1.8 100,0,1009.9,35,100,450);
183 auterman 1.11 plotTools->Area(hexpexcl, Mzero, Mhalf, ExpExclCL);
184 auterman 1.7 hexpexcl->Draw("colz");
185 auterman 1.10 c1->SaveAs("results/ExpExclusion_m0_m12_tb10.pdf");
186 auterman 1.7
187     // Observed Exclusion in M0 - M1/2
188     TH2F*hobsexcl = new TH2F("obsexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Exclusion",
189 auterman 1.8 100,0,1009.9,35,100,450);
190 auterman 1.11 plotTools->Area(hobsexcl, Mzero, Mhalf, ObsExclCL);
191 auterman 1.7 hobsexcl->Draw("colz");
192 auterman 1.10 c1->SaveAs("results/ObsExclusion_m0_m12_tb10.pdf");
193 auterman 1.7
194 auterman 1.8 // Observed Exclusion in M0 - M1/2
195     TH2F*hPLobsexcl = new TH2F("plobsexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Exclusion",
196     100,0,1009.9,35,100,450);
197     plotTools->Area(hPLobsexcl, Mzero, Mhalf, PLObsExclusion);
198     hPLobsexcl->Draw("colz");
199 auterman 1.10 c1->SaveAs("results/PL_ObsExclusion_m0_m12_tb10.pdf");
200 auterman 1.8
201 auterman 1.9 // TestContours in M0 - M1/2
202 auterman 1.10 TH2F*texcl = new TH2F("texcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
203     100,0,1009.9,35,100,450);
204 auterman 1.11 TH2F*texpexcl=(TH2F*)texcl->Clone();
205     plotTools->Area(texpexcl, Mzero, Mhalf, MCMCExpExclusion);
206     TH2F*tobsexcl=(TH2F*)texcl->Clone();
207     plotTools->Area(tobsexcl, Mzero, Mhalf, MCMCObsExclusion);
208     std::vector<TGraph*> contours = plotTools->GetContours(texpexcl,3);
209     //std::vector<TGraph*> contours = plotTools->GetContours(tobsexcl,3);
210 auterman 1.9 //hPLexpexcl
211     //hexcl->Draw("colz");
212     //hexpexcl->Draw("colz");
213     //hobsexcl->Draw("colz");
214 auterman 1.11 texpexcl->Draw("colz");
215 auterman 1.10 int col=kBlue-10;
216 auterman 1.9 for (std::vector<TGraph*>::iterator cont=contours.begin(); cont!=contours.end(); ++cont){
217     if (! *cont) continue;
218     double x, y;
219     (*cont)->GetPoint(0, x, y);
220     (*cont)->SetLineColor(col);
221     (*cont)->Draw("l");
222     TLatex l; l.SetTextSize(0.04); l.SetTextColor(col++);
223     char val[20];
224     sprintf(val,"%d",cont-contours.begin());
225     l.DrawLatex(x,y,val);
226 auterman 1.11 //if (cont-contours.begin()>3) break;
227 auterman 1.9 }
228 auterman 1.10 c1->SaveAs("results/ExclusionTestContours_m0_m12_tb10.pdf");
229 auterman 1.9
230 auterman 1.8 // Exclusion in M0 - M1/2
231     TH2F*hexcl = new TH2F("hexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
232     100,0,1009.9,35,100,450);
233 auterman 1.10 TGraph * gexpexcl = plotTools->GetContour(hexpexcl,3,0);
234     TGraph * gobsexcl = plotTools->GetContour(hobsexcl,3,0);
235     TGraph * gPLobsexcl = plotTools->GetContour(hPLobsexcl,3,0);
236     TH2F*hPLexpexcl=(TH2F*)hexcl->Clone();
237     TH2F*hFCexpexcl=(TH2F*)hexcl->Clone();
238     TH2F*hFCobsexcl=(TH2F*)hexcl->Clone();
239     TH2F*hMCMCexpexcl=(TH2F*)hexcl->Clone();
240     TH2F*hMCMCobsexcl=(TH2F*)hexcl->Clone();
241 auterman 1.11 TH2F*hCLsExpHT=(TH2F*)hexcl->Clone();
242     TH2F*hCLsObsHT=(TH2F*)hexcl->Clone();
243 auterman 1.10 plotTools->Area(hPLexpexcl, Mzero, Mhalf, PLExpExclusion);
244 auterman 1.11 plotToolsHT->Area(hCLsExpHT, Mzero, Mhalf, ExpExclCL);
245     plotToolsHT->Area(hCLsObsHT, Mzero, Mhalf, ObsExclCL);
246 auterman 1.10 TGraph * gPLexpexcl = plotTools->GetContour(hPLexpexcl,3,0);
247     TGraph * gFCexpexcl = plotTools->GetContour(hFCexpexcl,3,0);
248     TGraph * gFCobsexcl = plotTools->GetContour(hFCobsexcl,3,0);
249     TGraph * gMCMCexpexcl = plotTools->GetContour(hMCMCexpexcl,3,0);
250     TGraph * gMCMCobsexcl = plotTools->GetContour(hMCMCobsexcl,3,0);
251 auterman 1.11 TGraph * gCLsExpExclHT = plotTools->GetContour(hCLsExpHT,3,0);
252     TGraph * gCLsObsExclHT = plotTools->GetContour(hCLsObsHT,3,0);
253 auterman 1.8 hexcl->Draw("colz");
254 auterman 1.10 //set old exclusion Limits
255     TGraph* LEP_ch = set_lep_ch();
256     TGraph* LEP_sl = set_lep_sl();//slepton curve
257     TGraph* TEV_sg_cdf = set_tev_sg_cdf();//squark gluino cdf
258     TGraph* TEV_sg_d0 = set_tev_sg_d0();//squark gluino d0
259     TGraph* TEV_tlp_cdf = set_tev_tlp_cdf();//trilepton cdf
260     TGraph* TEV_tlp_d0 = set_tev_tlp_d0();//trilepton d0
261     TGraph* stau = set_tev_stau();//stau
262     TGraph* TEV_sn_d0_1 = set_sneutrino_d0_1();
263     TGraph* TEV_sn_d0_2 = set_sneutrino_d0_2();
264     TGraphErrors* First = getObserved_NLOunc();
265     TGraphErrors* Second = getExpected_NLOunc();//getLO_jetMultis();
266     TGraphErrors* Third = getLO_signalCont();
267     First->GetXaxis()->SetRangeUser(0,505);
268     First->GetYaxis()->SetRangeUser(80,500);
269     First->GetXaxis()->SetTitle("m_{0} (GeV)");
270     First->GetYaxis()->SetTitle("m_{1/2} (GeV)");
271     TSpline3 *sFirst = new TSpline3("sFirst",First);
272     sFirst->SetLineColor(kBlue);
273     sFirst->SetLineWidth(3);
274     TSpline3 *sSecond = new TSpline3("sSecond",Second);
275     sSecond->SetLineColor(kBlue);
276     sSecond->SetLineStyle(2);
277     sSecond->SetLineWidth(3);
278     TSpline3 *sThird = new TSpline3("sThird",Third);
279     sThird->SetLineColor(kGreen+2);
280     sThird->SetLineStyle(4);
281     sThird->SetLineWidth(3);
282     TEV_sn_d0_1->Draw("fsame");
283     TEV_sn_d0_2->Draw("fsame");
284     TEV_sg_d0->Draw("fsame");
285     TEV_sg_cdf->Draw("fsame");
286     LEP_ch->Draw("fsame");
287     LEP_sl->Draw("fsame");
288     stau->Draw("fsame");
289     sFirst->Draw("same");
290     sSecond->Draw("same");
291     TLatex b; b.SetTextSize(0.02); b.SetTextColor(1);
292     b.DrawLatex( 10,420,"#tilde{#tau} LSP");
293     b.DrawLatex( 6,150,"LEP2");
294     b.DrawLatex( 22,138,"#tilde{l}^{#pm}");
295     b.DrawLatex(360,110,"LEP2 #tilde{#chi}^{#pm}");
296     b.DrawLatex(100,140,"CDF");
297     b.DrawLatex(248,129,"D0 #tilde{g}, #tilde{q}");
298     b.DrawLatex( 80,180,"D0 #tilde{#nu}");
299    
300 auterman 1.8 if (gexpexcl) gexpexcl->SetLineStyle(2);
301     if (gPLobsexcl) gPLobsexcl->SetLineColor(2);
302 auterman 1.10 if (gPLexpexcl) {gPLexpexcl->SetLineStyle(2);gPLexpexcl->SetLineColor(2);}
303     if (gFCobsexcl) gFCobsexcl->SetLineColor(3);
304     if (gFCexpexcl) {gFCexpexcl->SetLineStyle(2);gFCexpexcl->SetLineColor(3);}
305     if (gMCMCobsexcl) gMCMCobsexcl->SetLineColor(4);
306     if (gMCMCexpexcl) {gMCMCexpexcl->SetLineStyle(2);gMCMCexpexcl->SetLineColor(4);}
307 auterman 1.11 if (gCLsObsExclHT) gCLsObsExclHT->SetLineColor(2);
308     if (gCLsExpExclHT) {gCLsExpExclHT->SetLineStyle(2);gCLsExpExclHT->SetLineColor(2);}
309 auterman 1.10 if (gobsexcl) gobsexcl->Draw("l");
310 auterman 1.11 if (gCLsObsExclHT) gCLsObsExclHT->Draw("l");
311     //if (gPLobsexcl) gPLobsexcl->Draw("l");
312 auterman 1.10 //if (gFCobsexcl) gFCobsexcl->Draw("l");
313 auterman 1.11 if (gMCMCobsexcl) gMCMCobsexcl->Draw("l");
314 auterman 1.10 //if (gFCexpexcl) gFCexpexcl->Draw("l");
315 auterman 1.11 //if (gPLexpexcl) gPLexpexcl->Draw("l");
316     if (gMCMCexpexcl) gMCMCexpexcl->Draw("l");
317 auterman 1.10 if (gexpexcl) gexpexcl->Draw("l");
318     //if (gFCexpexcl) gFCexpexcl->Draw("l");
319 auterman 1.11 if (gCLsExpExclHT) gCLsExpExclHT->Draw("l");
320 auterman 1.10 TLegend * leg = new TLegend(0.45,0.7,0.85,0.89);
321 auterman 1.8 leg->SetBorderSize(0);leg->SetFillColor(0);
322 auterman 1.11 if (gobsexcl) leg->AddEntry(gobsexcl,"Observed (MHT, CLs, TLimit)","l");
323     if (gexpexcl) leg->AddEntry(gexpexcl,"Expected (MHT, CLs, TLimit)","l");
324     if (gCLsObsExclHT) leg->AddEntry(gCLsObsExclHT,"Observed (HT, CLs, TLimit)","l");
325     if (gCLsExpExclHT) leg->AddEntry(gCLsExpExclHT,"Expected (HT, CLs, TLimit)","l");
326     //if (gPLobsexcl) leg->AddEntry(gPLobsexcl,"Observed (PL, RooStat)","l");
327     //if (gPLexpexcl) leg->AddEntry(gPLexpexcl,"Expected (PL, RooStat)","l");
328 auterman 1.10 //if (gFCobsexcl) leg->AddEntry(gFCobsexcl,"Observed (FC, RooStat)","l");
329     //if (gFCexpexcl) leg->AddEntry(gFCexpexcl,"Expected (FC, RooStat)","l");
330 auterman 1.11 if (gMCMCobsexcl) leg->AddEntry(gMCMCobsexcl,"Observed (MHT, MCMC, RooStat)","l");
331     if (gMCMCexpexcl) leg->AddEntry(gMCMCexpexcl,"Expected (MHT, MCMC, RooStat)","l");
332 auterman 1.10 if (sFirst) leg->AddEntry(sFirst, "RA1 NLO Observed");
333     if (sSecond) leg->AddEntry(sSecond,"RA1 NLO Expected");
334 auterman 1.8 leg->Draw();
335 auterman 1.10 gPad->RedrawAxis();
336     c1->SaveAs("results/Exclusion_m0_m12_tb10.pdf");
337 auterman 1.8
338 auterman 1.4 //plotTools->Area(h, Mzero, Mhalf, XsecOverObserved);
339     //plotTools->Area(h, Mzero, Mhalf, XsecOverExpected);
340 auterman 1.1
341 auterman 1.2
342 auterman 1.7 //-----------------------------------------------------------------------------------
343     c1->SetLogz(1);
344    
345     TGraph * mz500 = plotMasses->Line( MSquarkL, MGluino, Mzero, 500, 1);
346     TGraph * mh250 = plotMasses->Line( MSquarkL, MGluino, Mhalf, 250, 1);
347    
348 auterman 1.8 // cross-section in squark - gluino mass
349 auterman 1.7 TH2F*hxsec_qg = new TH2F("xsec_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; cross section [pb]",
350     60,200,1400,50,200,1200);
351     plotTools->Area(hxsec_qg, MSquarkL, MGluino, Xsection);
352     hxsec_qg->SetMinimum(0.01);
353     hxsec_qg->Draw("colz");
354     mz500->Draw();
355     mh250->Draw();
356 auterman 1.10 c1->SaveAs("results/Xsection_mSql_mGl_tb10.pdf");
357 auterman 1.7
358 auterman 1.8 // Observed Limit in squark - gluino mass
359 auterman 1.7 TH2F*hobslimit_qg = new TH2F("obslimit_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Limit [pb]",
360     60,200,1400,50,200,1200);
361     plotTools->Area(hobslimit_qg, MSquarkL, MGluino, ObsXsecLimit);
362     hobslimit_qg->SetMinimum(0.01);
363     hobslimit_qg->Draw("colz");
364 auterman 1.10 c1->SaveAs("results/ObsLimit_mSql_mGl_tb10.pdf");
365 auterman 1.7
366 auterman 1.8 // Expected Limit in squark - gluino mass
367 auterman 1.7 TH2F*hexplimit_qg = new TH2F("explimit_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Expected Limit [pb]",
368     60,200,1400,50,200,1200);
369     plotTools->Area(hexplimit_qg, MSquarkL, MGluino, ExpXsecLimit);
370     hexplimit_qg->SetMinimum(0.01);
371     hexplimit_qg->Draw("colz");
372 auterman 1.10 c1->SaveAs("results/ExpLimit_mSql_mGl_tb10.pdf");
373 auterman 1.7
374 auterman 1.8 // Signal Acceptance in squark - gluino mass
375 auterman 1.7 TH2F*hsigacc_qg = new TH2F("sigacc_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; Signal Acceptance",
376     60,200,1400,50,200,1200);
377     plotTools->Area(hsigacc_qg, MSquarkL, MGluino, SignalAcceptance);
378     hsigacc_qg->SetMinimum(0.01);
379     hsigacc_qg->SetMaximum(1.0);
380     hsigacc_qg->Draw("colz");
381 auterman 1.10 c1->SaveAs("results/SigAcc_mSql_mGl_tb10.pdf");
382 auterman 1.7
383 auterman 1.8 // Exp. Limit on Number of Signal Events in squark - gluino mass
384     c1->SetLogz(0);
385 auterman 1.7 TH2F*hexplimitnsig_qg = new TH2F("explimitnsig_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL exp. limit signal events [# ]",
386     60,200,1400,50,200,1200);
387     plotTools->Area(hexplimitnsig_qg, MSquarkL, MGluino, ExpNSignLimit);
388 auterman 1.10 hexplimitnsig_qg->SetMinimum(0.0);
389     hexplimitnsig_qg->SetMaximum(20);
390 auterman 1.7 hexplimitnsig_qg->Draw("colz");
391 auterman 1.10 c1->SaveAs("results/ExpLimitOnNSig_mSql_mGl_tb10.pdf");
392 auterman 1.6
393 auterman 1.8 // Obs. Limit on Number of Signal Events in squark - gluino mass
394 auterman 1.7 TH2F*hobslimitnsig_qg = new TH2F("obslimitnsig_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL obs. limit signal events [# ]",
395     60,200,1400,50,200,1200);
396     plotTools->Area(hobslimitnsig_qg, MSquarkL, MGluino, ObsNSignLimit);
397 auterman 1.10 hobslimitnsig_qg->SetMinimum(0.0);
398     hobslimitnsig_qg->SetMaximum(20);
399 auterman 1.7 hobslimitnsig_qg->Draw("colz");
400 auterman 1.10 c1->SaveAs("results/ObsLimitOnNSig_mSql_mGl_tb10.pdf");
401 auterman 1.7
402     c1->SetLogz(0);
403 auterman 1.8 // Expected Exclusion in squark - gluino mass
404 auterman 1.7 TH2F*hexpexcl_qg = new TH2F("expexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Expected Exclusion",
405 auterman 1.2 60,200,1400,50,200,1200);
406 auterman 1.11 plotTools->Area(hexpexcl_qg, MSquarkL, MGluino, ExpExclCL);
407 auterman 1.7 hexpexcl_qg->Draw("colz");
408 auterman 1.10 c1->SaveAs("results/ExpExclusion_mSql_mGl_tb10.pdf");
409 auterman 1.2
410 auterman 1.8 // Observed Exclusion in squark - gluino mass
411 auterman 1.7 TH2F*hobsexcl_qg = new TH2F("obsexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
412     60,200,1400,50,200,1200);
413 auterman 1.11 plotTools->Area(hobsexcl_qg, MSquarkL, MGluino, ObsExclCL);
414 auterman 1.8 //std::vector<TGraph *> vobsexcl_qg = plotTools->GetContours(hobsexcl_qg);
415 auterman 1.7 hobsexcl_qg->Draw("colz");
416 auterman 1.8 //for (std::vector<TGraph *>::iterator g=vobsexcl_qg.begin();g!=vobsexcl_qg.end();++g){
417     // if (! *g) continue;
418     // // (*g)->Draw("l");
419     //}
420 auterman 1.10 c1->SaveAs("results/ObsExclusion_mSql_mGl_tb10.pdf");
421 auterman 1.2
422 auterman 1.9 // TestContours in M0 - M1/2
423     TH2F*texcl_qg = new TH2F("texcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
424     60,200,1400,50,200,1200);
425     TH2F*tPLobsexcl_qg=(TH2F*)texcl_qg->Clone();
426     plotTools->Area(tPLobsexcl_qg, MSquarkL, MGluino, PLObsExclusion);
427 auterman 1.10 TH2F*tPLexpexcl_qg=(TH2F*)texcl_qg->Clone();
428     plotTools->Area(tPLexpexcl_qg, MSquarkL, MGluino, PLExpExclusion);
429 auterman 1.9 //std::vector<TGraph*> contours_qg = plotTools->GetContours(hexpexcl_qg,3);
430     //std::vector<TGraph*> contours_qg = plotTools->GetContours(hobsexcl_qg,3);
431     std::vector<TGraph*> contours_qg = plotTools->GetContours(tPLobsexcl_qg,3);
432 auterman 1.10 //std::vector<TGraph*> contours_qg = plotTools->GetContours(tPLexpexcl_qg,3);
433 auterman 1.9 //hPLexpexcl_qg
434     //hexcl_qg->Draw("colz");
435     //hexpexcl_qg->Draw("colz");
436     //hobsexcl_qg->Draw("colz");
437     tPLobsexcl_qg->Draw("colz");
438     int col_gl=kBlue-10;
439     for (std::vector<TGraph*>::iterator cont=contours_qg.begin(); cont!=contours_qg.end(); ++cont){
440     if (! *cont) continue;
441     double x, y;
442     (*cont)->GetPoint(0, x, y);
443     (*cont)->SetLineColor(col_gl);(*cont)->SetLineWidth(3);
444     (*cont)->Draw("l");
445     TLatex l; l.SetTextSize(0.04); l.SetTextColor(col_gl++);
446     char val[20];
447     sprintf(val,"%d",cont-contours_qg.begin());
448     l.DrawLatex(x,y,val);
449 auterman 1.10 if (cont-contours_qg.begin()>3) break;
450 auterman 1.9 }
451 auterman 1.10 c1->SaveAs("results/ExclusionTestContours_mSql_mGl_tb10.pdf");
452 auterman 1.9
453 auterman 1.8 // Observed Exclusion in squark - gluino mass
454     TH2F*hPLobsexcl_qg = new TH2F("plobsexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
455     60,200,1400,50,200,1200);
456     plotTools->Area(hPLobsexcl_qg, MSquarkL, MGluino, PLObsExclusion);
457 auterman 1.10 //hPLobsexcl_qg->Draw("colz");
458     //c1->SaveAs("results/PL_ObsExclusion_mSql_mGl_tb10.pdf");
459 auterman 1.8
460 auterman 1.11
461    
462    
463    
464 auterman 1.10 // Exclusion in squark - gluino mass ----------------------------------------
465 auterman 1.8 TH2F*hexcl_qg = new TH2F("hexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
466     60,200,1400,50,200,1200);
467 auterman 1.10 TGraph * gexpexcl_qg = plotTools->GetContour(hexpexcl_qg,3,0);
468 auterman 1.8 if (gexpexcl_qg) gexpexcl_qg->SetLineStyle(2);
469 auterman 1.10 TGraph * gobsexcl_qg = plotTools->GetContour(hobsexcl_qg,3,0);
470 auterman 1.8 TH2F*hPLexpexcl_qg=(TH2F*)hexcl_qg->Clone();
471 auterman 1.10 plotTools->Area(hPLexpexcl_qg, MSquarkL, MGluino, PLExpExclusion);
472     TGraph * gPLexpexcl_qg = plotTools->GetContour(hPLexpexcl_qg,3,0);
473     if (gPLexpexcl_qg) {gPLexpexcl_qg->SetLineStyle(2);gPLexpexcl_qg->SetLineColor(2);}
474     TGraph * gPLobsexcl_qg = plotTools->GetContour(hPLobsexcl_qg,3,0);
475     if (gPLobsexcl_qg) gPLobsexcl_qg->SetLineColor(2);
476 auterman 1.11 TH2F*hCLsExpHT_qg=(TH2F*)hexcl_qg->Clone();
477     TH2F*hCLsObsHT_qg=(TH2F*)hexcl_qg->Clone();
478     plotToolsHT->Area(hCLsExpHT_qg, MSquarkL, MGluino, ExpExclCL);
479     plotToolsHT->Area(hCLsObsHT_qg, MSquarkL, MGluino, ObsExclCL);
480     TGraph * gCLsExpExclHT_qg = plotTools->GetContour(hCLsExpHT_qg,3,0);
481     TGraph * gCLsObsExclHT_qg = plotTools->GetContour(hCLsObsHT_qg,3,0);
482     if (gCLsObsExclHT_qg) gCLsObsExclHT_qg->SetLineColor(2);
483     if (gCLsExpExclHT_qg) {gCLsExpExclHT_qg->SetLineStyle(2);gCLsExpExclHT_qg->SetLineColor(2);}
484 auterman 1.10 hexcl_qg->Draw("");
485 auterman 1.9 if (gobsexcl_qg) gobsexcl_qg->Draw("l");
486 auterman 1.11 if (gCLsObsExclHT_qg) gCLsObsExclHT_qg->Draw("l");
487 auterman 1.9 if (gexpexcl_qg) gexpexcl_qg->Draw("l");
488 auterman 1.11 //if (gPLobsexcl_qg) gPLobsexcl_qg->Draw("l");
489     //if (gPLexpexcl_qg) gPLexpexcl_qg->Draw("l");
490     if (gCLsExpExclHT_qg) gCLsExpExclHT_qg->Draw("l");
491 auterman 1.8 TLegend * leg_qg = new TLegend(0.45,0.78,0.85,0.89);
492     leg_qg->SetBorderSize(0);leg_qg->SetFillColor(0);
493 auterman 1.11 if (gobsexcl_qg) leg_qg->AddEntry(gobsexcl_qg,"Observed (MHT, CLs, TLimit)","l");
494     if (gexpexcl_qg) leg_qg->AddEntry(gexpexcl_qg,"Expected (MHT, CLs, TLimit)","l");
495     if (gCLsObsExclHT_qg) leg_qg->AddEntry(gCLsObsExclHT_qg,"Observed (HT, CLs, TLimit)","l");
496     if (gCLsExpExclHT_qg) leg_qg->AddEntry(gCLsExpExclHT_qg,"Expected (HT, CLs, TLimit)","l");
497     //if (gPLobsexcl_qg) leg_qg->AddEntry(gPLobsexcl_qg,"Observed (PL, RooStat)","l");
498     //if (gPLexpexcl_qg) leg_qg->AddEntry(gPLexpexcl_qg,"Expected (PL, RooStat)","l");
499 auterman 1.8 leg_qg->Draw();
500 auterman 1.10 c1->SaveAs("results/Exclusion_mSql_mGl_tb10.pdf");
501 auterman 1.1
502 auterman 1.10 //c1->SaveAs("plot_tb10.pdf");
503 auterman 1.2
504 auterman 1.10 c1->SetLogy(1);
505     c1->SetLogx(1);
506     TH2F*hUncertScan = new TH2F("hUncertScan",";relative signal uncertainty; number of signal events",
507     10,0.1,0.6,10,0.9,200);
508     //hUncertScan->GetXaxis()->SetNdivisions(505, false);
509     //hUncertScan->SetMinimum(1);
510     TGraph * gCLsExpUncert = new TGraph(0);
511     TGraph * gCLsObsUncert = new TGraph(0);
512     TGraph * gPLExpUncert = new TGraph(0);
513     TGraph * gPLObsUncert = new TGraph(0);
514     TGraph * gFCExpUncert = new TGraph(0);
515     TGraph * gFCObsUncert = new TGraph(0);
516     TGraph * gMCMCExpUncert= new TGraph(0);
517     TGraph * gMCMCObsUncert= new TGraph(0);
518     plotTools->Graph(gCLsExpUncert, SignalRelUncertainty, ExpNSignLimit,1);
519     plotTools->Graph(gCLsObsUncert, SignalRelUncertainty, ObsNSignLimit,1);
520     plotTools->Graph(gPLExpUncert, SignalRelUncertainty, PLExpNSignLimit,1);
521     plotTools->Graph(gPLObsUncert, SignalRelUncertainty, PLObsNSignLimit, 1);
522     plotTools->Graph(gFCExpUncert, SignalRelUncertainty, FCExpNSignLimit,1);
523     plotTools->Graph(gFCObsUncert, SignalRelUncertainty, FCObsNSignLimit, 1);
524     plotTools->Graph(gMCMCExpUncert,SignalRelUncertainty, MCMCExpNSignLimit,1);
525     plotTools->Graph(gMCMCObsUncert,SignalRelUncertainty, MCMCObsNSignLimit, 1);
526     gCLsExpUncert->SetLineStyle(8);
527     gPLObsUncert->SetLineColor(2);
528     gPLExpUncert->SetLineColor(2); gPLExpUncert->SetLineStyle(8);
529     gFCObsUncert->SetLineColor(3);
530     gFCExpUncert->SetLineColor(3); gFCExpUncert->SetLineStyle(8);
531     gMCMCObsUncert->SetLineColor(4);
532     gMCMCExpUncert->SetLineColor(4); gMCMCExpUncert->SetLineStyle(8);
533     hUncertScan->Draw("h");
534     gCLsExpUncert->Draw("l");
535     gCLsObsUncert->Draw("l");
536     gPLObsUncert->Draw("l");
537     gPLExpUncert->Draw("l");
538 auterman 1.11 gFCObsUncert->Draw("l");
539     gFCExpUncert->Draw("l");
540     gMCMCObsUncert->Draw("l");
541     gMCMCExpUncert->Draw("l");
542 auterman 1.10 TLatex l; l.SetTextSize(0.03); l.SetTextColor(1);
543     l.DrawLatex(0.025,25,"excluded");
544     TMarker m; m.SetMarkerStyle(29); m.SetMarkerColor(2);
545     m.DrawMarker(0.128, 28.5);l.DrawLatex(0.14,28.5,"LM1");
546     m.DrawMarker(0.147, 77.4);l.DrawLatex(0.16,77.4,"LM0");
547    
548     TLegend * leg_S = new TLegend(0.5,0.14,0.85,0.38);
549     leg_S->SetBorderSize(0);leg_S->SetFillColor(0);
550     leg_S->SetHeader("95% CL upper limits");
551     leg_S->AddEntry(gCLsExpUncert,"Expected (CLs, TLimit)","l");
552     leg_S->AddEntry(gCLsObsUncert,"Observed (CLs, TLimit)","l");
553     leg_S->AddEntry(gPLExpUncert,"Expected (PL, RooStat)","l");
554     leg_S->AddEntry(gPLObsUncert,"Observed (PL, RooStat)","l");
555 auterman 1.11 leg_S->AddEntry(gFCObsUncert,"Observed (FC, RooStat)","l");
556     leg_S->AddEntry(gFCExpUncert,"Expected (FC, RooStat)","l");
557     leg_S->AddEntry(gMCMCObsUncert,"Observed (MCMC, RooStat)","l");
558     leg_S->AddEntry(gMCMCExpUncert,"Expected (MCMC, RooStat)","l");
559 auterman 1.10 leg_S->Draw();
560     c1->SaveAs("results/UncertaintyScan.pdf");
561 auterman 1.2
562 auterman 1.7 //theApp.Run();
563 auterman 1.1 }
564    
565    
566     int main(int argc, char** argv)
567     {
568     return plot(argc, argv);
569     }