ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/plot.cc
Revision: 1.15
Committed: Wed Feb 9 09:50:37 2011 UTC (14 years, 3 months ago) by auterman
Content type: text/plain
Branch: MAIN
Changes since 1.14: +13 -292 lines
Log Message:
fiing conflicsts

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 auterman 1.12
88     TheLimits * genpointsHT_SC = new TheLimits();
89 auterman 1.13 genpointsHT_SC->Fill("limits_HT_SigCont/filelist.txt");
90    
91     TheLimits * genpointsMHT_SC = new TheLimits();
92     genpointsMHT_SC->Fill("limits_MHT_SigCont/filelist.txt");
93 auterman 1.11
94 auterman 1.10
95     //Replace read limits with specific numbers
96     //genpoints->OverwriteLimits("ABCD_MHT");
97    
98 auterman 1.5 genpoints->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
99     genpoints->match();
100 auterman 1.11 genpointsHT->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
101     genpointsHT->match();
102 auterman 1.12 genpointsHT_SC->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
103     genpointsHT_SC->match();
104 auterman 1.13 genpointsMHT_SC->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
105     genpointsMHT_SC->match();
106 auterman 1.2
107 auterman 1.6 //the plotting ----------------------------------------------------------------------
108 auterman 1.7 //plotting helper functions
109 auterman 1.4 PlotTools<SusyScan> * plotTools = new PlotTools<SusyScan>(genpoints->GetScan());
110 auterman 1.11 PlotTools<SusyScan> * plotToolsHT = new PlotTools<SusyScan>(genpointsHT->GetScan());
111 auterman 1.12 PlotTools<SusyScan> * plotToolsHT_SC = new PlotTools<SusyScan>(genpointsHT_SC->GetScan());
112 auterman 1.15 PlotTools<SusyScan> * plotToolsMHT_SC = new PlotTools<SusyScan>(genpointsMHT_SC->GetScan());
113 auterman 1.6 PlotTools<GeneratorMasses> * plotMasses = new PlotTools<GeneratorMasses>(genpoints->GetGeneratorMasses());
114 auterman 1.2
115 auterman 1.7 //iso mass lines
116     TGraph * gl500 = plotMasses->Line(Mzero, Mhalf, MGluino, 500);
117     TGraph * sq500 = plotMasses->Line(Mzero, Mhalf, MSquarkL, 500, 10);
118     sq500->SetLineWidth(2); sq500->SetLineColor(7);
119    
120     TGraph * chi100 = plotMasses->Line(Mzero, Mhalf, MChi1, 50, 20);
121     TGraph * cha200 = plotMasses->Line(Mzero, Mhalf, MCha1, 200, 20);
122     cha200->SetLineColor(2);
123    
124     //the histograms
125     c1->SetLogz(1);
126     //h->SetMaximum(27);
127     //h->SetMinimum(0.01);
128 auterman 1.10
129     /**/
130 auterman 1.7 // cross-section in M0 - M1/2
131     TH2F*hxsec = new TH2F("xsec",";m_{0} [GeV]; m_{1/2} [GeV]; cross section [pb]",
132     100,0,1009.9,50,0,500);
133     plotTools->Area(hxsec, Mzero, Mhalf, Xsection);
134     hxsec->SetMinimum(0.01);
135     //sq500->Draw();
136     //gl500->Draw();
137     hxsec->Draw("colz");
138 auterman 1.10 c1->SaveAs("results/Xsection_m0_m12_tb10.pdf");
139 auterman 1.7 std::string wait;
140     //std::cin>>wait;
141 auterman 1.10
142 auterman 1.7 // Observed Limit in M0 - M1/2
143     TH2F*hobslimit = new TH2F("obslimit",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Limit [pb]",
144     100,0,1009.9,50,0,500);
145     plotTools->Area(hobslimit, Mzero, Mhalf, ObsXsecLimit);
146     hobslimit->SetMinimum(0.01);
147     hobslimit->Draw("colz");
148 auterman 1.14 c1->SaveAs("results/ObsLimit_m0_m12_tb10.pdf");
149    
150 auterman 1.15
151 auterman 1.7 // Expected Limit in M0 - M1/2
152     TH2F*hexplimit = new TH2F("explimit",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Limit [pb]",
153     100,0,1009.9,50,0,500);
154     plotTools->Area(hexplimit, Mzero, Mhalf, ExpXsecLimit);
155     hexplimit->SetMinimum(0.01);
156     hexplimit->Draw("colz");
157 auterman 1.10 c1->SaveAs("results/ExpLimit_m0_m12_tb10.pdf");
158 auterman 1.7
159 auterman 1.13 // Signal Acceptance in M0 - M1/2
160 auterman 1.7 TH2F*hsigacc = new TH2F("sigacc",";m_{0} [GeV]; m_{1/2} [GeV]; Signal Acceptance",
161     100,0,1009.9,50,0,500);
162     plotTools->Area(hsigacc, Mzero, Mhalf, SignalAcceptance);
163     hsigacc->SetMinimum(0.01);
164     hsigacc->SetMaximum(1.0);
165     hsigacc->Draw("colz");
166 auterman 1.14 //chi100->Draw();
167     //cha200->Draw();
168     //gl500 ->Draw();
169     // sq500 ->Draw();
170     c1->SaveAs("results/SigAccMHT_m0_m12_tb10.pdf");
171    
172 auterman 1.15
173 auterman 1.7 // Exp. Limit on Number of Signal Events in M0 - M1/2
174 auterman 1.8 c1->SetLogz(0);
175 auterman 1.7 TH2F*hexplimitnsig = new TH2F("explimitnsig",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL exp. limit signal events [# ]",
176     100,0,1009.9,50,0,500);
177     plotTools->Area(hexplimitnsig, Mzero, Mhalf, ExpNSignLimit);
178 auterman 1.10 hexplimitnsig->SetMinimum(0.0);
179     hexplimitnsig->SetMaximum(20);
180 auterman 1.7 hexplimitnsig->Draw("colz");
181 auterman 1.10 c1->SaveAs("results/ExpLimitOnNSig_m0_m12_tb10.pdf");
182 auterman 1.7
183     // Obs. Limit on Number of Signal Events in M0 - M1/2
184     TH2F*hobslimitnsig = new TH2F("obslimitnsig",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL obs. limit signal events [# ]",
185 auterman 1.2 100,0,1009.9,50,0,500);
186 auterman 1.7 plotTools->Area(hobslimitnsig, Mzero, Mhalf, ObsNSignLimit);
187 auterman 1.10 hobslimitnsig->SetMinimum(0.0);
188     hobslimitnsig->SetMaximum(20);
189 auterman 1.7 hobslimitnsig->Draw("colz");
190 auterman 1.10 c1->SaveAs("results/ObsLimitOnNSig_m0_m12_tb10.pdf");
191 auterman 1.7
192     c1->SetLogz(0);
193     // Expected Exclusion in M0 - M1/2
194     TH2F*hexpexcl = new TH2F("expexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
195 auterman 1.8 100,0,1009.9,35,100,450);
196 auterman 1.11 plotTools->Area(hexpexcl, Mzero, Mhalf, ExpExclCL);
197 auterman 1.7 hexpexcl->Draw("colz");
198 auterman 1.10 c1->SaveAs("results/ExpExclusion_m0_m12_tb10.pdf");
199 auterman 1.7
200     // Observed Exclusion in M0 - M1/2
201     TH2F*hobsexcl = new TH2F("obsexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Exclusion",
202 auterman 1.8 100,0,1009.9,35,100,450);
203 auterman 1.11 plotTools->Area(hobsexcl, Mzero, Mhalf, ObsExclCL);
204 auterman 1.7 hobsexcl->Draw("colz");
205 auterman 1.10 c1->SaveAs("results/ObsExclusion_m0_m12_tb10.pdf");
206 auterman 1.7
207 auterman 1.8 // Observed Exclusion in M0 - M1/2
208     TH2F*hPLobsexcl = new TH2F("plobsexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Observed Exclusion",
209     100,0,1009.9,35,100,450);
210     plotTools->Area(hPLobsexcl, Mzero, Mhalf, PLObsExclusion);
211     hPLobsexcl->Draw("colz");
212 auterman 1.10 c1->SaveAs("results/PL_ObsExclusion_m0_m12_tb10.pdf");
213 auterman 1.8
214 auterman 1.9 // TestContours in M0 - M1/2
215 auterman 1.14 TH2F*texcl = new TH2F("texcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
216     100,0,1009.9,35,100,450);
217     TH2F*tPLexpexcl=(TH2F*)texcl->Clone();
218     plotTools->Area(tPLexpexcl, Mzero, Mhalf, PLExpExclusion);
219     TH2F*tFCexpexcl=(TH2F*)texcl->Clone();
220     plotTools->Area(tFCexpexcl, Mzero, Mhalf, FCExpExclusion);
221     TH2F*tFCobsexcl=(TH2F*)texcl->Clone();
222     plotTools->Area(tFCobsexcl, Mzero, Mhalf, FCObsExclusion);
223     std::vector<TGraph*> contours = plotTools->GetContours(hexpexcl,3);
224     //std::vector<TGraph*> contours = plotTools->GetContours(hobsexcl,3);
225     //std::vector<TGraph*> contours = plotTools->GetContours(tPLexpexcl,3);
226     //std::vector<TGraph*> contours = plotTools->GetContours(hPLobsexcl,3);
227 auterman 1.9 //hPLexpexcl
228     //hexcl->Draw("colz");
229 auterman 1.15 hexpexcl->Draw("colz");
230 auterman 1.9 //hobsexcl->Draw("colz");
231 auterman 1.14 int col=kBlue-10;
232 auterman 1.9 for (std::vector<TGraph*>::iterator cont=contours.begin(); cont!=contours.end(); ++cont){
233     if (! *cont) continue;
234     double x, y;
235     (*cont)->GetPoint(0, x, y);
236     (*cont)->SetLineColor(col);
237     (*cont)->Draw("l");
238     TLatex l; l.SetTextSize(0.04); l.SetTextColor(col++);
239     char val[20];
240 auterman 1.13 sprintf(val,"%d",(int)(cont-contours.begin()));
241 auterman 1.9 l.DrawLatex(x,y,val);
242 auterman 1.11 //if (cont-contours.begin()>3) break;
243 auterman 1.9 }
244 auterman 1.10 c1->SaveAs("results/ExclusionTestContours_m0_m12_tb10.pdf");
245 auterman 1.9
246 auterman 1.13
247 auterman 1.8 // Exclusion in M0 - M1/2
248     TH2F*hexcl = new TH2F("hexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
249     100,0,1009.9,35,100,450);
250 auterman 1.14 hexcl->Draw("colz");
251 auterman 1.13 TGraph * gexpexcl = plotTools ->GetContour(hexcl,Mzero,Mhalf,ExpExclCL, 3,0, 2,2);
252     TGraph * gobsexcl = plotTools ->GetContour(hexcl,Mzero,Mhalf,ObsExclCL, 3,0, 2,1);
253     TGraph * gMCMCexpexcl = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,MCMCExpExclusion,3,0, 3,2);
254     TGraph * gMCMCobsexcl = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,MCMCObsExclusion,3,0, 3,1);
255     TGraph * gCLsExpExclHT_SC = plotToolsHT_SC->GetContour(hexcl,Mzero,Mhalf,ExpExclCL, 3,0, 4,2);
256     TGraph * gCLsExpExclHT = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,ExpExclCL, 3,0, 1,2);
257     TGraph * gCLsObsExclHT = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,ObsExclCL, 3,0, 1,1);
258     TGraph * gCLsExpExclHTm1 = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,ExpExclCLm1sigma,3,0, 5,2);
259     TGraph * gCLsExpExclHTp1 = plotToolsHT ->GetContour(hexcl,Mzero,Mhalf,ExpExclCLp1sigma,3,0, 5,2);
260     TGraph * gCLsExp1Sigma = MakeBand(gCLsExpExclHTp1, gCLsExpExclHTm1);
261     hexcl->Draw("colz");
262     if (gCLsExp1Sigma) gCLsExp1Sigma->Draw("lf");
263     if (gexpexcl) gexpexcl->Draw("l");
264     if (gCLsExpExclHT_SC) gCLsExpExclHT_SC->Draw("l");
265     if (gCLsExpExclHT) gCLsExpExclHT->Draw("l");
266     if (gMCMCexpexcl) gMCMCexpexcl->Draw("l");
267     if (gCLsObsExclHT) gCLsObsExclHT->Draw("l");
268     //if (gobsexcl) gobsexcl->Draw("l");
269     //if (gPLobsexcl) gPLobsexcl->Draw("l");
270     //if (gFCobsexcl) gFCobsexcl->Draw("l");
271     //if (gMCMCobsexcl) gMCMCobsexcl->Draw("l");
272     //if (gFCexpexcl) gFCexpexcl->Draw("l");
273     //if (gPLexpexcl) gPLexpexcl->Draw("l");
274     //if (gFCexpexcl) gFCexpexcl->Draw("l");
275 auterman 1.10 //set old exclusion Limits
276     TGraph* LEP_ch = set_lep_ch();
277     TGraph* LEP_sl = set_lep_sl();//slepton curve
278     TGraph* TEV_sg_cdf = set_tev_sg_cdf();//squark gluino cdf
279     TGraph* TEV_sg_d0 = set_tev_sg_d0();//squark gluino d0
280     TGraph* TEV_tlp_cdf = set_tev_tlp_cdf();//trilepton cdf
281     TGraph* TEV_tlp_d0 = set_tev_tlp_d0();//trilepton d0
282     TGraph* stau = set_tev_stau();//stau
283     TGraph* TEV_sn_d0_1 = set_sneutrino_d0_1();
284     TGraph* TEV_sn_d0_2 = set_sneutrino_d0_2();
285 auterman 1.15 TGraphErrors* First = getObserved_NLO_tanBeta10();
286     TGraphErrors* Second = getExpected_NLO_tanBeta10();//getLO_jetMultis();
287     TGraphErrors* Third = getLO_tanBeta10();
288 auterman 1.10 First->GetXaxis()->SetRangeUser(0,505);
289     First->GetYaxis()->SetRangeUser(80,500);
290     First->GetXaxis()->SetTitle("m_{0} (GeV)");
291     First->GetYaxis()->SetTitle("m_{1/2} (GeV)");
292     TSpline3 *sFirst = new TSpline3("sFirst",First);
293     sFirst->SetLineColor(kBlue);
294     sFirst->SetLineWidth(3);
295     TSpline3 *sSecond = new TSpline3("sSecond",Second);
296     sSecond->SetLineColor(kBlue);
297     sSecond->SetLineStyle(2);
298     sSecond->SetLineWidth(3);
299     TSpline3 *sThird = new TSpline3("sThird",Third);
300     sThird->SetLineColor(kGreen+2);
301     sThird->SetLineStyle(4);
302     sThird->SetLineWidth(3);
303     TEV_sn_d0_1->Draw("fsame");
304     TEV_sn_d0_2->Draw("fsame");
305     TEV_sg_d0->Draw("fsame");
306     TEV_sg_cdf->Draw("fsame");
307     LEP_ch->Draw("fsame");
308     LEP_sl->Draw("fsame");
309     stau->Draw("fsame");
310     sFirst->Draw("same");
311     sSecond->Draw("same");
312 auterman 1.15 sThird->Draw("same");
313 auterman 1.10 TLatex b; b.SetTextSize(0.02); b.SetTextColor(1);
314     b.DrawLatex( 10,420,"#tilde{#tau} LSP");
315     b.DrawLatex( 6,150,"LEP2");
316     b.DrawLatex( 22,138,"#tilde{l}^{#pm}");
317     b.DrawLatex(360,110,"LEP2 #tilde{#chi}^{#pm}");
318     b.DrawLatex(100,140,"CDF");
319     b.DrawLatex(248,129,"D0 #tilde{g}, #tilde{q}");
320     b.DrawLatex( 80,180,"D0 #tilde{#nu}");
321 auterman 1.14
322     TLegend * leg = new TLegend(0.45,0.7,0.85,0.89);
323 auterman 1.8 leg->SetBorderSize(0);leg->SetFillColor(0);
324 auterman 1.12 //if (gobsexcl) leg->AddEntry(gobsexcl,"Observed (MHT, CLs, TLimit)","l");
325     if (gexpexcl) leg->AddEntry(gexpexcl,"LO Expected (MHT, CLs, TLimit)","l");
326     if (gCLsObsExclHT) leg->AddEntry(gCLsObsExclHT,"LO Observed (HT, CLs, TLimit)","l");
327     if (gCLsExpExclHT) leg->AddEntry(gCLsExpExclHT,"LO Expected (HT, CLs, TLimit)","l");
328     if (gCLsExpExclHT_SC) leg->AddEntry(gCLsExpExclHT_SC,"LO Expected (HT, CLs, sig cont)","l");
329 auterman 1.11 //if (gPLobsexcl) leg->AddEntry(gPLobsexcl,"Observed (PL, RooStat)","l");
330     //if (gPLexpexcl) leg->AddEntry(gPLexpexcl,"Expected (PL, RooStat)","l");
331 auterman 1.10 //if (gFCobsexcl) leg->AddEntry(gFCobsexcl,"Observed (FC, RooStat)","l");
332     //if (gFCexpexcl) leg->AddEntry(gFCexpexcl,"Expected (FC, RooStat)","l");
333 auterman 1.12 //if (gMCMCobsexcl) leg->AddEntry(gMCMCobsexcl,"Observed (MHT, MCMC, RooStat)","l");
334     if (gMCMCexpexcl) leg->AddEntry(gMCMCexpexcl,"LO Expected (HT, MCMC, RooStat)","l");
335 auterman 1.15 if (sFirst) leg->AddEntry(sFirst, "NLO RA1 tb10 Observed");
336     if (sSecond) leg->AddEntry(sSecond,"NLO RA1 tb10 Expected");
337     if (sThird) leg->AddEntry(sThird,"LO RA1 tb10 Observed");
338 auterman 1.8 leg->Draw();
339 auterman 1.10 gPad->RedrawAxis();
340 auterman 1.13 c1->SaveAs("results/Exclusion_m0_m12_tb10.pdf");
341 auterman 1.15
342 auterman 1.8
343 auterman 1.13 // Signal Contamination in M0 - M1/2
344     c1->SetLogz(0);
345     TH2F*hsigcont = new TH2F("sigcont",";m_{0} [GeV]; m_{1/2}; number of signal in bkg yield [events]",
346     100,0,1009.9,50,0,500);
347     plotToolsHT_SC->Area(hsigcont, Mzero, Mhalf, SignalContamination);
348     hsigcont->SetMinimum(0.01);
349     hsigcont->SetMaximum(20);
350     hsigcont->Draw("colz");
351     if (gCLsObsExclHT) gCLsObsExclHT->Draw("l");
352     c1->SaveAs("results/SignalContamination_HT_m0_m12_tb10.pdf");
353    
354     // Signal Contamination in M0 - M1/2
355     c1->SetLogz(0);
356     TH2F*hsigcontMHT = new TH2F("sigcontMHT",";m_{0} [GeV]; m_{1/2}; number of signal in bkg yield [events]",
357     100,0,1009.9,50,0,500);
358     plotToolsMHT_SC->Area(hsigcontMHT, Mzero, Mhalf, SignalContamination);
359     hsigcontMHT->SetMinimum(0.01);
360     hsigcontMHT->SetMaximum(20);
361     hsigcontMHT->Draw("colz");
362     if (gobsexcl) gobsexcl->Draw("l");
363     c1->SaveAs("results/SignalContamination_MHT_m0_m12_tb10.pdf");
364    
365 auterman 1.1
366 auterman 1.2
367 auterman 1.7 //-----------------------------------------------------------------------------------
368     c1->SetLogz(1);
369    
370     TGraph * mz500 = plotMasses->Line( MSquarkL, MGluino, Mzero, 500, 1);
371     TGraph * mh250 = plotMasses->Line( MSquarkL, MGluino, Mhalf, 250, 1);
372    
373 auterman 1.8 // cross-section in squark - gluino mass
374 auterman 1.7 TH2F*hxsec_qg = new TH2F("xsec_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; cross section [pb]",
375     60,200,1400,50,200,1200);
376     plotTools->Area(hxsec_qg, MSquarkL, MGluino, Xsection);
377     hxsec_qg->SetMinimum(0.01);
378     hxsec_qg->Draw("colz");
379     mz500->Draw();
380     mh250->Draw();
381 auterman 1.10 c1->SaveAs("results/Xsection_mSql_mGl_tb10.pdf");
382 auterman 1.7
383 auterman 1.8 // Observed Limit in squark - gluino mass
384 auterman 1.7 TH2F*hobslimit_qg = new TH2F("obslimit_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Limit [pb]",
385     60,200,1400,50,200,1200);
386     plotTools->Area(hobslimit_qg, MSquarkL, MGluino, ObsXsecLimit);
387     hobslimit_qg->SetMinimum(0.01);
388     hobslimit_qg->Draw("colz");
389 auterman 1.10 c1->SaveAs("results/ObsLimit_mSql_mGl_tb10.pdf");
390 auterman 1.7
391 auterman 1.8 // Expected Limit in squark - gluino mass
392 auterman 1.7 TH2F*hexplimit_qg = new TH2F("explimit_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Expected Limit [pb]",
393     60,200,1400,50,200,1200);
394     plotTools->Area(hexplimit_qg, MSquarkL, MGluino, ExpXsecLimit);
395     hexplimit_qg->SetMinimum(0.01);
396     hexplimit_qg->Draw("colz");
397 auterman 1.10 c1->SaveAs("results/ExpLimit_mSql_mGl_tb10.pdf");
398 auterman 1.7
399 auterman 1.8 // Signal Acceptance in squark - gluino mass
400 auterman 1.7 TH2F*hsigacc_qg = new TH2F("sigacc_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; Signal Acceptance",
401     60,200,1400,50,200,1200);
402     plotTools->Area(hsigacc_qg, MSquarkL, MGluino, SignalAcceptance);
403     hsigacc_qg->SetMinimum(0.01);
404     hsigacc_qg->SetMaximum(1.0);
405     hsigacc_qg->Draw("colz");
406 auterman 1.14 c1->SaveAs("results/SigAccMHT_mSql_mGl_tb10.pdf");
407    
408     // Signal Acceptance in squark - gluino mass
409     TH2F*hsigaccHT_qg = new TH2F("sigaccHT_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; Signal Acceptance",
410     60,200,1400,50,200,1200);
411     plotToolsHT->Area(hsigaccHT_qg, MSquarkL, MGluino, SignalAcceptance);
412     hsigaccHT_qg->SetMinimum(0.01);
413     hsigaccHT_qg->SetMaximum(1.0);
414     hsigaccHT_qg->Draw("colz");
415     c1->SaveAs("results/SigAccHT_mSql_mGl_tb10.pdf");
416 auterman 1.15
417 auterman 1.7
418 auterman 1.8 // Exp. Limit on Number of Signal Events in squark - gluino mass
419     c1->SetLogz(0);
420 auterman 1.7 TH2F*hexplimitnsig_qg = new TH2F("explimitnsig_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL exp. limit signal events [# ]",
421     60,200,1400,50,200,1200);
422     plotTools->Area(hexplimitnsig_qg, MSquarkL, MGluino, ExpNSignLimit);
423 auterman 1.10 hexplimitnsig_qg->SetMinimum(0.0);
424     hexplimitnsig_qg->SetMaximum(20);
425 auterman 1.7 hexplimitnsig_qg->Draw("colz");
426 auterman 1.10 c1->SaveAs("results/ExpLimitOnNSig_mSql_mGl_tb10.pdf");
427 auterman 1.6
428 auterman 1.8 // Obs. Limit on Number of Signal Events in squark - gluino mass
429 auterman 1.7 TH2F*hobslimitnsig_qg = new TH2F("obslimitnsig_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL obs. limit signal events [# ]",
430     60,200,1400,50,200,1200);
431     plotTools->Area(hobslimitnsig_qg, MSquarkL, MGluino, ObsNSignLimit);
432 auterman 1.10 hobslimitnsig_qg->SetMinimum(0.0);
433     hobslimitnsig_qg->SetMaximum(20);
434 auterman 1.7 hobslimitnsig_qg->Draw("colz");
435 auterman 1.10 c1->SaveAs("results/ObsLimitOnNSig_mSql_mGl_tb10.pdf");
436 auterman 1.7
437     c1->SetLogz(0);
438 auterman 1.8 // Expected Exclusion in squark - gluino mass
439 auterman 1.7 TH2F*hexpexcl_qg = new TH2F("expexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Expected Exclusion",
440 auterman 1.2 60,200,1400,50,200,1200);
441 auterman 1.11 plotTools->Area(hexpexcl_qg, MSquarkL, MGluino, ExpExclCL);
442 auterman 1.7 hexpexcl_qg->Draw("colz");
443 auterman 1.10 c1->SaveAs("results/ExpExclusion_mSql_mGl_tb10.pdf");
444 auterman 1.2
445 auterman 1.8 // Observed Exclusion in squark - gluino mass
446 auterman 1.7 TH2F*hobsexcl_qg = new TH2F("obsexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
447     60,200,1400,50,200,1200);
448 auterman 1.11 plotTools->Area(hobsexcl_qg, MSquarkL, MGluino, ObsExclCL);
449 auterman 1.8 //std::vector<TGraph *> vobsexcl_qg = plotTools->GetContours(hobsexcl_qg);
450 auterman 1.7 hobsexcl_qg->Draw("colz");
451 auterman 1.8 //for (std::vector<TGraph *>::iterator g=vobsexcl_qg.begin();g!=vobsexcl_qg.end();++g){
452     // if (! *g) continue;
453     // // (*g)->Draw("l");
454     //}
455 auterman 1.10 c1->SaveAs("results/ObsExclusion_mSql_mGl_tb10.pdf");
456 auterman 1.2
457 auterman 1.9 // TestContours in M0 - M1/2
458     TH2F*texcl_qg = new TH2F("texcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
459     60,200,1400,50,200,1200);
460     TH2F*tPLobsexcl_qg=(TH2F*)texcl_qg->Clone();
461     plotTools->Area(tPLobsexcl_qg, MSquarkL, MGluino, PLObsExclusion);
462 auterman 1.10 TH2F*tPLexpexcl_qg=(TH2F*)texcl_qg->Clone();
463     plotTools->Area(tPLexpexcl_qg, MSquarkL, MGluino, PLExpExclusion);
464 auterman 1.9 //std::vector<TGraph*> contours_qg = plotTools->GetContours(hexpexcl_qg,3);
465     //std::vector<TGraph*> contours_qg = plotTools->GetContours(hobsexcl_qg,3);
466     std::vector<TGraph*> contours_qg = plotTools->GetContours(tPLobsexcl_qg,3);
467 auterman 1.10 //std::vector<TGraph*> contours_qg = plotTools->GetContours(tPLexpexcl_qg,3);
468 auterman 1.9 //hPLexpexcl_qg
469     //hexcl_qg->Draw("colz");
470     //hexpexcl_qg->Draw("colz");
471     //hobsexcl_qg->Draw("colz");
472     tPLobsexcl_qg->Draw("colz");
473     int col_gl=kBlue-10;
474     for (std::vector<TGraph*>::iterator cont=contours_qg.begin(); cont!=contours_qg.end(); ++cont){
475     if (! *cont) continue;
476     double x, y;
477     (*cont)->GetPoint(0, x, y);
478     (*cont)->SetLineColor(col_gl);(*cont)->SetLineWidth(3);
479     (*cont)->Draw("l");
480     TLatex l; l.SetTextSize(0.04); l.SetTextColor(col_gl++);
481     char val[20];
482 auterman 1.13 sprintf(val,"%d",(int)(cont-contours_qg.begin()));
483 auterman 1.9 l.DrawLatex(x,y,val);
484 auterman 1.10 if (cont-contours_qg.begin()>3) break;
485 auterman 1.9 }
486 auterman 1.10 c1->SaveAs("results/ExclusionTestContours_mSql_mGl_tb10.pdf");
487 auterman 1.9
488 auterman 1.8 // Observed Exclusion in squark - gluino mass
489     TH2F*hPLobsexcl_qg = new TH2F("plobsexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
490     60,200,1400,50,200,1200);
491     plotTools->Area(hPLobsexcl_qg, MSquarkL, MGluino, PLObsExclusion);
492 auterman 1.10 //hPLobsexcl_qg->Draw("colz");
493     //c1->SaveAs("results/PL_ObsExclusion_mSql_mGl_tb10.pdf");
494 auterman 1.8
495 auterman 1.11
496    
497    
498    
499 auterman 1.10 // Exclusion in squark - gluino mass ----------------------------------------
500 auterman 1.8 TH2F*hexcl_qg = new TH2F("hexcl_qg",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; 95% CL Observed Exclusion",
501     60,200,1400,50,200,1200);
502 auterman 1.10 TGraph * gexpexcl_qg = plotTools->GetContour(hexpexcl_qg,3,0);
503 auterman 1.8 if (gexpexcl_qg) gexpexcl_qg->SetLineStyle(2);
504 auterman 1.10 TGraph * gobsexcl_qg = plotTools->GetContour(hobsexcl_qg,3,0);
505 auterman 1.8 TH2F*hPLexpexcl_qg=(TH2F*)hexcl_qg->Clone();
506 auterman 1.10 plotTools->Area(hPLexpexcl_qg, MSquarkL, MGluino, PLExpExclusion);
507     TGraph * gPLexpexcl_qg = plotTools->GetContour(hPLexpexcl_qg,3,0);
508     if (gPLexpexcl_qg) {gPLexpexcl_qg->SetLineStyle(2);gPLexpexcl_qg->SetLineColor(2);}
509     TGraph * gPLobsexcl_qg = plotTools->GetContour(hPLobsexcl_qg,3,0);
510     if (gPLobsexcl_qg) gPLobsexcl_qg->SetLineColor(2);
511 auterman 1.11 TH2F*hCLsExpHT_qg=(TH2F*)hexcl_qg->Clone();
512     TH2F*hCLsObsHT_qg=(TH2F*)hexcl_qg->Clone();
513     plotToolsHT->Area(hCLsExpHT_qg, MSquarkL, MGluino, ExpExclCL);
514     plotToolsHT->Area(hCLsObsHT_qg, MSquarkL, MGluino, ObsExclCL);
515     TGraph * gCLsExpExclHT_qg = plotTools->GetContour(hCLsExpHT_qg,3,0);
516     TGraph * gCLsObsExclHT_qg = plotTools->GetContour(hCLsObsHT_qg,3,0);
517     if (gCLsObsExclHT_qg) gCLsObsExclHT_qg->SetLineColor(2);
518     if (gCLsExpExclHT_qg) {gCLsExpExclHT_qg->SetLineStyle(2);gCLsExpExclHT_qg->SetLineColor(2);}
519 auterman 1.10 hexcl_qg->Draw("");
520 auterman 1.9 if (gobsexcl_qg) gobsexcl_qg->Draw("l");
521 auterman 1.11 if (gCLsObsExclHT_qg) gCLsObsExclHT_qg->Draw("l");
522 auterman 1.9 if (gexpexcl_qg) gexpexcl_qg->Draw("l");
523 auterman 1.11 //if (gPLobsexcl_qg) gPLobsexcl_qg->Draw("l");
524     //if (gPLexpexcl_qg) gPLexpexcl_qg->Draw("l");
525     if (gCLsExpExclHT_qg) gCLsExpExclHT_qg->Draw("l");
526 auterman 1.8 TLegend * leg_qg = new TLegend(0.45,0.78,0.85,0.89);
527     leg_qg->SetBorderSize(0);leg_qg->SetFillColor(0);
528 auterman 1.11 if (gobsexcl_qg) leg_qg->AddEntry(gobsexcl_qg,"Observed (MHT, CLs, TLimit)","l");
529     if (gexpexcl_qg) leg_qg->AddEntry(gexpexcl_qg,"Expected (MHT, CLs, TLimit)","l");
530     if (gCLsObsExclHT_qg) leg_qg->AddEntry(gCLsObsExclHT_qg,"Observed (HT, CLs, TLimit)","l");
531     if (gCLsExpExclHT_qg) leg_qg->AddEntry(gCLsExpExclHT_qg,"Expected (HT, CLs, TLimit)","l");
532     //if (gPLobsexcl_qg) leg_qg->AddEntry(gPLobsexcl_qg,"Observed (PL, RooStat)","l");
533     //if (gPLexpexcl_qg) leg_qg->AddEntry(gPLexpexcl_qg,"Expected (PL, RooStat)","l");
534 auterman 1.8 leg_qg->Draw();
535 auterman 1.10 c1->SaveAs("results/Exclusion_mSql_mGl_tb10.pdf");
536 auterman 1.1
537 auterman 1.10 //c1->SaveAs("plot_tb10.pdf");
538 auterman 1.2
539 auterman 1.14 c1->SetLogy(1);
540     c1->SetLogx(1);
541     TH2F*hUncertScan = new TH2F("hUncertScan",";relative signal uncertainty; number of signal events",
542     10,0.1,0.6,10,0.9,200);
543     //hUncertScan->GetXaxis()->SetNdivisions(505, false);
544     //hUncertScan->SetMinimum(1);
545     TGraph * gCLsExpUncert = new TGraph(0);
546     TGraph * gCLsObsUncert = new TGraph(0);
547     TGraph * gPLExpUncert = new TGraph(0);
548     TGraph * gPLObsUncert = new TGraph(0);
549     TGraph * gFCExpUncert = new TGraph(0);
550     TGraph * gFCObsUncert = new TGraph(0);
551     TGraph * gMCMCExpUncert= new TGraph(0);
552     TGraph * gMCMCObsUncert= new TGraph(0);
553     plotTools->Graph(gCLsExpUncert, SignalRelUncertainty, ExpNSignLimit,1);
554     plotTools->Graph(gCLsObsUncert, SignalRelUncertainty, ObsNSignLimit,1);
555     plotTools->Graph(gPLExpUncert, SignalRelUncertainty, PLExpNSignLimit,1);
556     plotTools->Graph(gPLObsUncert, SignalRelUncertainty, PLObsNSignLimit, 1);
557     plotTools->Graph(gFCExpUncert, SignalRelUncertainty, FCExpNSignLimit,1);
558     plotTools->Graph(gFCObsUncert, SignalRelUncertainty, FCObsNSignLimit, 1);
559     plotTools->Graph(gMCMCExpUncert,SignalRelUncertainty, MCMCExpNSignLimit,1);
560     plotTools->Graph(gMCMCObsUncert,SignalRelUncertainty, MCMCObsNSignLimit, 1);
561     gCLsExpUncert->SetLineStyle(8);
562     gPLObsUncert->SetLineColor(2);
563     gPLExpUncert->SetLineColor(2); gPLExpUncert->SetLineStyle(8);
564     gFCObsUncert->SetLineColor(3);
565     gFCExpUncert->SetLineColor(3); gFCExpUncert->SetLineStyle(8);
566     gMCMCObsUncert->SetLineColor(4);
567     gMCMCExpUncert->SetLineColor(4); gMCMCExpUncert->SetLineStyle(8);
568     hUncertScan->Draw("h");
569     gCLsExpUncert->Draw("l");
570     gCLsObsUncert->Draw("l");
571     //gPLObsUncert->Draw("l");
572     gPLExpUncert->Draw("l");
573     //gFCObsUncert->Draw("l");
574     //gFCExpUncert->Draw("l");
575     //gMCMCObsUncert->Draw("l");
576     //gMCMCExpUncert->Draw("l");
577     TLatex l; l.SetTextSize(0.03); l.SetTextColor(1);
578     l.DrawLatex(0.025,25,"excluded");
579     TMarker m; m.SetMarkerStyle(29); m.SetMarkerColor(2);
580     m.DrawMarker(0.128, 28.5);l.DrawLatex(0.14,28.5,"LM1");
581     m.DrawMarker(0.147, 77.4);l.DrawLatex(0.16,77.4,"LM0");
582    
583     TLegend * leg_S = new TLegend(0.5,0.14,0.85,0.38);
584     leg_S->SetBorderSize(0);leg_S->SetFillColor(0);
585     leg_S->SetHeader("95% CL upper limits");
586     leg_S->AddEntry(gCLsExpUncert,"Expected (CLs, TLimit)","l");
587     leg_S->AddEntry(gCLsObsUncert,"Observed (CLs, TLimit)","l");
588     //leg_S->AddEntry(gPLExpUncert,"Expected (PL, RooStat)","l");
589     //leg_S->AddEntry(gPLObsUncert,"Observed (PL, RooStat)","l");
590     //leg_S->AddEntry(gFCObsUncert,"Observed (FC, RooStat)","l");
591     //leg_S->AddEntry(gFCExpUncert,"Expected (FC, RooStat)","l");
592     //leg_S->AddEntry(gMCMCObsUncert,"Observed (MCMC, RooStat)","l");
593     //leg_S->AddEntry(gMCMCExpUncert,"Expected (MCMC, RooStat)","l");
594     leg_S->Draw();
595     c1->SaveAs("results/UncertaintyScan.pdf");
596 auterman 1.2
597 auterman 1.7 //theApp.Run();
598 auterman 1.1 }
599    
600    
601     int main(int argc, char** argv)
602     {
603     return plot(argc, argv);
604     }