redND.C
Go to the documentation of this file.
1 //Run using: root -b -q -l MakingProfile.C
2 
3 //This script is where I make the graph from 2d plots that I shall fit. I also then
4 //make nice versions of the graph and 2d plot with fit lines on it.
5 
6 #include <iostream>
7 #include <fstream>
8 #include <iomanip>
9 #include <sstream>
10 #include <string>
11 #include <cstring>
12 #include "TFile.h"
13 #include "TH2D.h"
14 #include "TObject.h"
15 #include "TArray.h"
16 #include "TArrayF.h"
17 #include "TGraphAsymmErrors.h"
18 
19 
20 void redND()
21 {
22  std::cout<<"Hello Susie!"<<std::endl;
23 
24 
25 
26  gStyle->SetOptStat(0);
27  TFile* file = new TFile("./2DPlotsForFitting.root","READ");
28  TH2D* f10 = file->Get("10");
29  TH2D* f13 = file->Get("13");
30  TH2D* f16 = file->Get("16");
31  TH2D* f19 = file->Get("19");
32  TH2D* f22 = file->Get("22");
33  TH2D* f25 = file->Get("25");
34  TH2D* f28 = file->Get("28");
35  TH2D* f31 = file->Get("31");
36  TH2D* f34 = file->Get("34");
37  TH2D* f37 = file->Get("37");
38 
39  TH2D* f11 = file->Get("11");
40  TH2D* f14 = file->Get("14");
41  TH2D* f17 = file->Get("17");
42  TH2D* f20 = file->Get("20");
43  TH2D* f23 = file->Get("23");
44  TH2D* f26 = file->Get("26");
45  TH2D* f29 = file->Get("29");
46  TH2D* f32 = file->Get("32");
47  TH2D* f35 = file->Get("35");
48  TH2D* f38 = file->Get("38");
49 
50  diag = TLine(0.0,0.0,5.0,5.0);
51  diag.SetLineColor(2);
52 
53  diagMC = TLine(0.0,0.0,3.0,3.0);
54  diagMC.SetLineColor(2);
55 
56  flatM = TLine(0.0,0.0,1500.0,0.0);
57  flatM.SetLineColor(2);
58 
59  flatMC = TLine(0.0,0.0,400.0,0.0);
60  flatMC.SetLineColor(2);
61 
62  flat = TLine(0.0,0.0,5.0,0.0);
63  flat.SetLineColor(2);
64 
65  //Graph with fitting line
66  TCanvas* c10 = new TCanvas("c10","c10");
67  f10->GetXaxis()->CenterTitle();
68  f10->GetYaxis()->CenterTitle();
69  c10->SetLogz();
70  f10->Draw("colz");
71  flatM.Draw();
72  gPad->Update();
73  gPad->SetRightMargin(0.13);
74  TPaletteAxis *palette10 = (TPaletteAxis*)f10->GetListOfFunctions()->FindObject("palette");
75  palette10->SetBBoxCenterX(625);
76  gPad->Modified();
77  gPad->Update();
78  c10->Print("NDmuonFlat_allAct.pdf");
79 
80  //Graph with fitting line
81  TCanvas* c13 = new TCanvas("c13","c13");
82  f13->GetXaxis()->CenterTitle();
83  f13->GetYaxis()->CenterTitle();
84  c13->SetLogz();
85  f13->Draw("colz");
86  flatMC.Draw();
87  gPad->Update();
88  gPad->SetRightMargin(0.13);
89  TPaletteAxis *palette13 = (TPaletteAxis*)f13->GetListOfFunctions()->FindObject("palette");
90  palette13->SetBBoxCenterX(625);
91  gPad->Modified();
92  gPad->Update();
93  c13->Print("NDmuonFlat_actCat_CatOnly.pdf");
94 
95  //Graph with fitting line
96  TCanvas* c16 = new TCanvas("c16","c16");
97  f16->GetXaxis()->CenterTitle();
98  f16->GetYaxis()->CenterTitle();
99  c16->SetLogz();
100  f16->Draw("colz");
101  flatM.Draw();
102  gPad->Update();
103  gPad->SetRightMargin(0.13);
104  TPaletteAxis *palette16 = (TPaletteAxis*)f16->GetListOfFunctions()->FindObject("palette");
105  palette16->SetBBoxCenterX(625);
106  gPad->Modified();
107  gPad->Update();
108  c16->Print("NDmuonFlat_actCat_tog.pdf");
109 
110  //Graph with fitting line
111  TCanvas* c19 = new TCanvas("c19","c19");
112  f19->GetXaxis()->CenterTitle();
113  f19->GetYaxis()->CenterTitle();
114  c19->SetLogz();
115  f19->Draw("colz");
116  flatM.Draw();
117  gPad->Update();
118  gPad->SetRightMargin(0.13);
119  TPaletteAxis *palette19 = (TPaletteAxis*)f19->GetListOfFunctions()->FindObject("palette");
120  palette19->SetBBoxCenterX(625);
121  gPad->Modified();
122  gPad->Update();
123  c19->Print("NDmuonFlat.pdf");
124 
125  //Graph with fitting line
126  TCanvas* c22 = new TCanvas("c22","c22");
127  c22->SetLogz();
128  f22->GetXaxis()->CenterTitle();
129  f22->GetYaxis()->CenterTitle();
130  f22->Draw("colz");
131  flat.Draw();
132  gPad->Update();
133  gPad->SetRightMargin(0.13);
134  TPaletteAxis *palette22 = (TPaletteAxis*)f22->GetListOfFunctions()->FindObject("palette");
135  palette22->SetBBoxCenterX(625);
136  gPad->Modified();
137  gPad->Update();
138  c22->Print("NDhadqeFlat.pdf");
139 
140  //Graph with fitting line
141  TCanvas* c25 = new TCanvas("c25","c25");
142  c25->SetLogz();
143  f25->GetXaxis()->CenterTitle();
144  f25->GetYaxis()->CenterTitle();
145  f25->Draw("colz");
146  flat.Draw();
147  gPad->Update();
148  gPad->SetRightMargin(0.13);
149  TPaletteAxis *palette25 = (TPaletteAxis*)f25->GetListOfFunctions()->FindObject("palette");
150  palette25->SetBBoxCenterX(625);
151  gPad->Modified();
152  gPad->Update();
153  c25->Print("NDhadnonqeFlat.pdf");
154 
155  //Graph with fitting line
156  TCanvas* c28 = new TCanvas("c28","c28");
157  c28->SetLogz();
158  f28->GetXaxis()->CenterTitle();
159  f28->GetYaxis()->CenterTitle();
160  f28->Draw("colz");
161  flat.Draw();
162  gPad->Update();
163  gPad->SetRightMargin(0.13);
164  TPaletteAxis *palette28 = (TPaletteAxis*)f28->GetListOfFunctions()->FindObject("palette");
165  palette28->SetBBoxCenterX(625);
166  gPad->Modified();
167  gPad->Update();
168  c28->Print("NDhadccFlat.pdf");
169 
170  //Graph with fitting line
171  TCanvas* c31 = new TCanvas("c31","c31");
172  c31->SetLogz();
173  f31->Draw("colz");
174  flat.Draw();
175  gPad->Update();
176  gPad->SetRightMargin(0.13);
177  TPaletteAxis *palette31 = (TPaletteAxis*)f31->GetListOfFunctions()->FindObject("palette");
178  palette31->SetBBoxCenterX(625);
179  gPad->Modified();
180  gPad->Update();
181  c31->Print("NDneutrinoqeFlat.pdf");
182 
183  //Graph with fitting line
184  TCanvas* c34 = new TCanvas("c34","c34");
185  c34->SetLogz();
186  f34->GetXaxis()->CenterTitle();
187  f34->GetYaxis()->CenterTitle();
188  f34->Draw("colz");
189  flat.Draw();
190  gPad->Update();
191  gPad->SetRightMargin(0.13);
192  TPaletteAxis *palette34 = (TPaletteAxis*)f34->GetListOfFunctions()->FindObject("palette");
193  palette34->SetBBoxCenterX(625);
194  gPad->Modified();
195  gPad->Update();
196  c34->Print("NDneutrinononqeFlat.pdf");
197 
198  //Graph with fitting line
199  TCanvas* c37 = new TCanvas("c37","c37");
200  c37->SetLogz();
201  f37->GetXaxis()->CenterTitle();
202  f37->GetYaxis()->CenterTitle();
203  f37->Draw("colz");
204  flat.Draw();
205  gPad->Update();
206  gPad->SetRightMargin(0.13);
207  TPaletteAxis *palette37 = (TPaletteAxis*)f37->GetListOfFunctions()->FindObject("palette");
208  palette37->SetBBoxCenterX(625);
209  gPad->Modified();
210  gPad->Update();
211  c37->Print("NDneutrinoccFlat.pdf");
212 
213 
214  //Graph with fitting line
215  TCanvas* c11 = new TCanvas("c11","c11");
216  c11->SetLogz();
217  f11->GetXaxis()->CenterTitle();
218  f11->GetYaxis()->CenterTitle();
219  f11->Draw("colz");
220  diag.Draw();
221  gPad->Update();
222  gPad->SetRightMargin(0.13);
223  TPaletteAxis *palette11 = (TPaletteAxis*)f11->GetListOfFunctions()->FindObject("palette");
224  palette11->SetBBoxCenterX(625);
225  gPad->Modified();
226  gPad->Update();
227  c11->Print("NDmuon45_allAct.pdf");
228 
229  //Graph with fitting line
230  TCanvas* c14 = new TCanvas("c14","c14");
231  c14->SetLogz();
232  f14->GetXaxis()->CenterTitle();
233  f14->GetYaxis()->CenterTitle();
234  f14->Draw("colz");
235  diagMC.Draw();
236  gPad->Update();
237  gPad->SetRightMargin(0.13);
238  TPaletteAxis *palette14 = (TPaletteAxis*)f14->GetListOfFunctions()->FindObject("palette");
239  palette14->SetBBoxCenterX(625);
240  gPad->Modified();
241  gPad->Update();
242  c14->Print("NDmuon45_actCat_CatOnly.pdf");
243 
244  //Graph with fitting line
245  TCanvas* c17 = new TCanvas("c17","c17");
246  c17->SetLogz();
247  f17->GetXaxis()->CenterTitle();
248  f17->GetYaxis()->CenterTitle();
249  f17->Draw("colz");
250  diag.Draw();
251  gPad->Update();
252  gPad->SetRightMargin(0.13);
253  TPaletteAxis *palette17 = (TPaletteAxis*)f17->GetListOfFunctions()->FindObject("palette");
254  palette17->SetBBoxCenterX(625);
255  gPad->Modified();
256  gPad->Update();
257  c17->Print("NDmuon45_actCat_tog.pdf");
258 
259  //Graph with fitting line
260  TCanvas* c20 = new TCanvas("c20","c20");
261  c20->SetLogz();
262  f20->GetXaxis()->CenterTitle();
263  f20->GetYaxis()->CenterTitle();
264  f20->Draw("colz");
265  diag.Draw();
266  gPad->Update();
267  gPad->SetRightMargin(0.13);
268  TPaletteAxis *palette20 = (TPaletteAxis*)f20->GetListOfFunctions()->FindObject("palette");
269  palette20->SetBBoxCenterX(625);
270  gPad->Modified();
271  gPad->Update();
272  c20->Print("NDmuon45.pdf");
273 
274  //Graph with fitting line
275  TCanvas* c23 = new TCanvas("c23","c23");
276  c23->SetLogz();
277  f23->Draw("colz");
278  diag.Draw();
279  gPad->Update();
280  gPad->SetRightMargin(0.13);
281  TPaletteAxis *palette23 = (TPaletteAxis*)f23->GetListOfFunctions()->FindObject("palette");
282  palette23->SetBBoxCenterX(625);
283  gPad->Modified();
284  gPad->Update();
285  c23->Print("NDhadqe45.pdf");
286 
287 
288  //Graph with fitting line
289  TCanvas* c26 = new TCanvas("c26","c26");
290  c26->SetLogz();
291  f26->GetXaxis()->CenterTitle();
292  f26->GetYaxis()->CenterTitle();
293  f26->Draw("colz");
294  diag.Draw();
295  gPad->Update();
296  gPad->SetRightMargin(0.13);
297  TPaletteAxis *palette26 = (TPaletteAxis*)f26->GetListOfFunctions()->FindObject("palette");
298  palette26->SetBBoxCenterX(625);
299  gPad->Modified();
300  gPad->Update();
301  c26->Print("NDhadnonqe45.pdf");
302 
303  //Graph with fitting line
304  TCanvas* c29 = new TCanvas("c29","c29");
305  c29->SetLogz();
306  f29->GetXaxis()->CenterTitle();
307  f29->GetYaxis()->CenterTitle();
308  f29->Draw("colz");
309  diag.Draw();
310  gPad->Update();
311  gPad->SetRightMargin(0.13);
312  TPaletteAxis *palette29 = (TPaletteAxis*)f29->GetListOfFunctions()->FindObject("palette");
313  palette29->SetBBoxCenterX(625);
314  gPad->Modified();
315  gPad->Update();
316  c29->Print("NDhadcc45.pdf");
317 
318  //Graph with fitting line
319  TCanvas* c32 = new TCanvas("c32","c32");
320  c32->SetLogz();
321  f32->Draw("colz");
322  diag.Draw();
323  gPad->Update();
324  gPad->SetRightMargin(0.13);
325  TPaletteAxis *palette32 = (TPaletteAxis*)f32->GetListOfFunctions()->FindObject("palette");
326  palette32->SetBBoxCenterX(625);
327  gPad->Modified();
328  gPad->Update();
329  c32->Print("NDneutrinoqe45.pdf");
330 
331  //Graph with fitting line
332  TCanvas* c35 = new TCanvas("c35","c35");
333  c35->SetLogz();
334  f35->GetXaxis()->CenterTitle();
335  f35->GetYaxis()->CenterTitle();
336  f35->Draw("colz");
337  diag.Draw();
338  gPad->Update();
339  gPad->SetRightMargin(0.13);
340  TPaletteAxis *palette35 = (TPaletteAxis*)f35->GetListOfFunctions()->FindObject("palette");
341  palette35->SetBBoxCenterX(625);
342  gPad->Modified();
343  gPad->Update();
344  c35->Print("NDneutrinononqe45.pdf");
345 
346  //Graph with fitting line
347  TCanvas* c38 = new TCanvas("c38","c38");
348  c38->SetLogz();
349  f38->GetXaxis()->CenterTitle();
350  f38->GetYaxis()->CenterTitle();
351  f38->Draw("colz");
352  diag.Draw();
353  gPad->Update();
354  gPad->SetRightMargin(0.13);
355  TPaletteAxis *palette38 = (TPaletteAxis*)f38->GetListOfFunctions()->FindObject("palette");
356  palette38->SetBBoxCenterX(625);
357  gPad->Modified();
358  gPad->Update();
359  c38->Print("NDneutrinocc45.pdf");
360 
361 }
362 
363 
364 
void redND()
Definition: redND.C:20
OStream cout
Definition: OStream.cxx:6
TFile * file
Definition: cellShifts.C:17