red.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 red()
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* f5 = file->Get("5");
29  TH2D* f7 = file->Get("7");
30  TH2D* f9 = file->Get("9");
31  TH2D* f21 = file->Get("21");
32  TH2D* f11 = file->Get("11");
33  TH2D* f13 = file->Get("13");
34  TH2D* f23 = file->Get("23");
35 
36  TH2D* f14 = file->Get("14");
37  TH2D* f15 = file->Get("15");
38  TH2D* f16 = file->Get("16");
39  TH2D* f24 = file->Get("24");
40  TH2D* f17 = file->Get("17");
41  TH2D* f18 = file->Get("18");
42  TH2D* f25 = file->Get("25");
43 
44  diag = TLine(0.0,0.0,5.0,5.0);
45  diag.SetLineColor(2);
46 
47  flatM = TLine(0.0,0.0,2000.0,0.0);
48  flatM.SetLineColor(2);
49 
50  flat = TLine(0.0,0.0,5.0,0.0);
51  flat.SetLineColor(2);
52 
53  //Graph with fitting line
54  TCanvas* c5 = new TCanvas("c5","c5");
55  f5->GetXaxis()->CenterTitle();
56  f5->GetYaxis()->CenterTitle();
57  c5->SetLogz();
58  f5->Draw("colz");
59  flatM.Draw();
60  gPad->Update();
61  gPad->SetRightMargin(0.13);
62  TPaletteAxis *palette5 = (TPaletteAxis*)f5->GetListOfFunctions()->FindObject("palette");
63  palette5->SetBBoxCenterX(625);
64  gPad->Modified();
65  gPad->Update();
66  c5->Print("muonFlat.pdf");
67 
68  //Graph with fitting line
69  TCanvas* c7 = new TCanvas("c7","c7");
70  c7->SetLogz();
71  f7->GetXaxis()->CenterTitle();
72  f7->GetYaxis()->CenterTitle();
73  f7->Draw("colz");
74  flat.Draw();
75  gPad->Update();
76  gPad->SetRightMargin(0.13);
77  TPaletteAxis *palette7 = (TPaletteAxis*)f7->GetListOfFunctions()->FindObject("palette");
78  palette7->SetBBoxCenterX(625);
79  gPad->Modified();
80  gPad->Update();
81  c7->Print("hadqeFlat.pdf");
82 
83  //Graph with fitting line
84  TCanvas* c9 = new TCanvas("c9","c9");
85  c9->SetLogz();
86  f9->GetXaxis()->CenterTitle();
87  f9->GetYaxis()->CenterTitle();
88  f9->Draw("colz");
89  flat.Draw();
90  gPad->Update();
91  gPad->SetRightMargin(0.13);
92  TPaletteAxis *palette9 = (TPaletteAxis*)f9->GetListOfFunctions()->FindObject("palette");
93  palette9->SetBBoxCenterX(625);
94  gPad->Modified();
95  gPad->Update();
96  c9->Print("hadnonqeFlat.pdf");
97 
98  //Graph with fitting line
99  TCanvas* c21 = new TCanvas("c21","c21");
100  c21->SetLogz();
101  f21->GetXaxis()->CenterTitle();
102  f21->GetYaxis()->CenterTitle();
103  f21->Draw("colz");
104  flat.Draw();
105  gPad->Update();
106  gPad->SetRightMargin(0.13);
107  TPaletteAxis *palette21 = (TPaletteAxis*)f21->GetListOfFunctions()->FindObject("palette");
108  palette21->SetBBoxCenterX(625);
109  gPad->Modified();
110  gPad->Update();
111  c21->Print("hadccFlat.pdf");
112 
113  //Graph with fitting line
114  TCanvas* c11 = new TCanvas("c11","c11");
115  c11->SetLogz();
116  f11->Draw("colz");
117  flat.Draw();
118  gPad->Update();
119  gPad->SetRightMargin(0.13);
120  TPaletteAxis *palette11 = (TPaletteAxis*)f11->GetListOfFunctions()->FindObject("palette");
121  palette11->SetBBoxCenterX(625);
122  gPad->Modified();
123  gPad->Update();
124  c11->Print("neutrinoqeFlat.pdf");
125 
126  //Graph with fitting line
127  TCanvas* c13 = new TCanvas("c13","c13");
128  c13->SetLogz();
129  f13->GetXaxis()->CenterTitle();
130  f13->GetYaxis()->CenterTitle();
131  f13->Draw("colz");
132  flat.Draw();
133  gPad->Update();
134  gPad->SetRightMargin(0.13);
135  TPaletteAxis *palette13 = (TPaletteAxis*)f13->GetListOfFunctions()->FindObject("palette");
136  palette13->SetBBoxCenterX(625);
137  gPad->Modified();
138  gPad->Update();
139  c13->Print("neutrinononqeFlat.pdf");
140 
141  //Graph with fitting line
142  TCanvas* c23 = new TCanvas("c23","c23");
143  c23->SetLogz();
144  f23->GetXaxis()->CenterTitle();
145  f23->GetYaxis()->CenterTitle();
146  f23->Draw("colz");
147  flat.Draw();
148  gPad->Update();
149  gPad->SetRightMargin(0.13);
150  TPaletteAxis *palette23 = (TPaletteAxis*)f23->GetListOfFunctions()->FindObject("palette");
151  palette23->SetBBoxCenterX(625);
152  gPad->Modified();
153  gPad->Update();
154  c23->Print("neutrinoccFlat.pdf");
155 
156 
157  //Graph with fitting line
158  TCanvas* c14 = new TCanvas("c14","c14");
159  c14->SetLogz();
160  f14->GetXaxis()->CenterTitle();
161  f14->GetYaxis()->CenterTitle();
162  f14->Draw("colz");
163  diag.Draw();
164  gPad->Update();
165  gPad->SetRightMargin(0.13);
166  TPaletteAxis *palette14 = (TPaletteAxis*)f14->GetListOfFunctions()->FindObject("palette");
167  palette14->SetBBoxCenterX(625);
168  gPad->Modified();
169  gPad->Update();
170  c14->Print("muon45.pdf");
171 
172  //Graph with fitting line
173  TCanvas* c15 = new TCanvas("c15","c15");
174  c15->SetLogz();
175  f15->GetXaxis()->CenterTitle();
176  f15->GetYaxis()->CenterTitle();
177  f15->Draw("colz");
178  diag.Draw();
179  gPad->Update();
180  gPad->SetRightMargin(0.13);
181  TPaletteAxis *palette15 = (TPaletteAxis*)f15->GetListOfFunctions()->FindObject("palette");
182  palette15->SetBBoxCenterX(625);
183  gPad->Modified();
184  gPad->Update();
185  c15->Print("hadqe45.pdf");
186 
187 
188  //Graph with fitting line
189  TCanvas* c16 = new TCanvas("c16","c16");
190  c16->SetLogz();
191  f16->GetXaxis()->CenterTitle();
192  f16->GetYaxis()->CenterTitle();
193  f16->Draw("colz");
194  diag.Draw();
195  gPad->Update();
196  gPad->SetRightMargin(0.13);
197  TPaletteAxis *palette16 = (TPaletteAxis*)f16->GetListOfFunctions()->FindObject("palette");
198  palette16->SetBBoxCenterX(625);
199  gPad->Modified();
200  gPad->Update();
201  c16->Print("hadnonqe45.pdf");
202 
203  //Graph with fitting line
204  TCanvas* c24 = new TCanvas("c24","c24");
205  c24->SetLogz();
206  f24->GetXaxis()->CenterTitle();
207  f24->GetYaxis()->CenterTitle();
208  f24->Draw("colz");
209  diag.Draw();
210  gPad->Update();
211  gPad->SetRightMargin(0.13);
212  TPaletteAxis *palette24 = (TPaletteAxis*)f24->GetListOfFunctions()->FindObject("palette");
213  palette24->SetBBoxCenterX(625);
214  gPad->Modified();
215  gPad->Update();
216  c24->Print("hadcc45.pdf");
217 
218  //Graph with fitting line
219  TCanvas* c17 = new TCanvas("c17","c17");
220  c17->SetLogz();
221  f17->GetXaxis()->CenterTitle();
222  f17->GetYaxis()->CenterTitle();
223  f17->Draw("colz");
224  diag.Draw();
225  gPad->Update();
226  gPad->SetRightMargin(0.13);
227  TPaletteAxis *palette17 = (TPaletteAxis*)f17->GetListOfFunctions()->FindObject("palette");
228  palette17->SetBBoxCenterX(625);
229  gPad->Modified();
230  gPad->Update();
231  c17->Print("neutrinoqe45.pdf");
232 
233  //Graph with fitting line
234  TCanvas* c18 = new TCanvas("c18","c18");
235  c18->SetLogz();
236  f18->GetXaxis()->CenterTitle();
237  f18->GetYaxis()->CenterTitle();
238  f18->Draw("colz");
239  diag.Draw();
240  gPad->Update();
241  gPad->SetRightMargin(0.13);
242  TPaletteAxis *palette18 = (TPaletteAxis*)f18->GetListOfFunctions()->FindObject("palette");
243  palette18->SetBBoxCenterX(625);
244  gPad->Modified();
245  gPad->Update();
246  c18->Print("neutrinononqe45.pdf");
247 
248  //Graph with fitting line
249  TCanvas* c25 = new TCanvas("c25","c25");
250  c25->SetLogz();
251  f25->GetXaxis()->CenterTitle();
252  f25->GetYaxis()->CenterTitle();
253  f25->Draw("colz");
254  diag.Draw();
255  gPad->Update();
256  gPad->SetRightMargin(0.13);
257  TPaletteAxis *palette25 = (TPaletteAxis*)f25->GetListOfFunctions()->FindObject("palette");
258  palette25->SetBBoxCenterX(625);
259  gPad->Modified();
260  gPad->Update();
261  c25->Print("neutrinocc45.pdf");
262 
263 }
264 
265 
266 
void red()
Definition: red.C:20
OStream cout
Definition: OStream.cxx:6
TFile * file
Definition: cellShifts.C:17