ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/plotComp.cc
Revision: 1.1
Committed: Wed Jun 22 15:11:53 2011 UTC (13 years, 10 months ago) by auterman
Content type: text/plain
Branch: MAIN
CVS Tags: JHEP2010, HEAD
Log Message:
2010 RA2 paper

File Contents

# Content
1 #include "plot.h"
2 #include "SusyScan.h"
3 #include "GeneratorMasses.h"
4 #include "PlotTools.h"
5 #include "TheLimits.h"
6 #include "GlobalFunctions.h"
7 #include "StyleSettings.h"
8
9 #include "TRint.h"
10 #include "TROOT.h"
11 #include "TObjArray.h"
12 #include "TStyle.h"
13
14 #include "TChain.h"
15 #include "TFile.h"
16 #include "TGraph.h"
17 #include "TH1.h"
18 #include "TH2.h"
19 #include "TH2F.h"
20 #include "TTree.h"
21 #include "TKey.h"
22 #include "Riostream.h"
23 #include "TCanvas.h"
24 #include "TLegend.h"
25 #include "TLatex.h"
26 #include "TMarker.h"
27
28 #include <string>
29 #include <cmath>
30 #include <stdio.h>
31
32 int plot(int argc, char** argv)
33 {
34 //interactive root session
35 //TApplication theApp("App", 0, 0);
36 if (gROOT->IsBatch()) {
37 fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]);
38 return 1;
39 }
40
41 /*
42 //Style stuff
43 gStyle->SetHistFillColor(0);
44 gStyle->SetPalette(1);
45 gStyle->SetCanvasColor(0);
46 gStyle->SetCanvasBorderMode(0);
47 gStyle->SetPadColor(0);
48 gStyle->SetPadBorderMode(0);
49 gStyle->SetFrameBorderMode(0);
50
51 gStyle->SetTitleFillColor(0);
52 gStyle->SetTitleBorderSize(0);
53 gStyle->SetTitleX(0.10);
54 gStyle->SetTitleY(0.98);
55 gStyle->SetTitleW(0.8);
56 gStyle->SetTitleH(0.06);
57
58 gStyle->SetErrorX(0);
59 gStyle->SetStatColor(0);
60 gStyle->SetStatBorderSize(0);
61 gStyle->SetStatX(0);
62 gStyle->SetStatY(0);
63 gStyle->SetStatW(0);
64 gStyle->SetStatH(0);
65
66 gStyle->SetTitleFont(22);
67 gStyle->SetLabelFont(22,"X");
68 gStyle->SetLabelFont(22,"Y");
69 gStyle->SetLabelFont(22,"Z");
70 gStyle->SetLabelSize(0.03,"X");
71 gStyle->SetLabelSize(0.03,"Y");
72 gStyle->SetLabelSize(0.03,"Z");
73 */
74 util::StyleSettings::paper();
75 gStyle->SetPadBottomMargin(0.18);
76
77 //gROOT->SetStyle("MyStyle");
78 TCanvas * c1 = new TCanvas("c1","c1",600,600);
79 //c1->SetFillStyle ( 4000 );
80 //c1->SetLeftMargin ( 0.15 );
81 //c1->SetRightMargin ( 0.15 );
82 //c1->SetBottomMargin( 0.10 );
83 c1->cd();
84
85 //Get limits and generator masses ---------------------------------------------------
86 TheLimits * genpoints3MHT = new TheLimits();
87 genpoints3MHT->Fill("limits_moriond_MHT/filelist_tb3.txt");
88
89 TheLimits * genpoints3HT = new TheLimits();
90 genpoints3HT->Fill("limits_moriond_HT/filelist_tb3.txt");
91
92 TheLimits * genpoints10MHT = new TheLimits();
93 genpoints10MHT->Fill("limits_moriond_MHT/filelist_tb10.txt");
94
95 TheLimits * genpoints10HT = new TheLimits();
96 genpoints10HT->Fill("limits_moriond_HT/filelist_tb10.txt");
97
98 TheLimits * genpoints50MHT = new TheLimits();
99 genpoints50MHT->Fill("limits_moriond_MHT/filelist_tb50.txt");
100
101 TheLimits * genpoints50HT = new TheLimits();
102 genpoints50HT->Fill("limits_moriond_HT/filelist_tb50.txt");
103
104 //genpoints->FillGeneratorMasses("GenScan_tb50.dat");
105 //genpoints->match();
106 //genpointsHT->FillGeneratorMasses("GenScan_tb50.dat");
107 //genpointsHT->match();
108
109 //the plotting ----------------------------------------------------------------------
110 //plotting helper functions
111 PlotTools<SusyScan> * plotTools3MHT = new PlotTools<SusyScan>(genpoints3MHT->GetScan());
112 PlotTools<SusyScan> * plotTools3HT = new PlotTools<SusyScan>(genpoints3HT->GetScan());
113 PlotTools<SusyScan> * plotTools10MHT = new PlotTools<SusyScan>(genpoints10MHT->GetScan());
114 PlotTools<SusyScan> * plotTools10HT = new PlotTools<SusyScan>(genpoints10HT->GetScan());
115 PlotTools<SusyScan> * plotTools50MHT = new PlotTools<SusyScan>(genpoints50MHT->GetScan());
116 PlotTools<SusyScan> * plotTools50HT = new PlotTools<SusyScan>(genpoints50HT->GetScan());
117
118
119
120 //the histograms
121 c1->SetLogz(1);
122 //h->SetMaximum(27);
123 //h->SetMinimum(0.01);
124
125
126
127 c1->SetRightMargin ( 0.1 );
128 // TestContours in M0 - M1/2
129 TH2F*texcl = new TH2F("texcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
130 40,200,600,26,140,400);
131 TH2F*texpexcl=(TH2F*)texcl->Clone();
132 plotTools3HT->Area(texpexcl, Mzero, Mhalf, NLOExpExclCLp1sigma);
133 std::vector<TGraph*> contours = plotTools3HT->GetContours(texpexcl,3);
134 texpexcl->Draw("colz");
135 int col=kBlue-10;
136 for (std::vector<TGraph*>::iterator cont=contours.begin(); cont!=contours.end(); ++cont){
137 if (! *cont) continue;
138 double x, y;
139 (*cont)->GetPoint(0, x, y);
140 (*cont)->SetLineColor(col);
141 (*cont)->Draw("l");
142 TLatex l; l.SetTextSize(0.04); l.SetTextColor(col++);
143 char val[20];
144 sprintf(val,"%d",(int)(cont-contours.begin()));
145 l.DrawLatex(x,y,val);
146 //if (cont-contours.begin()>3) break;
147 }
148 c1->SaveAs("results/ExclusionTestContours_m0_m12_Comp.pdf");
149
150
151 // Exclusion in M0 - M1/2
152 TH2F*hexcl = new TH2F("hexcl",";m_{0} [GeV]; m_{1/2} [GeV]; 95% CL Expected Exclusion",
153 100,0,650,26,200,400);
154 TH2F*hs3 = new TH2F("hs3","",50,0,509.9,35,100,450);
155 TH2F*hs10 = new TH2F("hs10","",100,0,1009.9,35,100,450);
156 TH2F*hs50 = new TH2F("hs50","",40,200,600,26,140,400);
157
158 TGraph * gCLsExp50HT = plotTools50HT ->GetContour(hs50,Mzero,Mhalf,NLOExpExclCL, 3,0, 4,2);
159 TGraph * gCLsExp50MHT = plotTools50MHT->GetContour(hs50,Mzero,Mhalf,NLOExpExclCL, 3,0, 4,2);
160 TGraph * gCLsObs50HT = plotTools50HT ->GetContour(hs50,Mzero,Mhalf,NLOObsExclCL, 3,0, 4,1);
161 TGraph * gCLsObs50MHT = plotTools50MHT->GetContour(hs50,Mzero,Mhalf,NLOObsExclCL, 3,0, 4,1);
162 TGraph * gCLsExp10HT = plotTools10HT ->GetContour(hs10,Mzero,Mhalf,NLOExpExclCL, 3,0, 1,2);
163 TGraph * gCLsExp10MHT = plotTools10MHT->GetContour(hs10,Mzero,Mhalf,NLOExpExclCL, 3,0, 1,2);
164 TGraph * gCLsObs10HT = plotTools10HT ->GetContour(hs10,Mzero,Mhalf,NLOObsExclCL, 3,0, 1,1);
165 TGraph * gCLsObs10MHT = plotTools10MHT->GetContour(hs10,Mzero,Mhalf,NLOObsExclCL, 3,0, 1,1);
166 TGraph * gCLsExp3HT = plotTools3HT ->GetContour(hs3, Mzero,Mhalf,NLOExpExclCL, 3,3, 2,2);
167 TGraph * gCLsExp3MHT = plotTools3MHT ->GetContour(hs3, Mzero,Mhalf,NLOExpExclCL, 3,3, 2,2);
168 TGraph * gCLsObs3HT = plotTools3HT ->GetContour(hs3, Mzero,Mhalf,NLOObsExclCL, 3,3, 2,1);
169 TGraph * gCLsObs3MHT = plotTools3MHT ->GetContour(hs3, Mzero,Mhalf,NLOObsExclCL, 3,3, 2,1);
170
171 TGraph * gCheck1 = (TGraph*)gCLsObs10HT->Clone();
172 TGraph * gCheck2 = (TGraph*)gCLsObs10MHT->Clone();
173 Smooth( gCLsObs3HT, 27); gCLsObs3HT->SetLineWidth( 3 );
174 Smooth( gCLsObs3MHT, 27);
175 Smooth( gCLsExp3HT, 27 ); gCLsExp3HT->SetLineWidth( 3 );
176 Smooth( gCLsExp3MHT, 27 );
177 Smooth( gCLsObs10HT, 27); gCLsObs10HT->SetLineWidth( 3 );
178 Smooth( gCLsObs10MHT, 27);
179 Smooth( gCLsExp10HT, 27 ); gCLsExp10HT->SetLineWidth( 3 );
180 Smooth( gCLsExp10MHT, 27 );
181 Smooth( gCLsObs50HT, 27); gCLsObs50HT->SetLineWidth( 3 );
182 Smooth( gCLsObs50MHT, 27);
183 Smooth( gCLsExp50HT, 27 ); gCLsExp50HT->SetLineWidth( 3 );
184 Smooth( gCLsExp50MHT, 27 );
185
186 TGraph * CLsObs3 = plotTools3HT ->ChooseBest(gCLsObs3HT,gCLsObs3MHT, gCLsObs3HT,gCLsObs3MHT);
187 TGraph * CLsExp3 = plotTools3HT ->ChooseBest(gCLsExp3HT,gCLsExp3MHT, gCLsExp3HT,gCLsExp3MHT);
188 TGraph * CLsObs10 = plotTools10HT->ChooseBest(gCLsObs10HT,gCLsObs10MHT, gCLsObs10HT,gCLsObs10MHT);
189 TGraph * CLsExp10 = plotTools10HT->ChooseBest(gCLsExp10HT,gCLsExp10MHT, gCLsExp10HT,gCLsExp10MHT);
190 TGraph * CLsObs50 = plotTools50HT->ChooseBest(gCLsObs50HT,gCLsObs50MHT, gCLsObs50HT,gCLsObs50MHT);
191 TGraph * CLsExp50 = plotTools50HT->ChooseBest(gCLsExp50HT,gCLsExp50MHT, gCLsExp50HT,gCLsExp50MHT);
192
193 hexcl->GetYaxis()->SetTitleOffset(1.3);
194 hexcl->GetXaxis()->SetTitleOffset(0.92);
195 hexcl->Draw("colz");
196
197 CLsObs3->Draw("l");
198 CLsExp3->Draw("l");
199 CLsObs10->Draw("l");
200 CLsExp10->Draw("l");
201 CLsObs50->Draw("l");
202 CLsExp50->Draw("l");
203 TLatex ms; ms.SetTextSize(0.03); ms.SetTextFont(42);//ms.SetTextColor(12);
204 ms.DrawLatex(100,389,"CMS preliminary");
205
206
207 TLegend * leg = new TLegend(0.55,0.65,0.90,0.92);
208 leg->SetBorderSize(0);leg->SetFillColor(0);leg->SetFillStyle(4000);leg->SetTextFont(42);
209 leg->SetHeader("L_{int} = 36/pb, #sqrt{s} = 7 TeV");
210 leg->AddEntry(CLsObs3, "Observed, tan#beta=3","l");
211 leg->AddEntry(CLsExp3, "Expected, tan#beta=3","l");
212 leg->AddEntry(CLsObs10, "Observed, tan#beta=10","l");
213 leg->AddEntry(CLsExp10, "Expected, tan#beta=10","l");
214 leg->AddEntry(CLsObs50, "Observed, tan#beta=50","l");
215 leg->AddEntry(CLsExp50, "Expected, tan#beta=50","l");
216 leg->Draw();
217 gPad->RedrawAxis();
218 c1->SaveAs("results/Exclusion_m0_m12_Comp.pdf");
219
220
221 //theApp.Run();
222 }
223
224
225 int main(int argc, char** argv)
226 {
227 return plot(argc, argv);
228 }