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 **************************************************************************/
17 #include "Riostream.h" //needed as include
18 #include "AliFlowCommonConstants.h" //needed as include
19 #include "AliFlowLYZConstants.h" //needed as include
20 #include "AliFlowAnalysisWithLeeYangZeros.h"
21 #include "AliFlowLYZHist1.h" //needed as include
22 #include "AliFlowLYZHist2.h" //needed as include
23 #include "AliFlowCommonHist.h" //needed as include
24 #include "AliFlowCommonHistResults.h" //needed as include
25 #include "AliFlowEventSimple.h" //needed as include
26 #include "AliFlowTrackSimple.h" //needed as include
30 #include "TMath.h" //needed as include
31 #include "TFile.h" //needed as include
39 //Description: Maker to analyze Flow using the LeeYangZeros method
40 // Equation numbers are from Big Paper (BP): Nucl. Phys. A 727, 373 (2003)
41 // Practical Guide (PG): J. Phys. G: Nucl. Part. Phys. 30, S1213 (2004)
42 // Adapted from StFlowLeeYangZerosMaker.cxx
43 // by Markus Oldenberg and Art Poskanzer, LBNL
44 // with advice from Jean-Yves Ollitrault and Nicolas Borghini
46 //Author: Naomi van der Kolk (kolk@nikhef.nl)
50 ClassImp(AliFlowAnalysisWithLeeYangZeros)
52 //-----------------------------------------------------------------------
54 AliFlowAnalysisWithLeeYangZeros::AliFlowAnalysisWithLeeYangZeros():
85 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::AliFlowAnalysisWithLeeYangZeros default constructor****"<<endl;
87 // output file (histograms)
88 TString fHistFileName = "outputFromLYZAnalysis.root" ;
90 for(Int_t i = 0;i<5;i++)
102 //-----------------------------------------------------------------------
105 AliFlowAnalysisWithLeeYangZeros::~AliFlowAnalysisWithLeeYangZeros()
108 if (fDebug) cout<<"****~AliFlowAnalysisWithLeeYangZeros****"<<endl;
112 //-----------------------------------------------------------------------
114 Bool_t AliFlowAnalysisWithLeeYangZeros::Init()
117 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Init()****"<<endl;
119 // Open output files (->plots)
120 fHistFile = new TFile(fHistFileName.Data(), "RECREATE");
124 Int_t fNtheta = AliFlowLYZConstants::kTheta;
125 Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt();
126 Int_t fNbinsEta = AliFlowCommonConstants::GetNbinsEta();
128 Double_t fPtMin = AliFlowCommonConstants::GetPtMin();
129 Double_t fPtMax = AliFlowCommonConstants::GetPtMax();
130 Double_t fEtaMin = AliFlowCommonConstants::GetEtaMin();
131 Double_t fEtaMax = AliFlowCommonConstants::GetEtaMax();
134 //for control histograms
135 fCommonHists = new AliFlowCommonHist("LYZ");
136 fCommonHistsRes = new AliFlowCommonHistResults("LYZ");
138 //for first loop over events
140 fHistProR0theta = new TProfile("First_FlowPro_r0theta_LYZ","First_FlowPro_r0theta_LYZ",fNtheta,-0.5,fNtheta-0.5);
141 fHistProR0theta->SetXTitle("#theta");
142 fHistProR0theta->SetYTitle("r_{0}^{#theta}");
144 fHistProVtheta = new TProfile("First_FlowPro_Vtheta_LYZ","First_FlowPro_Vtheta_LYZ",fNtheta,-0.5,fNtheta-0.5);
145 fHistProVtheta->SetXTitle("#theta");
146 fHistProVtheta->SetYTitle("V_{n}^{#theta}");
148 //class AliFlowLYZHist1 defines the histograms: fHistProGtheta, fHistProReGtheta, fHistProImGtheta, fHistProR0theta
149 for (Int_t theta=0;theta<fNtheta;theta++) {
150 fHist1[theta]=new AliFlowLYZHist1(theta);
154 //for second loop over events
156 fHistProReDenom = new TProfile("Second_FlowPro_ReDenom_LYZ","Second_FlowPro_ReDenom_LYZ" , fNtheta, -0.5, fNtheta-0.5);
157 fHistProReDenom->SetXTitle("#theta");
158 fHistProReDenom->SetYTitle("Re(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
160 fHistProImDenom = new TProfile("Second_FlowPro_ImDenom_LYZ","Second_FlowPro_ImDenom_LYZ" , fNtheta, -0.5, fNtheta-0.5);
161 fHistProImDenom->SetXTitle("#theta");
162 fHistProImDenom->SetYTitle("Im(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
164 fHistProVeta = new TProfile("Second_FlowPro_Veta_LYZ","Second_FlowPro_Veta_LYZ",fNbinsEta,fEtaMin,fEtaMax);
165 fHistProVeta->SetXTitle("rapidity");
166 fHistProVeta->SetYTitle("v (%)");
168 fHistProVPt = new TProfile("Second_FlowPro_VPt_LYZ","Second_FlowPro_VPt_LYZ",fNbinsPt,fPtMin,fPtMax);
169 fHistProVPt->SetXTitle("Pt");
170 fHistProVPt->SetYTitle("v (%)");
172 fHistProReDtheta = new TProfile("Second_FlowPro_ReDtheta_LYZ","Second_FlowPro_ReDtheta_LYZ",fNtheta, -0.5, fNtheta-0.5);
173 fHistProReDtheta->SetXTitle("#theta");
174 fHistProReDtheta->SetYTitle("Re(D^{#theta})");
176 fHistProImDtheta = new TProfile("Second_FlowPro_ImDtheta_LYZ","Second_FlowPro_ImDtheta_LYZ",fNtheta, -0.5, fNtheta-0.5);
177 fHistProImDtheta->SetXTitle("#theta");
178 fHistProImDtheta->SetYTitle("Im(D^{#theta})");
180 //class AliFlowLYZHist2 defines the histograms:
181 for (Int_t theta=0;theta<fNtheta;theta++) {
182 fHist2[theta]=new AliFlowLYZHist2(theta);
185 //read hists from first run file
186 //firstRunFile = new TFile("fof_flowLYZAnal_firstrun.root","READ"); //default is read
187 if (firstRunFile->IsZombie()){ //check if file exists
188 cout << "Error opening file, run first with fFirstrun = kTRUE" << endl;
190 } else if (firstRunFile->IsOpen()){
191 cout<<"----firstRunFile is open----"<<endl<<endl;
192 fHistProR0theta = (TProfile*)firstRunFile->Get("First_FlowPro_r0theta_LYZ");
197 if (fDebug) cout<<"****Histograms initialised****"<<endl;
199 fEventNumber = 0; //set event counter to zero
204 //-----------------------------------------------------------------------
206 Bool_t AliFlowAnalysisWithLeeYangZeros::Make(AliFlowEventSimple* fEvent)
209 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Make()****"<<endl;
211 //get tracks from event
214 fCommonHists->FillControlHistograms(fEvent);
215 FillFromFlowEvent(fEvent);
218 fCommonHists->FillControlHistograms(fEvent);
219 SecondFillFromFlowEvent(fEvent);
224 cout<<"##### FlowLeeYangZero: Stack pointer null"<<endl;
227 cout<<"^^^^read event "<<fEventNumber<<endl;
235 //-----------------------------------------------------------------------
236 Bool_t AliFlowAnalysisWithLeeYangZeros::Finish()
239 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Finish()****"<<endl;
241 //define variables for both runs
242 Double_t fJ01 = 2.405;
243 Int_t fNtheta = AliFlowLYZConstants::kTheta;
247 Double_t fVtheta = 0;
250 for (Int_t theta=0;theta<fNtheta;theta++)
252 //get the first minimum r0
253 fHist1[theta]->FillGtheta();
254 fR0 = fHist1[theta]->GetR0();
256 //calculate integrated flow
257 if (fR0!=0) fVtheta = fJ01/fR0;
258 //for estimating systematic error resulting from r0
259 Double_t binsize = (AliFlowLYZConstants::fgMax)/(AliFlowLYZConstants::kNbins);
260 Double_t fVplus = fJ01/(fR0+binsize);
261 Double_t fVmin = fJ01/(fR0-binsize);
263 Double_t fvplus = fVplus;
264 Double_t fvmin = fVmin;
265 cout<<"fv = "<<fv<<" and fvplus = "<<fvplus<< " and fvmin = "<<fvmin<<endl;
267 //fill the histograms
268 fHistProR0theta->Fill(theta,fR0);
269 fHistProVtheta->Fill(theta,fVtheta);
270 //get average value of fVtheta = fV
272 } //end of loop over theta
274 //get average value of fVtheta = fV
278 Double_t fSigma2 = 0;
280 if (fEventNumber!=0) {
281 fQsum /= fEventNumber;
282 fQ2sum /= fEventNumber;
283 fSigma2 = fQ2sum - TMath::Power(fQsum.X(),2.) - TMath::Power(fQsum.Y(),2.) - TMath::Power(fV,2.); //BP eq. 62
284 if (fSigma2>0) fChi = fV/TMath::Sqrt(fSigma2);
286 fCommonHistsRes->FillChi(fChi);
287 cout<<"fV = "<<fV<<" and chi = "<<fChi<<endl;
290 // recalculate statistical errors on integrated flow
291 //combining 5 theta angles to 1 relative error BP eq. 89
292 Double_t fRelErr2comb = 0.;
293 Int_t nEvts = fEventNumber;
294 for (Int_t theta=0;theta<fNtheta;theta++){
295 Double_t fTheta = ((double)theta/fNtheta)*TMath::Pi();
296 Double_t fApluscomb = TMath::Exp((fJ01*fJ01)/(2*fChi*fChi)*
298 Double_t fAmincomb = TMath::Exp(-(fJ01*fJ01)/(2*fChi*fChi)*
300 fRelErr2comb += (1/(2*nEvts*(fJ01*fJ01)*TMath::BesselJ1(fJ01)*
301 TMath::BesselJ1(fJ01)))*
302 (fApluscomb*TMath::BesselJ0(2*fJ01*TMath::Sin(fTheta/2)) +
303 fAmincomb*TMath::BesselJ0(2*fJ01*TMath::Cos(fTheta/2)));
305 fRelErr2comb /= fNtheta;
306 Double_t fRelErrcomb = TMath::Sqrt(fRelErr2comb);
307 cout<<"fRelErrcomb = "<<fRelErrcomb<<endl;
309 //copy content of profile into TH1D and add error
310 Double_t fv2pro = fV; //in the case that fv is equal to fV
311 Double_t fv2Err = fv2pro*fRelErrcomb ;
312 cout<<"fv2pro +- fv2Err = "<<fv2pro<<" +- "<<fv2Err<<endl;
313 fCommonHistsRes->FillIntegratedFlow(fv2pro, fv2Err);
316 if (fDebug) cout<<"****histograms filled****"<<endl;
318 //save histograms in file //temp for testing selector
323 fEventNumber =0; //set to zero for second round over events
329 //calculate differential flow
331 TComplex fDenom, fNumer, fDtheta;
333 TComplex i = TComplex::I();
334 Double_t fBesselRatio[3] = {1., 1.202, 2.69};
335 Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt();
336 Int_t fNbinsEta = AliFlowCommonConstants::GetNbinsEta();
338 Double_t fEta, fPt, fReRatio, fVeta, fVPt;
342 Double_t fVtheta = 0.;
344 Double_t fReDenom = 0.;
345 Double_t fImDenom = 0.;
346 for (Int_t theta=0;theta<fNtheta;theta++) { //loop over theta
347 if (fHistProR0theta) {
348 fR0 = fHistProR0theta->GetBinContent(theta+1);
349 if (fDebug) cerr<<"fR0 = "<<fR0<<endl;
350 if (fR0!=0) fVtheta = fJ01/fR0;
352 // BP Eq. 9 -> Vn^theta = j01/r0^theta
353 if (fHistProReDenom && fHistProImDenom) {
354 fReDenom = fHistProReDenom->GetBinContent(theta+1);
355 fImDenom = fHistProImDenom->GetBinContent(theta+1);
358 cout << "Hist pointer fDenom in file does not exist" <<endl;
363 cout << "Hist pointer R0theta in file does not exist" <<endl;
365 //} //loop over theta
367 fDenom(fReDenom,fImDenom);
370 //for new method and use by others (only with the sum generating function):
372 fR0 = fHistProR0theta->GetBinContent(theta+1);
373 fDtheta = fR0*fDenom/fJ01;
374 fHistProReDtheta->Fill(theta,fDtheta.Re());
375 fHistProImDtheta->Fill(theta,fDtheta.Im());
378 fDenom *= TComplex::Power(i, m-1);
379 //cerr<<"TComplex::Power(i, m-1) = "<<TComplex::Power(i, m-1).Rho()<<endl; //checked ok
381 //v as a function of eta
382 for (Int_t be=1;be<=fNbinsEta;be++) {
383 fEta = fHist2[theta]->GetBinCenter(be);
384 fNumer = fHist2[theta]->GetfNumer(be);
385 if (fNumer.Rho()==0) {
386 if (fDebug) cerr<<"WARNING: modulus of fNumer is zero in Finish()"<<endl;
389 else if (fDenom.Rho()==0) {
390 if (fDebug) cerr<<"WARNING: modulus of fDenom is zero"<<endl;
394 //if ( j==1 && theta==0) cerr<<"modulus of fNumer = "<<fNumer.Rho() <<endl; //always a number smaller than 1, or 0.
395 fReRatio = (fNumer/fDenom).Re();
398 fVeta = fBesselRatio[m-1]*fReRatio*fVtheta*100.; //BP eq. 12
399 //if ( j==1 && theta==0) cerr<<"eta = "<<fEta<<" cerr::fReRatio for eta = "<<fReRatio<<" cerr::fVeta for eta = "<<fVeta<<endl;
401 fHistProVeta->Fill(fEta,fVeta);
402 } //loop over bins be
404 //v as a function of Pt
405 Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt();
406 for (Int_t bp=1;bp<=fNbinsPt;bp++) {
407 fPt = fHist2[theta]->GetBinCenterPt(bp);
408 fNumer = fHist2[theta]->GetfNumerPt(bp);
409 if (fNumer.Rho()==0) {
410 if (fDebug) cerr<<"modulus of fNumer is zero"<<endl;
413 else if (fDenom.Rho()==0) {
414 if (fDebug) cerr<<"modulus of fDenom is zero"<<endl;
418 //if ( j==1 && theta==0) cerr<<"modulus of fNumer = "<<fNumer.Rho() <<endl; //always a number smaller than 1, or 0.
419 fReRatio = (fNumer/fDenom).Re();
422 fVPt = fBesselRatio[m-1]*fReRatio*fVtheta*100.; //BP eq. 12
424 fHistProVPt->Fill(fPt,fVPt);
425 } //loop over bins bp
427 }//end of loop over theta
429 //calculate the average of fVtheta = fV
432 //sigma2 and chi (for statistical error calculations)
433 Double_t fSigma2 = 0;
435 if (fEventNumber!=0) {
436 fQsum /= fEventNumber;
437 //cerr<<"fQsum.X() = "<<fQsum.X()<<endl;
438 //cerr<<"fQsum.Y() = "<<fQsum.Y()<<endl;
439 fQ2sum /= fEventNumber;
440 //cout<<"fQ2sum = "<<fQ2sum<<endl;
441 fSigma2 = fQ2sum - TMath::Power(fQsum.X(),2.) - TMath::Power(fQsum.Y(),2.) - TMath::Power(fV,2.); //BP eq. 62
442 if (fSigma2>0) fChi = fV/TMath::Sqrt(fSigma2);
444 fCommonHistsRes->FillChi(fChi);
445 cout<<"fV = "<<fV<<" and chi = "<<fChi<<endl;
448 //copy content of profile into TH1D and add error
449 for(Int_t b=0;b<fNbinsPt;b++) {
450 Double_t fv2pro = fHistProVPt->GetBinContent(b);
451 Double_t fNprime = fCommonHists->GetEntriesInPtBin(b);
452 Double_t fErrdifcomb = 0.; //set error to zero
453 Double_t fErr2difcomb = 0.; //set error to zero
456 for (Int_t theta=0;theta<fNtheta;theta++) {
457 Double_t fTheta = ((double)theta/fNtheta)*TMath::Pi();
458 Double_t fApluscomb = TMath::Exp((fJ01*fJ01)/(2*fChi*fChi)*
460 Double_t fAmincomb = TMath::Exp(-(fJ01*fJ01)/(2*fChi*fChi)*
462 fErr2difcomb += (TMath::Cos(fTheta)/(4*fNprime*TMath::BesselJ1(fJ01)*
463 TMath::BesselJ1(fJ01)))*
464 ((fApluscomb*TMath::BesselJ0(2*fJ01*TMath::Sin(fTheta/2))) -
465 (fAmincomb*TMath::BesselJ0(2*fJ01*TMath::Cos(fTheta/2))));
469 if (fErr2difcomb!=0.) {
470 fErr2difcomb /= fNtheta;
471 fErrdifcomb = TMath::Sqrt(fErr2difcomb)*100;
472 //cerr<<"fErrdifcomb = "<<fErrdifcomb<<endl;
474 else {fErrdifcomb = 0.;}
477 fCommonHistsRes->FillDifferentialFlow(b, fv2pro, fErrdifcomb);
481 //save histograms in file
485 //Note that when the file is closed, all histograms and Trees in memory associated with this file are deleted
486 if (fDebug) cout<<"****Histograms saved and fHistFile closed, all histograms deleted****"<<endl;
488 //close the first run file
489 firstRunFile->Close();
494 cout<<"----LYZ analysis finished....----"<<endl<<endl;
500 //-----------------------------------------------------------------------
502 Bool_t AliFlowAnalysisWithLeeYangZeros::FillFromFlowEvent(AliFlowEventSimple* fEvent)
504 // Get event quantities from AliFlowEvent for all particles
506 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::FillFromFlowEvent()****"<<endl;
509 cout<<"##### FlowLeeYangZero: FlowEvent pointer null"<<endl;
514 TComplex fExpo, fGtheta, fGthetaNew, fZ;
515 Int_t fNtheta = AliFlowLYZConstants::kTheta;
516 Int_t fNbins = AliFlowLYZConstants::kNbins;
520 Double_t fOrder = 2.;
524 //weight by the multiplicity
527 if (fQ.GetMult() != 0) {
528 fQX = fQ.X()/fQ.GetMult();
529 fQY = fQ.Y()/fQ.GetMult();
532 //for chi calculation:
535 //cerr<<"fQ2sum = "<<fQ2sum<<endl;
537 for (Int_t theta=0;theta<fNtheta;theta++)
539 fTheta = ((double)theta/fNtheta)*TMath::Pi()/fOrder;
541 //calculate fQtheta = cos(fOrder*(fPhi-fTheta);the projection of the Q vector on the reference direction fTheta
542 fQtheta = GetQtheta(fQ, fTheta);
544 for (Int_t bin=1;bin<=fNbins;bin++)
546 Double_t fR = fHist1[theta]->GetBinCenter(bin); //bincentre of bins in histogram //FIXED???
547 //if (theta == 0) cerr<<"cerr::fR = "<<fR<<endl;
550 //calculate the sum generating function
551 fExpo(0.,fR*fQtheta); //Re=0 ; Im=fR*fQtheta
552 fGtheta = TComplex::Exp(fExpo);
556 //calculate the product generating function
557 fGtheta = GetGrtheta(fEvent, fR, fTheta); //make this function
558 if (fGtheta.Rho2() > 100.) break;
561 fHist1[theta]->Fill(fR,fGtheta); //fill real and imaginary part of fGtheta
572 //-----------------------------------------------------------------------
573 Bool_t AliFlowAnalysisWithLeeYangZeros::SecondFillFromFlowEvent(AliFlowEventSimple* fEvent)
575 //for differential flow
577 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::SecondFillFromFlowEvent()****"<<endl;
580 cout<<"##### FlowLeeYangZero: FlowEvent pointer null"<<endl;
586 TComplex fExpo, fDenom, fNumer,fCosTermComplex;
587 Double_t fOrder, fPhi, fEta, fPt;
591 Int_t fNtheta = AliFlowLYZConstants::kTheta;
598 //weight by the multiplicity
601 if (fQ.GetMult() != 0) {
602 fQX = fQ.X()/fQ.GetMult();
603 fQY = fQ.Y()/fQ.GetMult();
606 //for chi calculation:
610 for (Int_t theta=0;theta<fNtheta;theta++)
612 fTheta = ((double)theta/fNtheta)*TMath::Pi()/fOrder;
614 //calculate fQtheta = cos(fOrder*(fPhi-fTheta);the projection of the Q vector on the reference direction fTheta
615 fQtheta = GetQtheta(fQ, fTheta);
616 //cerr<<"fQtheta for fdenom = "<<fQtheta<<endl;
618 //denominator for differential v
619 if (fHistProR0theta) {
620 fR0 = fHistProR0theta->GetBinContent(theta+1);
623 cout <<"pointer fHistProR0Theta does not exist" << endl;
625 //cerr<<"fR0 = "<<fR0 <<endl;
627 if (fUseSum) //sum generating function
629 fExpo(0.,fR0*fQtheta);
630 fDenom = fQtheta*(TComplex::Exp(fExpo)); //BP eq 12
631 //loop over tracks in event
632 Int_t fNumberOfTracks = fEvent->NumberOfTracks();
633 for (Int_t i=0;i<fNumberOfTracks;i++) {
634 fTrack = fEvent->GetTrack(i);
636 if (fTrack->UseForDifferentialFlow()) {
637 fEta = fTrack->Eta();
639 fPhi = fTrack->Phi();
640 fCosTerm = cos(m*fOrder*(fPhi-fTheta));
641 //cerr<<"fCosTerm = "<<fCosTerm <<endl;
642 fNumer = fCosTerm*(TComplex::Exp(fExpo));
643 if (fNumer.Rho()==0) {cerr<<"WARNING: modulus of fNumer is zero in SecondFillFromFlowEvent"<<endl;}
644 if (fDebug) cerr<<"modulus of fNumer is "<<fNumer.Rho()<<endl;
646 fHist2[theta]->Fill(fEta,fPt,fNumer);
649 cout << "fHist2 pointer mising" <<endl;
653 else {cerr << "no particle!!!"<<endl;}
657 else //product generating function
659 fDenom = GetDiffFlow(fEvent, fR0, theta);
662 if (fHistProReDenom && fHistProImDenom) {
663 fHistProReDenom->Fill(theta,fDenom.Re()); //fill the real part of fDenom
664 fHistProImDenom->Fill(theta,fDenom.Im()); //fill the imaginary part of fDenom
667 cout << "Pointers to fDenom mising" << endl;
670 }//end of loop over theta
676 //-----------------------------------------------------------------------
677 Double_t AliFlowAnalysisWithLeeYangZeros::GetQtheta(TVector2 fQ, Double_t fTheta)
679 //calculate Qtheta. Qtheta is the sum over all particles of cos(fOrder*(fPhi-fTheta)) BP eq. 3
680 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetQtheta()****"<<endl;
682 Double_t fQtheta = 0.;
683 Double_t fOrder = 2.;
685 fQtheta = fQ.X()*cos(fOrder*fTheta)+fQ.Y()*sin(fOrder*fTheta);
692 //-----------------------------------------------------------------------
693 TComplex AliFlowAnalysisWithLeeYangZeros::GetGrtheta(AliFlowEventSimple* fEvent, Double_t fR, Double_t fTheta)
695 // Product Generating Function for LeeYangZeros method
696 // PG Eq. 3 (J. Phys. G Nucl. Part. Phys 30 S1213 (2004))
698 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetGrtheta()****"<<endl;
701 TComplex fG = TComplex::One();
702 Double_t fOrder = 2.;
705 Int_t fNumberOfTracks = fEvent->NumberOfTracks();
707 for (Int_t i=0;i<fNumberOfTracks;i++) //loop over tracks in event
709 fTrack = fEvent->GetTrack(i) ;
711 if (fTrack->UseForIntegratedFlow()) {
712 Double_t fPhi = fTrack->Phi();
713 Double_t fGIm = fR * fWgt*cos(fOrder*(fPhi - fTheta));
714 TComplex fGi(1., fGIm);
715 fG *= fGi; //product over all tracks
718 else {cerr << "no particle pointer !!!"<<endl;}
726 //-----------------------------------------------------------------------
727 TComplex AliFlowAnalysisWithLeeYangZeros::GetDiffFlow(AliFlowEventSimple* fEvent, Double_t fR0, Int_t theta)
729 // Sum for the denominator for diff. flow for the Product Generating Function for LeeYangZeros method
730 // PG Eq. 9 (J. Phys. G Nucl. Part. Phys 30 S1213 (2004))
731 // Also for v1 mixed harmonics: DF Eq. 5
732 // It is the deriverative of Grtheta at r0 divided by Grtheta at r0
734 if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::GetGrtheta()****"<<endl;
736 TComplex fG = TComplex::One();
737 TComplex fdGr0(0.,0.);
738 Double_t fOrder = 2.;
741 Int_t fNumberOfTracks = fEvent->NumberOfTracks();
743 Int_t fNtheta = AliFlowLYZConstants::kTheta;
744 Double_t fTheta = ((double)theta/fNtheta)*TMath::Pi()/fOrder;
746 for (Int_t i=0;i<fNumberOfTracks;i++) //loop over tracks in event
748 fTrack = fEvent->GetTrack(i) ;
750 if (fTrack->UseForDifferentialFlow()) {
751 Double_t fPhi = fTrack->Phi();
752 Double_t fCosTerm = fWgt*cos(fOrder*(fPhi - fTheta));
754 Double_t fGIm = fR0 * fCosTerm;
755 TComplex fGi(1., fGIm);
756 fG *= fGi; //product over all tracks
758 TComplex fCosTermComplex(1., fR0*fCosTerm);
759 fdGr0 +=(fCosTerm / fCosTermComplex); //sum over all tracks
762 else {cerr << "no particle!!!"<<endl;}
766 for (Int_t i=0;i<fNumberOfTracks;i++)
768 fTrack = fEvent->GetTrack(i) ;
770 if (fTrack->UseForDifferentialFlow()) {
771 Double_t fEta = fTrack->Eta();
772 Double_t fPt = fTrack->Pt();
773 Double_t fPhi = fTrack->Phi();
774 Double_t fCosTerm = cos(fOrder*(fPhi-fTheta));
775 TComplex fCosTermComplex(1.,fR0*fCosTerm);
776 TComplex fNumer = fG*fCosTerm/fCosTermComplex; //PG Eq. 9
777 fHist2[theta]->Fill(fEta,fPt,fNumer);
780 else {cerr << "no particle pointer!!!"<<endl;}
783 TComplex fDenom = fG*fdGr0;
788 //-----------------------------------------------------------------------