-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawAlis.C
More file actions
117 lines (108 loc) · 3.21 KB
/
DrawAlis.C
File metadata and controls
117 lines (108 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
void DrawAlis()
{
//gStyle->SetOptFit(1);
DoDraw("0005");
DoDraw("3040");
DoDraw("7080");
}
void DoDraw(char *centstring)
{
TH1D *halis = new TH1D(Form("halis_c%s",centstring),"",50,-2,2);
TH1D *hron1 = new TH1D(Form("hron1_c%s",centstring),"",50,-2,2);
TH1D *hron2 = new TH1D(Form("hron2_c%s",centstring),"",50,-2,2);
TH1D *hron3 = new TH1D(Form("hron3_c%s",centstring),"",50,-2,2);
ifstream falis;
ifstream fron2;
ifstream fron3;
falis.open(Form("AlisBF_c%s.dat",centstring));
fron2.open(Form("TextChargeAveAlisBF_c%s.dat",centstring));
fron3.open(Form("TextChargeCovAlisBF_c%s.dat",centstring));
for(int i=0; i<50; i++)
{
float tmp1, tmp2, tmp3;
if(i<40)
{
falis>>tmp1>>tmp2>>tmp3;
halis->SetBinContent(i+6,tmp2);
halis->SetBinError(i+6,tmp3);
}
// ---
fron2>>tmp1>>tmp2>>tmp3;
hron2->SetBinContent(i+1,tmp2);
hron2->SetBinError(i+1,tmp3);
// ---
fron3>>tmp1>>tmp2>>tmp3;
hron3->SetBinContent(i+1,tmp2);
hron3->SetBinError(i+1,tmp3);
}
falis.close();
//fron1.close();
fron2.close();
fron3.close();
// ---
halis->SetMarkerStyle(kFullCircle);
hron2->SetMarkerStyle(kOpenTriangleUp);
hron3->SetMarkerStyle(kOpenDiamond);
halis->SetMarkerColor(kBlack);
hron2->SetMarkerColor(kBlue);
hron3->SetMarkerColor(kGreen+2);
halis->SetLineColor(kBlack);
hron2->SetLineColor(kBlue);
hron3->SetLineColor(kGreen+2);
// ---
halis->Draw("ex0p");
hron2->Draw("same ex0p");
hron3->Draw("same ex0p");
halis->GetYaxis()->SetTitle("Balance Function");
halis->GetXaxis()->SetTitle("#Delta#eta");
// ---
TLegend *leg = new TLegend(0.18,0.68,0.38,0.88);
leg->AddEntry(halis,"Alis Corr","ep");
leg->AddEntry(hron2,"Ron Charge Ave","ep");
leg->AddEntry(hron3,"Ron Charge Cov","ep");
leg->SetTextSize(0.04);
leg->Draw();
c1->Print(Form("ComparisonFig_AlisRon1_c%s.pdf",centstring));
// ---
// ---
hron2->Divide(halis);
hron3->Divide(halis);
hron1->Draw("ex0p");
hron1->SetMaximum(2.0);
hron1->SetMinimum(0.0);
hron2->Draw("same ex0p");
hron3->Draw("same ex0p");
hron1->GetYaxis()->SetTitle("Ratio of Balance Functions");
hron1->GetXaxis()->SetTitle("#Delta#eta");
TLine line(-2.0,1.0,2.0,1.0);
line.Draw();
TF1 *fun2 = new TF1("fun2","pol0",-2,2);
fun2->SetLineColor(kBlack);
hron2->Fit(fun2,"R");
TF1 *fun3 = new TF1("fun3","pol0",-2,2);
fun3->SetLineColor(kBlack);
hron3->Fit(fun3,"R");
// ---
float par2, err2, chi2_2; int ndf2;
par2 = fun2->GetParameter(0);
err2 = fun2->GetParError(0);
TLatex *tex2 = new TLatex(-1,0.25,Form("p0 = %.2f #pm %.2f",par2,err2));
tex2->SetTextSize(0.04);
tex2->SetTextColor(kBlue);
tex2->Draw();
// ---
float par3, err3, chi2_3; int ndf3;
par3 = fun3->GetParameter(0);
err3 = fun3->GetParError(0);
TLatex *tex3 = new TLatex(-1,0.1,Form("p0 = %.2f #pm %.2f",par3,err3));
tex3->SetTextSize(0.04);
tex3->SetTextColor(kGreen+2);
tex3->Draw();
// ---
TLegend *leg = new TLegend(0.18,0.72,0.38,0.88);
leg->AddEntry(hron2,"(Ron Charge Ave)/(Alis Corr)","ep");
leg->AddEntry(hron3,"(Ron Charge Cov)/(Alis Corr)","ep");
leg->SetTextSize(0.04);
leg->Draw();
c1->Print(Form("ComparisonFig_AlisRonRatio1_c%s.pdf",centstring));
}