FairRoot/PandaRoot
ReadMesDecCorrRes_PiT.C
Go to the documentation of this file.
1 {
2 
3 TFile* f1 = new TFile("AnaFSimpleBup1TXm_Bg.root");
4 // TFile* f2 = new TFile("AnaFSimpleP4Bup1TXXb.root");
5 
6 
7 // TFile* f3 = new TFile("AnaFSimpleP6Bup1TXXb.root");
8 // TFile* f4 = new TFile("AnaFSimpleP8Bup1TXXb.root");
9 TH2D * h1 =(TH2D*)f1->Get("hvtx201");
10 TH2D * h2 =(TH2D*)f1->Get("hvtx202");
11 
12 TH2D * h3 =(TH2D*)f1->Get("hvtx203");
13 TH2D * h4 =(TH2D*)f1->Get("hvtx204");
14 
15 TH1D * h1p =(TH1D*)h1->ProjectionX(" proj_x1",0,-1,"");
16 TH1D * h2p =(TH1D*)h1->ProjectionY(" proj_y2",0,-1,"");
17 
18 TH1D * h3p =(TH1D*)h3->ProjectionY(" proj_y3",0,-1,"");
19 
20 TH1D * h4p =(TH1D*)h4->ProjectionX(" proj_x4",0,-1,"");
21 
22 
23 TCanvas* c2 = new TCanvas("c2","c2");
24 //c2->Divide(1,2);
25 //c2->cd(1);
26  h1->SetTitle("#pi_{L} + #pi_{H} correlation");
27  h1->GetXaxis()->CenterTitle();
28  h1->GetYaxis()->SetTitle("P_{Low} (GeV/c)");
29  h1->GetXaxis()->CenterTitle();
30  h1->GetXaxis()->SetTitle("P_{High} (GeV/c)");
31  h1->GetYaxis()->SetTitleOffset(1.25);
32  h1->GetXaxis()->SetTitleOffset(1.25);
33  h1->Draw("box");
34  // c2->cd(2);
35  // h3->Draw("samebox");
36  //h4->Draw("samebox");
37 
38 TCanvas* c = new TCanvas("c1","c1");
39 c->Divide(1,3);
40 
41 c->cd(1);
42  h1p->GetXaxis()->SetTitle("P_{high} (GeV/c)P");
43  h1p->GetYaxis()->SetTitle("Counts");
44  h1p->GetXaxis()->SetLabelSize(0.05);
45  h1p->GetYaxis()->SetLabelSize(0.05);
46  h1p->GetYaxis()->SetTitleSize(0.05);
47  h1p->GetXaxis()->SetTitleSize(0.05);
48  h1p->GetYaxis()->SetTitleOffset(0.75);
49 
50  h1p->SetLineWidth(2);
51  // h4p->SetLineWidth(2);
52  h1p->SetLineColor(1);
53  //h4p->SetLineColor(2);
54 h1p->Draw();
55 //h4p->Draw("same");
56 
57  // leg = new TLegend(0.2,0.6,0.45,0.85,0);
58  // leg ->AddEntry(h1p," two pion events","L");
59  // leg ->AddEntry(h4p,"one pion events ","L");
60  // leg->SetBorderSize(0);
61  // leg ->SetFillColor(0);
62  // leg ->Draw();
63 
64 c->cd(2);
65 
66 h2p->GetXaxis()->SetTitle("P_{low}(GeV/c)");
67  h2p->GetYaxis()->SetTitle("Counts");
68  h2p->GetYaxis()->SetTitleSize(0.05);
69  h2p->GetXaxis()->SetTitleSize(0.05);
70  h2p->GetXaxis()->SetLabelSize(0.05);
71  h2p->GetYaxis()->SetLabelSize(0.05);
72  h2p->GetYaxis()->SetTitleOffset(0.75);
73 
74  h2p->SetLineWidth(2);
75  //h3p->SetLineWidth(2);
76  h2p->SetLineColor(1);
77  h3p->SetLineColor(2);
78 h2p->Draw();
79 //h3p->Draw("same");
80 
81  // leg = new TLegend(0.2,0.6,0.45,0.85,0);
82  // leg ->AddEntry(h2p," two pion events","L");
83  // leg ->AddEntry(h3p,"one pion events ","L");
84  // leg->SetBorderSize(0);
85  // leg ->SetFillColor(0);
86  // leg ->Draw();
87 
88 c->cd(3);
89  h3p->SetTitle("one pion events ");
90 h3p->GetXaxis()->SetTitle("P(GeV/c)");
91  h3p->GetYaxis()->SetTitle("Counts");
92  h3p->GetYaxis()->SetTitleSize(0.05);
93  h3p->GetXaxis()->SetTitleSize(0.05);
94  h3p->GetXaxis()->SetLabelSize(0.05);
95  h3p->GetYaxis()->SetLabelSize(0.05);
96  h3p->GetYaxis()->SetTitleOffset(0.75);
97  h3p->SetLineWidth(2);
98  h3p->SetLineColor(1);
99  h4p->SetLineWidth(2);
100 h4p->SetLineColor(1);
101 
102 h3p->Draw();
103  h4p->Draw("same");
104 // c->cd(4);
105 // h4p->Draw();
106 
107 
108 
109 
110  gStyle->SetPadBorderMode(1);
111  gStyle->SetPadBorderSize(1);
112  gStyle->SetPadColor(0);
113  gStyle->SetDrawBorder(0);
114  gStyle->SetCanvasBorderMode(0);
115  gStyle->SetCanvasBorderSize(0);
116  gStyle->SetTitleBorderSize(0);
117  gStyle->SetCanvasColor(10);
118  gStyle->SetStatBorderSize(1);
119  gStyle->SetFrameBorderMode(0);
120  gStyle->SetFrameBorderSize(1);
121 
122  printf("...Loading Fit/Stat\n");
123  gStyle->SetFitFormat("2.3f");
124  gStyle->SetOptFit(0);
125  gStyle->SetOptStat(0) ;
126  gStyle->SetStatColor(0);
127  gStyle->SetStatX(0.46);
128  gStyle->SetStatY(0.9);
129  gStyle->SetStatW(0.15);
130  gStyle->SetStatH(0.1);
131 
132  printf("...Loading Title Style\n");
133  gStyle->SetTitleColor(1);
134  gStyle->SetTitleFillColor(0);
135  gStyle->SetTitleX(0.5);
136  gStyle->SetTitleY(0.8);
137 
138  gStyle->SetTitleOffset(1.3,"x");
139  gStyle->SetTitleOffset(1.7,"y");
140  gStyle->SetTitleOffset(1.7,"z");
141  gStyle->SetTitleSize(.0525,"x");
142  gStyle->SetTitleSize(.0525,"y");
143  gStyle->SetTitleSize(.0525,"z");
144 
145  printf("...Loading Label Style\n");
146  gStyle->SetLabelOffset(.02,"x");
147  gStyle->SetLabelOffset(.025,"y");
148  gStyle->SetLabelOffset(.02,"z");
149  gStyle->SetLabelFont(42,"x");
150  gStyle->SetLabelFont(42,"y");
151  gStyle->SetLabelFont(42,"z");
152  gStyle->SetTickLength(-0.02,"x");
153  gStyle->SetTickLength(-0.02,"y");
154  gStyle->SetTickLength(-0.02,"z");
155  gStyle->SetLabelSize(.0525,"x");
156  gStyle->SetLabelSize(.0525,"y");
157  gStyle->SetLabelSize(.0525,"z");
158  gStyle->SetPadTickX(1);
159  gStyle->SetPadTickY(1);
160 
161  gStyle->SetPadTopMargin(0.03);
162  gStyle->SetPadRightMargin(0.03);
163  gStyle->SetPadBottomMargin(0.12);
164  gStyle->SetPadLeftMargin(0.15);
165 
166  printf("...Loading Fonts\n");
167  gStyle->SetTitleFont(42);
168  gStyle->SetStatFont(42);
169  gStyle->SetTitleFont(42,"x");
170  gStyle->SetTitleFont(42,"y");
171  gStyle->SetTitleFont(42,"z");
172  gStyle->GetAttDate()->SetTextFont(42);
173  gStyle->GetAttDate()->SetTextSize(0.02);
174 
175  printf("...Loading Histo Options\n");
176  gStyle->SetHistFillStyle(1001);
177  gStyle->SetHistLineWidth(1);
178 
179  gStyle->SetOptDate(0);
180  gStyle->SetPalette(1);
181  printf("\n");
182 
183 
184 
185 
186 }
TH1D * h3p
TH1D * h1p
TF1 * f1
Definition: reco_analys2.C:50
TH1D * h2p
printf("...Loading Fit/Stat\n")
TH2D * h2
TH2D * h1
TH1D * h4p
TH2D * h3
TH2D * h4
TCanvas * c2