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