1 /*************************************************************************
2 * Copyright(c) 1998-2008, 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 **************************************************************************/
20 //#define AliFlowAnalysisWithLYZEventPlane_cxx
22 #include "Riostream.h" //needed as include
23 #include "TComplex.h" //needed as include
24 #include "TProfile.h" //needed as include
31 #include "AliFlowLYZConstants.h" //needed as include
32 #include "AliFlowCommonConstants.h" //needed as include
33 #include "AliFlowEventSimple.h"
34 #include "AliFlowTrackSimple.h"
35 #include "AliFlowCommonHist.h"
36 #include "AliFlowCommonHistResults.h"
37 #include "AliFlowLYZEventPlane.h"
38 #include "AliFlowAnalysisWithLYZEventPlane.h"
42 // AliFlowAnalysisWithLYZEventPlane:
44 // Class to do flow analysis with the event plane from the LYZ method
46 // author: N. van der Kolk (kolk@nikhef.nl)
49 ClassImp(AliFlowAnalysisWithLYZEventPlane)
51 //-----------------------------------------------------------------------
53 AliFlowAnalysisWithLYZEventPlane::AliFlowAnalysisWithLYZEventPlane():
56 fSecondReDtheta(NULL),
57 fSecondImDtheta(NULL),
60 fHistProVetaPOI(NULL),
65 fHistQsumforChi(NULL),
68 fHistDeltaPhihere(NULL),
74 fCommonHistsRes(NULL),
81 fQsum = new TVector2(); // flow vector sum
83 fHistList = new TList();
84 fSecondRunList = new TList();
89 //-----------------------------------------------------------------------
92 AliFlowAnalysisWithLYZEventPlane::~AliFlowAnalysisWithLYZEventPlane()
97 delete fSecondRunList;
101 //-----------------------------------------------------------------------
103 void AliFlowAnalysisWithLYZEventPlane::WriteHistograms(TString* outputFileName)
105 //store the final results in output .root file
107 TFile *output = new TFile(outputFileName->Data(),"RECREATE");
108 //output->WriteObject(fHistList, "cobjLYZEP","SingleKey");
109 fHistList->SetName("cobjLYZEP");
110 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
114 //-----------------------------------------------------------------------
116 void AliFlowAnalysisWithLYZEventPlane::WriteHistograms(TString outputFileName)
118 //store the final results in output .root file
120 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
121 //output->WriteObject(fHistList, "cobjLYZEP","SingleKey");
122 fHistList->SetName("cobjLYZEP");
123 fHistList->Write(fHistList->GetName(), TObject::kSingleKey);
127 //-----------------------------------------------------------------------
128 void AliFlowAnalysisWithLYZEventPlane::Init() {
130 //Initialise all histograms
131 cout<<"---Analysis with Lee Yang Zeros Event Plane Method---"<<endl;
134 if (fSecondRunList) {
135 fSecondReDtheta = (TProfile*)fSecondRunList->FindObject("Second_FlowPro_ReDtheta_LYZ");
136 fHistList->Add(fSecondReDtheta);
138 fSecondImDtheta = (TProfile*)fSecondRunList->FindObject("Second_FlowPro_ImDtheta_LYZ");
139 fHistList->Add(fSecondImDtheta);
141 fFirstr0theta = (TProfile*)fSecondRunList->FindObject("First_FlowPro_r0theta_LYZ");
142 fHistList->Add(fFirstr0theta);
145 if (!fSecondReDtheta) {cout<<"fSecondReDtheta is NULL!"<<endl; }
146 if (!fSecondImDtheta) {cout<<"fSecondImDtheta is NULL!"<<endl; }
147 if (!fFirstr0theta) {cout<<"fFirstr0theta is NULL!"<<endl; }
151 fCommonHists = new AliFlowCommonHist("AliFlowCommonHistLYZEP");
152 fHistList->Add(fCommonHists);
154 fCommonHistsRes = new AliFlowCommonHistResults("AliFlowCommonHistResultsLYZEP");
155 fHistList->Add(fCommonHistsRes);
157 Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
158 Int_t iNbinsEta = AliFlowCommonConstants::GetNbinsEta();
159 Double_t dPtMin = AliFlowCommonConstants::GetPtMin();
160 Double_t dPtMax = AliFlowCommonConstants::GetPtMax();
161 Double_t dEtaMin = AliFlowCommonConstants::GetEtaMin();
162 Double_t dEtaMax = AliFlowCommonConstants::GetEtaMax();
164 fHistProVetaRP = new TProfile("FlowPro_VetaRP_LYZEP","FlowPro_VetaRP_LYZEP",iNbinsEta,dEtaMin,dEtaMax);
165 fHistProVetaRP->SetXTitle("rapidity");
166 fHistProVetaRP->SetYTitle("v_{2}(#eta) for RP selection");
167 fHistList->Add(fHistProVetaRP);
169 fHistProVetaPOI = new TProfile("FlowPro_VetaPOI_LYZEP","FlowPro_VetaPOI_LYZEP",iNbinsEta,dEtaMin,dEtaMax);
170 fHistProVetaPOI->SetXTitle("rapidity");
171 fHistProVetaPOI->SetYTitle("v_{2}(#eta) for POI selection");
172 fHistList->Add(fHistProVetaPOI);
174 fHistProVPtRP = new TProfile("FlowPro_VPtRP_LYZEP","FlowPro_VPtRP_LYZEP",iNbinsPt,dPtMin,dPtMax);
175 fHistProVPtRP->SetXTitle("Pt");
176 fHistProVPtRP->SetYTitle("v_{2}(p_{T}) for RP selection");
177 fHistList->Add(fHistProVPtRP);
179 fHistProVPtPOI = new TProfile("FlowPro_VPtPOI_LYZEP","FlowPro_VPtPOI_LYZEP",iNbinsPt,dPtMin,dPtMax);
180 fHistProVPtPOI->SetXTitle("p_{T}");
181 fHistProVPtPOI->SetYTitle("v_{2}(p_{T}) for POI selection");
182 fHistList->Add(fHistProVPtPOI);
184 fHistProWr = new TProfile("FlowPro_Wr_LYZEP","FlowPro_Wr_LYZEP",100,0.,0.25);
185 fHistProWr->SetXTitle("Q");
186 fHistProWr->SetYTitle("Wr");
187 fHistList->Add(fHistProWr);
189 fHistQsumforChi = new TH1F("Flow_QsumforChi_LYZEP","Flow_QsumforChi_LYZEP",3,-1.,2.);
190 fHistQsumforChi->SetXTitle("Qsum.X , Qsum.Y, Q2sum");
191 fHistQsumforChi->SetYTitle("value");
192 fHistList->Add(fHistQsumforChi);
194 fHistDeltaPhi = new TH1F("Flow_DeltaPhi_LYZEP","Flow_DeltaPhi_LYZEP",100,0.,3.14);
195 fHistDeltaPhi->SetXTitle("DeltaPhi");
196 fHistDeltaPhi->SetYTitle("Counts");
197 fHistList->Add(fHistDeltaPhi);
199 fHistPhiLYZ = new TH1F("Flow_PhiLYZ_LYZEP","Flow_PhiLYZ_LYZEP",100,0.,3.14);
200 fHistPhiLYZ->SetXTitle("Phi from LYZ");
201 fHistPhiLYZ->SetYTitle("Counts");
202 fHistList->Add(fHistPhiLYZ);
204 fHistPhiEP = new TH1F("Flow_PhiEP_LYZEP","Flow_PhiEP_LYZEP",100,0.,3.14);
205 fHistPhiEP->SetXTitle("Phi from EP");
206 fHistPhiEP->SetYTitle("Counts");
207 fHistList->Add(fHistPhiEP);
209 fEventNumber = 0; //set number of events to zero
213 //-----------------------------------------------------------------------
215 void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* anEvent, AliFlowLYZEventPlane* aLYZEP) {
217 //Get the event plane and weight for each event
220 //fill control histograms
221 fCommonHists->FillControlHistograms(anEvent);
223 //get the Q vector from the FlowEvent
224 AliFlowVector vQ = anEvent->GetQ();
225 if (vQ.X()== 0. && vQ.Y()== 0. ) { cout<<"Q vector is NULL!"<<endl; }
226 //Weight with the multiplicity
229 if (vQ.GetMult()!=0.) {
230 dQX = vQ.X()/vQ.GetMult();
231 dQY = vQ.Y()/vQ.GetMult();
232 } else {cerr<<"vQ.GetMult() is zero!"<<endl; }
234 //cout<<"vQ("<<dQX<<","<<dQY<<")"<<endl;
236 //for chi calculation:
238 fHistQsumforChi->SetBinContent(1,fQsum->X());
239 fHistQsumforChi->SetBinContent(2,fQsum->Y());
241 fHistQsumforChi->SetBinContent(3,fQ2sum);
242 //cout<<"fQ2sum = "<<fQ2sum<<endl;
244 //call AliFlowLYZEventPlane::CalculateRPandW() here!
245 aLYZEP->CalculateRPandW(vQ);
247 Double_t dWR = aLYZEP->GetWR();
248 Double_t dRP = aLYZEP->GetPsi();
250 //fHistProWr->Fill(vQ.Mod(),dWR); //this weight is always positive
251 fHistPhiLYZ->Fill(dRP);
253 //plot difference between event plane from EP-method and LYZ-method
254 Double_t dRPEP = vQ.Phi()/2; //gives distribution from (0 to pi)
255 //Double_t dRPEP = 0.5*TMath::ATan2(vQ.Y(),vQ.X()); //gives distribution from (-pi/2 to pi/2)
256 //cout<<"dRPEP = "<< dRPEP <<endl;
257 fHistPhiEP->Fill(dRPEP);
259 Double_t dDeltaPhi = dRPEP - dRP;
260 if (dDeltaPhi < 0.) { dDeltaPhi += TMath::Pi(); } //to shift distribution from (-pi/2 to pi/2) to (0 to pi)
261 //cout<<"dDeltaPhi = "<<dDeltaPhi<<endl;
262 fHistDeltaPhi->Fill(dDeltaPhi);
265 Double_t dLow = TMath::Pi()/4.;
266 Double_t dHigh = 3.*(TMath::Pi()/4.);
267 if ((dDeltaPhi > dLow) && (dDeltaPhi < dHigh)){
268 dRP -= (TMath::Pi()/2);
270 cerr<<"*** dRP modified ***"<<endl;
272 fHistProWr->Fill(vQ.Mod(),dWR); //corrected weight
274 //calculate flow for RP and POI selections
275 //loop over the tracks of the event
276 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
277 for (Int_t i=0;i<iNumberOfTracks;i++)
279 AliFlowTrackSimple* pTrack = anEvent->GetTrack(i) ;
281 Double_t dPhi = pTrack->Phi();
282 //if (dPhi<0.) fPhi+=2*TMath::Pi();
283 Double_t dPt = pTrack->Pt();
284 Double_t dEta = pTrack->Eta();
286 Double_t dv2 = dWR * TMath::Cos(2*(dPhi-dRP));
287 if (pTrack->InRPSelection()) {
288 //fill histograms for RP selection
289 fHistProVetaRP -> Fill(dEta,dv2);
290 fHistProVPtRP -> Fill(dPt,dv2);
292 if (pTrack->InPOISelection()) {
293 //fill histograms for POI selection
294 fHistProVetaPOI -> Fill(dEta,dv2);
295 fHistProVPtPOI -> Fill(dPt,dv2);
301 // cout<<"@@@@@ "<<fEventNumber<<" events processed"<<endl;
305 //--------------------------------------------------------------------
306 void AliFlowAnalysisWithLYZEventPlane::GetOutputHistograms(TList *outputListHistos){
307 //get pointers to all output histograms (called before Finish())
308 if (outputListHistos) {
309 //Get the common histograms from the output list
310 AliFlowCommonHist *pCommonHist = dynamic_cast<AliFlowCommonHist*>
311 (outputListHistos->FindObject("AliFlowCommonHistLYZEP"));
312 AliFlowCommonHistResults *pCommonHistResults = dynamic_cast<AliFlowCommonHistResults*>
313 (outputListHistos->FindObject("AliFlowCommonHistResultsLYZEP"));
315 TProfile* pHistProR0theta = dynamic_cast<TProfile*>
316 (outputListHistos->FindObject("First_FlowPro_r0theta_LYZ"));
318 TProfile* pHistProVetaRP = dynamic_cast<TProfile*>
319 (outputListHistos->FindObject("FlowPro_VetaRP_LYZEP"));
320 TProfile* pHistProVetaPOI = dynamic_cast<TProfile*>
321 (outputListHistos->FindObject("FlowPro_VetaPOI_LYZEP"));
322 TProfile* pHistProVPtRP = dynamic_cast<TProfile*>
323 (outputListHistos->FindObject("FlowPro_VPtRP_LYZEP"));
324 TProfile* pHistProVPtPOI = dynamic_cast<TProfile*>
325 (outputListHistos->FindObject("FlowPro_VPtPOI_LYZEP"));
327 TH1F* pHistQsumforChi = dynamic_cast<TH1F*>
328 (outputListHistos->FindObject("Flow_QsumforChi_LYZEP"));
330 if (pCommonHist && pCommonHistResults && pHistProR0theta &&
331 pHistProVetaRP && pHistProVetaPOI && pHistProVPtRP &&
332 pHistProVPtPOI && pHistQsumforChi ) {
333 this -> SetCommonHists(pCommonHist);
334 this -> SetCommonHistsRes(pCommonHistResults);
335 this -> SetFirstr0theta(pHistProR0theta);
336 this -> SetHistProVetaRP(pHistProVetaRP);
337 this -> SetHistProVetaPOI(pHistProVetaPOI);
338 this -> SetHistProVPtRP(pHistProVPtRP);
339 this -> SetHistProVPtPOI(pHistProVPtPOI);
340 this -> SetHistQsumforChi(pHistQsumforChi);
343 cout<<"WARNING: Histograms needed to run Finish() are not accessable!"<<endl;
347 //--------------------------------------------------------------------
348 void AliFlowAnalysisWithLYZEventPlane::Finish() {
350 //plot histograms etc.
351 cout<<"AliFlowAnalysisWithLYZEventPlane::Finish()"<<endl;
354 Double_t dJ01 = 2.405;
355 Int_t iNtheta = AliFlowLYZConstants::kTheta;
356 Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
357 Int_t iNbinsEta = AliFlowCommonConstants::GetNbinsEta();
358 //set the event number
359 SetEventNumber((int)fCommonHists->GetHistMultOrig()->GetEntries());
360 //cout<<"number of events processed is "<<fEventNumber<<endl;
362 //set the sum of Q vectors
363 fQsum->Set(fHistQsumforChi->GetBinContent(1),fHistQsumforChi->GetBinContent(2));
364 SetQ2sum(fHistQsumforChi->GetBinContent(3));
366 //calculate dV the mean of dVtheta
367 Double_t dVtheta = 0;
369 for (Int_t theta=0;theta<iNtheta;theta++) {
370 Double_t dR0 = fFirstr0theta->GetBinContent(theta+1);
371 if (dR0!=0.) { dVtheta = dJ01/dR0 ;}
377 Double_t dSigma2 = 0;
379 if (fEventNumber!=0) {
380 *fQsum /= fEventNumber;
381 //cerr<<"fQsum->X() = "<<fQsum->X()<<endl;
382 //cerr<<"fQsum->Y() = "<<fQsum->Y()<<endl;
383 fQ2sum /= fEventNumber;
384 //cerr<<"fEventNumber = "<<fEventNumber<<endl;
385 //cerr<<"fQ2sum = "<<fQ2sum<<endl;
386 dSigma2 = fQ2sum - TMath::Power(fQsum->X(),2.) - TMath::Power(fQsum->Y(),2.) - TMath::Power(dV,2.); //BP eq. 62
387 //cerr<<"dSigma2"<<dSigma2<<endl;
388 if (dSigma2>0) dChi = dV/TMath::Sqrt(dSigma2);
390 fCommonHistsRes->FillChiRP(dChi);
392 // recalculate statistical errors on integrated flow
393 //combining 5 theta angles to 1 relative error BP eq. 89
394 Double_t dRelErr2comb = 0.;
395 Int_t iEvts = fEventNumber;
397 for (Int_t theta=0;theta<iNtheta;theta++){
398 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
399 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
401 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
403 dRelErr2comb += (1/(2*iEvts*(dJ01*dJ01)*TMath::BesselJ1(dJ01)*
404 TMath::BesselJ1(dJ01)))*
405 (dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2)) +
406 dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2)));
408 dRelErr2comb /= iNtheta;
410 Double_t dRelErrcomb = TMath::Sqrt(dRelErr2comb);
411 Double_t dVErr = dV*dRelErrcomb ;
412 fCommonHistsRes->FillIntegratedFlow(dV, dVErr);
414 cout<<"*************************************"<<endl;
415 cout<<"*************************************"<<endl;
416 cout<<" Integrated flow from "<<endl;
417 cout<<" Lee-Yang Zeroes Event Plane "<<endl;
419 cout<<"dChi = "<<dChi<<endl;
420 cout<<"dV = "<<dV<<" +- "<<dVErr<<endl;
425 //copy content of profile into TH1D, add error and fill the AliFlowCommonHistResults
427 //v as a function of eta for RP selection
428 for(Int_t b=0;b<iNbinsEta;b++) {
429 Double_t dv2pro = fHistProVetaRP->GetBinContent(b);
430 Double_t dNprime = fCommonHists->GetEntriesInEtaBinRP(b);
431 Double_t dErrdifcomb = 0.; //set error to zero
432 Double_t dErr2difcomb = 0.; //set error to zero
435 for (Int_t theta=0;theta<iNtheta;theta++) {
436 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
437 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
439 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
441 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
442 TMath::BesselJ1(dJ01)))*
443 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
444 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
448 if (dErr2difcomb!=0.) {
449 dErr2difcomb /= iNtheta;
450 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
452 else {dErrdifcomb = 0.;}
454 fCommonHistsRes->FillDifferentialFlowEtaRP(b, dv2pro, dErrdifcomb);
458 //v as a function of eta for POI selection
459 for(Int_t b=0;b<iNbinsEta;b++) {
460 Double_t dv2pro = fHistProVetaPOI->GetBinContent(b);
461 Double_t dNprime = fCommonHists->GetEntriesInEtaBinPOI(b);
462 Double_t dErrdifcomb = 0.; //set error to zero
463 Double_t dErr2difcomb = 0.; //set error to zero
466 for (Int_t theta=0;theta<iNtheta;theta++) {
467 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
468 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
470 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
472 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
473 TMath::BesselJ1(dJ01)))*
474 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
475 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
479 if (dErr2difcomb!=0.) {
480 dErr2difcomb /= iNtheta;
481 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
483 else {dErrdifcomb = 0.;}
485 fCommonHistsRes->FillDifferentialFlowEtaPOI(b, dv2pro, dErrdifcomb);
488 //v as a function of Pt for RP selection
489 TH1F* fHistPtRP = fCommonHists->GetHistPtRP(); //for calculating integrated flow
494 for(Int_t b=0;b<iNbinsPt;b++) {
495 Double_t dv2pro = fHistProVPtRP->GetBinContent(b);
496 Double_t dNprime = fCommonHists->GetEntriesInPtBinRP(b);
497 Double_t dErrdifcomb = 0.; //set error to zero
498 Double_t dErr2difcomb = 0.; //set error to zero
501 for (Int_t theta=0;theta<iNtheta;theta++) {
502 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
503 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
505 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
507 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
508 TMath::BesselJ1(dJ01)))*
509 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
510 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
514 if (dErr2difcomb!=0.) {
515 dErr2difcomb /= iNtheta;
516 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
517 //cerr<<"dErrdifcomb = "<<dErrdifcomb<<endl;
519 else {dErrdifcomb = 0.;}
522 fCommonHistsRes->FillDifferentialFlowPtRP(b, dv2pro, dErrdifcomb);
523 //calculate integrated flow for RP selection
525 Double_t dYieldPt = fHistPtRP->GetBinContent(b);
526 dVRP += dv2pro*dYieldPt;
528 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
529 } else { cout<<"fHistPtRP is NULL"<<endl; }
534 dVRP /= dSum; //the pt distribution should be normalised
535 dErrV /= (dSum*dSum);
536 dErrV = TMath::Sqrt(dErrV);
538 fCommonHistsRes->FillIntegratedFlowRP(dVRP,dErrV);
540 cout<<"dV(RP) = "<<dVRP<<" +- "<<dErrV<<endl;
544 //v as a function of Pt for POI selection
545 TH1F* fHistPtPOI = fCommonHists->GetHistPtPOI(); //for calculating integrated flow
550 for(Int_t b=0;b<iNbinsPt;b++) {
551 Double_t dv2pro = fHistProVPtPOI->GetBinContent(b);
552 Double_t dNprime = fCommonHists->GetEntriesInPtBinPOI(b);
554 //cerr<<"dNprime = "<<dNprime<<endl;
555 //Int_t iNprime = TMath::Nint(fHistProVPtPOI->GetBinEntries(b));
556 //cerr<<"iNprime = "<<iNprime<<endl;
558 Double_t dErrdifcomb = 0.; //set error to zero
559 Double_t dErr2difcomb = 0.; //set error to zero
562 for (Int_t theta=0;theta<iNtheta;theta++) {
563 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
564 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
566 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
568 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
569 TMath::BesselJ1(dJ01)))*
570 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
571 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
575 if (dErr2difcomb!=0.) {
576 dErr2difcomb /= iNtheta;
577 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
578 //cerr<<"dErrdifcomb = "<<dErrdifcomb<<endl;
580 else {dErrdifcomb = 0.;}
583 fCommonHistsRes->FillDifferentialFlowPtPOI(b, dv2pro, dErrdifcomb);
585 //calculate integrated flow for POI selection
587 Double_t dYieldPt = fHistPtPOI->GetBinContent(b);
588 dVPOI += dv2pro*dYieldPt;
590 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
591 } else { cout<<"fHistPtPOI is NULL"<<endl; }
595 dVPOI /= dSum; //the pt distribution should be normalised
596 dErrV /= (dSum*dSum);
597 dErrV = TMath::Sqrt(dErrV);
599 fCommonHistsRes->FillIntegratedFlowPOI(dVPOI,dErrV);
601 cout<<"dV(POI) = "<<dVPOI<<" +- "<<dErrV<<endl;
603 cout<<"*************************************"<<endl;
604 cout<<"*************************************"<<endl;
606 //cout<<".....finished"<<endl;