Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot_p2pi_trees.C
Go to the documentation of this file.
1 void plot_p2pi_trees(void)
2 {
3 // File: p2pi_trees.C
4 //
5 
6  gStyle->SetPalette(1,0);
7  gStyle->SetOptStat(111111);
8  gStyle->SetOptFit(111111);
9  gStyle->SetPadRightMargin(0.15);
10  gStyle->SetPadLeftMargin(0.15);
11  gStyle->SetPadBottomMargin(0.15);
12 
13  TString filename = "DSelector_p2pi_trees_pulls3";
14 
15  TFile *f = new TFile(filename+".root","read");
16 
17  cout << "Opening root file: " << (filename+".root").Data() << endl;
18 
19  TH1F *NumEventsSurvivedAction = (TH1F*)f->Get("NumEventsSurvivedAction");
20  TH2F *NumCombosSurvivedAction = (TH2F*)f->Get("NumCombosSurvivedAction");
21  TH1F *BeamEnergy = (TH1F*)f->Get("BeamEnergy");
22  TH1F *pMomentumMeasured = (TH1F*)f->Get("pMomentumMeasured");
23  TH1F *piplusMomentumMeasured = (TH1F*)f->Get("piplusMomentumMeasured");
24  TH1F *piminusMomentumMeasured = (TH1F*)f->Get("piminusMomentumMeasured");
25 
26  TH1F *KinFitChiSq = (TH1F*)f->Get("KinFitChiSq");
27  TH1F *KinFitCL = (TH1F*)f->Get("KinFitCL");
28  TH1F *MissingMassSquared = (TH1F*)f->Get("MissingMassSquared");
29  TH1F *M2pi = (TH1F*)f->Get("M2pi");
30  TH1F *t = (TH1F*)f->Get("t");
31  TH2F *CosTheta_Psi = (TH2F*)f->Get("CosTheta_Psi");
32 
33  TH1F *pDeltap_Measured = (TH1F*)f->Get("pDeltap_Measured");
34  TH1F *pipDeltap_Measured = (TH1F*)f->Get("pipDeltap_Measured");
35  TH1F *pimDeltap_Measured = (TH1F*)f->Get("pimDeltap_Measured");
36  TH1F *pDeltap = (TH1F*)f->Get("pDeltap");
37  TH1F *pipDeltap = (TH1F*)f->Get("pipDeltap");
38  TH1F *pimDeltap = (TH1F*)f->Get("pimDeltap");
39 
40  TCanvas *c0 = new TCanvas("c0", "c0",200,10,1000,700);
41 
42  c0->Divide(3,2);
43  c0->cd(1);
44  // gPad->SetLogy();
45  Double_t xmin = 0;
46  Double_t xmax = 2;
47  Double_t ymin = 100;
48  Double_t ymax = 10000;
49 
50  NumEventsSurvivedAction->SetTitle(filename);
51  // NumEventsSurvivedAction->GetXaxis()->SetRangeUser(xmin,xmax);
52  // NumEventsSurvivedAction->GetYaxis()->SetRangeUser(ymin,ymax);
53  NumEventsSurvivedAction->GetXaxis()->SetTitleSize(0.05);
54  NumEventsSurvivedAction->GetYaxis()->SetTitleSize(0.05);
55  // NumEventsSurvivedAction->GetXaxis()->SetTitle("Events");
56  NumEventsSurvivedAction->SetMarkerColor(4);
57  NumEventsSurvivedAction->Draw();
58 
59  c0->cd(2);
60  // gPad->SetLogy();
61  ymin = 0;
62  ymax = 5000;
63 
64  NumCombosSurvivedAction->SetTitle(filename);
65  // NumCombosSurvivedAction->GetXaxis()->SetRangeUser(xmin,xmax);
66  // NumCombosSurvivedAction->GetYaxis()->SetRangeUser(ymin,ymax);
67  NumCombosSurvivedAction->GetXaxis()->SetTitleSize(0.05);
68  NumCombosSurvivedAction->GetYaxis()->SetTitleSize(0.05);
69  // NumCombosSurvivedAction->GetXaxis()->SetTitle("Events");
70  // NumCombosSurvivedAction->SetMarkerColor(4);
71  NumCombosSurvivedAction->Draw("colz");
72 
73  c0->cd(3);
74  // gPad->SetLogy();
75  ymin = 0;
76  ymax = 4000;
77 
78  BeamEnergy->SetTitle(filename);
79  // BeamEnergy->GetXaxis()->SetRangeUser(xmin,xmax);
80  // BeamEnergy->GetYaxis()->SetRangeUser(ymin,ymax);
81  BeamEnergy->GetXaxis()->SetTitleSize(0.05);
82  BeamEnergy->GetYaxis()->SetTitleSize(0.05);
83  BeamEnergy->GetXaxis()->SetTitle("Energy (GeV)");
84  BeamEnergy->SetMarkerColor(4);
85  BeamEnergy->Draw();
86 
87  c0->cd(4);
88  // gPad->SetLogy();
89  ymin = 0;
90  ymax = 4000;
91 
92  pMomentumMeasured->SetTitle(filename);
93  // pMomentumMeasured->GetXaxis()->SetRangeUser(xmin,xmax);
94  // pMomentumMeasured->GetYaxis()->SetRangeUser(ymin,ymax);
95  pMomentumMeasured->GetXaxis()->SetTitleSize(0.05);
96  pMomentumMeasured->GetYaxis()->SetTitleSize(0.05);
97  pMomentumMeasured->GetXaxis()->SetTitle("Proton Momentum (GeV)");
98  pMomentumMeasured->SetMarkerColor(4);
99  pMomentumMeasured->Draw();
100 
101  c0->cd(5);
102  // gPad->SetLogy();
103  ymin = 0;
104  ymax = 4000;
105 
106  piplusMomentumMeasured->SetTitle(filename);
107  // piplusMomentumMeasured->GetXaxis()->SetRangeUser(xmin,xmax);
108  // piplusMomentumMeasured->GetYaxis()->SetRangeUser(ymin,ymax);
109  piplusMomentumMeasured->GetXaxis()->SetTitleSize(0.05);
110  piplusMomentumMeasured->GetYaxis()->SetTitleSize(0.05);
111  piplusMomentumMeasured->GetXaxis()->SetTitle("PiPlus Momentum (GeV)");
112  piplusMomentumMeasured->SetMarkerColor(4);
113  piplusMomentumMeasured->Draw();
114 
115  c0->cd(6);
116  // gPad->SetLogy();
117  ymin = 0;
118  ymax = 4000;
119 
120  piminusMomentumMeasured->SetTitle(filename);
121  // piminusMomentumMeasured->GetXaxis()->SetRangeUser(xmin,xmax);
122  // piminusMomentumMeasured->GetYaxis()->SetRangeUser(ymin,ymax);
123  piminusMomentumMeasured->GetXaxis()->SetTitleSize(0.05);
124  piminusMomentumMeasured->GetYaxis()->SetTitleSize(0.05);
125  piminusMomentumMeasured->GetXaxis()->SetTitle("PiMinus Momentum (GeV)");
126  piminusMomentumMeasured->SetMarkerColor(4);
127  piminusMomentumMeasured->Draw();
128 
129 
130  TCanvas *c1 = new TCanvas("c1", "c1",200,10,1000,700);
131 
132  c1->Divide(3,2);
133 
134 
135  c1->cd(1);
136  // gPad->SetLogy();
137  ymin = 0;
138  ymax = 4000;
139 
140  KinFitChiSq->SetTitle(filename);
141  // KinFitChiSq->GetXaxis()->SetRangeUser(xmin,xmax);
142  // KinFitChiSq->GetYaxis()->SetRangeUser(ymin,ymax);
143  KinFitChiSq->GetXaxis()->SetTitleSize(0.05);
144  KinFitChiSq->GetYaxis()->SetTitleSize(0.05);
145  KinFitChiSq->GetXaxis()->SetTitle("#chi^{2}");
146  KinFitChiSq->SetMarkerColor(4);
147  KinFitChiSq->Draw();
148 
149  c1->cd(2);
150  gPad->SetLogy();
151  ymin = 0;
152  ymax = 4000;
153 
154  KinFitCL->SetTitle(filename);
155  // KinFitCL->GetXaxis()->SetRangeUser(xmin,xmax);
156  // KinFitCL->GetYaxis()->SetRangeUser(ymin,ymax);
157  KinFitCL->GetXaxis()->SetTitleSize(0.05);
158  KinFitCL->GetYaxis()->SetTitleSize(0.05);
159  KinFitCL->GetXaxis()->SetTitle("Probability");
160  KinFitCL->SetMarkerColor(4);
161  KinFitCL->Draw();
162 
163  c1->cd(3);
164  // gPad->SetLogy();
165  ymin = 0;
166  ymax = 4000;
167 
168  MissingMassSquared->SetTitle(filename);
169  // MissingMassSquared->GetXaxis()->SetRangeUser(xmin,xmax);
170  // MissingMassSquared->GetYaxis()->SetRangeUser(ymin,ymax);
171  MissingMassSquared->GetXaxis()->SetTitleSize(0.05);
172  MissingMassSquared->GetYaxis()->SetTitleSize(0.05);
173  MissingMassSquared->GetXaxis()->SetTitle("Missing Mass (GeV2)");
174  MissingMassSquared->SetMarkerColor(4);
175  MissingMassSquared->Draw();
176 
177  c1->cd(4);
178  // gPad->SetLogy();
179  ymin = 0;
180  ymax = 4000;
181 
182  M2pi->SetTitle(filename);
183  // M2pi->GetXaxis()->SetRangeUser(xmin,xmax);
184  // M2pi->GetYaxis()->SetRangeUser(ymin,ymax);
185  M2pi->GetXaxis()->SetTitleSize(0.05);
186  M2pi->GetYaxis()->SetTitleSize(0.05);
187  M2pi->GetXaxis()->SetTitle("Mass 2pi (GeV)");
188  M2pi->SetMarkerColor(4);
189  M2pi->Draw();
190 
191  c1->cd(5);
192  // gPad->SetLogy();
193  ymin = 0;
194  ymax = 4000;
195 
196  t->SetTitle(filename);
197  // t->GetXaxis()->SetRangeUser(xmin,xmax);
198  // t->GetYaxis()->SetRangeUser(ymin,ymax);
199  t->GetXaxis()->SetTitleSize(0.05);
200  t->GetYaxis()->SetTitleSize(0.05);
201  t->GetXaxis()->SetTitle("-t (GeV2)");
202  t->SetMarkerColor(4);
203  t->Draw();
204 
205  c1->cd(6);
206  // gPad->SetLogy();
207  ymin = 0;
208  ymax = 4000;
209 
210  CosTheta_Psi->SetTitle(filename);
211  // CosTheta_Psi->GetXaxis()->SetRangeUser(xmin,xmax);
212  // CosTheta_Psi->GetYaxis()->SetRangeUser(ymin,ymax);
213  CosTheta_Psi->GetXaxis()->SetTitleSize(0.05);
214  CosTheta_Psi->GetYaxis()->SetTitleSize(0.05);
215  CosTheta_Psi->GetYaxis()->SetTitle("CosTheta");
216  CosTheta_Psi->GetXaxis()->SetTitle("#Psi (Degrees)");
217  CosTheta_Psi->SetMarkerColor(4);
218  CosTheta_Psi->Draw("colz");
219 
220 
221  TCanvas *c2 = new TCanvas("c2", "c2",200,10,1000,700);
222 
223  c2->Divide(3,2);
224 
225  c2->cd(1);
226  // gPad->SetLogy();
227  ymin = 0;
228  ymax = 4000;
229 
230  pDeltap_Measured->SetTitle(filename);
231  // pDeltap_Measured->GetXaxis()->SetRangeUser(xmin,xmax);
232  // pDeltap_Measured->GetYaxis()->SetRangeUser(ymin,ymax);
233  pDeltap_Measured->GetXaxis()->SetTitleSize(0.05);
234  pDeltap_Measured->GetYaxis()->SetTitleSize(0.05);
235  // pDeltap_Measured->GetXaxis()->SetTitle("");
236  pDeltap_Measured->SetMarkerColor(4);
237  pDeltap_Measured->Draw();
238 
239  c2->cd(2);
240  // gPad->SetLogy();
241  ymin = 0;
242  ymax = 4000;
243 
244  pipDeltap_Measured->SetTitle(filename);
245  // pipDeltap_Measured->GetXaxis()->SetRangeUser(xmin,xmax);
246  // pipDeltap_Measured->GetYaxis()->SetRangeUser(ymin,ymax);
247  pipDeltap_Measured->GetXaxis()->SetTitleSize(0.05);
248  pipDeltap_Measured->GetYaxis()->SetTitleSize(0.05);
249  // pipDeltap_Measured->GetXaxis()->SetTitle("#chi^{2}");
250  pipDeltap_Measured->SetMarkerColor(4);
251  pipDeltap_Measured->Draw();
252 
253  c2->cd(3);
254  // gPad->SetLogy();
255  ymin = 0;
256  ymax = 4000;
257 
258  pimDeltap_Measured->SetTitle(filename);
259  // pimDeltap_Measured->GetXaxis()->SetRangeUser(xmin,xmax);
260  // pimDeltap_Measured->GetYaxis()->SetRangeUser(ymin,ymax);
261  pimDeltap_Measured->GetXaxis()->SetTitleSize(0.05);
262  pimDeltap_Measured->GetYaxis()->SetTitleSize(0.05);
263  // pimDeltap_Measured->GetXaxis()->SetTitle("#chi^{2}");
264  pimDeltap_Measured->SetMarkerColor(4);
265  pimDeltap_Measured->Draw();
266 
267  c2->cd(4);
268  // gPad->SetLogy();
269  ymin = 0;
270  ymax = 4000;
271 
272  pDeltap->SetTitle(filename);
273  // pDeltap->GetXaxis()->SetRangeUser(xmin,xmax);
274  // pDeltap->GetYaxis()->SetRangeUser(ymin,ymax);
275  pDeltap->GetXaxis()->SetTitleSize(0.05);
276  pDeltap->GetYaxis()->SetTitleSize(0.05);
277  // pDeltap->GetXaxis()->SetTitle("");
278  pDeltap->SetMarkerColor(4);
279  pDeltap->Draw();
280 
281  c2->cd(5);
282  // gPad->SetLogy();
283  ymin = 0;
284  ymax = 4000;
285 
286  pipDeltap->SetTitle(filename);
287  // pipDeltap->GetXaxis()->SetRangeUser(xmin,xmax);
288  // pipDeltap->GetYaxis()->SetRangeUser(ymin,ymax);
289  pipDeltap->GetXaxis()->SetTitleSize(0.05);
290  pipDeltap->GetYaxis()->SetTitleSize(0.05);
291  // pipDeltap->GetXaxis()->SetTitle("#chi^{2}");
292  pipDeltap->SetMarkerColor(4);
293  pipDeltap->Draw();
294 
295  c2->cd(6);
296  // gPad->SetLogy();
297  ymin = 0;
298  ymax = 4000;
299 
300  pimDeltap->SetTitle(filename);
301  // pimDeltap->GetXaxis()->SetRangeUser(xmin,xmax);
302  // pimDeltap->GetYaxis()->SetRangeUser(ymin,ymax);
303  pimDeltap->GetXaxis()->SetTitleSize(0.05);
304  pimDeltap->GetYaxis()->SetTitleSize(0.05);
305  // pimDeltap->GetXaxis()->SetTitle("#chi^{2}");
306  pimDeltap->SetMarkerColor(4);
307  pimDeltap->Draw();
308 
309 
310  c0->SaveAs(filename+".pdf(");
311  c1->SaveAs(filename+".pdf");
312  c2->SaveAs(filename+".pdf)");
313 }
Double_t c0[2][NMODULES]
Definition: tw_corr.C:67
void plot_p2pi_trees(void)
TString filename
Double_t c1[2][NMODULES]
Definition: tw_corr.C:68
TF1 * f
Definition: FitGains.C:21
Double_t c2[2][NMODULES]
Definition: tw_corr.C:69
Double_t ymin
Definition: bcal_hist_eff.C:89
Double_t ymax
Definition: bcal_hist_eff.C:91