ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/plot.cc
Revision: 1.6
Committed: Sat Nov 27 16:36:51 2010 UTC (14 years, 5 months ago) by auterman
Content type: text/plain
Branch: MAIN
Changes since 1.5: +16 -26 lines
Log Message:
code cleanup

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    
24     #include <string>
25 auterman 1.2 #include <cmath>
26 auterman 1.1
27    
28     int plot(int argc, char** argv)
29     {
30 auterman 1.6 //interactive root session
31 auterman 1.2 TApplication theApp("App", 0, 0);
32     if (gROOT->IsBatch()) {
33     fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]);
34     return 1;
35     }
36    
37 auterman 1.6 //Style stuff
38 auterman 1.1 gStyle->SetHistFillColor(0);
39     gStyle->SetPalette(1);
40     gStyle->SetCanvasColor(0);
41     gStyle->SetCanvasBorderMode(0);
42     gStyle->SetPadColor(0);
43     gStyle->SetPadBorderMode(0);
44     gStyle->SetFrameBorderMode(0);
45    
46     gStyle->SetTitleFillColor(0);
47     gStyle->SetTitleBorderSize(0);
48     gStyle->SetTitleX(0.10);
49     gStyle->SetTitleY(0.98);
50     gStyle->SetTitleW(0.8);
51     gStyle->SetTitleH(0.06);
52    
53     gStyle->SetErrorX(0);
54     gStyle->SetStatColor(0);
55     gStyle->SetStatBorderSize(0);
56     gStyle->SetStatX(0);
57     gStyle->SetStatY(0);
58     gStyle->SetStatW(0);
59     gStyle->SetStatH(0);
60    
61     gStyle->SetTitleFont(22);
62     gStyle->SetLabelFont(22,"X");
63     gStyle->SetLabelFont(22,"Y");
64     gStyle->SetLabelFont(22,"Z");
65     gStyle->SetLabelSize(0.03,"X");
66     gStyle->SetLabelSize(0.03,"Y");
67     gStyle->SetLabelSize(0.03,"Z");
68    
69     //gROOT->SetStyle("MyStyle");
70     TCanvas * c1 = new TCanvas("c1","c1",600,600);
71     c1->SetFillStyle ( 4000 );
72     c1->SetLeftMargin ( 0.15 );
73     c1->SetRightMargin ( 0.15 );
74     c1->SetBottomMargin( 0.10 );
75     c1->cd();
76    
77 auterman 1.6 //Get limits and generator masses ---------------------------------------------------
78 auterman 1.4 TheLimits * genpoints = new TheLimits();
79 auterman 1.1 for (int i = 1; i<argc; ++i)
80     {
81 auterman 1.4 genpoints->add( new SusyScan(argv[i]) );
82 auterman 1.1 }
83 auterman 1.5 genpoints->FillGeneratorMasses("tb10_mu1_a0_massscan.dat");
84     genpoints->match();
85 auterman 1.2
86 auterman 1.6
87     //the plotting ----------------------------------------------------------------------
88 auterman 1.2 //c1->SetLogz(1);
89 auterman 1.4 PlotTools<SusyScan> * plotTools = new PlotTools<SusyScan>(genpoints->GetScan());
90 auterman 1.6 PlotTools<GeneratorMasses> * plotMasses = new PlotTools<GeneratorMasses>(genpoints->GetGeneratorMasses());
91 auterman 1.2
92     TH2F*h = new TH2F("xsec",";m_{0} [GeV]; m_{1/2} [GeV]; x-section [pb]",
93     100,0,1009.9,50,0,500);
94 auterman 1.4 //plotTools->Area(h, Mzero, Mhalf, ObsXsecLimit);
95     //plotTools->Area(h, Mzero, Mhalf, Xsection);
96     //plotTools->Area(h, Mzero, Mhalf, XsecOverObserved);
97     //plotTools->Area(h, Mzero, Mhalf, XsecOverExpected);
98     //plotTools->Area(h, Mzero, Mhalf, SignalAcceptance);
99     //plotTools->Area(h, Mzero, Mhalf, NSignExpLimit);
100 auterman 1.6 //plotTools->Area(h, Mzero, Mhalf, ObsExclusion);
101     plotTools->Area(h, Mzero, Mhalf, ExpExclusion);
102 auterman 1.2 //h->SetMaximum(27);
103     //h->SetMinimum(0.01);
104     //c1->SetLogz(1);
105     h->GetYaxis()->SetTitleOffset(1.3);
106     h->GetZaxis()->SetTitleOffset(1.2);
107     h->Draw("colz");
108 auterman 1.1
109 auterman 1.4 TGraph * gl500 = plotTools->Line(Mzero, Mhalf, MGluino, 500);
110 auterman 1.2 gl500->Draw();
111 auterman 1.1
112 auterman 1.6 TGraph * sq500 = plotTools->Line(Mzero, Mhalf, MSquarkL, 500, 8);
113     sq500->SetLineWidth(2);
114 auterman 1.2 sq500->Draw();
115    
116 auterman 1.6 TGraph * sq500_m = plotMasses->Line(Mzero, Mhalf, MSquarkL, 500, 10);
117     sq500_m->SetLineWidth(2); sq500_m->SetLineColor(7);
118     sq500_m->Draw();
119    
120    
121 auterman 1.2 TH2F*h_qg = new TH2F("AccMGMSQ",";m_{#tilde{q}} [GeV]; m_{#tilde{g}} [GeV]; signal acceptance",
122     60,200,1400,50,200,1200);
123 auterman 1.4 plotTools->Area(h_qg, MSquarkL, MGluino, SignalAcceptance);
124     plotTools->Area(h_qg, MSquarkL, MGluino, NSignExpLimit);
125 auterman 1.2 //h_qg->SetMaximum(1.0);
126     h_qg->SetMinimum(0.01);
127    
128     //c1->SetLogz(1);
129     h_qg->GetYaxis()->SetTitleOffset(1.3);
130     //h_qg->Draw("colz");
131    
132    
133 auterman 1.1
134 auterman 1.2 //c1->SaveAs("plot.pdf");
135    
136    
137     theApp.Run();
138 auterman 1.1 }
139    
140    
141     int main(int argc, char** argv)
142     {
143     return plot(argc, argv);
144     }