1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////////////////////////////////
17 //Description: Maker to analyze Flow using the LeeYangZeros method
18 // Equation numbers are from Big Paper (BP): Nucl. Phys. A 727, 373 (2003)
19 // Practical Guide (PG): J. Phys. G: Nucl. Part. Phys. 30, S1213 (2004)
20 // Adapted from StFlowLeeYangZerosMaker.cxx
21 // by Markus Oldenberg and Art Poskanzer, LBNL
22 // with advice from Jean-Yves Ollitrault and Nicolas Borghini
24 //Author: Naomi van der Kolk (kolk@nikhef.nl)
25 /////////////////////////////////////////////////////////////////////////////////////////
27 #include "Riostream.h" //needed as include
28 #include "TObject.h" //needed as include
29 #include "AliFlowCommonConstants.h" //needed as include
30 #include "AliFlowLYZConstants.h" //needed as include
31 #include "AliFlowAnalysisWithLeeYangZeros.h"
32 #include "AliFlowLYZHist1.h" //needed as include
33 #include "AliFlowLYZHist2.h" //needed as include
34 #include "AliFlowCommonHist.h" //needed as include
35 #include "AliFlowCommonHistResults.h" //needed as include
36 #include "AliFlowEventSimple.h" //needed as include
37 #include "AliFlowTrackSimple.h" //needed as include
41 #include "TMath.h" //needed as include
42 #include "TFile.h" //needed as include
51 ClassImp(AliFlowAnalysisWithLeeYangZeros)
53 //-----------------------------------------------------------------------
55 AliFlowAnalysisWithLeeYangZeros::AliFlowAnalysisWithLeeYangZeros():
67 fHistProVetaPOI(NULL),
70 fHistProR0theta(NULL),
71 fHistProReDenom(NULL),
72 fHistProImDenom(NULL),
73 fHistProReDtheta(NULL),
74 fHistProImDtheta(NULL),
75 fHistQsumforChi(NULL),
81 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::AliFlowAnalysisWithLeeYangZeros default constructor****"<<endl;
83 fHistList = new TList();
84 fFirstRunList = new TList();
86 for(Int_t i = 0;i<5;i++)
93 fQsum = new TVector2();
97 //-----------------------------------------------------------------------
100 AliFlowAnalysisWithLeeYangZeros::~AliFlowAnalysisWithLeeYangZeros()
103 if (fDebug) cout<<"****~AliFlowAnalysisWithLeeYangZeros****"<<endl;
106 delete fFirstRunList;
110 //-----------------------------------------------------------------------
112 void AliFlowAnalysisWithLeeYangZeros::WriteHistograms(TString* outputFileName)
114 //store the final results in output .root file
116 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
118 //output->WriteObject(fHistList, "cobjLYZ1","SingleKey");
119 fHistList->SetName("cobjLYZ1");
120 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
123 //output->WriteObject(fHistList, "cobjLYZ2","SingleKey");
124 fHistList->SetName("cobjLYZ2");
125 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
130 //-----------------------------------------------------------------------
132 void AliFlowAnalysisWithLeeYangZeros::WriteHistograms(TString outputFileName)
134 //store the final results in output .root file
136 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
138 //output->WriteObject(fHistList, "cobjLYZ1","SingleKey");
139 fHistList->SetName("cobjLYZ1");
140 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
143 //output->WriteObject(fHistList, "cobjLYZ2","SingleKey");
144 fHistList->SetName("cobjLYZ2");
145 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
150 //-----------------------------------------------------------------------
152 Bool_t AliFlowAnalysisWithLeeYangZeros::Init()
155 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Init()****"<<endl;
158 Int_t iNtheta = AliFlowLYZConstants::kTheta;
159 Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
160 Int_t iNbinsEta = AliFlowCommonConstants::GetNbinsEta();
162 Double_t dPtMin = AliFlowCommonConstants::GetPtMin();
163 Double_t dPtMax = AliFlowCommonConstants::GetPtMax();
164 Double_t dEtaMin = AliFlowCommonConstants::GetEtaMin();
165 Double_t dEtaMax = AliFlowCommonConstants::GetEtaMax();
167 //for control histograms
168 if (fFirstRun){ fCommonHists = new AliFlowCommonHist("AliFlowCommonHistLYZ1");
169 fHistList->Add(fCommonHists);
170 fCommonHistsRes = new AliFlowCommonHistResults("AliFlowCommonHistResultsLYZ1");
171 fHistList->Add(fCommonHistsRes);
173 else { fCommonHists = new AliFlowCommonHist("AliFlowCommonHistLYZ2");
174 fHistList->Add(fCommonHists);
175 fCommonHistsRes = new AliFlowCommonHistResults("AliFlowCommonHistResultsLYZ2");
176 fHistList->Add(fCommonHistsRes);
179 fHistQsumforChi = new TH1F("Flow_QsumforChi_LYZ","Flow_QsumforChi_LYZ",3,-1.,2.);
180 fHistQsumforChi->SetXTitle("Qsum.X , Qsum.Y, Q2sum");
181 fHistQsumforChi->SetYTitle("value");
182 fHistList->Add(fHistQsumforChi);
184 //for first loop over events
186 fHistProR0theta = new TProfile("First_FlowPro_r0theta_LYZ","First_FlowPro_r0theta_LYZ",iNtheta,-0.5,iNtheta-0.5);
187 fHistProR0theta->SetXTitle("#theta");
188 fHistProR0theta->SetYTitle("r_{0}^{#theta}");
189 fHistList->Add(fHistProR0theta);
191 fHistProVtheta = new TProfile("First_FlowPro_Vtheta_LYZ","First_FlowPro_Vtheta_LYZ",iNtheta,-0.5,iNtheta-0.5);
192 fHistProVtheta->SetXTitle("#theta");
193 fHistProVtheta->SetYTitle("V_{n}^{#theta}");
194 fHistList->Add(fHistProVtheta);
196 //class AliFlowLYZHist1 defines the histograms: fHistProGtheta, fHistProReGtheta, fHistProImGtheta, fHistProR0theta
197 for (Int_t theta=0;theta<iNtheta;theta++) {
198 TString name = "AliFlowLYZHist1_";
200 fHist1[theta]=new AliFlowLYZHist1(theta, name);
201 fHistList->Add(fHist1[theta]);
205 //for second loop over events
207 fHistProReDenom = new TProfile("Second_FlowPro_ReDenom_LYZ","Second_FlowPro_ReDenom_LYZ" , iNtheta, -0.5, iNtheta-0.5);
208 fHistProReDenom->SetXTitle("#theta");
209 fHistProReDenom->SetYTitle("Re(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
210 fHistList->Add(fHistProReDenom);
212 fHistProImDenom = new TProfile("Second_FlowPro_ImDenom_LYZ","Second_FlowPro_ImDenom_LYZ" , iNtheta, -0.5, iNtheta-0.5);
213 fHistProImDenom->SetXTitle("#theta");
214 fHistProImDenom->SetYTitle("Im(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
215 fHistList->Add(fHistProImDenom);
217 fHistProVetaRP = new TProfile("Second_FlowPro_VetaRP_LYZ","Second_FlowPro_VetaRP_LYZ",iNbinsEta,dEtaMin,dEtaMax);
218 fHistProVetaRP->SetXTitle("rapidity");
219 fHistProVetaRP->SetYTitle("v_{2}(#eta) for RP selection");
220 fHistList->Add(fHistProVetaRP);
222 fHistProVetaPOI = new TProfile("Second_FlowPro_VetaPOI_LYZ","Second_FlowPro_VetaPOI_LYZ",iNbinsEta,dEtaMin,dEtaMax);
223 fHistProVetaPOI->SetXTitle("rapidity");
224 fHistProVetaPOI->SetYTitle("v_{2}(#eta) for POI selection");
225 fHistList->Add(fHistProVetaPOI);
227 fHistProVPtRP = new TProfile("Second_FlowPro_VPtRP_LYZ","Second_FlowPro_VPtRP_LYZ",iNbinsPt,dPtMin,dPtMax);
228 fHistProVPtRP->SetXTitle("Pt");
229 fHistProVPtRP->SetYTitle("v_{2}(p_{T}) for RP selection");
230 fHistList->Add(fHistProVPtRP);
232 fHistProVPtPOI = new TProfile("Second_FlowPro_VPtPOI_LYZ","Second_FlowPro_VPtPOI_LYZ",iNbinsPt,dPtMin,dPtMax);
233 fHistProVPtPOI->SetXTitle("p_{T}");
234 fHistProVPtPOI->SetYTitle("v_{2}(p_{T}) for POI selection");
235 fHistList->Add(fHistProVPtPOI);
237 fHistProReDtheta = new TProfile("Second_FlowPro_ReDtheta_LYZ","Second_FlowPro_ReDtheta_LYZ",iNtheta, -0.5, iNtheta-0.5);
238 fHistProReDtheta->SetXTitle("#theta");
239 fHistProReDtheta->SetYTitle("Re(D^{#theta})");
240 fHistList->Add(fHistProReDtheta);
242 fHistProImDtheta = new TProfile("Second_FlowPro_ImDtheta_LYZ","Second_FlowPro_ImDtheta_LYZ",iNtheta, -0.5, iNtheta-0.5);
243 fHistProImDtheta->SetXTitle("#theta");
244 fHistProImDtheta->SetYTitle("Im(D^{#theta})");
245 fHistList->Add(fHistProImDtheta);
247 //class AliFlowLYZHist2 defines the histograms:
248 for (Int_t theta=0;theta<iNtheta;theta++) {
249 TString nameRP = "AliFlowLYZHist2RP_";
251 fHist2RP[theta]=new AliFlowLYZHist2(theta, "RP", nameRP);
252 fHistList->Add(fHist2RP[theta]);
254 TString namePOI = "AliFlowLYZHist2POI_";
256 fHist2POI[theta]=new AliFlowLYZHist2(theta, "POI", namePOI);
257 fHistList->Add(fHist2POI[theta]);
260 //read histogram fHistProR0theta from the first run list
262 fHistProR0theta = (TProfile*)fFirstRunList->FindObject("First_FlowPro_r0theta_LYZ");
263 if (!fHistProR0theta) {cout<<"fHistProR0theta has a NULL pointer!"<<endl;}
264 fHistList->Add(fHistProR0theta);
265 } else { cout<<"list is NULL pointer!"<<endl; }
270 if (fDebug) cout<<"****Histograms initialised****"<<endl;
272 fEventNumber = 0; //set event counter to zero
277 //-----------------------------------------------------------------------
279 Bool_t AliFlowAnalysisWithLeeYangZeros::Make(AliFlowEventSimple* anEvent)
282 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Make()****"<<endl;
284 //get tracks from event
287 fCommonHists->FillControlHistograms(anEvent);
288 FillFromFlowEvent(anEvent);
291 fCommonHists->FillControlHistograms(anEvent);
292 SecondFillFromFlowEvent(anEvent);
297 cout<<"##### FlowLeeYangZero: Stack pointer null"<<endl;
300 // cout<<"^^^^read event "<<fEventNumber<<endl;
307 //-----------------------------------------------------------------------
308 void AliFlowAnalysisWithLeeYangZeros::GetOutputHistograms(TList *outputListHistos) {
309 // get the pointers to all output histograms before calling Finish()
311 const Int_t iNtheta = AliFlowLYZConstants::kTheta;
313 if (outputListHistos) {
315 //define histograms for first and second run
316 AliFlowCommonHist *pCommonHist = NULL;
317 AliFlowCommonHistResults *pCommonHistResults = NULL;
318 TProfile* pHistProVtheta = NULL;
319 TProfile* pHistProReDenom = NULL;
320 TProfile* pHistProImDenom = NULL;
321 TProfile* pHistProReDtheta = NULL;
322 TProfile* pHistProImDtheta = NULL;
323 TProfile* pHistProVetaRP = NULL;
324 TProfile* pHistProVetaPOI = NULL;
325 TProfile* pHistProVPtRP = NULL;
326 TProfile* pHistProVPtPOI = NULL;
327 AliFlowLYZHist1 *pLYZHist1[iNtheta] = {NULL}; //array of pointers to AliFlowLYZHist1
328 AliFlowLYZHist2 *pLYZHist2RP[iNtheta] = {NULL}; //array of pointers to AliFlowLYZHist2
329 AliFlowLYZHist2 *pLYZHist2POI[iNtheta] = {NULL}; //array of pointers to AliFlowLYZHist2
331 if (GetFirstRun()) { //first run
332 //Get the common histograms from the output list
333 pCommonHist = dynamic_cast<AliFlowCommonHist*>
334 (outputListHistos->FindObject("AliFlowCommonHistLYZ1"));
335 pCommonHistResults = dynamic_cast<AliFlowCommonHistResults*>
336 (outputListHistos->FindObject("AliFlowCommonHistResultsLYZ1"));
339 //Get the common histograms from the output list
340 pCommonHist = dynamic_cast<AliFlowCommonHist*>
341 (outputListHistos->FindObject("AliFlowCommonHistLYZ2"));
342 pCommonHistResults = dynamic_cast<AliFlowCommonHistResults*>
343 (outputListHistos->FindObject("AliFlowCommonHistResultsLYZ2"));
346 TProfile* pHistProR0theta = dynamic_cast<TProfile*>
347 (outputListHistos->FindObject("First_FlowPro_r0theta_LYZ"));
349 TH1F* pHistQsumforChi = dynamic_cast<TH1F*>
350 (outputListHistos->FindObject("Flow_QsumforChi_LYZ"));
353 if (GetFirstRun()) { //for firstrun
354 //Get the histograms from the output list
355 for(Int_t theta = 0;theta<iNtheta;theta++){
356 TString name = "AliFlowLYZHist1_";
358 pLYZHist1[theta] = dynamic_cast<AliFlowLYZHist1*>
359 (outputListHistos->FindObject(name));
361 pHistProVtheta = dynamic_cast<TProfile*>
362 (outputListHistos->FindObject("First_FlowPro_Vtheta_LYZ"));
364 //Set the histogram pointers and call Finish()
365 if (pCommonHist && pCommonHistResults && pLYZHist1[0] &&
366 pHistProVtheta && pHistProR0theta && pHistQsumforChi ) {
367 this->SetCommonHists(pCommonHist);
368 this->SetCommonHistsRes(pCommonHistResults);
369 this->SetHist1(pLYZHist1);
370 this->SetHistProVtheta(pHistProVtheta);
371 this->SetHistProR0theta(pHistProR0theta);
372 this->SetHistQsumforChi(pHistQsumforChi);
374 cout<<"WARNING: Histograms needed to run Finish() firstrun are not accessable!"<<endl;
376 } else { //for second run
377 //Get the histograms from the output list
378 for(Int_t theta = 0;theta<iNtheta;theta++){
379 TString nameRP = "AliFlowLYZHist2RP_";
381 pLYZHist2RP[theta] = dynamic_cast<AliFlowLYZHist2*>
382 (outputListHistos->FindObject(nameRP));
383 TString namePOI = "AliFlowLYZHist2POI_";
385 pLYZHist2POI[theta] = dynamic_cast<AliFlowLYZHist2*>
386 (outputListHistos->FindObject(namePOI));
390 pHistProReDenom = dynamic_cast<TProfile*>
391 (outputListHistos->FindObject("Second_FlowPro_ReDenom_LYZ"));
392 pHistProImDenom = dynamic_cast<TProfile*>
393 (outputListHistos->FindObject("Second_FlowPro_ImDenom_LYZ"));
395 pHistProReDtheta = dynamic_cast<TProfile*>
396 (outputListHistos->FindObject("Second_FlowPro_ReDtheta_LYZ"));
397 pHistProImDtheta = dynamic_cast<TProfile*>
398 (outputListHistos->FindObject("Second_FlowPro_ImDtheta_LYZ"));
400 pHistProVetaRP = dynamic_cast<TProfile*>
401 (outputListHistos->FindObject("Second_FlowPro_VetaRP_LYZ"));
402 pHistProVetaPOI = dynamic_cast<TProfile*>
403 (outputListHistos->FindObject("Second_FlowPro_VetaPOI_LYZ"));
404 pHistProVPtRP = dynamic_cast<TProfile*>
405 (outputListHistos->FindObject("Second_FlowPro_VPtRP_LYZ"));
406 pHistProVPtPOI = dynamic_cast<TProfile*>
407 (outputListHistos->FindObject("Second_FlowPro_VPtPOI_LYZ"));
410 //Set the histogram pointers and call Finish()
411 if (pCommonHist && pCommonHistResults && pLYZHist2RP[0] && pLYZHist2POI[0] &&
412 pHistProR0theta && pHistProReDenom && pHistProImDenom && pHistProVetaRP &&
413 pHistProVetaPOI && pHistProVPtRP && pHistProVPtPOI) {
414 this->SetCommonHists(pCommonHist);
415 this->SetCommonHistsRes(pCommonHistResults);
416 this->SetHist2RP(pLYZHist2RP);
417 this->SetHist2POI(pLYZHist2POI);
418 this->SetHistProR0theta(pHistProR0theta);
419 this->SetHistProReDenom(pHistProReDenom);
420 this->SetHistProImDenom(pHistProImDenom);
421 this->SetHistProReDtheta(pHistProReDtheta);
422 this->SetHistProImDtheta(pHistProImDtheta);
423 this->SetHistProVetaRP(pHistProVetaRP);
424 this->SetHistProVetaPOI(pHistProVetaPOI);
425 this->SetHistProVPtRP(pHistProVPtRP);
426 this->SetHistProVPtPOI(pHistProVPtPOI);
427 this->SetHistQsumforChi(pHistQsumforChi);
429 cout<<"WARNING: Histograms needed to run Finish() secondrun are not accessable!"<<endl;
433 // outputListHistos->Print();
434 } else { cout << "histogram list pointer in Lee-Yang Zeros is empty in method AFAWLYZ::GetOutputHistograms() " << endl;}
437 //-----------------------------------------------------------------------
438 Bool_t AliFlowAnalysisWithLeeYangZeros::Finish()
441 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Finish()****"<<endl;
443 //define variables for both runs
444 Double_t dJ01 = 2.405;
445 Int_t iNtheta = AliFlowLYZConstants::kTheta;
446 //set the event number
447 SetEventNumber((int)fCommonHists->GetHistMultOrig()->GetEntries());
448 //cout<<"number of events processed is "<<fEventNumber<<endl;
450 //set the sum of Q vectors
451 fQsum->Set(fHistQsumforChi->GetBinContent(1),fHistQsumforChi->GetBinContent(2));
452 SetQ2sum(fHistQsumforChi->GetBinContent(3));
456 Double_t dVtheta = 0;
459 for (Int_t theta=0;theta<iNtheta;theta++)
461 //get the first minimum r0
462 fHist1[theta]->FillGtheta();
463 dR0 = fHist1[theta]->GetR0();
465 //calculate integrated flow
466 if (dR0!=0.) { dVtheta = dJ01/dR0; }
467 else { cout<<"r0 is not found! Leaving LYZ analysis."<<endl; return kFALSE; }
469 //for estimating systematic error resulting from d0
470 Double_t dBinsize = (AliFlowLYZConstants::fgMax)/(AliFlowLYZConstants::kNbins);
471 Double_t dVplus = -1.;
472 Double_t dVmin = -1.;
473 if (dR0+dBinsize!=0.) {dVplus = dJ01/(dR0+dBinsize);}
474 if (dR0-dBinsize!=0.) {dVmin = dJ01/(dR0-dBinsize);}
475 //convert V to v (normally v = V/M, but here V=v because the Q-vector is scaled by 1/M)
477 Double_t dvplus = dVplus;
478 Double_t dvmin = dVmin;
479 if (fDebug) cout<<"dv = "<<dv<<" and dvplus = "<<dvplus<< " and dvmin = "<<dvmin<<endl;
481 //fill the histograms
482 fHistProR0theta->Fill(theta,dR0);
483 fHistProVtheta->Fill(theta,dVtheta);
484 //get average value of fVtheta = fV
486 } //end of loop over theta
488 //get average value of fVtheta = fV
492 Double_t dSigma2 = 0;
494 if (fEventNumber!=0) {
495 *fQsum /= fEventNumber;
496 fQ2sum /= fEventNumber;
497 dSigma2 = fQ2sum - TMath::Power(fQsum->X(),2.) - TMath::Power(fQsum->Y(),2.) - TMath::Power(dV,2.); //BP eq. 62
498 if (dSigma2>0) dChi = dV/TMath::Sqrt(dSigma2);
500 fCommonHistsRes->FillChiRP(dChi);
502 cout<<"*************************************"<<endl;
503 cout<<"*************************************"<<endl;
504 cout<<" Integrated flow from "<<endl;
505 cout<<" Lee-Yang Zeroes "<<endl;
507 cout<<"Chi = "<<dChi<<endl;
511 // recalculate statistical errors on integrated flow
512 //combining 5 theta angles to 1 relative error BP eq. 89
513 Double_t dRelErr2comb = 0.;
514 Int_t iEvts = fEventNumber;
516 for (Int_t theta=0;theta<iNtheta;theta++){
517 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
518 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
520 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
522 dRelErr2comb += (1/(2*iEvts*(dJ01*dJ01)*TMath::BesselJ1(dJ01)*
523 TMath::BesselJ1(dJ01)))*
524 (dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2)) +
525 dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2)));
527 dRelErr2comb /= iNtheta;
529 Double_t dRelErrcomb = TMath::Sqrt(dRelErr2comb);
531 //copy content of profile into TH1D and add error
532 Double_t dv2pro = dV; //in the case that fv is equal to fV
533 Double_t dv2Err = dv2pro*dRelErrcomb ;
534 cout<<"dV = "<<dv2pro<<" +- "<<dv2Err<<endl;
536 cout<<"*************************************"<<endl;
537 cout<<"*************************************"<<endl;
538 fCommonHistsRes->FillIntegratedFlow(dv2pro, dv2Err);
541 if (fDebug) cout<<"****histograms filled****"<<endl;
544 fEventNumber =0; //set to zero for second round over events
550 //calculate differential flow
552 TComplex cDenom, cNumerRP, cNumerPOI, cDtheta;
554 TComplex i = TComplex::I();
555 Double_t dBesselRatio[3] = {1., 1.202, 2.69};
556 Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
557 Int_t iNbinsEta = AliFlowCommonConstants::GetNbinsEta();
559 Double_t dEtaRP, dPtRP, dReRatioRP, dVetaRP, dVPtRP, dEtaPOI, dPtPOI, dReRatioPOI, dVetaPOI, dVPtPOI;
562 Double_t dVtheta = 0.;
564 Double_t dReDenom = 0.;
565 Double_t dImDenom = 0.;
566 for (Int_t theta=0;theta<iNtheta;theta++) { //loop over theta
567 if (!fHistProR0theta) {
568 cout << "Hist pointer R0theta in file does not exist" <<endl;
570 dR0 = fHistProR0theta->GetBinContent(theta+1); //histogram starts at bin 1
571 if (fDebug) cerr<<"dR0 = "<<dR0<<endl;
572 if (dR0!=0) dVtheta = dJ01/dR0;
574 // BP Eq. 9 -> Vn^theta = j01/r0^theta
575 if (!fHistProReDenom && !fHistProImDenom) {
576 cout << "Hist pointer fDenom in file does not exist" <<endl;
578 dReDenom = fHistProReDenom->GetBinContent(theta+1);
579 dImDenom = fHistProImDenom->GetBinContent(theta+1);
580 cDenom(dReDenom,dImDenom);
582 //for new method and use by others (only with the sum generating function):
584 cDtheta = dR0*cDenom/dJ01;
585 fHistProReDtheta->Fill(theta,cDtheta.Re());
586 fHistProImDtheta->Fill(theta,cDtheta.Im());
589 cDenom *= TComplex::Power(i, m-1);
590 //cerr<<"TComplex::Power(i, m-1) = "<<TComplex::Power(i, m-1).Rho()<<endl; //checked ok
592 //v as a function of eta for RP selection
593 for (Int_t be=1;be<=iNbinsEta;be++) {
594 dEtaRP = fHist2RP[theta]->GetBinCenter(be);
595 cNumerRP = fHist2RP[theta]->GetNumerEta(be);
596 if (cNumerRP.Rho()==0) {
597 if (fDebug) cerr<<"WARNING: modulus of cNumerRP is zero in Finish()"<<endl;
600 else if (cDenom.Rho()==0) {
601 if (fDebug) cerr<<"WARNING: modulus of cDenom is zero"<<endl;
605 dReRatioRP = (cNumerRP/cDenom).Re();
607 dVetaRP = dBesselRatio[m-1]*dReRatioRP*dVtheta; //BP eq. 12
608 fHistProVetaRP->Fill(dEtaRP,dVetaRP);
609 } //loop over bins be
612 //v as a function of eta for POI selection
613 for (Int_t be=1;be<=iNbinsEta;be++) {
614 dEtaPOI = fHist2POI[theta]->GetBinCenter(be);
615 cNumerPOI = fHist2POI[theta]->GetNumerEta(be);
616 if (cNumerPOI.Rho()==0) {
617 if (fDebug) cerr<<"WARNING: modulus of cNumerPOI is zero in Finish()"<<endl;
620 else if (cDenom.Rho()==0) {
621 if (fDebug) cerr<<"WARNING: modulus of cDenom is zero"<<endl;
625 dReRatioPOI = (cNumerPOI/cDenom).Re();
627 dVetaPOI = dBesselRatio[m-1]*dReRatioPOI*dVtheta; //BP eq. 12
628 fHistProVetaPOI->Fill(dEtaPOI,dVetaPOI);
629 } //loop over bins be
632 //v as a function of Pt for RP selection
633 for (Int_t bp=1;bp<=iNbinsPt;bp++) {
634 dPtRP = fHist2RP[theta]->GetBinCenterPt(bp);
635 cNumerRP = fHist2RP[theta]->GetNumerPt(bp);
636 if (cNumerRP.Rho()==0) {
637 if (fDebug) cerr<<"WARNING: modulus of cNumerRP is zero"<<endl;
640 else if (cDenom.Rho()==0) {
641 if (fDebug) cerr<<"WARNING: modulus of cDenom is zero"<<endl;
645 dReRatioRP = (cNumerRP/cDenom).Re();
647 dVPtRP = dBesselRatio[m-1]*dReRatioRP*dVtheta; //BP eq. 12
648 fHistProVPtRP->Fill(dPtRP,dVPtRP);
649 } //loop over bins bp
653 //v as a function of Pt for POI selection
654 for (Int_t bp=1;bp<=iNbinsPt;bp++) {
655 dPtPOI = fHist2POI[theta]->GetBinCenterPt(bp);
656 cNumerPOI = fHist2POI[theta]->GetNumerPt(bp);
657 if (cNumerPOI.Rho()==0) {
658 if (fDebug) cerr<<"WARNING: modulus of cNumerPOI is zero"<<endl;
661 else if (cDenom.Rho()==0) {
662 if (fDebug) cerr<<"WARNING: modulus of cDenom is zero"<<endl;
666 dReRatioPOI = (cNumerPOI/cDenom).Re();
668 dVPtPOI = dBesselRatio[m-1]*dReRatioPOI*dVtheta; //BP eq. 12
669 fHistProVPtPOI->Fill(dPtPOI,dVPtPOI);
670 } //loop over bins bp
675 }//end of loop over theta
677 //calculate the average of fVtheta = fV
679 if (dV==0.) { cout<<"dV = 0! Leaving LYZ analysis."<<endl; return kFALSE; }
681 //sigma2 and chi (for statistical error calculations)
682 Double_t dSigma2 = 0;
684 if (fEventNumber!=0) {
685 *fQsum /= fEventNumber;
686 //cerr<<"fQsum.X() = "<<fQsum.X()<<endl;
687 //cerr<<"fQsum.Y() = "<<fQsum.Y()<<endl;
688 fQ2sum /= fEventNumber;
689 //cout<<"fQ2sum = "<<fQ2sum<<endl;
690 dSigma2 = fQ2sum - TMath::Power(fQsum->X(),2.) - TMath::Power(fQsum->Y(),2.) - TMath::Power(dV,2.); //BP eq. 62
691 if (dSigma2>0) dChi = dV/TMath::Sqrt(dSigma2);
693 fCommonHistsRes->FillChiRP(dChi);
695 // recalculate statistical errors on integrated flow
696 //combining 5 theta angles to 1 relative error BP eq. 89
697 Double_t dRelErr2comb = 0.;
698 Int_t iEvts = fEventNumber;
700 for (Int_t theta=0;theta<iNtheta;theta++){
701 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
702 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
704 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
706 dRelErr2comb += (1/(2*iEvts*(dJ01*dJ01)*TMath::BesselJ1(dJ01)*
707 TMath::BesselJ1(dJ01)))*
708 (dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2)) +
709 dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2)));
711 dRelErr2comb /= iNtheta;
713 Double_t dRelErrcomb = TMath::Sqrt(dRelErr2comb);
714 Double_t dVErr = dV*dRelErrcomb ;
715 fCommonHistsRes->FillIntegratedFlow(dV,dVErr);
717 cout<<"*************************************"<<endl;
718 cout<<"*************************************"<<endl;
719 cout<<" Integrated flow from "<<endl;
720 cout<<" Lee-Yang Zeroes "<<endl;
722 cout<<"Chi = "<<dChi<<endl;
723 cout<<"dV = "<<dV<<" +- "<<dVErr<<endl;
727 //copy content of profile into TH1D and add error and fill the AliFlowCommonHistResults
729 //v as a function of eta for RP selection
730 for(Int_t b=0;b<iNbinsEta;b++) {
731 Double_t dv2pro = fHistProVetaRP->GetBinContent(b);
732 Double_t dNprime = fCommonHists->GetEntriesInEtaBinRP(b);
733 Double_t dErrdifcomb = 0.; //set error to zero
734 Double_t dErr2difcomb = 0.; //set error to zero
737 for (Int_t theta=0;theta<iNtheta;theta++) {
738 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
739 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
741 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
743 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
744 TMath::BesselJ1(dJ01)))*
745 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
746 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
750 if (dErr2difcomb!=0.) {
751 dErr2difcomb /= iNtheta;
752 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
754 else {dErrdifcomb = 0.;}
756 fCommonHistsRes->FillDifferentialFlowEtaRP(b, dv2pro, dErrdifcomb);
760 //v as a function of eta for POI selection
761 for(Int_t b=0;b<iNbinsEta;b++) {
762 Double_t dv2pro = fHistProVetaPOI->GetBinContent(b);
763 Double_t dNprime = fCommonHists->GetEntriesInEtaBinPOI(b);
764 Double_t dErrdifcomb = 0.; //set error to zero
765 Double_t dErr2difcomb = 0.; //set error to zero
768 for (Int_t theta=0;theta<iNtheta;theta++) {
769 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
770 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
772 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
774 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
775 TMath::BesselJ1(dJ01)))*
776 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
777 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
781 if (dErr2difcomb!=0.) {
782 dErr2difcomb /= iNtheta;
783 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
785 else {dErrdifcomb = 0.;}
787 fCommonHistsRes->FillDifferentialFlowEtaPOI(b, dv2pro, dErrdifcomb);
792 //v as a function of Pt for RP selection
793 TH1F* fHistPtRP = fCommonHists->GetHistPtRP(); //for calculating integrated flow
797 for(Int_t b=0;b<iNbinsPt;b++) {
798 Double_t dv2pro = fHistProVPtRP->GetBinContent(b);
799 Double_t dNprime = fCommonHists->GetEntriesInPtBinRP(b);
800 Double_t dErrdifcomb = 0.; //set error to zero
801 Double_t dErr2difcomb = 0.; //set error to zero
804 for (Int_t theta=0;theta<iNtheta;theta++) {
805 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
806 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
808 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
810 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
811 TMath::BesselJ1(dJ01)))*
812 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
813 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
817 if (dErr2difcomb!=0.) {
818 dErr2difcomb /= iNtheta;
819 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
820 //cerr<<"dErrdifcomb = "<<dErrdifcomb<<endl;
822 else {dErrdifcomb = 0.;}
825 fCommonHistsRes->FillDifferentialFlowPtRP(b, dv2pro, dErrdifcomb);
826 //calculate integrated flow for RP selection
828 Double_t dYieldPt = fHistPtRP->GetBinContent(b);
829 dVRP += dv2pro*dYieldPt;
831 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
832 } else { cout<<"fHistPtRP is NULL"<<endl; }
836 dVRP /= dSum; //the pt distribution should be normalised
837 dErrV /= (dSum*dSum);
838 dErrV = TMath::Sqrt(dErrV);
840 cout<<"dV(RP) = "<<dVRP<<" +- "<<dErrV<<endl;
842 fCommonHistsRes->FillIntegratedFlowRP(dVRP,dErrV);
845 //v as a function of Pt for POI selection
846 TH1F* fHistPtPOI = fCommonHists->GetHistPtPOI(); //for calculating integrated flow
851 for(Int_t b=0;b<iNbinsPt;b++) {
852 Double_t dv2pro = fHistProVPtPOI->GetBinContent(b);
853 Double_t dNprime = fCommonHists->GetEntriesInPtBinPOI(b);
854 Double_t dErrdifcomb = 0.; //set error to zero
855 Double_t dErr2difcomb = 0.; //set error to zero
858 for (Int_t theta=0;theta<iNtheta;theta++) {
859 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
860 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
862 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
864 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
865 TMath::BesselJ1(dJ01)))*
866 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
867 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
871 if (dErr2difcomb!=0.) {
872 dErr2difcomb /= iNtheta;
873 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
874 //cerr<<"dErrdifcomb = "<<dErrdifcomb<<endl;
876 else {dErrdifcomb = 0.;}
879 fCommonHistsRes->FillDifferentialFlowPtPOI(b, dv2pro, dErrdifcomb);
880 //calculate integrated flow for POI selection
882 Double_t dYieldPt = fHistPtPOI->GetBinContent(b);
883 dVPOI += dv2pro*dYieldPt;
885 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
886 } else { cout<<"fHistPtPOI is NULL"<<endl; }
890 dVPOI /= dSum; //the pt distribution should be normalised
891 dErrV /= (dSum*dSum);
892 dErrV = TMath::Sqrt(dErrV);
894 cout<<"dV(POI) = "<<dVPOI<<" +- "<<dErrV<<endl;
896 cout<<"*************************************"<<endl;
897 cout<<"*************************************"<<endl;
898 fCommonHistsRes->FillIntegratedFlowPOI(dVPOI,dErrV);
902 //cout<<"----LYZ analysis finished....----"<<endl<<endl;
908 //-----------------------------------------------------------------------
910 Bool_t AliFlowAnalysisWithLeeYangZeros::FillFromFlowEvent(AliFlowEventSimple* anEvent)
912 // Get event quantities from AliFlowEvent for all particles
914 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::FillFromFlowEvent()****"<<endl;
917 cout<<"##### FlowLeeYangZero: FlowEvent pointer null"<<endl;
922 TComplex cExpo, cGtheta, cGthetaNew, cZ;
923 Int_t iNtheta = AliFlowLYZConstants::kTheta;
924 Int_t iNbins = AliFlowLYZConstants::kNbins;
928 Double_t dOrder = 2.;
931 AliFlowVector vQ = anEvent->GetQ();
932 //weight by the multiplicity
935 if (vQ.GetMult() != 0) {
936 dQX = vQ.X()/vQ.GetMult();
937 dQY = vQ.Y()/vQ.GetMult();
941 //for chi calculation:
943 fHistQsumforChi->SetBinContent(1,fQsum->X());
944 fHistQsumforChi->SetBinContent(2,fQsum->Y());
946 fHistQsumforChi->SetBinContent(3,fQ2sum);
947 //cerr<<"fQ2sum = "<<fQ2sum<<endl;
949 for (Int_t theta=0;theta<iNtheta;theta++)
951 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi()/dOrder;
953 //calculate dQtheta = cos(dOrder*(fPhi-dTheta);the projection of the Q vector on the reference direction dTheta
954 Double_t dQtheta = GetQtheta(vQ, dTheta);
956 for (Int_t bin=1;bin<=iNbins;bin++)
958 Double_t dR = fHist1[theta]->GetBinCenter(bin); //bincentre of bins in histogram //FIXED???
959 //if (theta == 0) cerr<<"cerr::dR = "<<dR<<endl;
962 //calculate the sum generating function
963 cExpo(0.,dR*dQtheta); //Re=0 ; Im=dR*dQtheta
964 cGtheta = TComplex::Exp(cExpo);
968 //calculate the product generating function
969 cGtheta = GetGrtheta(anEvent, dR, dTheta);
970 if (cGtheta.Rho2() > 100.) break;
973 fHist1[theta]->Fill(dR,cGtheta); //fill real and imaginary part of cGtheta
984 //-----------------------------------------------------------------------
985 Bool_t AliFlowAnalysisWithLeeYangZeros::SecondFillFromFlowEvent(AliFlowEventSimple* anEvent)
987 //for differential flow
989 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::SecondFillFromFlowEvent()****"<<endl;
992 cout<<"##### FlowLeeYangZero: FlowEvent pointer null"<<endl;
997 TComplex cExpo, cDenom, cNumerRP, cNumerPOI, cCosTermComplex;
998 Double_t dPhi, dEta, dPt;
1000 Double_t dCosTermRP = 0.;
1001 Double_t dCosTermPOI = 0.;
1003 Double_t dOrder = 2.;
1004 Int_t iNtheta = AliFlowLYZConstants::kTheta;
1008 AliFlowVector vQ = anEvent->GetQ();
1009 //weight by the multiplicity
1012 if (vQ.GetMult() != 0) {
1013 dQX = vQ.X()/vQ.GetMult();
1014 dQY = vQ.Y()/vQ.GetMult();
1018 //for chi calculation:
1020 fHistQsumforChi->SetBinContent(1,fQsum->X());
1021 fHistQsumforChi->SetBinContent(2,fQsum->Y());
1022 fQ2sum += vQ.Mod2();
1023 fHistQsumforChi->SetBinContent(3,fQ2sum);
1025 for (Int_t theta=0;theta<iNtheta;theta++)
1027 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi()/dOrder;
1029 //calculate dQtheta = cos(dOrder*(dPhi-dTheta);the projection of the Q vector on the reference direction dTheta
1030 Double_t dQtheta = GetQtheta(vQ, dTheta);
1031 //cerr<<"dQtheta for fdenom = "<<dQtheta<<endl;
1033 //denominator for differential v
1034 if (fHistProR0theta) {
1035 dR0 = fHistProR0theta->GetBinContent(theta+1);
1038 cout <<"pointer fHistProR0theta does not exist" << endl;
1040 //cerr<<"dR0 = "<<dR0 <<endl;
1042 if (fUseSum) //sum generating function
1044 cExpo(0.,dR0*dQtheta);
1045 cDenom = dQtheta*(TComplex::Exp(cExpo)); //BP eq 12
1046 //loop over tracks in event
1047 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
1048 for (Int_t i=0;i<iNumberOfTracks;i++) {
1049 AliFlowTrackSimple* pTrack = anEvent->GetTrack(i);
1051 dEta = pTrack->Eta();
1053 dPhi = pTrack->Phi();
1054 if (pTrack->InRPSelection()) { // RP selection
1055 dCosTermRP = cos(m*dOrder*(dPhi-dTheta));
1056 cNumerRP = dCosTermRP*(TComplex::Exp(cExpo));
1057 if (cNumerRP.Rho()==0) {cerr<<"WARNING: modulus of cNumerRP is zero in SecondFillFromFlowEvent"<<endl;}
1058 if (fDebug) cerr<<"modulus of cNumerRP is "<<cNumerRP.Rho()<<endl;
1059 if (fHist2RP[theta]) {
1060 fHist2RP[theta]->Fill(dEta,dPt,cNumerRP); }
1062 if (pTrack->InPOISelection()) { //POI selection
1063 dCosTermPOI = cos(m*dOrder*(dPhi-dTheta));
1064 cNumerPOI = dCosTermPOI*(TComplex::Exp(cExpo));
1065 if (cNumerPOI.Rho()==0) {cerr<<"WARNING: modulus of cNumerPOI is zero in SecondFillFromFlowEvent"<<endl;}
1066 if (fDebug) cerr<<"modulus of cNumerPOI is "<<cNumerPOI.Rho()<<endl;
1067 if (fHist2POI[theta]) {
1068 fHist2POI[theta]->Fill(dEta,dPt,cNumerPOI); }
1071 // cout << "fHist2 pointer mising" <<endl;
1074 else {cerr << "no particle!!!"<<endl;}
1075 } //loop over tracks
1078 else //product generating function
1080 cDenom = GetDiffFlow(anEvent, dR0, theta);
1083 if (fHistProReDenom && fHistProImDenom) {
1084 fHistProReDenom->Fill(theta,cDenom.Re()); //fill the real part of fDenom
1085 fHistProImDenom->Fill(theta,cDenom.Im()); //fill the imaginary part of fDenom
1088 cout << "Pointers to cDenom mising" << endl;
1091 }//end of loop over theta
1097 //-----------------------------------------------------------------------
1098 Double_t AliFlowAnalysisWithLeeYangZeros::GetQtheta(AliFlowVector aQ, Double_t aTheta)
1100 //calculate Qtheta. Qtheta is the sum over all particles of cos(dOrder*(dPhi-dTheta)) BP eq. 3
1101 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetQtheta()****"<<endl;
1103 Double_t dQtheta = 0.;
1104 Double_t dOrder = 2.;
1106 dQtheta = aQ.X()*cos(dOrder*aTheta)+aQ.Y()*sin(dOrder*aTheta);
1113 //-----------------------------------------------------------------------
1114 TComplex AliFlowAnalysisWithLeeYangZeros::GetGrtheta(AliFlowEventSimple* const anEvent, Double_t aR, Double_t aTheta)
1116 // Product Generating Function for LeeYangZeros method
1117 // PG Eq. 3 (J. Phys. G Nucl. Part. Phys 30 S1213 (2004))
1119 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetGrtheta()****"<<endl;
1122 TComplex cG = TComplex::One();
1123 Double_t dOrder = 2.;
1124 Double_t dWgt = 1./anEvent->GetEventNSelTracksRP(); //weight with the multiplicity
1126 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
1128 for (Int_t i=0;i<iNumberOfTracks;i++) //loop over tracks in event
1130 AliFlowTrackSimple* pTrack = anEvent->GetTrack(i) ;
1132 if (pTrack->InRPSelection()) {
1133 Double_t dPhi = pTrack->Phi();
1134 Double_t dGIm = aR * dWgt*cos(dOrder*(dPhi - aTheta));
1135 TComplex cGi(1., dGIm);
1136 cG *= cGi; //product over all tracks
1139 else {cerr << "no particle pointer !!!"<<endl;}
1147 //-----------------------------------------------------------------------
1148 TComplex AliFlowAnalysisWithLeeYangZeros::GetDiffFlow(AliFlowEventSimple* const anEvent, Double_t aR0, Int_t theta)
1150 // Sum for the denominator for diff. flow for the Product Generating Function for LeeYangZeros method
1151 // PG Eq. 9 (J. Phys. G Nucl. Part. Phys 30 S1213 (2004))
1152 // Also for v1 mixed harmonics: DF Eq. 5
1153 // It is the deriverative of Grtheta at r0 divided by Grtheta at r0
1155 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetGrtheta()****"<<endl;
1157 TComplex cG = TComplex::One();
1158 TComplex cdGr0(0.,0.);
1159 Double_t dOrder = 2.;
1162 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
1164 Int_t iNtheta = AliFlowLYZConstants::kTheta;
1165 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi()/dOrder;
1167 //for the denominator (use all RP selected particles)
1168 for (Int_t i=0;i<iNumberOfTracks;i++) //loop over tracks in event
1170 AliFlowTrackSimple* pTrack = anEvent->GetTrack(i) ;
1172 if (pTrack->InRPSelection()) {
1173 Double_t dPhi = pTrack->Phi();
1174 Double_t dCosTerm = dWgt*cos(dOrder*(dPhi - dTheta));
1176 Double_t dGIm = aR0 * dCosTerm;
1177 TComplex cGi(1., dGIm);
1178 TComplex cCosTermComplex(1., aR0*dCosTerm);
1179 cG *= cGi; //product over all tracks
1181 cdGr0 +=(dCosTerm / cCosTermComplex); //sum over all tracks
1184 else {cerr << "no particle!!!"<<endl;}
1188 for (Int_t i=0;i<iNumberOfTracks;i++)
1190 AliFlowTrackSimple* pTrack = anEvent->GetTrack(i) ;
1192 Double_t dEta = pTrack->Eta();
1193 Double_t dPt = pTrack->Pt();
1194 Double_t dPhi = pTrack->Phi();
1195 Double_t dCosTerm = cos(dOrder*(dPhi-dTheta));
1196 TComplex cCosTermComplex(1.,aR0*dCosTerm);
1198 if (pTrack->InRPSelection()) {
1199 TComplex cNumerRP = cG*dCosTerm/cCosTermComplex; //PG Eq. 9
1200 fHist2RP[theta]->Fill(dEta,dPt,cNumerRP);
1203 if (pTrack->InPOISelection()) {
1204 TComplex cNumerPOI = cG*dCosTerm/cCosTermComplex; //PG Eq. 9
1205 fHist2POI[theta]->Fill(dEta,dPt,cNumerPOI);
1208 else {cerr << "no particle pointer!!!"<<endl;}
1211 TComplex cDenom = cG*cdGr0;
1216 //-----------------------------------------------------------------------