-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathv2_plot.C
86 lines (74 loc) · 2.15 KB
/
v2_plot.C
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
void v2_plot() {
const int nPtBin=15;
double pt[nPtBin];
double v2[nPtBin];
double v2e[nPtBin];
ifstream inv2;
inv2.open("output_v2.txt");
if(!inv2.good()) cout<<" input fail"<<endl;
else cout<<" input OK! "<<endl;
for(int i=0;i<nPtBin;i++){
inv2>>pt[i];
inv2>>v2[i];
inv2>>v2e[i];
//v2[i]=v2[i]*1.35;
}
////////////////
////////
TCanvas *c1 = new TCanvas("c1","c1",1,1,650,550);
c1->SetFillColor(10);
c1->SetFrameFillColor(0);
c1->SetFrameBorderSize(0);
c1->SetFrameBorderMode(0);
c1->SetLeftMargin(0.15);
c1->SetBottomMargin(0.15);
c1->SetTopMargin(0.02);
c1->SetRightMargin(0.02);
//c1->Divide(2,1,0,0);
gStyle->SetOptStat(0);
c1->SetTicks(-1);
TH1D* hist = new TH1D("hist","",200,0.,10.0);
hist->SetXTitle("p_{T} (GeV/c)");
hist->SetYTitle("v_{2}{EP}");
hist->SetMinimum(0.001);
hist->SetMaximum(0.259);
hist->GetXaxis()->CenterTitle(1);
hist->GetYaxis()->CenterTitle(1);
hist->GetYaxis()->SetTitleOffset(1.1);
hist->GetXaxis()->SetTitleOffset(0.95);
hist->GetXaxis()->SetTitleSize(0.066);
hist->GetYaxis()->SetTitleSize(0.066);
hist->GetXaxis()->SetLabelSize(0.05);
hist->GetYaxis()->SetLabelSize(0.05);
hist->Draw();
TF1 *V2vsPt = new TF1("V2vsPt","((x/3.4)^1.8/(1+(x/3)^1.8))*(.00005+(1/x)^0.8)",0.2,10);
V2vsPt->SetLineColor(2);
V2vsPt->SetLineWidth(2);
V2vsPt->SetLineStyle(2);
V2vsPt->Draw("same");
TGraphErrors *gr2 = new TGraphErrors(nPtBin,pt,v2,0,v2e);
gr2->SetTitle("");
gr2->SetMarkerStyle(20);
gr2->SetMarkerSize(1.0);
gr2->SetMarkerColor(1);
gr2->SetLineWidth(2);
gr2->SetLineColor(1);
gr2->Draw("psameez");
TLegend *leg = new TLegend(0.63,0.75,0.9,0.92);
leg->SetFillColor(10);
leg->SetBorderSize(0);
leg->SetTextFont(42);
leg->SetTextColor(1);
leg->SetTextSize(0.04);
//leg->SetLineStyle(0.06);
leg->AddEntry(gr2,"Extracted v_{2}","p");
leg->AddEntry(V2vsPt,"Input v_{2}","l");
leg->Draw();
TLatex *tex2= new TLatex(0.6,0.205,"Toy Event Generator");
tex2->SetTextColor(1);
tex2->SetTextSize(0.05);
tex2->SetTextFont(42);
tex2->Draw();
c1->Print("eventplane_v2.png");
c1->Print("eventplane_v2.pdf");
}