19 #include <Riostream.h>
25 #include "TGraphErrors.h"
30 void directCumulants_v2(){
32 TCanvas* cOld = (TCanvas*)gROOT->GetListOfCanvases();
33 if (cOld) cOld->Delete();
35 bool ptGraphs = kFALSE;
38 TFile *myfile =
new TFile(
"flow.dirCumulant.root",
"READ");
40 const int CENTBINS= 9;
41 float x[CENTBINS] = {2.5, 7.5, 15., 25., 35., 45., 55., 65., 75.};
43 gROOT->SetStyle(
"Plain");
45 gStyle->SetOptStat(0);
52 const int PTINTBINS=19;
53 int ptOverflow = PTBINS-1;
56 double yields[SPECIES][PTBINS]={{0}};
57 double cent_yields[SPECIES][CENTBINS][PTBINS]={{{0}}};
60 double v2_2[SPECIES][CENTBINS+1][PTBINS]={{{0.}}};
61 double v2_2_e[SPECIES][CENTBINS+1][PTBINS]={{{0.}}};
62 double v2_4[SPECIES][CENTBINS+1][PTBINS]={{{0.}}};
63 double v2_4_e[SPECIES][CENTBINS+1][PTBINS]={{{0.}}};
64 double v2IntPt_2[SPECIES][CENTBINS+1]={{0.}};
65 double v2IntPt_2_e[SPECIES][CENTBINS+1]={{0.}};
66 double v2IntPt_4[SPECIES][CENTBINS+1]={{0.}};
67 double v2IntPt_4_e[SPECIES][CENTBINS+1]={{0.}};
68 double used_cent_yields2[SPECIES][CENTBINS+1]={{0.}};
69 double used_cent_yields4[SPECIES][CENTBINS+1]={{0.}};
70 double usedInt_cent_yields2[SPECIES][CENTBINS+1]={{0.}};
71 double usedInt_cent_yields4[SPECIES][CENTBINS+1]={{0.}};
79 double Terms[TERMS][TYPES][PHASES][SPECIES][CENTBINS][PTBINS]={{{{{{0}}}}}};
80 double Terms_e[TERMS][TYPES][PHASES][SPECIES][CENTBINS][PTBINS]={{{{{{0}}}}}};
85 for(
int species=0; species<SPECIES; species++){
87 name =
new TString(
"Cent_Pt_yields_");
90 for(
int cent=0; cent<CENTBINS; cent++){
92 for(
int ptbin=0; ptbin<PTBINS; ptbin++){
94 cent_yields[species][cent][ptbin] = ((TH2D*)myfile->Get(name->Data()))->GetBinContent(cent+1,ptbin+1);
95 yields[species][ptbin] += cent_yields[species][cent][ptbin];
101 for(
int term=0; term<TERMS; term++){
103 name1 =
new TString(
"Term_");
106 for(
int type=0; type<TYPES; type++){
108 name2 =
new TString();
109 if(type==0) name2->Append(
"_D_");
110 else name2->Append(
"_I_");
112 for(
int phase=0; phase<PHASES; phase++){
114 name3 =
new TString();
115 if(phase==0) name3->Append(
"cos_");
116 else name3->Append(
"sin_");
117 for(
int species=0; species<SPECIES; species++){
119 name4 =
new TString();
122 for(
int cent=0; cent<CENTBINS; cent++){
124 for(
int ptbin=0; ptbin<PTBINS; ptbin++){
126 if(cent_yields[species][cent][ptbin] < 1)
continue;
128 name =
new TString();
129 name->Append(name1->Data());
130 name->Append(name2->Data());
131 name->Append(name3->Data());
132 name->Append(name4->Data());
134 Terms[term][type][phase][species][cent][ptbin] = ((TH2D*)myfile->Get(name->Data()))->GetBinContent(cent+1,ptbin+1)/cent_yields[species][cent][ptbin];
137 Terms_e[term][type][phase][species][cent][ptbin] = ((TH2D*)myfile->Get(name->Data()))->GetBinContent(cent+1,ptbin+1)/cent_yields[species][cent][ptbin];
138 Terms_e[term][type][phase][species][cent][ptbin] -= pow(Terms[term][type][phase][species][cent][ptbin],2);
139 Terms_e[term][type][phase][species][cent][ptbin] /= cent_yields[species][cent][ptbin];
140 Terms_e[term][type][phase][species][cent][ptbin] = sqrt(Terms_e[term][type][phase][species][cent][ptbin]);
151 int COS=0, SIN=1, I=1;
153 double Cumulant_term[11][TYPES][SPECIES][CENTBINS][PTBINS]={{{{{0}}}}};
154 double Cumulant_term_e[11][TYPES][SPECIES][CENTBINS][PTBINS]={{{{{0}}}}};
155 double Cumulant_4[TYPES][SPECIES][CENTBINS][PTBINS]={{{{0}}}};
156 double Cumulant_4_e[TYPES][SPECIES][CENTBINS][PTBINS]={{{{0}}}};
157 double Cumulant_2[TYPES][SPECIES][CENTBINS][PTBINS]={{{{0}}}};
158 double Cumulant_2_e[TYPES][SPECIES][CENTBINS][PTBINS]={{{{0}}}};
161 for(
int type=0; type<TYPES; type++){
163 for(
int species=0; species<SPECIES; species++){
165 for(
int cent=0; cent<CENTBINS; cent++){
167 for(
int ptbin=0; ptbin<PTBINS; ptbin++){
169 Cumulant_term[0][type][species][cent][ptbin] = Terms[0][type][COS][species][cent][ptbin];
170 Cumulant_term_e[0][type][species][cent][ptbin] = Terms_e[0][type][COS][species][cent][ptbin];
172 Cumulant_term[1][type][species][cent][ptbin] = Terms[1][type][COS][species][cent][ptbin]*Terms[2][I][COS][species][cent][ptbin];
173 Cumulant_term[1][type][species][cent][ptbin] -= Terms[1][type][SIN][species][cent][ptbin]*Terms[2][I][SIN][species][cent][ptbin];
174 Cumulant_term_e[1][type][species][cent][ptbin] = pow(Terms_e[1][type][COS][species][cent][ptbin]*Terms[2][I][COS][species][cent][ptbin],2);
175 Cumulant_term_e[1][type][species][cent][ptbin] += pow(Terms[1][type][COS][species][cent][ptbin]*Terms_e[2][I][COS][species][cent][ptbin],2);
176 Cumulant_term_e[1][type][species][cent][ptbin] += pow(Terms_e[1][type][SIN][species][cent][ptbin]*Terms[2][I][SIN][species][cent][ptbin],2);
177 Cumulant_term_e[1][type][species][cent][ptbin] += pow(Terms[1][type][SIN][species][cent][ptbin]*Terms_e[2][I][SIN][species][cent][ptbin],2);
178 Cumulant_term_e[1][type][species][cent][ptbin] = sqrt(Cumulant_term_e[1][type][species][cent][ptbin]);
180 Cumulant_term[2][type][species][cent][ptbin] = Terms[3][type][COS][species][cent][ptbin]*Terms[4][I][COS][species][cent][ptbin];
181 Cumulant_term[2][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[4][I][SIN][species][cent][ptbin];
183 Cumulant_term[3][type][species][cent][ptbin] = Terms[5][I][COS][species][cent][ptbin]*Terms[6][type][COS][species][cent][ptbin];
184 Cumulant_term[3][type][species][cent][ptbin] -= Terms[5][I][SIN][species][cent][ptbin]*Terms[6][type][SIN][species][cent][ptbin];
186 Cumulant_term[4][type][species][cent][ptbin] = Terms[7][I][COS][species][cent][ptbin]*Terms[8][type][COS][species][cent][ptbin];
187 Cumulant_term[4][type][species][cent][ptbin] -= Terms[7][I][SIN][species][cent][ptbin]*Terms[8][type][SIN][species][cent][ptbin];
189 Cumulant_term[5][type][species][cent][ptbin] = Terms[9][type][COS][species][cent][ptbin]*Terms[9][I][COS][species][cent][ptbin];
190 Cumulant_term[5][type][species][cent][ptbin] -= Terms[9][type][SIN][species][cent][ptbin]*Terms[9][I][SIN][species][cent][ptbin];
192 Cumulant_term[6][type][species][cent][ptbin] = Terms[3][type][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[2][I][COS][species][cent][ptbin];
193 Cumulant_term[6][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[2][I][COS][species][cent][ptbin];
194 Cumulant_term[6][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[2][I][SIN][species][cent][ptbin];
195 Cumulant_term[6][type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[2][I][SIN][species][cent][ptbin];
197 Cumulant_term_e[6][type][species][cent][ptbin] = pow(Terms[3][type][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms_e[2][I][COS][species][cent][ptbin],2);
198 Cumulant_term_e[6][type][species][cent][ptbin] = sqrt(Cumulant_term_e[6][I][species][cent][ptbin]);
201 Cumulant_term[7][type][species][cent][ptbin] = Terms[3][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[1][type][COS][species][cent][ptbin];
202 Cumulant_term[7][type][species][cent][ptbin] -= Terms[3][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[1][type][COS][species][cent][ptbin];
203 Cumulant_term[7][type][species][cent][ptbin] -= Terms[3][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[1][type][SIN][species][cent][ptbin];
204 Cumulant_term[7][type][species][cent][ptbin] -= Terms[3][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[1][type][SIN][species][cent][ptbin];
206 Cumulant_term_e[7][type][species][cent][ptbin] = pow(Terms[3][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms_e[1][type][COS][species][cent][ptbin],2);
207 Cumulant_term_e[7][type][species][cent][ptbin] = sqrt(Cumulant_term_e[7][type][species][cent][ptbin]);
210 Cumulant_term[8][type][species][cent][ptbin] = Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[9][I][COS][species][cent][ptbin];
211 Cumulant_term[8][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[9][I][COS][species][cent][ptbin];
212 Cumulant_term[8][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[9][I][SIN][species][cent][ptbin];
213 Cumulant_term[8][type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[9][I][SIN][species][cent][ptbin];
215 Cumulant_term[9][type][species][cent][ptbin] = Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[9][type][COS][species][cent][ptbin];
216 Cumulant_term[9][type][species][cent][ptbin] -= Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[9][type][COS][species][cent][ptbin];
217 Cumulant_term[9][type][species][cent][ptbin] -= Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[9][type][SIN][species][cent][ptbin];
218 Cumulant_term[9][type][species][cent][ptbin] -= Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[9][type][SIN][species][cent][ptbin];
220 Cumulant_term[10][type][species][cent][ptbin] = Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin];
221 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin];
222 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin];
223 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin];
224 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin];
225 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[7][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin];
226 Cumulant_term[10][type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[5][I][COS][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin];
227 Cumulant_term[10][type][species][cent][ptbin] += Terms[3][type][SIN][species][cent][ptbin]*Terms[5][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin]*Terms[7][I][SIN][species][cent][ptbin];
230 Cumulant_4[type][species][cent][ptbin] = Cumulant_term[0][type][species][cent][ptbin] -2*Cumulant_term[1][type][species][cent][ptbin];
231 Cumulant_4[type][species][cent][ptbin] -= Cumulant_term[2][type][species][cent][ptbin] + Cumulant_term[3][type][species][cent][ptbin];
232 Cumulant_4[type][species][cent][ptbin] -= 2*Cumulant_term[4][type][species][cent][ptbin];
233 Cumulant_4[type][species][cent][ptbin] -= Cumulant_term[5][type][species][cent][ptbin];
234 Cumulant_4[type][species][cent][ptbin] += 4*Cumulant_term[6][type][species][cent][ptbin];
235 Cumulant_4[type][species][cent][ptbin] += 4*Cumulant_term[7][type][species][cent][ptbin];
236 Cumulant_4[type][species][cent][ptbin] += 2*Cumulant_term[8][type][species][cent][ptbin];
237 Cumulant_4[type][species][cent][ptbin] += 2*Cumulant_term[9][type][species][cent][ptbin];
238 Cumulant_4[type][species][cent][ptbin] -= 6*Cumulant_term[10][type][species][cent][ptbin];
263 Cumulant_4_e[type][species][cent][ptbin] = Cumulant_term_e[0][type][species][cent][ptbin]**2;
264 Cumulant_4_e[type][species][cent][ptbin] += 2*(Cumulant_term_e[1][type][species][cent][ptbin])**2;
265 Cumulant_4_e[type][species][cent][ptbin] += 4*(Cumulant_term_e[6][type][species][cent][ptbin])**2;
266 Cumulant_4_e[type][species][cent][ptbin] += 4*(Cumulant_term_e[7][type][species][cent][ptbin])**2;
267 Cumulant_4_e[type][species][cent][ptbin] = sqrt(Cumulant_4_e[type][species][cent][ptbin]);
270 Cumulant_2[type][species][cent][ptbin] = Terms[1][type][COS][species][cent][ptbin];
271 Cumulant_2[type][species][cent][ptbin] -= Terms[3][type][COS][species][cent][ptbin]*Terms[7][type][COS][species][cent][ptbin];
273 Cumulant_2_e[type][species][cent][ptbin] = Terms_e[1][type][COS][species][cent][ptbin]**2;
274 Cumulant_2_e[type][species][cent][ptbin] += (Terms_e[3][type][COS][species][cent][ptbin]*Terms[7][type][COS][species][cent][ptbin])**2;
275 Cumulant_2_e[type][species][cent][ptbin] += (Terms[3][type][COS][species][cent][ptbin]*Terms_e[7][type][COS][species][cent][ptbin])**2;
276 Cumulant_2_e[type][species][cent][ptbin] = sqrt(Cumulant_2_e[type][species][cent][ptbin]);
286 int ptcount[SPECIES]={0};
287 double used_pt_yields4[CENTBINS+1] = {0.};
288 double used_pt_yields2[CENTBINS+1] = {0.};
289 double v2IntCu_2[CENTBINS] = {0.};
290 double v2IntCu_2Err[CENTBINS] = {0.};
291 double v2IntCu_4[CENTBINS] = {0.};
292 double v2IntCu_4Err[CENTBINS] = {0.};
295 for(
int species=0; species<SPECIES; species++){
297 cout << endl <<
"cent: \t v2IntCu_2 +/- err,\t v2IntCu_4 +/- err" << endl;
299 for(
int ptbin=0; ptbin<PTBINS; ptbin++){
302 v2_2[species][0][ptcount[species]] = 10.;
303 v2_2_e[species][0][ptcount[species]] = 10.;
304 v2_4[species][0][ptcount[species]] = 10.;
305 v2_4_e[species][0][ptcount[species]] = 10.;
306 used_pt_yields4[0] = 0.;
307 used_pt_yields2[0] = 0.;
309 for(
int cent=0; cent<CENTBINS; cent++){
311 if(Cumulant_2[1][0][cent][ptCu]>0) {
312 v2IntCu_2[cent] = pow(Cumulant_2[1][0][cent][ptCu],0.5);
313 v2IntCu_2Err[cent] = pow((.5/(Cumulant_2[1][0][cent][ptCu])),0.5)*Cumulant_2_e[1][0][cent][ptCu];
315 if(Cumulant_4[1][0][cent][ptCu]<0) {
316 v2IntCu_4[cent] = pow(-Cumulant_4[1][0][cent][ptCu],0.25);
317 v2IntCu_4Err[cent] = pow((.25/(-Cumulant_4[1][0][cent][ptCu])),0.75)*Cumulant_4_e[1][0][cent][ptCu];
319 cout << cent+1 <<
": \t" << setprecision(3) << v2IntCu_2[cent]*100. <<
320 " \t+/- " << v2IntCu_2Err[cent]*100. <<
", \t" << v2IntCu_4[cent]*100. <<
321 " \t+/- " << v2IntCu_4Err[cent]*100. << endl;
325 v2_2[species][cent+1][ptcount[species]] = 10.;
326 v2_2_e[species][cent+1][ptcount[species]] = 10.;
327 v2_4[species][cent+1][ptcount[species]] = 10.;
328 v2_4_e[species][cent+1][ptcount[species]] = 10.;
329 used_pt_yields4[cent+1] = 0.;
330 used_pt_yields2[cent+1] = 0.;
333 if(Cumulant_4[1][species][cent][ptbin] < 0 && Cumulant_4[0][species][cent][ptbin] < 0) {
334 v2_4[species][cent+1][ptcount[species]] += -cent_yields[species][cent][ptbin]*Cumulant_4[0][species][cent][ptbin]/(pow(-Cumulant_4[1][species][cent][ptbin],.75));
335 v2_4[species][0][ptcount[species]] += v2_4[species][cent+1][ptcount[species]];
336 if(ptbin<PTINTBINS) {
337 v2IntPt_4[species][cent+1] += v2_4[species][cent+1][ptcount[species]];
338 usedInt_cent_yields4[species][cent+1] += cent_yields[species][cent][ptbin];
340 v2_4_e[species][cent+1][ptcount[species]] += pow(cent_yields[species][cent][ptbin]*Cumulant_4_e[0][species][cent][ptbin]/(pow(-Cumulant_4[1][species][cent][ptbin],.75)),2);
341 v2_4_e[species][cent+1][ptcount[species]] += pow(.75*cent_yields[species][cent][ptbin]*Cumulant_4[0][species][cent][ptbin]*Cumulant_4_e[1][species][cent][ptbin]/(pow(-Cumulant_4[1][species][cent][ptbin],1.75)),2);
342 v2_4_e[species][0][ptcount[species]] += v2_4_e[species][cent+1][ptcount[species]];
343 if(ptbin<PTINTBINS) v2IntPt_4_e[species][cent+1] += v2_4_e[species][cent+1][ptcount[species]];
345 used_pt_yields4[cent+1] = cent_yields[species][cent][ptbin];
346 used_cent_yields4[species][cent+1] += cent_yields[species][cent][ptbin];
347 used_pt_yields4[0] += used_pt_yields4[cent+1];
351 if(Cumulant_2[1][species][cent][ptbin] > 0) {
352 v2_2[species][cent+1][ptcount[species]] += cent_yields[species][cent][ptbin]*Cumulant_2[0][species][cent][ptbin]/(pow(Cumulant_2[1][species][cent][ptbin],.5));
353 v2_2[species][0][ptcount[species]] += v2_2[species][cent+1][ptcount[species]];
354 if(ptbin<PTINTBINS) {
355 v2IntPt_2[species][cent+1] += v2_2[species][cent+1][ptcount[species]];
356 usedInt_cent_yields2[species][cent+1] += cent_yields[species][cent][ptbin];
358 v2_2_e[species][cent+1][ptcount[species]] += pow(cent_yields[species][cent][ptbin]*Cumulant_2_e[0][species][cent][ptbin]/(pow(Cumulant_2[1][species][cent][ptbin],.5)),2);
359 v2_2_e[species][cent+1][ptcount[species]] += pow(.5*cent_yields[species][cent][ptbin]*Cumulant_2[0][species][cent][ptbin]*Cumulant_2_e[1][species][cent][ptbin]/(pow(Cumulant_2[1][species][cent][ptbin],1.5)),2);
360 v2_2_e[species][0][ptcount[species]] += v2_2_e[species][cent+1][ptcount[species]];
361 if(ptbin<PTINTBINS) v2IntPt_2_e[species][cent+1] += v2_2_e[species][cent+1][ptcount[species]];
363 used_pt_yields2[cent+1] = cent_yields[species][cent][ptbin];
364 used_cent_yields2[species][cent+1] += cent_yields[species][cent][ptbin];
365 used_pt_yields2[0] += used_pt_yields2[cent+1];
370 for(
int cent=0; cent<CENTBINS+1; cent++){
372 if(used_pt_yields2[cent] > 0){
373 v2_2[species][cent][ptcount[species]] /= used_pt_yields2[cent];
374 v2_2_e[species][cent][ptcount[species]] = sqrt(v2_2_e[species][cent][ptcount[species]]);
375 v2_2_e[species][cent][ptcount[species]] /= used_pt_yields2[cent];
377 if(used_pt_yields4[cent] > 0){
378 v2_4[species][cent][ptcount[species]] /= used_pt_yields4[cent];
379 v2_4_e[species][cent][ptcount[species]] = sqrt(v2_4_e[species][cent][ptcount[species]]);
380 v2_4_e[species][cent][ptcount[species]] /= used_pt_yields4[cent];
389 for(
int cent=0; cent<CENTBINS+1; cent++){
390 if(usedInt_cent_yields2[species][cent] > 0){
391 v2IntPt_2[species][cent] /= usedInt_cent_yields2[species][cent];
392 v2IntPt_2_e[species][cent] = sqrt(v2IntPt_2_e[species][cent]);
393 v2IntPt_2_e[species][cent] /= usedInt_cent_yields2[species][cent];
395 if(usedInt_cent_yields4[species][cent] > 0){
396 v2IntPt_4[species][cent] /= usedInt_cent_yields4[species][cent];
397 v2IntPt_4_e[species][cent] = sqrt(v2IntPt_4_e[species][cent]);
398 v2IntPt_4_e[species][cent] /= usedInt_cent_yields4[species][cent];
405 for(
int ptbin=0; ptbin<PTBINS; ptbin++){
411 cout << endl <<
"cent: \t v2IntPt_2 +/- err,\t v2IntPt_4 +/- err" << endl;
412 for(
int cent=0; cent<CENTBINS+1; cent++){
417 v2_2[0][cent][ptOverflow]= 10.;
418 v2_4[0][cent][ptOverflow]= 10.;
420 v2_2[0][cent][ptCu]= 10.;
421 v2_4[0][cent][ptCu]= 10.;
425 cout << cent <<
": \t" << setprecision(3) << v2IntPt_2[0][cent]*100. <<
" \t+/- " <<
426 v2IntPt_2_e[0][cent]*100. <<
", \t" << v2IntPt_4[0][cent]*100. <<
" \t+/- " <<
427 v2IntPt_4_e[0][cent]*100. << endl;
435 TFile graphFile(
"flow.dirCumulant.graphs.root",
"RECREATE");
439 double middle_pt_points[PTBINS]={0};
440 for(
int i=0; i<PTBINS; i++){
441 middle_pt_points[i]=double((i)/10. + 0.1);
443 double middle_pt_points_e[PTBINS]={0};
447 TGraphErrors *charged_v2_2[CENTBINS+1];
448 TGraphErrors *charged_v2_4[CENTBINS+1];
449 TCanvas* can[CENTBINS+1];
450 int canvasWidth = 780, canvasHeight = 600;
451 for(
int cent=0; cent<CENTBINS+1; cent++){
452 TString* canName =
new TString(
"centrality_");
455 cout <<
"plot " << canName->Data() << endl;
456 can[cent] =
new TCanvas(canName->Data(), canName->Data(), canvasWidth, canvasHeight);
458 TLegend *legend =
new TLegend(.1,.7,.46,.9,NULL,
"brNDC");
459 legend->SetFillColor(kWhite);
460 TPaveLabel* title =
new TPaveLabel(0.7,0.96,0.9,0.99,canName->Data());
461 if(ptGraphs) title->Draw();
463 TString graphName(
"v22_");
465 charged_v2_2[cent]=
new TGraphErrors(PTBINS,middle_pt_points,v2_2[0][cent],middle_pt_points_e,v2_2_e[0][cent]);
466 charged_v2_2[cent]->SetMarkerStyle(20);
467 charged_v2_2[cent]->SetMarkerColor(2);
468 charged_v2_2[cent]->SetLineColor(2);
469 charged_v2_2[cent]->SetMinimum(0.);
470 charged_v2_2[cent]->SetMaximum(v2max);
471 charged_v2_2[cent]->GetXaxis()->SetTitle(
"P_{t} (GeV/c)");
472 charged_v2_2[cent]->GetYaxis()->SetTitle(
"v_{2}");
473 charged_v2_2[cent]->SetTitle(
"Elliptic Flow");
474 charged_v2_2[cent]->Write(graphName.Data());
476 TString graphName(
"v24_");
478 charged_v2_4[cent]=
new TGraphErrors(PTBINS,middle_pt_points,v2_4[0][cent],middle_pt_points_e,v2_4_e[0][cent]);
479 charged_v2_4[cent]->SetMarkerStyle(20);
480 charged_v2_4[cent]->SetMarkerColor(4);
481 charged_v2_4[cent]->SetLineColor(4);
482 charged_v2_4[cent]->SetMinimum(0.);
483 charged_v2_4[cent]->SetMaximum(v2max);
484 charged_v2_4[cent]->GetXaxis()->SetTitle(
"P_{t} (GeV/c)");
485 charged_v2_4[cent]->GetYaxis()->SetTitle(
"v_{2}{4}");
486 charged_v2_4[cent]->SetTitle(
"Elliptic Flow");
487 charged_v2_4[cent]->Write(graphName.Data());
489 if(ptGraphs) charged_v2_2[cent]->Draw(
"AP");
490 legend->AddEntry(charged_v2_2[cent],
"charged hadron v_{2}{2}",
"p");
491 if(ptGraphs) charged_v2_4[cent]->Draw(
"P");
492 legend->AddEntry(charged_v2_4[cent],
"charged hadron v_{2}{4}",
"p");
493 if(ptGraphs) legend->Draw(
"same");
501 TH1* Event_counter =
dynamic_cast<TH1*
>(myfile->Get(
"Event_counter"));
502 if (!Event_counter) {
503 cout <<
"### Can't find hist Event_counter" << endl;
506 gStyle->SetOptStat(
"e");
507 TString* canEvtName =
new TString(
"Event_counter");
508 cout <<
"plot " << canEvtName->Data() << endl;
509 TCanvas* canEvt =
new TCanvas(canEvtName->Data(), canEvtName->Data(), 780, 600);
510 Event_counter->SetMinimum(0.);
511 Event_counter->GetXaxis()->SetTitle(
"centrality bin");
512 Event_counter->Draw();
513 Event_counter->Write(canEvtName->Data());
515 TH1* Event_counterWeighted =
dynamic_cast<TH1*
>(myfile->Get(
"Event_counterWeighted"));
516 if (!Event_counterWeighted) {
517 cout <<
"### Can't find hist Event_counterWeighted" << endl;
521 TString* canEvtWgtName =
new TString(
"Event_counterWeighted");
522 cout <<
"plot " << canEvtWgtName->Data() << endl;
523 TCanvas* canEvtWgt =
new TCanvas(canEvtWgtName->Data(), canEvtWgtName->Data(), 780, 600);
524 Event_counterWeighted->SetMinimum(0.);
525 Event_counterWeighted->GetXaxis()->SetTitle(
"centrality bin");
526 Event_counterWeighted->Draw(
"hist");
527 Event_counterWeighted->Write(canEvtWgtName->Data());
536 TString* canIntName =
new TString(
"v2Int");
537 cout <<
"plot " << canIntName->Data() << endl;
538 TCanvas* canInt =
new TCanvas(canIntName->Data(), canIntName->Data(), 600, 780);
539 TLegend* legendInt =
new TLegend(0.35,0.1,0.6,0.35);
540 legendInt->SetFillColor(kWhite);
543 TString* histCenName =
new TString(
"v2Int");
544 TH1F* histCen =
new TH1F(histCenName->Data(), histCenName->Data(), 80, 0., 80.);
545 histCen->SetLineColor(kBlack);
548 TGraphErrors *grv2IntPt_2 =
new TGraphErrors(CENTBINS);
549 TGraphErrors *grv2IntPt_4 =
new TGraphErrors(CENTBINS);
550 TGraphErrors *grv2IntCu_2 =
new TGraphErrors(CENTBINS);
551 TGraphErrors *grv2IntCu_4 =
new TGraphErrors(CENTBINS);
554 for(
int cent=0; cent<CENTBINS; cent++){
555 grv2IntPt_2->SetPoint(m, x[CENTBINS-cent-1], v2IntPt_2[0][cent+1]*100.);
556 grv2IntPt_2->SetPointError(m, 0., v2IntPt_2_e[0][cent+1]*100.);
557 grv2IntPt_4->SetPoint(m, x[CENTBINS-cent-1], v2IntPt_4[0][cent+1]*100.);
558 grv2IntPt_4->SetPointError(m, 0., v2IntPt_4_e[0][cent+1]*100.);
559 grv2IntCu_2->SetPoint(m, x[CENTBINS-cent-1], v2IntCu_2[cent]*100.);
560 grv2IntCu_2->SetPointError(m, 0., v2IntCu_2Err[cent]*100.);
561 grv2IntCu_4->SetPoint(m, x[CENTBINS-cent-1], v2IntCu_4[cent]*100.);
562 grv2IntCu_4->SetPointError(m, 0., v2IntCu_4Err[cent]*100.);
567 grv2IntPt_2->SetMarkerStyle(kFullCircle);
568 grv2IntPt_2->SetMarkerColor(kRed);
569 grv2IntPt_2->SetLineColor(kRed);
570 grv2IntPt_2->SetMinimum(0.);
571 grv2IntPt_2->SetMaximum(v2Intmax);
572 grv2IntPt_2->SetTitle(
"Elliptic Flow");
573 grv2IntPt_2->Draw(
"AP");
574 legendInt->AddEntry(grv2IntPt_2,
"v_{2}{2}(pt)",
"p");
576 grv2IntPt_4->SetMarkerStyle(kFullSquare);
577 grv2IntPt_4->SetMarkerColor(kBlue);
578 grv2IntPt_4->SetLineColor(kBlue);
579 grv2IntPt_4->Draw(
"P");
580 legendInt->AddEntry(grv2IntPt_4,
"v_{2}{4}(pt)",
"p");
582 grv2IntCu_2->SetMarkerStyle(kOpenCircle);
583 grv2IntCu_2->SetMarkerColor(kRed);
584 grv2IntCu_2->SetLineColor(kRed);
585 grv2IntCu_2->Draw(
"P");
586 legendInt->AddEntry(grv2IntCu_2,
"v_{2}{2}(cu)",
"p");
588 grv2IntCu_4->SetMarkerStyle(kOpenSquare);
589 grv2IntCu_4->SetMarkerColor(kBlue);
590 grv2IntCu_4->SetLineColor(kBlue);
591 grv2IntCu_4->Draw(
"P");
592 legendInt->AddEntry(grv2IntCu_4,
"v_{2}{4}(cu)",
"p");
594 legendInt->Draw(
"same");
596 grv2IntPt_2->Write(
"v22IntPt");
597 grv2IntPt_4->Write(
"v24IntPt");
598 grv2IntCu_2->Write(
"v22IntCu");
599 grv2IntCu_4->Write(
"v24IntCu");
607 l.DrawLatex(0.5,0.02,
"% Most Central");
609 l.DrawLatex(0.05,0.7,
"v_{2} (%)" );