ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/jbabb/ScriptsAndMacros/EffMacro.c
Revision: 1.1
Committed: Mon Aug 16 13:30:01 2010 UTC (14 years, 8 months ago) by jbabb
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
Initial Check-In

File Contents

# User Rev Content
1 jbabb 1.1 void EffMacro() {
2    
3     TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
4    
5    
6    
7     // For the canvas:
8    
9     tdrStyle->SetCanvasBorderMode(0);
10    
11     tdrStyle->SetCanvasColor(kWhite);
12    
13     tdrStyle->SetCanvasDefH(600); //Height of canvas
14    
15     tdrStyle->SetCanvasDefW(600); //Width of canvas
16    
17     tdrStyle->SetCanvasDefX(0); //POsition on screen
18    
19     tdrStyle->SetCanvasDefY(0);
20    
21    
22    
23     // For the Pad:
24    
25     tdrStyle->SetPadBorderMode(0);
26    
27     // tdrStyle->SetPadBorderSize(Width_t size = 1);
28    
29     tdrStyle->SetPadColor(kWhite);
30    
31     tdrStyle->SetPadGridX(false);
32    
33     tdrStyle->SetPadGridY(false);
34    
35     tdrStyle->SetGridColor(0);
36    
37     tdrStyle->SetGridStyle(3);
38    
39     tdrStyle->SetGridWidth(1);
40    
41    
42    
43     // For the frame:
44    
45     tdrStyle->SetFrameBorderMode(0);
46    
47     tdrStyle->SetFrameBorderSize(1);
48    
49     tdrStyle->SetFrameFillColor(0);
50    
51     tdrStyle->SetFrameFillStyle(0);
52    
53     tdrStyle->SetFrameLineColor(1);
54    
55     tdrStyle->SetFrameLineStyle(1);
56    
57     tdrStyle->SetFrameLineWidth(1);
58    
59    
60    
61     // For the histo:
62    
63     // tdrStyle->SetHistFillColor(1);
64    
65     // tdrStyle->SetHistFillStyle(0);
66    
67     tdrStyle->SetHistLineColor(1);
68    
69     tdrStyle->SetHistLineStyle(0);
70    
71     tdrStyle->SetHistLineWidth(1);
72    
73     // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
74    
75     // tdrStyle->SetNumberContours(Int_t number = 20);
76    
77    
78    
79     tdrStyle->SetEndErrorSize(2);
80    
81     //tdrStyle->SetErrorMarker(20);
82    
83     tdrStyle->SetErrorX(0.);
84    
85    
86    
87     tdrStyle->SetMarkerStyle(20);
88    
89    
90    
91     //For the fit/function:
92    
93     tdrStyle->SetOptFit(1);
94    
95     tdrStyle->SetFitFormat("5.4g");
96    
97     tdrStyle->SetFuncColor(2);
98    
99     tdrStyle->SetFuncStyle(1);
100    
101     tdrStyle->SetFuncWidth(1);
102    
103    
104    
105     //For the date:
106    
107     tdrStyle->SetOptDate(0);
108    
109     // tdrStyle->SetDateX(Float_t x = 0.01);
110    
111     // tdrStyle->SetDateY(Float_t y = 0.01);
112    
113    
114    
115     // For the statistics box:
116    
117     tdrStyle->SetOptFile(0);
118    
119     tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
120    
121     tdrStyle->SetStatColor(kWhite);
122    
123     tdrStyle->SetStatFont(42);
124    
125     tdrStyle->SetStatFontSize(0.025);
126    
127     tdrStyle->SetStatTextColor(1);
128    
129     tdrStyle->SetStatFormat("6.4g");
130    
131     tdrStyle->SetStatBorderSize(1);
132    
133     tdrStyle->SetStatH(0.1);
134    
135     tdrStyle->SetStatW(0.15);
136    
137     // tdrStyle->SetStatStyle(Style_t style = 1001);
138    
139     // tdrStyle->SetStatX(Float_t x = 0);
140    
141     // tdrStyle->SetStatY(Float_t y = 0);
142    
143    
144    
145     // Margins:
146    
147     tdrStyle->SetPadTopMargin(0.05);
148    
149     tdrStyle->SetPadBottomMargin(0.13);
150    
151     tdrStyle->SetPadLeftMargin(0.16);
152    
153     tdrStyle->SetPadRightMargin(0.02);
154    
155    
156    
157     // For the Global title:
158    
159    
160    
161     tdrStyle->SetOptTitle(0);
162    
163     tdrStyle->SetTitleFont(42);
164    
165     tdrStyle->SetTitleColor(1);
166    
167     tdrStyle->SetTitleTextColor(1);
168    
169     tdrStyle->SetTitleFillColor(10);
170    
171     tdrStyle->SetTitleFontSize(0.05);
172    
173     // tdrStyle->SetTitleH(0); // Set the height of the title box
174    
175     // tdrStyle->SetTitleW(0); // Set the width of the title box
176    
177     // tdrStyle->SetTitleX(0); // Set the position of the title box
178    
179     // tdrStyle->SetTitleY(0.985); // Set the position of the title box
180    
181     // tdrStyle->SetTitleStyle(Style_t style = 1001);
182    
183     // tdrStyle->SetTitleBorderSize(2);
184    
185    
186    
187     // For the axis titles:
188    
189    
190    
191     tdrStyle->SetTitleColor(1, "XYZ");
192    
193     tdrStyle->SetTitleFont(42, "XYZ");
194    
195     tdrStyle->SetTitleSize(0.06, "XYZ");
196    
197     // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
198    
199     // tdrStyle->SetTitleYSize(Float_t size = 0.02);
200    
201     tdrStyle->SetTitleXOffset(0.9);
202    
203     tdrStyle->SetTitleYOffset(1.25);
204    
205     // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
206    
207    
208    
209     // For the axis labels:
210    
211    
212    
213     tdrStyle->SetLabelColor(1, "XYZ");
214    
215     tdrStyle->SetLabelFont(42, "XYZ");
216    
217     tdrStyle->SetLabelOffset(0.007, "XYZ");
218    
219     tdrStyle->SetLabelSize(0.05, "XYZ");
220    
221    
222    
223     // For the axis:
224    
225    
226    
227     tdrStyle->SetAxisColor(1, "XYZ");
228    
229     tdrStyle->SetStripDecimals(kTRUE);
230    
231     tdrStyle->SetTickLength(0.03, "XYZ");
232    
233     tdrStyle->SetNdivisions(510, "XYZ");
234    
235     tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
236    
237     tdrStyle->SetPadTickY(1);
238    
239    
240    
241     // Change for log plots:
242    
243     tdrStyle->SetOptLogx(0);
244    
245     tdrStyle->SetOptLogy(0);
246    
247     tdrStyle->SetOptLogz(0);
248    
249    
250    
251     // Postscript options:
252    
253     tdrStyle->SetPaperSize(20.,20.);
254    
255     // tdrStyle->SetLineScalePS(Float_t scale = 3);
256    
257     // tdrStyle->SetLineStyleString(Int_t i, const char* text);
258    
259     // tdrStyle->SetHeaderPS(const char* header);
260    
261     // tdrStyle->SetTitlePS(const char* pstitle);
262    
263    
264    
265     // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
266    
267     // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
268    
269     // tdrStyle->SetPaintTextFormat(const char* format = "g");
270    
271     // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
272    
273     // tdrStyle->SetTimeOffset(Double_t toffset);
274    
275     // tdrStyle->SetHistMinimumZero(kTRUE);
276    
277    
278     tdrStyle->cd();
279    
280     //New Numbers
281    
282     const Int_t n = 4;
283     Double_t x[n] = {1., 2., 3., 4.,};
284     Double_t twoDEff[n] = {0.875023, 0.883398, 0.861037, 0.862617};
285     Double_t isoEff[n] = {0.86327, 0.824332, 0.589366, 0.564292};
286     // create the blue graph with a cos function
287     TGraph *TwoDCut = new TGraph(n,x,twoDEff);
288     TGraph *RelIso = new TGraph(n,x,isoEff);
289     TCanvas *c1 = new TCanvas("c1","Efficiencies");
290     TwoDCut->GetXaxis()->SetBinLabel(10, "ttbar");
291     TwoDCut->GetXaxis()->SetBinLabel(37, "1TeV");
292     TwoDCut->GetXaxis()->SetBinLabel(65, "2TeV");
293     TwoDCut->GetXaxis()->SetBinLabel(92, "3TeV");
294     //TwoDCut->GetXaxis()->SetBinLabel(92, "4TeV");
295     TwoDCut->GetYaxis()->SetRangeUser(0., 1.);
296     TwoDCut->SetTitle("Signal Selection Efficiency");
297     // draw the graph with axis, contineous line, and put a * at each point
298     TwoDCut->SetLineColor(4);
299     TwoDCut->Draw("AL*");
300     // superimpose the second graph by leaving out the axis option "A"
301     //gr2->SetLineWidth(3);
302     RelIso->SetMarkerStyle(21);
303     RelIso->SetLineColor(2);
304     RelIso->Draw("LP");
305    
306    
307     //c1->Print("SignalEfficiencies_new.png");
308    
309    
310     /*
311     const Int_t y = 7;
312     Double_t x_B[y] = {1., 2., 3., 4., 5., 6., 7.};
313     Double_t twoDEff_B[y] = {0., 0., 0.00216488, 0.00128299, 0.00316968, 0.00308293, 0.00287758};
314     Double_t isoEff_B[y] = {0., 0., 0.000074651, 0.000118953, 0.000228739, 0.00014387, 0.0000361202};
315     // create the blue graph with a cos function
316     TGraph *TwoDCut_B = new TGraph(y,x_B,twoDEff_B);
317     TGraph *RelIso_B = new TGraph(y,x_B,isoEff_B);
318     TCanvas *c2 = new TCanvas("c2","Efficiencies");
319     TwoDCut_B->GetXaxis()->SetBinLabel(5, "Mu15");
320     TwoDCut_B->GetXaxis()->SetBinLabel(20, "Mu5pt350");
321     TwoDCut_B->GetXaxis()->SetBinLabel(35, "ttbar");
322     TwoDCut_B->GetXaxis()->SetBinLabel(50, "1TeV");
323     TwoDCut_B->GetXaxis()->SetBinLabel(65, "2TeV");
324     TwoDCut_B->GetXaxis()->SetBinLabel(80, "3TeV");
325     TwoDCut_B->GetXaxis()->SetBinLabel(95, "4TeV");
326     TwoDCut->GetYaxis()->SetRangeUser(0., 1.);
327     TwoDCut_B->SetTitle("Background Selection Efficiency");
328     // draw the graph with axis, contineous line, and put a * at each point
329     TwoDCut_B->SetLineColor(4);
330     TwoDCut_B->Draw("AL*");
331     // superimpose the second graph by leaving out the axis option "A"
332     //gr2->SetLineWidth(3);
333     RelIso_B->SetMarkerStyle(21);
334     RelIso_B->SetLineColor(2);
335     RelIso_B->Draw("LP");
336    
337     c2->Print("BackgroundEfficiencies.png");
338     */
339    
340     //gROOT->ProcessLine(".q");
341    
342     /*
343     //OLD Numbers
344    
345     const Int_t n = 4;
346     Double_t x[n] = {1., 2., 3., 4.,};
347     Double_t twoDEff[n] = {0.92, 0.89, 0.88, 0.85};
348     Double_t isoEff[n] = {0.88, 0.84, 0.56, 0.53};
349     // create the blue graph with a cos function
350     TGraph *TwoDCut = new TGraph(n,x,twoDEff);
351     TGraph *RelIso = new TGraph(n,x,isoEff);
352     TCanvas *c1 = new TCanvas("c1","Efficiencies");
353     TwoDCut->GetXaxis()->SetBinLabel(10, "ttbar");
354     TwoDCut->GetXaxis()->SetBinLabel(37, "1TeV");
355     TwoDCut->GetXaxis()->SetBinLabel(65, "2TeV");
356     TwoDCut->GetXaxis()->SetBinLabel(92, "3TeV");
357     //TwoDCut->GetXaxis()->SetBinLabel(92, "4TeV");
358     TwoDCut->GetYaxis()->SetRangeUser(0., 1.);
359     TwoDCut->SetTitle("Signal Selection Efficiency");
360     // draw the graph with axis, contineous line, and put a * at each point
361     TwoDCut->SetLineColor(4);
362     TwoDCut->Draw("AL*");
363     // superimpose the second graph by leaving out the axis option "A"
364     //gr2->SetLineWidth(3);
365     RelIso->SetMarkerStyle(21);
366     RelIso->SetLineColor(2);
367     RelIso->Draw("LP");
368    
369     */
370     //c1->Print("SignalEfficiencies_new.png");
371    
372    
373     }