]>
Commit | Line | Data |
---|---|---|
e751e1d9 | 1 | int drawMB=0; |
2 | ||
3 | void GetNU(int side=0){ | |
4 | ||
5 | gStyle->SetOptStat(0); | |
6 | ||
7 | TFile * f = new TFile("flow11h_QA.root") ; | |
8 | ||
9 | TFile * f2 = new TFile("flow11hMB_QA.root") ; | |
10 | ||
11 | char what[20]; | |
12 | if(side==0) sprintf(what,"phiRPV0Aflat") ; | |
13 | if(side==1) sprintf(what,"phiRPV0Cflat") ; | |
14 | if(side==2) sprintf(what,"phiRPflat") ; | |
15 | ||
16 | TH2F* h=f->Get(what); | |
17 | TH2F* h2=f2->Get(what); | |
18 | ||
19 | TH3D* hPHOSphi=f->Get("hPHOSphi"); | |
20 | ||
21 | TF1 *fu=new TF1("fu","[0]*(1+2*[1]*TMath::Cos(2*x)+2*[2]*TMath::Sin(2*x))",1,5); | |
22 | ||
23 | TH1D* hcos=new TH1D("cos","cos",10,0.,50.); | |
24 | TH1D* hsin=new TH1D("sin","sin",10,0.,50.); | |
25 | TH1D* hcosMB=new TH1D("cosMB","cosMB",10,0.,50.); | |
26 | TH1D* hsinMB=new TH1D("sinMB","sinMB",10,0.,50.); | |
27 | TH1D* hsinv2=new TH1D("sinv2","sinv2",10,0.,50.); | |
28 | ||
29 | for(int cen=1;cen<=10;cen++){ | |
30 | char name[255]; | |
31 | sprintf(name,"phi_%d",cen); | |
32 | TH3D* hphi = hPHOSphi->Clone(name); | |
33 | hphi->GetXaxis()->SetRangeUser((cen-1)*5,(cen)*5); | |
34 | TH1D* hCos=hphi->Project3D("z"); | |
35 | ||
36 | double meanC=0,meanS=0,errC=0,errS=0,mean=0; | |
37 | ||
38 | for(int i=0;i<hCos->GetXaxis()->GetNbins();i++){ | |
39 | double bin=hCos->GetBinContent(i+1); | |
40 | double err=hCos->GetBinError(i+1); | |
41 | double phi=hCos->GetBinCenter(i+1); | |
42 | mean+=bin; | |
43 | meanC+=TMath::Cos(2*phi)*bin; | |
44 | meanS+=TMath::Sin(2*phi)*bin; | |
45 | errC+=TMath::Cos(2*phi)*err; | |
46 | errS+=TMath::Cos(2*phi)*err; | |
47 | } | |
48 | meanC/=mean; | |
49 | meanS/=mean; | |
50 | errC/=mean; | |
51 | errS/=mean; | |
52 | ||
53 | cout<<"i: "<<cen<<", cos: "<<meanC<<"+-"<<errC<<", sin: "<<meanS<<"+-"<<errS<<endl; | |
54 | ||
55 | char name[255]; | |
56 | sprintf(name,"EP_cen%d",cen); | |
57 | TH1D * h1D = h->ProjectionX(name,cen,cen) ; | |
58 | sprintf(name,"MB_cen%d",cen); | |
59 | TH1D * h1DMB = h2->ProjectionX(name,cen,cen) ; | |
60 | ||
61 | h1D->Fit(fu,"q0"); | |
62 | ||
63 | double sinv2 = meanS*fu->GetParameter(1) - meanC*fu->GetParameter(2); | |
64 | double err = meanS*fu->GetParError(1) + errS*fu->GetParameter(1); | |
65 | ||
66 | hsinv2->SetBinContent(cen,sinv2); | |
67 | hsinv2->SetBinError(cen,err); | |
68 | ||
69 | hcos->SetBinContent(cen,fu->GetParameter(1)); | |
70 | hcos->SetBinError(cen,fu->GetParError(1)); | |
71 | hsin->SetBinContent(cen,fu->GetParameter(2)); | |
72 | hsin->SetBinError(cen,fu->GetParError(2)); | |
73 | ||
74 | h1DMB->Fit(fu,"q0"); | |
75 | ||
76 | hcosMB->SetBinContent(cen,fu->GetParameter(1)); | |
77 | hcosMB->SetBinError(cen,fu->GetParError(1)); | |
78 | hsinMB->SetBinContent(cen,fu->GetParameter(2)); | |
79 | hsinMB->SetBinError(cen,fu->GetParError(2)); | |
80 | } | |
81 | ||
82 | if(side==0) hcos->SetTitle("V0A EP"); | |
83 | if(side==1) hcos->SetTitle("V0C EP"); | |
84 | if(side==2) hcos->SetTitle("TPC EP"); | |
85 | ||
86 | hcos->SetMarkerStyle(20) ; | |
87 | hcos->SetMarkerColor(2) ; | |
88 | hcos->SetLineColor(2) ; | |
89 | hcos->SetLineWidth(3); | |
90 | ||
91 | hcos->SetMinimum(-0.01) ; | |
92 | hcos->SetMaximum(0.01) ; | |
93 | hcos->SetXTitle("centrality") ; | |
94 | hcos->SetYTitle("<cos2#Psi> and <sin2#Psi") ; | |
95 | ||
96 | hsin->SetMarkerStyle(20) ; | |
97 | hsin->SetMarkerColor(3) ; | |
98 | hsin->SetLineColor(3) ; | |
99 | hsin->SetLineWidth(2); | |
100 | ||
101 | hcosMB->SetMarkerStyle(25) ; | |
102 | hcosMB->SetMarkerColor(2) ; | |
103 | hcosMB->SetLineColor(2) ; | |
104 | hcosMB->SetLineWidth(3); | |
105 | ||
106 | hsinMB->SetMarkerStyle(25) ; | |
107 | hsinMB->SetMarkerColor(3) ; | |
108 | hsinMB->SetLineColor(3) ; | |
109 | hsinMB->SetLineWidth(2); | |
110 | ||
111 | hsinv2->SetMarkerStyle(20) ; | |
112 | hsinv2->SetMarkerColor(4) ; | |
113 | hsinv2->SetLineColor(4) ; | |
114 | hsinv2->SetLineWidth(2); | |
115 | ||
116 | ||
117 | hcos->Draw("pl") ; | |
118 | hsin->Draw("pl same") ; | |
119 | hsinv2->Draw("pl same"); | |
120 | if(drawMB){ | |
121 | hcosMB->Draw("pl same") ; | |
122 | hsinMB->Draw("pl same") ; | |
123 | } | |
124 | ||
125 | TLegend * leg = new TLegend(0.6,0.7,0.9,0.9) ; | |
126 | leg->AddEntry(hcos,"cos2#Psi","p") ; | |
127 | leg->AddEntry(hsin,"sin2#Psi","p") ; | |
128 | leg->AddEntry(hsinv2,"sin2#phi*cos2#Psi - cos2#phi*sin2#Psi","p") ; | |
129 | ||
130 | if(drawMB){ | |
131 | leg->AddEntry(hcosMB,"cos2#Psi, kMB","p") ; | |
132 | leg->AddEntry(hsinMB,"sin2#Psi, kMB","p") ; | |
133 | } | |
134 | leg->Draw() ; | |
135 | } |