]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliQCumulantsFunctions.cxx
correct settings for POI and RP change name macro
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliQCumulantsFunctions.cxx
CommitLineData
bc92c0cb 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/**********************************
17 * functions and equations needed *
18 * for calculation of Q-cumulants *
19 * and final flow estimates *
20 * *
21 * author: Ante Bilandzic *
22 * (anteb@nikhef.nl) *
23 *********************************/
24
25#define AliQCumulantsFunctions_cxx
26
27#include "Riostream.h"
bc92c0cb 28#include "TChain.h"
29#include "TFile.h"
30#include "TList.h"
31#include "TParticle.h"
32
33#include "TProfile.h"
34#include "TProfile2D.h"
35#include "TProfile3D.h"
36#include "TF1.h"
37#include "TAxis.h"
38#include "TH1.h"
39#include "TH1D.h"
40
bc92c0cb 41#include "AliFlowEventSimple.h"
42#include "AliFlowTrackSimple.h"
43#include "AliFlowAnalysisWithCumulants.h"
44#include "AliFlowCommonConstants.h"
7e58a232 45#include "AliFlowCommonHist.h"
1315fe58 46#include "AliFlowCommonHistResults.h"
bc92c0cb 47#include "AliQCumulantsFunctions.h"
48
49ClassImp(AliQCumulantsFunctions)
50
51//================================================================================================================_
52
53AliQCumulantsFunctions::AliQCumulantsFunctions():
54 fIntRes(NULL),
55 fDiffRes2nd(NULL),
56 fDiffRes4th(NULL),
1315fe58 57 fCovar(NULL),
bc92c0cb 58 fAvMult(NULL),
59 fQVector(NULL),
60 fQCorr(NULL),
8842fb2b 61 fQProd(NULL),
bc92c0cb 62 fDirect(NULL),
1dfa3c16 63 fbinPt2p1n1nRP(NULL),
64 fbinPt2p2n2nRP(NULL),
65 fbinPt3p2n1n1nRP(NULL),
66 fbinPt3p1n1n2nRP(NULL),
67 fbinPt4p1n1n1n1nRP(NULL),
68 fbinEta2p1n1nRP(NULL),
69 fbinEta2p2n2nRP(NULL),
70 fbinEta3p2n1n1nRP(NULL),
71 fbinEta3p1n1n2nRP(NULL),
72 fbinEta4p1n1n1n1nRP(NULL),
73 fbinPt2p1n1nPOI(NULL),
74 fbinPt2p2n2nPOI(NULL),
75 fbinPt3p2n1n1nPOI(NULL),
76 fbinPt3p1n1n2nPOI(NULL),
77 fbinPt4p1n1n1n1nPOI(NULL),
78 fbinEta2p1n1nPOI(NULL),
79 fbinEta2p2n2nPOI(NULL),
80 fbinEta3p2n1n1nPOI(NULL),
81 fbinEta3p1n1n2nPOI(NULL),
82 fbinEta4p1n1n1n1nPOI(NULL),
7e58a232 83 fch2nd(NULL),//ch = common histogram (control)
84 fch4th(NULL),
85 fch6th(NULL),
86 fch8th(NULL),
87 fchr2nd(NULL),//chr = common histogram results
8842fb2b 88 fchr4th(NULL),
89 fchr6th(NULL),
90 fchr8th(NULL)
bc92c0cb 91{
92 //default constructor
93}
94
95AliQCumulantsFunctions::~AliQCumulantsFunctions()
96{
97 //destructor
98}
99
7e58a232 100AliQCumulantsFunctions::AliQCumulantsFunctions(TH1D *intRes, TH1D *diffRes2nd, TH1D *diffRes4th, TH1D *covar, TProfile *AvMult, TProfile *QVector, TProfile *QCorr, TProfile *QProd, TProfile *Direct, TProfile *binPt2p1n1nRP, TProfile *binPt2p2n2nRP, TProfile *binPt3p2n1n1nRP, TProfile *binPt3p1n1n2nRP, TProfile *binPt4p1n1n1n1nRP, TProfile *binEta2p1n1nRP, TProfile *binEta2p2n2nRP, TProfile *binEta3p2n1n1nRP, TProfile *binEta3p1n1n2nRP, TProfile *binEta4p1n1n1n1nRP, TProfile *binPt2p1n1nPOI, TProfile *binPt2p2n2nPOI, TProfile *binPt3p2n1n1nPOI, TProfile *binPt3p1n1n2nPOI, TProfile *binPt4p1n1n1n1nPOI, TProfile *binEta2p1n1nPOI, TProfile *binEta2p2n2nPOI, TProfile *binEta3p2n1n1nPOI, TProfile *binEta3p1n1n2nPOI, TProfile *binEta4p1n1n1n1nPOI, AliFlowCommonHist *ch2nd, AliFlowCommonHist *ch4th, AliFlowCommonHist *ch6th, AliFlowCommonHist *ch8th, AliFlowCommonHistResults *chr2nd, AliFlowCommonHistResults *chr4th, AliFlowCommonHistResults *chr6th, AliFlowCommonHistResults *chr8th):
bc92c0cb 101 fIntRes(intRes),
102 fDiffRes2nd(diffRes2nd),
103 fDiffRes4th(diffRes4th),
1315fe58 104 fCovar(covar),
bc92c0cb 105 fAvMult(AvMult),
106 fQVector(QVector),
107 fQCorr(QCorr),
8842fb2b 108 fQProd(QProd),
bc92c0cb 109 fDirect(Direct),
1dfa3c16 110 fbinPt2p1n1nRP(binPt2p1n1nRP),
111 fbinPt2p2n2nRP(binPt2p2n2nRP),
112 fbinPt3p2n1n1nRP(binPt3p2n1n1nRP),
113 fbinPt3p1n1n2nRP(binPt3p1n1n2nRP),
114 fbinPt4p1n1n1n1nRP(binPt4p1n1n1n1nRP),
115 fbinEta2p1n1nRP(binEta2p1n1nRP),
116 fbinEta2p2n2nRP(binEta2p2n2nRP),
117 fbinEta3p2n1n1nRP(binEta3p2n1n1nRP),
118 fbinEta3p1n1n2nRP(binEta3p1n1n2nRP),
119 fbinEta4p1n1n1n1nRP(binEta4p1n1n1n1nRP),
120 fbinPt2p1n1nPOI(binPt2p1n1nPOI),
121 fbinPt2p2n2nPOI(binPt2p2n2nPOI),
122 fbinPt3p2n1n1nPOI(binPt3p2n1n1nPOI),
123 fbinPt3p1n1n2nPOI(binPt3p1n1n2nPOI),
124 fbinPt4p1n1n1n1nPOI(binPt4p1n1n1n1nPOI),
125 fbinEta2p1n1nPOI(binEta2p1n1nPOI),
126 fbinEta2p2n2nPOI(binEta2p2n2nPOI),
127 fbinEta3p2n1n1nPOI(binEta3p2n1n1nPOI),
128 fbinEta3p1n1n2nPOI(binEta3p1n1n2nPOI),
7e58a232 129 fbinEta4p1n1n1n1nPOI(binEta4p1n1n1n1nPOI),
130 fch2nd(ch2nd),
131 fch4th(ch4th),
132 fch6th(ch6th),
133 fch8th(ch8th),
1315fe58 134 fchr2nd(chr2nd),
135 fchr4th(chr4th),
136 fchr6th(chr6th),
137 fchr8th(chr8th)
bc92c0cb 138{
139 //custom constructor
140}
1315fe58 141
bc92c0cb 142//================================================================================================================
143
144void AliQCumulantsFunctions::Calculate()
145{
146 //final results
4057ba99 147
bc92c0cb 148 //harmonics
149 Int_t n = 2; //to be improved
150
151 //---------------------------------------------------------------------------------------------------------
152 //avarage multiplicity
153 Double_t AvM = fAvMult->GetBinContent(1);
154
155 //number of events
156 Double_t nEvts = fAvMult->GetBinEntries(1);
157
158 //2-, 4- and 6-particle azimuthal correlation:
8842fb2b 159 Double_t two = fQCorr->GetBinContent(1); //<<2>>_{n|n}
160 Double_t four = fQCorr->GetBinContent(11); //<<4>>_{n,n|n,n}
dee1e0e0 161 Double_t six = fQCorr->GetBinContent(24); //<<6>>_{n,n,n|n,n,n}
3963f25c 162 Double_t eight = fQCorr->GetBinContent(31); //<<8>>_{n,n,n,n|n,n,n,n}
bc92c0cb 163
164 //errors of 2-, 4- and 6-particle azimuthal correlation:
8842fb2b 165 Double_t twoErr = fQCorr->GetBinError(1); //sigma_{<<2>>_{n|n}}
166 Double_t fourErr = fQCorr->GetBinError(11); //sigma_{<<4>>_{n,n|n,n}}
3963f25c 167 Double_t sixErr = fQCorr->GetBinError(24); //sigma_{<<6>>_{n,n,n|n,n,n}}
8842fb2b 168 //Double_t eightErr = fQCorr->GetBinError(); //sigma_{<<8>>_{n,n,n,n|n,n,n,n}}
bc92c0cb 169
170 //covariances of multi-particle correlations
8842fb2b 171 Double_t cov24=fQProd->GetBinContent(1)-two*four; //cov24=<<2>*<4>>-<<2>>*<<4>>
172 Double_t cov26=fQProd->GetBinContent(2)-two*six; //cov26=<<2>*<6>>-<<2>>*<<6>>
173 //Double_t cov28=fQProd->GetBinContent(3)-two*eight; //cov28=<<2>*<8>>-<<2>>*<<8>>
174 Double_t cov46=fQProd->GetBinContent(4)-four*six; //cov46=<<4>*<6>>-<<4>>*<<6>>
175 //Double_t cov48=fQProd->GetBinContent(5)-four*eight; //cov48=<<4>*<8>>-<<4>>*<<8>>
176 //Double_t cov68=fQProd->GetBinContent(6)-six*eight; //cov68=<<6>*<8>>-<<6>>*<<8>>
177
1315fe58 178 fCovar->SetBinContent(1,cov24);
179 fCovar->SetBinContent(2,cov26);
8842fb2b 180 //fCovar->SetBinContent(3,cov28);
1315fe58 181 fCovar->SetBinContent(4,cov46);
8842fb2b 182 //fCovar->SetBinContent(5,cov48);
183 //fCovar->SetBinContent(6,cov68);
bc92c0cb 184
185 //2nd, 4th and 6th order Q-cumulant and theirs errors:
186 Double_t secondOrderQCumulant = two; //c_n{2}
187 Double_t secondOrderQCumulantError = twoErr; //sigma_{c_n{2}}
188
189 Double_t fourthOrderQCumulant = four-2.*pow(two,2.);//c_n{4}
190 Double_t fourthOrderQCumulantError = 0.; //sigma_{c_n{4}}
191
192 if(16.*pow(two,2.)*pow(twoErr,2.)+pow(fourErr,2.)-8.*two*cov24>0.)
193 {
194 fourthOrderQCumulantError = pow(16.*pow(two,2.)*pow(twoErr,2.)+pow(fourErr,2.)-8.*two*cov24,0.5);//sigma_{c_n{4}}
195 }
196
1315fe58 197 Double_t sixthOrderQCumulant = six-9.*two*four+12.*pow(two,3.); //c_n{6}
bc92c0cb 198 Double_t sixthOrderQCumulantError = 0.; //sigma_{c_n{6}}
199
200 if(81.*pow(4.*two*two-four,2.)*pow(twoErr,2.)+81.*pow(two,2.)*pow(fourErr,2.)+pow(sixErr,2.)-162.*(4.*two*two-four)*two*cov24+18.*(4.*two*two-four)*cov26-18.*two*cov46>0.)
201 {
202 sixthOrderQCumulantError = pow(81.*pow(4.*two*two-four,2.)*pow(twoErr,2.)+81.*pow(two,2.)*pow(fourErr,2.)+pow(sixErr,2.)-162.*(4.*two*two-four)*two*cov24+18.*(4.*two*two-four)*cov26-18.*two*cov46,0.5);//sigma_{c_n{6}}
203 }
dee1e0e0 204
205 Double_t eightOrderQCumulant = eight-16.*two*six-18.*pow(four,2.)+144.*pow(two,2.)*four-144.*pow(two,4.);
206
bc92c0cb 207 //integrated flow estimates from Q-cumulants:
1dfa3c16 208 cout<<endl;
4057ba99 209 cout<<"**************************************"<<endl;
210 cout<<"**************************************"<<endl;
3963f25c 211 cout<<"flow estimates from Q-cumulants :"<<endl;
1dfa3c16 212 cout<<endl;
bc92c0cb 213
dee1e0e0 214 Double_t vn2=0.,vn4=0.,vn6=0.,vn8=0.;
215 Double_t sd2=0.,sd4=0.,sd6=0.,sd8=0.;
bc92c0cb 216 if(secondOrderQCumulant>0.){
217 vn2 = pow(secondOrderQCumulant,0.5);//v_n{2}
218 sd2 = 0.5*pow(secondOrderQCumulant,-0.5)*secondOrderQCumulantError;//sigma_{v_n{2}}
e6614983 219 cout<<" v_"<<n<<"{2} = "<<vn2<<" +/- "<<sd2<<endl;
220 fIntRes->SetBinContent(1,vn2);
221 fIntRes->SetBinError(1,sd2);
8842fb2b 222 //common histograms:
3963f25c 223 fchr2nd->FillIntegratedFlow(vn2,sd2);
1dfa3c16 224 fchr2nd->FillChi(vn2*pow(AvM,0.5));//to be removed
bc92c0cb 225 }else{
226 cout<<" v_"<<n<<"{2} = Im"<<endl;
4057ba99 227 }
bc92c0cb 228 if(four!=0. && fourthOrderQCumulant<0.){
229 vn4 = pow(-fourthOrderQCumulant,1./4.); //v_n{4}
230 sd4 = 0.25*pow(-fourthOrderQCumulant,-3./4.)*fourthOrderQCumulantError;//sigma_{v_n{4}}
e6614983 231 cout<<" v_"<<n<<"{4} = "<<vn4<<" +/- "<<sd4<<endl;
232 fIntRes->SetBinContent(2,vn4);
233 fIntRes->SetBinError(2,sd4);
8842fb2b 234 //common histograms:
3963f25c 235 fchr4th->FillIntegratedFlow(vn4,sd4);
1dfa3c16 236 fchr4th->FillChi(vn4*pow(AvM,0.5));//to be removed
bc92c0cb 237 }else{
238 cout<<" v_"<<n<<"{4} = Im"<<endl;
239 }
240 if(six!=0. && sixthOrderQCumulant>0.){
241 vn6 = pow((1./4.)*sixthOrderQCumulant,1./6.); //v_n{6}
242 sd6 = (1./6.)*pow(2.,-1./3.)*pow(sixthOrderQCumulant,-5./6.)*sixthOrderQCumulantError;
e6614983 243 cout<<" v_"<<n<<"{6} = "<<vn6<<" +/- "<<sd6<<endl;
244 fIntRes->SetBinContent(3,vn6);
245 fIntRes->SetBinError(3,sd6);
8842fb2b 246 //common histograms:
3963f25c 247 fchr6th->FillIntegratedFlow(vn6,sd6);
1dfa3c16 248 fchr6th->FillChi(vn6*pow(AvM,0.5));//to be removed
bc92c0cb 249 }else{
250 cout<<" v_"<<n<<"{6} = Im"<<endl;
251 }
dee1e0e0 252 if(eight!=0. && eightOrderQCumulant<0.){
253 vn8 = pow((-1./33.)*eightOrderQCumulant,1./8.); //v_n{8}
254 cout<<" v_"<<n<<"{8} = "<<vn8<<" +/- "<<sd8<<endl;
255 fIntRes->SetBinContent(4,vn8);
256 fIntRes->SetBinError(4,sd8);
257 //common histograms:
3963f25c 258 fchr8th->FillIntegratedFlow(vn8,sd8);
1dfa3c16 259 fchr8th->FillChi(vn8*pow(AvM,0.5));//to be removed
1dfa3c16 260 }else{
261 cout<<" v_"<<n<<"{8} = Im"<<endl;
dee1e0e0 262 }
1dfa3c16 263 cout<<endl;
bc92c0cb 264 cout<<" nEvts = "<<nEvts<<", AvM = "<<AvM<<endl;
4057ba99 265 cout<<"**************************************"<<endl;
266 cout<<"**************************************"<<endl;
1dfa3c16 267 cout<<endl;
bc92c0cb 268//---------------------------------------------------------------------------------------------------------
1315fe58 269
3963f25c 270
271
272//---------------------------------------------------------------------------------------------------------
1dfa3c16 273//differential flow (RP)
3963f25c 274Int_t nBinsPtRP = fbinPt2p1n1nRP->GetNbinsX();
275Int_t nBinsEtaRP = fbinEta2p1n1nRP->GetNbinsX();
1dfa3c16 276
277//Pt:
278Double_t secondOrderQCumulantDiffFlowPtRP = 0.;
279Double_t fourthOrderQCumulantDiffFlowPtRP = 0.;
280
3963f25c 281Double_t dVn2ndRP=0.,dSd2ndRP=0.,dDiffvn2ndRP=0.,dYield2ndRP=0.,dSum2ndRP=0.;
282Double_t dVn4thRP=0.,dSd4thRP=0.,dDiffvn4thRP=0.,dYield4thRP=0.,dSum4thRP=0.;
1dfa3c16 283
284for(Int_t bb=1;bb<nBinsPtRP+1;bb++)
285{
3963f25c 286 //QC{2}
1dfa3c16 287 if(fbinPt2p1n1nRP->GetBinEntries(bb)>0.&&vn2!=0)
288 {
3963f25c 289 //cout<<"bin = "<<bb<<" : "<<(fch2nd->GetHistPtDiff())->GetBinContent(bb)<<endl;
290 //cout<<endl;
1dfa3c16 291 secondOrderQCumulantDiffFlowPtRP = fbinPt2p1n1nRP->GetBinContent(bb);
292 fDiffRes2nd->SetBinContent(bb,secondOrderQCumulantDiffFlowPtRP/vn2);
293 //common histogram:
3963f25c 294 fchr2nd->FillDifferentialFlowPtRP(bb,secondOrderQCumulantDiffFlowPtRP/vn2, 0.);//to be improved (errors) && bb or bb+1
295 //-------------------------------------------------------------
296 //integrated flow (RP, Pt, 2nd order):
297 dDiffvn2ndRP=(fchr2nd->GetHistDiffFlowPtRP())->GetBinContent(bb);
298 dYield2ndRP=(fch2nd->GetHistPtInt())->GetBinContent(bb);
299 dVn2ndRP+=dDiffvn2ndRP*dYield2ndRP;
300 dSum2ndRP+=dYield2ndRP;
301 //-------------------------------------------------------------
1dfa3c16 302 }
3963f25c 303 //QC{4]
1dfa3c16 304 if(fbinPt4p1n1n1n1nRP->GetBinEntries(bb)>0.&&vn4!=0.)
305 {
306 fourthOrderQCumulantDiffFlowPtRP = fbinPt4p1n1n1n1nRP->GetBinContent(bb)-2.*fbinPt2p1n1nRP->GetBinContent(bb)*pow(vn2,2.);
307 fDiffRes4th->SetBinContent(bb,-1.*fourthOrderQCumulantDiffFlowPtRP/pow(vn4,3.));
308 //common histogram:
309 fchr4th->FillDifferentialFlowPtRP(bb,-1.*fourthOrderQCumulantDiffFlowPtRP/pow(vn4,3.), 0.);//to be improved (errors)
3963f25c 310 //-------------------------------------------------------------
311 //integrated flow (RP, Pt, 4th order):
312 dDiffvn4thRP=(fchr4th->GetHistDiffFlowPtRP())->GetBinContent(bb);
313 dYield4thRP=(fch4th->GetHistPtInt())->GetBinContent(bb);
314 dVn4thRP+=dDiffvn4thRP*dYield4thRP;
315 dSum4thRP+=dYield4thRP;
316 //-------------------------------------------------------------
1dfa3c16 317 }
3963f25c 318}
319
320//integrated flow estimates from Q-cumulants (RP):
321cout<<endl;
322cout<<"**************************************"<<endl;
323cout<<"**************************************"<<endl;
324cout<<"flow estimates from Q-cumulants (RP):"<<endl;
325cout<<endl;
326//storing the final results for integrated flow (RP):
327//QC{2}
328if(dSum2ndRP && fchr2nd)
329{
330 dVn2ndRP/=dSum2ndRP;
331 fchr2nd->FillIntegratedFlowRP(dVn2ndRP,0.);//to be improved (errors)
332 cout<<" v_"<<n<<"{2} = "<<dVn2ndRP<<" +/- "<<dSd2ndRP<<endl;
333}else
334 {
335 cout<<" v_"<<n<<"{2} = Im"<<endl;
336 }
337
338//QC{4}
339if(dSum4thRP && fchr4th)
340{
341 dVn4thRP/=dSum4thRP;
342 fchr4th->FillIntegratedFlowRP(dVn4thRP,0.);//to be improved (errors)
343 cout<<" v_"<<n<<"{4} = "<<dVn4thRP<<" +/- "<<dSd4thRP<<endl;
344}else
345 {
346 cout<<" v_"<<n<<"{4} = Im"<<endl;
347 }
348
349cout<<endl;
350cout<<" nEvts = "<<nEvts<<", AvM = "<<AvM<<endl;
351cout<<"**************************************"<<endl;
352cout<<"**************************************"<<endl;
353cout<<endl;
1dfa3c16 354
355//Eta:
356Double_t secondOrderQCumulantDiffFlowEtaRP = 0.;
357Double_t fourthOrderQCumulantDiffFlowEtaRP = 0.;
358
1dfa3c16 359for(Int_t bb=1;bb<nBinsEtaRP+1;bb++)
360{
361 if(fbinEta2p1n1nRP->GetBinEntries(bb)>0.&&vn2!=0)
362 {
363 secondOrderQCumulantDiffFlowEtaRP = fbinEta2p1n1nRP->GetBinContent(bb);
364 fDiffRes2nd->SetBinContent(bb,secondOrderQCumulantDiffFlowEtaRP/vn2);
365 //common histogram:
366 fchr2nd->FillDifferentialFlowEtaRP(bb,secondOrderQCumulantDiffFlowEtaRP/vn2, 0.);//to be improved (errors)
367 }
368 if(fbinEta4p1n1n1n1nRP->GetBinEntries(bb)>0.&&vn4!=0.)
369 {
370 fourthOrderQCumulantDiffFlowEtaRP = fbinEta4p1n1n1n1nRP->GetBinContent(bb)-2.*fbinEta2p1n1nRP->GetBinContent(bb)*pow(vn2,2.);
371 fDiffRes4th->SetBinContent(bb,-1.*fourthOrderQCumulantDiffFlowEtaRP/pow(vn4,3.));
372 //common histogram:
373 fchr4th->FillDifferentialFlowEtaRP(bb,-1.*fourthOrderQCumulantDiffFlowEtaRP/pow(vn4,3.), 0.);//to be improved (errors)
374 }
3963f25c 375}
376//---------------------------------------------------------------------------------------------------
377
378
379
380
381//---------------------------------------------------------------------------------------------------------
1dfa3c16 382//differential flow (POI)
7e58a232 383Int_t nBinsPtPOI = fbinPt2p1n1nPOI->GetNbinsX();
384Int_t nBinsEtaPOI = fbinEta2p1n1nPOI->GetNbinsX();
1dfa3c16 385
386//Pt:
387Double_t secondOrderQCumulantDiffFlowPtPOI = 0.;
388Double_t fourthOrderQCumulantDiffFlowPtPOI = 0.;
8842fb2b 389
3963f25c 390Double_t dVn2ndPOI=0.,dSd2ndPOI=0.,dDiffvn2ndPOI=0.,dYield2ndPOI=0.,dSum2ndPOI=0.;
391Double_t dVn4thPOI=0.,dSd4thPOI=0.,dDiffvn4thPOI=0.,dYield4thPOI=0.,dSum4thPOI=0.;
1dfa3c16 392
393for(Int_t bb=1;bb<nBinsPtPOI+1;bb++)
bc92c0cb 394{
7e58a232 395 //QC{2}
1dfa3c16 396 if(fbinPt2p1n1nPOI->GetBinEntries(bb)>0.&&vn2!=0)
bc92c0cb 397 {
7e58a232 398 //cout<<"bin = "<<bb<<" : "<<(fch2nd->GetHistPtDiff())->GetBinContent(bb)<<endl;
399 //cout<<endl;
1dfa3c16 400 secondOrderQCumulantDiffFlowPtPOI = fbinPt2p1n1nPOI->GetBinContent(bb);
401 fDiffRes2nd->SetBinContent(bb,secondOrderQCumulantDiffFlowPtPOI/vn2);
8842fb2b 402 //common histogram:
7e58a232 403 fchr2nd->FillDifferentialFlowPtPOI(bb,secondOrderQCumulantDiffFlowPtPOI/vn2, 0.);//to be improved (errors) && bb or bb+1
404 //-------------------------------------------------------------
405 //integrated flow (POI, Pt, 2nd order):
3963f25c 406 dDiffvn2ndPOI=(fchr2nd->GetHistDiffFlowPtPOI())->GetBinContent(bb);
407 dYield2ndPOI=(fch2nd->GetHistPtDiff())->GetBinContent(bb);
408 dVn2ndPOI+=dDiffvn2ndPOI*dYield2ndPOI;
409 dSum2ndPOI+=dYield2ndPOI;
7e58a232 410 //-------------------------------------------------------------
bc92c0cb 411 }
7e58a232 412 //QC{4]
1dfa3c16 413 if(fbinPt4p1n1n1n1nPOI->GetBinEntries(bb)>0.&&vn4!=0.)
bc92c0cb 414 {
1dfa3c16 415 fourthOrderQCumulantDiffFlowPtPOI = fbinPt4p1n1n1n1nPOI->GetBinContent(bb)-2.*fbinPt2p1n1nPOI->GetBinContent(bb)*pow(vn2,2.);
416 fDiffRes4th->SetBinContent(bb,-1.*fourthOrderQCumulantDiffFlowPtPOI/pow(vn4,3.));
8842fb2b 417 //common histogram:
1dfa3c16 418 fchr4th->FillDifferentialFlowPtPOI(bb,-1.*fourthOrderQCumulantDiffFlowPtPOI/pow(vn4,3.), 0.);//to be improved (errors)
4057ba99 419 //-------------------------------------------------------------
420 //integrated flow (POI, Pt, 4th order):
3963f25c 421 dDiffvn4thPOI=(fchr4th->GetHistDiffFlowPtPOI())->GetBinContent(bb);
422 dYield4thPOI=(fch4th->GetHistPtDiff())->GetBinContent(bb);
423 dVn4thPOI+=dDiffvn4thPOI*dYield4thPOI;
424 dSum4thPOI+=dYield4thPOI;
4057ba99 425 //-------------------------------------------------------------
bc92c0cb 426 }
427}
1dfa3c16 428
4e1fb6e8 429cout<<endl;
430cout<<"**************************************"<<endl;
431cout<<"**************************************"<<endl;
432cout<<"flow estimates from Q-cumulants (POI):"<<endl;
433cout<<endl;
7e58a232 434//storing the final results for integrated flow (POI):
435//QC{2}
3963f25c 436if(dSum2ndPOI && fchr2nd)
7e58a232 437{
3963f25c 438 dVn2ndPOI/=dSum2ndPOI;
4057ba99 439 fchr2nd->FillIntegratedFlowPOI(dVn2ndPOI,0.);//to be improved (errors)
4e1fb6e8 440 cout<<" v_"<<n<<"{2} = "<<dVn2ndPOI<<" +/- "<<dSd2ndPOI<<endl;
441}else
442 {
443 cout<<" v_"<<n<<"{2} = Im"<<endl;
444 }
445
4057ba99 446//QC{4}
3963f25c 447if(dSum4thPOI && fchr4th)
4057ba99 448{
3963f25c 449 dVn4thPOI/=dSum4thPOI;
4057ba99 450 fchr4th->FillIntegratedFlowPOI(dVn4thPOI,0.);//to be improved (errors)
4e1fb6e8 451 cout<<" v_"<<n<<"{4} = "<<dVn4thPOI<<" +/- "<<dSd4thPOI<<endl;
452}else
453 {
454 cout<<" v_"<<n<<"{4} = Im"<<endl;
455 }
456
457cout<<endl;
458cout<<" nEvts = "<<nEvts<<", AvM = "<<AvM<<endl;
459cout<<"**************************************"<<endl;
460cout<<"**************************************"<<endl;
461cout<<endl;
7e58a232 462
1dfa3c16 463//Eta:
464Double_t secondOrderQCumulantDiffFlowEtaPOI = 0.;
465Double_t fourthOrderQCumulantDiffFlowEtaPOI = 0.;
466
1dfa3c16 467for(Int_t bb=1;bb<nBinsEtaPOI+1;bb++)
468{
469 if(fbinEta2p1n1nPOI->GetBinEntries(bb)>0.&&vn2!=0)
470 {
471 secondOrderQCumulantDiffFlowEtaPOI = fbinEta2p1n1nPOI->GetBinContent(bb);
472 fDiffRes2nd->SetBinContent(bb,secondOrderQCumulantDiffFlowEtaPOI/vn2);
473 //common histogram:
474 fchr2nd->FillDifferentialFlowEtaPOI(bb,secondOrderQCumulantDiffFlowEtaPOI/vn2, 0.);//to be improved (errors)
475 }
476 if(fbinEta4p1n1n1n1nPOI->GetBinEntries(bb)>0.&&vn4!=0.)
477 {
478 fourthOrderQCumulantDiffFlowEtaPOI = fbinEta4p1n1n1n1nPOI->GetBinContent(bb)-2.*fbinEta2p1n1nPOI->GetBinContent(bb)*pow(vn2,2.);
479 fDiffRes4th->SetBinContent(bb,-1.*fourthOrderQCumulantDiffFlowEtaPOI/pow(vn4,3.));
480 //common histogram:
481 fchr4th->FillDifferentialFlowEtaPOI(bb,-1.*fourthOrderQCumulantDiffFlowEtaPOI/pow(vn4,3.), 0.);//to be improved (errors)
482 }
483}
484
bc92c0cb 485//---------------------------------------------------------------------------------------------------------
486
4057ba99 487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
bc92c0cb 508
509
510
511
512
bc92c0cb 513
514
515
4057ba99 516Bool_t bNestedLoopsResults=kFALSE;
517if(bNestedLoopsResults)
518{
519 //needed for direct correlations (obtained from nested loops)
1dfa3c16 520 cout<<endl;
521 cout<<endl;
bc92c0cb 522 cout<<" **** cross-checking the formulas ****"<<endl;
523 cout<<" **** for integrated flow ****"<<endl;
4057ba99 524 cout<<"(selected only events for which 0 < M < 12 "<<endl;
dee1e0e0 525 cout<<" from dataset in /data/alice2/ante/AOD) "<<endl;
526
1dfa3c16 527 cout<<endl;
bc92c0cb 528 cout<<" nEvts = "<<nEvts<<", AvM = "<<AvM<<endl;
1dfa3c16 529 cout<<endl;
dee1e0e0 530 cout<<"<2>_{n|n} from Q-vectors = "<<fQCorr->GetBinContent(1)<<endl;
531 cout<<"<2>_{n|n} from nested loops = "<<fDirect->GetBinContent(1)<<endl;
1dfa3c16 532 cout<<endl;
dee1e0e0 533 cout<<"<2>_{2n|2n} from Q-vectors = "<<fQCorr->GetBinContent(2)<<endl;
534 cout<<"<2>_{2n|2n} from nested loops = "<<fDirect->GetBinContent(2)<<endl;
1dfa3c16 535 cout<<endl;
dee1e0e0 536 cout<<"<2>_{3n|3n} from Q-vectors = "<<fQCorr->GetBinContent(3)<<endl;
537 cout<<"<2>_{3n|3n} from nested loops = "<<fDirect->GetBinContent(3)<<endl;
1dfa3c16 538 cout<<endl;
dee1e0e0 539 cout<<"<2>_{4n|4n} from Q-vectors = "<<fQCorr->GetBinContent(4)<<endl;
540 cout<<"<2>_{4n|4n} from nested loops = "<<fDirect->GetBinContent(4)<<endl;
1dfa3c16 541 cout<<endl;
dee1e0e0 542 cout<<"<3>_{2n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(6)<<endl;
543 cout<<"<3>_{2n,n,n} from nested loops = "<<fDirect->GetBinContent(6)<<endl;
1dfa3c16 544 cout<<endl;
dee1e0e0 545 cout<<"<3>_{3n,2n,n} from Q-vectors = "<<fQCorr->GetBinContent(7)<<endl;
546 cout<<"<3>_{3n,2n,n} from nested loops = "<<fDirect->GetBinContent(7)<<endl;
1dfa3c16 547 cout<<endl;
dee1e0e0 548 cout<<"<3>_{4n,2n,2n} from Q-vectors = "<<fQCorr->GetBinContent(8)<<endl;
549 cout<<"<3>_{4n,2n,2n} from nested loops = "<<fDirect->GetBinContent(8)<<endl;
1dfa3c16 550 cout<<endl;
dee1e0e0 551 cout<<"<3>_{4n,3n,n} from Q-vectors = "<<fQCorr->GetBinContent(9)<<endl;
552 cout<<"<3>_{4n,3n,n} from nested loops = "<<fDirect->GetBinContent(9)<<endl;
1dfa3c16 553 cout<<endl;
dee1e0e0 554 cout<<"<4>_{n,n|n,n} from Q-vectors = "<<fQCorr->GetBinContent(11)<<endl;
555 cout<<"<4>_{n,n|n,n} from nested loops = "<<fDirect->GetBinContent(11)<<endl;
1dfa3c16 556 cout<<endl;
dee1e0e0 557 cout<<"<4>_{2n,n|2n,n} from Q-vectors = "<<fQCorr->GetBinContent(12)<<endl;
558 cout<<"<4>_{2n,n|2n,n} from nested loops = "<<fDirect->GetBinContent(12)<<endl;
1dfa3c16 559 cout<<endl;
dee1e0e0 560 cout<<"<4>_{2n,2n|2n,2n} from Q-vectors = "<<fQCorr->GetBinContent(13)<<endl;
561 cout<<"<4>_{2n,2n|2n,2n} from nested loops = "<<fDirect->GetBinContent(13)<<endl;
1dfa3c16 562 cout<<endl;
dee1e0e0 563 cout<<"<4>_{3n|n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(14)<<endl;
564 cout<<"<4>_{3n|n,n,n} from nested loops = "<<fDirect->GetBinContent(14)<<endl;
1dfa3c16 565 cout<<endl;
dee1e0e0 566 cout<<"<4>_{3n,n|3n,n} from Q-vectors = "<<fQCorr->GetBinContent(15)<<endl;
567 cout<<"<4>_{3n,n|3n,n} from nested loops = "<<fDirect->GetBinContent(15)<<endl;
1dfa3c16 568 cout<<endl;
dee1e0e0 569 cout<<"<4>_{3n,n|2n,2n} from Q-vectors = "<<fQCorr->GetBinContent(16)<<endl;
570 cout<<"<4>_{3n,n|2n,2n} from nested loops = "<<fDirect->GetBinContent(16)<<endl;
1dfa3c16 571 cout<<endl;
dee1e0e0 572 cout<<"<4>_{4n|2n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(17)<<endl;
573 cout<<"<4>_{4n|2n,n,n} from nested loops = "<<fDirect->GetBinContent(17)<<endl;
1dfa3c16 574 cout<<endl;
dee1e0e0 575 cout<<"<5>_{2n,n|n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(19)<<endl;
576 cout<<"<5>_{2n,n|n,n,n} from nested loops = "<<fDirect->GetBinContent(19)<<endl;
1dfa3c16 577 cout<<endl;
dee1e0e0 578 cout<<"<5>_{2n,2n|2n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(20)<<endl;
579 cout<<"<5>_{2n,2n|2n,n,n} from nested loops = "<<fDirect->GetBinContent(20)<<endl;
1dfa3c16 580 cout<<endl;
dee1e0e0 581 cout<<"<5>_{3n,n|2n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(21)<<endl;
582 cout<<"<5>_{3n,n|2n,n,n} from nested loops = "<<fDirect->GetBinContent(21)<<endl;
1dfa3c16 583 cout<<endl;
dee1e0e0 584 cout<<"<5>_{4n|n,n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(22)<<endl;
585 cout<<"<5>_{4n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(22)<<endl;
1dfa3c16 586 cout<<endl;
dee1e0e0 587 cout<<"<6>_{n,n,n|n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(24)<<endl;
588 cout<<"<6>_{n,n,n|n,n,n} from nested loops = "<<fDirect->GetBinContent(24)<<endl;
1dfa3c16 589 cout<<endl;
dee1e0e0 590 cout<<"<6>_{2n,n,n|2n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(25)<<endl;
591 cout<<"<6>_{2n,n,n|2n,n,n} from nested loops = "<<fDirect->GetBinContent(25)<<endl;
1dfa3c16 592 cout<<endl;
dee1e0e0 593 cout<<"<6>_{2n,2n|n,n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(26)<<endl;
594 cout<<"<6>_{2n,2n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(26)<<endl;
1dfa3c16 595 cout<<endl;
dee1e0e0 596 cout<<"<6>_{3n,n|n,n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(27)<<endl;
597 cout<<"<6>_{3n,n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(27)<<endl;
1dfa3c16 598 cout<<endl;
dee1e0e0 599 cout<<"<7>_{2n,n,n|n,n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(29)<<endl;
600 cout<<"<7>_{2n,n,n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(29)<<endl;
1dfa3c16 601 cout<<endl;
dee1e0e0 602 cout<<"<8>_{n,n,n,n|n,n,n,n} from Q-vectors = "<<fQCorr->GetBinContent(31)<<endl;
603 cout<<"<8>_{n,n,n,n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(31)<<endl;
1dfa3c16 604 cout<<endl;
bc92c0cb 605
4057ba99 606 //DIFFERENTIAL FLOW:
bc92c0cb 607 //41st bin: <2'>_{n|n}
608 //42nd bin: <2'>_{2n|2n}
609 //46th bin: <3'>_{2n|n,n}
610 //47th bin: <3'>_{n,n|2n}
611 //51st bin: <4'>_{n,n|n,n}
612
1dfa3c16 613 cout<<endl;
614 cout<<endl;
bc92c0cb 615 cout<<" **** cross-checking the formulas ****"<<endl;
616 cout<<" **** for differential flow ****"<<endl;
4057ba99 617 cout<<"(selected only events for which 0 < M < 12 "<<endl;
dee1e0e0 618 cout<<" from dataset in /data/alice2/ante/AOD) "<<endl;
619
1dfa3c16 620 cout<<endl;
bc92c0cb 621 cout<<"nEvts = "<<nEvts<<", AvM = "<<AvM<<endl;
622 cout<<"0.5 < Pt < 0.6 GeV"<<endl;
1dfa3c16 623 cout<<endl;
4057ba99 624 cout<<"<2'>_{n|n} from Q-vectors = "<<fbinPt2p1n1nPOI->GetBinContent(6)<<endl;
625 cout<<"<2'>_{n|n} from nested loops = "<<fDirect->GetBinContent(41)<<endl;
1dfa3c16 626 cout<<endl;
4057ba99 627 cout<<"<2'>_{2n|2n} from Q-vectors = "<<fbinPt2p2n2nPOI->GetBinContent(6)<<endl;
628 cout<<"<2'>_{2n|2n} from nested loops = "<<fDirect->GetBinContent(42)<<endl;
1dfa3c16 629 cout<<endl;
4057ba99 630 cout<<"<3'>_{2n|n,n} from Q-vectors = "<<fbinPt3p2n1n1nPOI->GetBinContent(6)<<endl;
631 cout<<"<3'>_{2n|n,n} from nested loops = "<<fDirect->GetBinContent(46)<<endl;
1dfa3c16 632 cout<<endl;
4057ba99 633 cout<<"<3'>_{n,n|2n} from Q-vectors = "<<fbinPt3p1n1n2nPOI->GetBinContent(6)<<endl;
634 cout<<"<3'>_{n,n|2n} from nested loops = "<<fDirect->GetBinContent(47)<<endl;
1dfa3c16 635 cout<<endl;
4057ba99 636 cout<<"<4'>_{n,n|n,n} from Q-vectors = "<<fbinPt4p1n1n1n1nPOI->GetBinContent(6)<<endl;
637 cout<<"<4'>_{n,n|n,n} from nested loops = "<<fDirect->GetBinContent(51)<<endl;
1dfa3c16 638 cout<<endl;
4057ba99 639 cout<<"<5'>_{2n,n|n,n,n} from Q-vectors = "<<endl;
640 cout<<"<5'>_{2n,n|n,n,n} from nested loops = "<<fDirect->GetBinContent(56)<<endl;
641 cout<<endl;
642 cout<<"<6'>_{n,n,n|n,n,n} from Q-vectors = "<<endl;
643 cout<<"<6'>_{n,n,n|n,n,n} from nested loops = "<<fDirect->GetBinContent(61)<<endl;
644 cout<<endl;
645 cout<<"<7'>_{2n,n,n|n,n,n,n} from Q-vectors = "<<endl;
646 cout<<"<7'>_{2n,n,n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(66)<<endl;
647 cout<<endl;
648 cout<<"<8'>_{n,n,n,n|n,n,n,n} from Q-vectors = "<<endl;
649 cout<<"<8'>_{n,n,n,n|n,n,n,n} from nested loops = "<<fDirect->GetBinContent(71)<<endl;
650 cout<<endl;
651}//end of if(bNestedLoopsResults)
e6614983 652
bc92c0cb 653}
654
e6614983 655
656
657
658
659
660
661
662
663
664
665
bc92c0cb 666
667
668