28 #include "Riostream.h"
56 fSecondReDtheta(NULL),
57 fSecondImDtheta(NULL),
60 fHistProVetaPOI(NULL),
65 fHistQsumforChi(NULL),
68 fHistDeltaPhihere(NULL),
74 fCommonHistsRes(NULL),
81 fQsum =
new TVector2();
83 fHistList =
new TList();
84 fSecondRunList =
new TList();
107 TFile *output =
new TFile(outputFileName->Data(),
"RECREATE");
121 TFile *output =
new TFile(outputFileName.Data(),
"RECREATE");
137 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
145 cout<<
"---Analysis with Lee Yang Zeros Event Plane Method---"<<endl;
150 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
151 TH1::AddDirectory(kFALSE);
184 fHistProVetaRP =
new TProfile(
"FlowPro_VetaRP_LYZEP",
"FlowPro_VetaRP_LYZEP",iNbinsEta,dEtaMin,dEtaMax);
189 fHistProVetaPOI =
new TProfile(
"FlowPro_VetaPOI_LYZEP",
"FlowPro_VetaPOI_LYZEP",iNbinsEta,dEtaMin,dEtaMax);
194 fHistProVPtRP =
new TProfile(
"FlowPro_VPtRP_LYZEP",
"FlowPro_VPtRP_LYZEP",iNbinsPt,dPtMin,dPtMax);
199 fHistProVPtPOI =
new TProfile(
"FlowPro_VPtPOI_LYZEP",
"FlowPro_VPtPOI_LYZEP",iNbinsPt,dPtMin,dPtMax);
204 fHistProWr =
new TProfile(
"FlowPro_Wr_LYZEP",
"FlowPro_Wr_LYZEP",100,0.,0.25);
209 fHistQsumforChi =
new TH1F(
"Flow_QsumforChi_LYZEP",
"Flow_QsumforChi_LYZEP",3,-1.,2.);
214 fHistDeltaPhi =
new TH1F(
"Flow_DeltaPhi_LYZEP",
"Flow_DeltaPhi_LYZEP",100,0.,3.14);
219 fHistPhiLYZ =
new TH1F(
"Flow_PhiLYZ_LYZEP",
"Flow_PhiLYZ_LYZEP",100,0.,3.14);
224 fHistPhiEP =
new TH1F(
"Flow_PhiEP_LYZEP",
"Flow_PhiEP_LYZEP",100,0.,3.14);
232 TH1::AddDirectory(oldHistAddStatus);
251 if (TMath::AreEqualAbs(vQ.
GetMult(),0.0,1e-10)) {
254 }
else {cerr<<
"vQ.GetMult() is zero!"<<endl; }
282 if (dDeltaPhi < 0.) { dDeltaPhi += TMath::Pi(); }
288 Double_t dHigh = 3.*(TMath::Pi()/4.);
289 if ((dDeltaPhi > dLow) && (dDeltaPhi < dHigh)){
290 dRP -= (TMath::Pi()/2);
292 cerr<<
"*** dRP modified ***"<<endl;
299 for (
Int_t i=0;i<iNumberOfTracks;i++)
308 Double_t dv2 = dWR * TMath::Cos(2*(dPhi-dRP));
330 if (outputListHistos) {
333 (outputListHistos->FindObject(
"AliFlowCommonHistLYZEP"));
335 (outputListHistos->FindObject(
"AliFlowCommonHistResultsLYZEP"));
337 TProfile* pHistProR0theta =
dynamic_cast<TProfile*
>
338 (outputListHistos->FindObject(
"First_FlowPro_r0theta_LYZSUM"));
340 TProfile* pHistProVetaRP =
dynamic_cast<TProfile*
>
341 (outputListHistos->FindObject(
"FlowPro_VetaRP_LYZEP"));
342 TProfile* pHistProVetaPOI =
dynamic_cast<TProfile*
>
343 (outputListHistos->FindObject(
"FlowPro_VetaPOI_LYZEP"));
344 TProfile* pHistProVPtRP =
dynamic_cast<TProfile*
>
345 (outputListHistos->FindObject(
"FlowPro_VPtRP_LYZEP"));
346 TProfile* pHistProVPtPOI =
dynamic_cast<TProfile*
>
347 (outputListHistos->FindObject(
"FlowPro_VPtPOI_LYZEP"));
349 TH1F* pHistQsumforChi =
dynamic_cast<TH1F*
>
350 (outputListHistos->FindObject(
"Flow_QsumforChi_LYZEP"));
352 if (pCommonHist && pCommonHistResults && pHistProR0theta &&
353 pHistProVetaRP && pHistProVetaPOI && pHistProVPtRP &&
354 pHistProVPtPOI && pHistQsumforChi ) {
365 cout<<
"WARNING: Histograms needed to run Finish() are not accessable!"<<endl;
373 cout<<
"AliFlowAnalysisWithLYZEventPlane::Finish()"<<endl;
385 cout<<
"Commonhist pointer is NULL."<<endl;
386 cout<<
"Leaving LYZ Event plane analysis!"<<endl;
397 for (
Int_t theta=0;theta<iNtheta;theta++) {
399 if (TMath::AreEqualAbs(dR0,0.0,1e-10)) { dVtheta = dJ01/dR0 ;}
414 dSigma2 =
fQ2sum - TMath::Power(
fQsum->X(),2.) - TMath::Power(
fQsum->Y(),2.) - TMath::Power(dV,2.);
416 if (dSigma2>0) dChi = dV/TMath::Sqrt(dSigma2);
425 for (
Int_t theta=0;theta<iNtheta;theta++){
426 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
427 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
429 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
431 dRelErr2comb += (1/(2*iEvts*(dJ01*dJ01)*TMath::BesselJ1(dJ01)*
432 TMath::BesselJ1(dJ01)))*
433 (dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2)) +
434 dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2)));
436 dRelErr2comb /= iNtheta;
438 Double_t dRelErrcomb = TMath::Sqrt(dRelErr2comb);
442 cout<<
"*************************************"<<endl;
443 cout<<
"*************************************"<<endl;
444 cout<<
" Integrated flow from "<<endl;
445 cout<<
" Lee-Yang Zeroes Event Plane "<<endl;
447 cout<<
"dChi = "<<dChi<<endl;
448 cout<<
"dV = "<<dV<<
" +- "<<dVErr<<endl;
456 for(
Int_t b=0;b<iNbinsEta;b++) {
462 if (TMath::AreEqualAbs(dNprime,0.0,1e-10)) {
463 for (
Int_t theta=0;theta<iNtheta;theta++) {
464 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
465 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
467 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
469 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
470 TMath::BesselJ1(dJ01)))*
471 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
472 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
476 if (TMath::AreEqualAbs(dErr2difcomb, 0.0, 1e-10)) {
477 dErr2difcomb /= iNtheta;
478 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
480 else {dErrdifcomb = 0.;}
487 for(
Int_t b=0;b<iNbinsEta;b++) {
494 for (
Int_t theta=0;theta<iNtheta;theta++) {
495 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
496 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
498 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
500 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
501 TMath::BesselJ1(dJ01)))*
502 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
503 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
507 if (dErr2difcomb!=0.) {
508 dErr2difcomb /= iNtheta;
509 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
511 else {dErrdifcomb = 0.;}
522 for(
Int_t b=0;b<iNbinsPt;b++) {
529 for (
Int_t theta=0;theta<iNtheta;theta++) {
530 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
531 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
533 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
535 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
536 TMath::BesselJ1(dJ01)))*
537 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
538 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
542 if (dErr2difcomb!=0.) {
543 dErr2difcomb /= iNtheta;
544 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
547 else {dErrdifcomb = 0.;}
553 Double_t dYieldPt = fHistPtRP->GetBinContent(b);
554 dVRP += dv2pro*dYieldPt;
556 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
557 }
else { cout<<
"fHistPtRP is NULL"<<endl; }
561 if (TMath::AreEqualAbs(dSum, 0.0, 1e-10)) {
563 dErrV /= (dSum*dSum);
564 dErrV = TMath::Sqrt(dErrV);
568 cout<<
"dV(RP) = "<<dVRP<<
" +- "<<dErrV<<endl;
578 for(
Int_t b=0;b<iNbinsPt;b++) {
590 for (
Int_t theta=0;theta<iNtheta;theta++) {
591 Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
592 Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
594 Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
596 dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
597 TMath::BesselJ1(dJ01)))*
598 ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
599 (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
603 if (dErr2difcomb!=0.) {
604 dErr2difcomb /= iNtheta;
605 dErrdifcomb = TMath::Sqrt(dErr2difcomb);
608 else {dErrdifcomb = 0.;}
615 Double_t dYieldPt = fHistPtPOI->GetBinContent(b);
616 dVPOI += dv2pro*dYieldPt;
618 dErrV += dYieldPt*dYieldPt*dErrdifcomb*dErrdifcomb;
619 }
else { cout<<
"fHistPtPOI is NULL"<<endl; }
624 dErrV /= (dSum*dSum);
625 dErrV = TMath::Sqrt(dErrV);
629 cout<<
"dV(POI) = "<<dVPOI<<
" +- "<<dErrV<<endl;
631 cout<<
"*************************************"<<endl;
632 cout<<
"*************************************"<<endl;
Double_t GetEtaMax() const
Bool_t FillChi(Double_t aChi)
void SetCommonHistsRes(AliFlowCommonHistResults *const aCommonHistResult)
virtual AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
Double_t GetEntriesInEtaBinPOI(Int_t iBin)
AliFlowCommonHist * fCommonHists
void WriteHistograms(TString *outputFileName)
AliFlowTrackSimple * GetTrack(Int_t i)
virtual void Make(AliFlowEventSimple *fEvent, AliFlowLYZEventPlane *fLYZEP)
Double_t GetEntriesInPtBinPOI(Int_t iBin)
void SetCommonHists(AliFlowCommonHist *const aCommonHist)
Double_t GetPtMin() const
Bool_t FillDifferentialFlowPtRP(Int_t aBin, Double_t av, Double_t anError)
virtual void GetOutputHistograms(TList *outputListHistos)
void SetHistProVPtPOI(TProfile *const aHistProVPtPOI)
Double_t GetPtMax() const
Bool_t InRPSelection() const
Bool_t FillControlHistograms(AliFlowEventSimple *anEvent, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE)
AliFlowCommonHistResults * fCommonHistsRes
TProfile * fSecondImDtheta
void SetHistProVPtRP(TProfile *const aHistProVPtRP)
static AliFlowLYZConstants * GetMaster()
TProfile * fHistProVPtPOI
Bool_t FillIntegratedFlowRP(Double_t aV, Double_t anError)
void SetHistQsumforChi(TH1F *const aHistQsumforChi)
Int_t GetNbinsEta() const
void SetFirstr0theta(TProfile *const aFirstr0theta)
Double_t GetEntriesInPtBinRP(Int_t iBin)
static AliFlowCommonConstants * GetMaster()
Double_t GetEntriesInEtaBinRP(Int_t iBin)
void SetHistProVetaRP(TProfile *const aHistProVetaRP)
Bool_t FillIntegratedFlow(Double_t aV, Double_t anError)
TProfile * fHistProVetaRP
Bool_t FillDifferentialFlowEtaPOI(Int_t aBin, Double_t av, Double_t anError)
Bool_t FillIntegratedFlowPOI(Double_t aV, Double_t anError)
virtual ~AliFlowAnalysisWithLYZEventPlane()
void SetEventNumber(Int_t n)
Bool_t FillDifferentialFlowPtPOI(Int_t aBin, Double_t av, Double_t anError)
Double_t GetEtaMin() const
void SetHistProVetaPOI(TProfile *const aHistProVetaPOI)
TProfile * fHistProVetaPOI
Bool_t InPOISelection(Int_t poiType=1) const
TProfile * fSecondReDtheta
Bool_t FillDifferentialFlowEtaRP(Int_t aBin, Double_t av, Double_t anError)
void CalculateRPandW(AliFlowVector aQ)
void SetQ2sum(Double_t d)
ClassImp(AliFlowAnalysisWithLYZEventPlane) AliFlowAnalysisWithLYZEventPlane
Int_t NumberOfTracks() const