3 void GetNU(int side=0){
7 TFile * f = new TFile("flow11h_QA.root") ;
9 TFile * f2 = new TFile("flow11hMB_QA.root") ;
12 if(side==0) sprintf(what,"phiRPV0Aflat") ;
13 if(side==1) sprintf(what,"phiRPV0Cflat") ;
14 if(side==2) sprintf(what,"phiRPflat") ;
17 TH2F* h2=f2->Get(what);
19 TH3D* hPHOSphi=f->Get("hPHOSphi");
21 TF1 *fu=new TF1("fu","[0]*(1+2*[1]*TMath::Cos(2*x)+2*[2]*TMath::Sin(2*x))",1,5);
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.);
29 for(int cen=1;cen<=10;cen++){
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");
36 double meanC=0,meanS=0,errC=0,errS=0,mean=0;
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);
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;
53 cout<<"i: "<<cen<<", cos: "<<meanC<<"+-"<<errC<<", sin: "<<meanS<<"+-"<<errS<<endl;
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) ;
63 double sinv2 = meanS*fu->GetParameter(1) - meanC*fu->GetParameter(2);
64 double err = meanS*fu->GetParError(1) + errS*fu->GetParameter(1);
66 hsinv2->SetBinContent(cen,sinv2);
67 hsinv2->SetBinError(cen,err);
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));
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));
82 if(side==0) hcos->SetTitle("V0A EP");
83 if(side==1) hcos->SetTitle("V0C EP");
84 if(side==2) hcos->SetTitle("TPC EP");
86 hcos->SetMarkerStyle(20) ;
87 hcos->SetMarkerColor(2) ;
88 hcos->SetLineColor(2) ;
89 hcos->SetLineWidth(3);
91 hcos->SetMinimum(-0.01) ;
92 hcos->SetMaximum(0.01) ;
93 hcos->SetXTitle("centrality") ;
94 hcos->SetYTitle("<cos2#Psi> and <sin2#Psi") ;
96 hsin->SetMarkerStyle(20) ;
97 hsin->SetMarkerColor(3) ;
98 hsin->SetLineColor(3) ;
99 hsin->SetLineWidth(2);
101 hcosMB->SetMarkerStyle(25) ;
102 hcosMB->SetMarkerColor(2) ;
103 hcosMB->SetLineColor(2) ;
104 hcosMB->SetLineWidth(3);
106 hsinMB->SetMarkerStyle(25) ;
107 hsinMB->SetMarkerColor(3) ;
108 hsinMB->SetLineColor(3) ;
109 hsinMB->SetLineWidth(2);
111 hsinv2->SetMarkerStyle(20) ;
112 hsinv2->SetMarkerColor(4) ;
113 hsinv2->SetLineColor(4) ;
114 hsinv2->SetLineWidth(2);
118 hsin->Draw("pl same") ;
119 hsinv2->Draw("pl same");
121 hcosMB->Draw("pl same") ;
122 hsinMB->Draw("pl same") ;
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") ;
131 leg->AddEntry(hcosMB,"cos2#Psi, kMB","p") ;
132 leg->AddEntry(hsinMB,"sin2#Psi, kMB","p") ;