27 #include "TObjArray.h"
28 #include "AliAnalysisTaskSE.h"
29 #include "AliAnalysisManager.h"
30 #include "AliAODEvent.h"
31 #include "AliAODInputHandler.h"
32 #include "AliCentrality.h"
35 #include "AliPIDCombined.h"
36 #include "AliMCEvent.h"
45 #include "AliAODVZERO.h"
46 #include "AliPIDResponse.h"
47 #include "AliTPCPIDResponse.h"
48 #include "AliAODMCParticle.h"
50 #include "AliEventPoolManager.h"
51 #include "AliMultSelection.h"
52 #include "TMatrixDSym.h"
53 #include "AliVVertex.h"
54 #include "AliAODVertex.h"
65 fDebug(0), fIsMC(0), fEventMixing(0), fTypeMixing(0),
fQA(0),
fV0(0), fMassBins(1), fMinMass(-1.), fMaxMass(0.), fCutsRP(NULL), fNullCuts(0),
fPIDResponse(0), fFlowEvent(0),
fBayesianResponse(0), fCandidates(0), fCandidateEtaPtCut(0), fCandidateMinEta(0), fCandidateMaxEta(0), fCandidateMinPt(0), fCandidateMaxPt(0), fCandidateYCut(kFALSE), fCandidateMinY(-.5), fCandidateMaxY(.5), fNPtBins(18), fCentrality(999), fVertex(999), fAOD(0), fPoolManager(0), fOutputList(0), fEventStats(0), fCentralityPass(0), fCentralityNoPass(0), fNOPID(0), fPIDk(0),fNOPIDTOF(0), fPIDTOF(0), fPtP(0), fPtN(0), fPtKP(0), fPtKN(0), fMultCorAfterCuts(0), fMultvsCentr(0), fCentralityMin(0), fCentralityMax(100), fkCentralityMethodA(0), fkCentralityMethodB(0), fCentralityCut2010(0), fCentralityCut2011(0), fPOICuts(0), fVertexRange(0), fPhi(0), fPt(0), fEta(0), fVZEROA(0), fVZEROC(0), fTPCM(0), fDCAAll(0), fDCAXYQA(0), fDCAZQA(0), fDCAPrim(0), fDCASecondaryWeak(0), fDCAMaterial(0), fSubEventDPhiv2(0), fSkipEventSelection(0), fUsePidResponse(0), fPIDCombined(0), fPileUp(kTRUE)
68 for(
Int_t i(0); i < 7; i++) fPIDConfig[i] = 1000.;
69 for(
Int_t i(0); i < 5; i++) fDCAConfig[i] = 0.;
70 for(
Int_t i(0); i < 20; i++) {
71 fVertexMixingBins[i] = 0;
72 fCentralityMixingBins[i] = 0;
74 fMixingParameters[0] = 1000; fMixingParameters[1] = 50000; fMixingParameters[2] = 5;
75 for(
Int_t i(0); i < 18; i++) {
76 for(
Int_t j(0); j < 2; j++) fV0Data[i][j] = 0;
77 fInvMNP[i] = 0; fInvMNN[i] = 0; fInvMPP[i] = 0; fPtSpectra[i] = 0; fPtBins[i] = 0.;
82 fDebug(0), fIsMC(0), fEventMixing(0), fTypeMixing(0),
fQA(0),
fV0(0), fMassBins(1), fMinMass(-1.), fMaxMass(0.), fCutsRP(NULL), fNullCuts(0),
fPIDResponse(0), fFlowEvent(0),
fBayesianResponse(0), fCandidates(0), fCandidateEtaPtCut(0), fCandidateMinEta(0), fCandidateMaxEta(0), fCandidateMinPt(0), fCandidateMaxPt(0), fCandidateYCut(kFALSE), fCandidateMinY(-.5), fCandidateMaxY(.5), fNPtBins(18), fCentrality(999), fVertex(999), fAOD(0), fPoolManager(0), fOutputList(0), fEventStats(0), fCentralityPass(0), fCentralityNoPass(0), fNOPID(0), fPIDk(0), fNOPIDTOF(0), fPIDTOF(0), fPtP(0), fPtN(0), fPtKP(0), fPtKN(0), fMultCorAfterCuts(0), fMultvsCentr(0), fCentralityMin(0), fCentralityMax(100), fkCentralityMethodA(0), fkCentralityMethodB(0), fCentralityCut2010(0), fCentralityCut2011(0), fPOICuts(0), fVertexRange(0), fPhi(0), fPt(0), fEta(0), fVZEROA(0), fVZEROC(0), fTPCM(0), fDCAAll(0), fDCAXYQA(0), fDCAZQA(0), fDCAPrim(0), fDCASecondaryWeak(0), fDCAMaterial(0), fSubEventDPhiv2(0), fSkipEventSelection(0), fUsePidResponse(0), fPIDCombined(0), fPileUp(kTRUE)
87 for(
Int_t i(0); i < 20; i++) {
92 for(
Int_t i(0); i < 18; i++) {
96 DefineInput(0, TChain::Class());
97 DefineOutput(1, TList::Class());
98 DefineOutput(2, AliFlowEventSimple::Class());
99 if(
fDebug > 0) cout <<
" === Created instance of AliAnaysisTaskPhiFlow === " << endl;
112 if (
fDebug > 0) cout <<
" === Deleted instance of AliAnalysisTaskPhiFlow === " << endl;
118 if(
fDebug > 0) cout <<
" *** BookHistogram() *** " << name << endl;
119 TH1F *hist =
new TH1F(name, Form(
"M_{INV} (%s)", name), 60, .99, 1.092);
120 hist->GetXaxis()->SetTitle(
"M_{INV} (GeV / c^{2})");
121 hist->GetYaxis()->SetTitle(
"No. of pairs");
122 hist->SetMarkerStyle(kFullCircle);
131 if(
fDebug > 0) cout <<
" *** BookPIDHisotgram() *** " << endl;
134 hist =
new TH2F(name, Form(
"PID (%s)", name), 100, 0, 5, 100, 0, 1000);
135 hist->GetYaxis()->SetTitle(
"dE/dx (a.u.)");
138 hist =
new TH2F(name, Form(
"PID (%s)", name), 100, 0, 5, 100, 0, 1.5);
139 hist->GetYaxis()->SetTitle(
"#beta");
141 hist->GetXaxis()->SetTitle(
"P (GeV / c)");
149 if(
fDebug > 0) cout <<
" *** InitPtSpectraHistograms() *** " << endl;
150 TH1F* hist =
new TH1F(Form(
"%4.2f p_{t} %4.2f", nmin, nmax), Form(
"%f p_{t} %f", nmin, nmax), 60, nmin, nmax);
151 hist->GetXaxis()->SetTitle(
"p_{T} GeV / c");
159 if(
fDebug > 0) cout <<
" *** BookPtHistogram() *** " << endl;
160 TH1F* ratio =
new TH1F(name, name, 100, 0, 7);
161 ratio->GetXaxis()->SetTitle(
"p_{T} ( GeV / c^{2} )");
162 ratio->GetYaxis()->SetTitle(
"No. of events");
171 if(
fDebug > 0) cout <<
" ** AddPhiIdentificationOutputObjects() *** " << endl;
173 fEventStats =
new TH1F(
"fHistStats",
"Event Statistics", 18, -.25, 4.25);
174 fEventStats->GetXaxis()->SetTitle(
"No. of events");
178 fCentralityPass =
new TH1F(
"fCentralityPass",
"Centrality Pass", 101, -1, 100);
181 fCentralityNoPass =
new TH1F(
"fCentralityNoPass",
"Centrality No Pass", 101, -1, 100);
199 fPhi =
new TH1F(
"fPhi",
"#phi distribution", 100, -.5, 7);
201 fPt =
new TH1F(
"fPt",
"p_{T}", 100, 0, 5.5);
203 fEta =
new TH1F(
"fEta",
"#eta distribution", 100, -1.1, 1.1);
205 fVZEROA =
new TH1F(
"fVZEROA",
"VZERO A Multiplicity", 1000, 0, 10000);
207 fVZEROC =
new TH1F(
"fVZEROC",
"VZERO C Multiplicity", 1000, 0, 10000);
209 fTPCM =
new TH1F(
"fTPCM",
"TPC multiplicity", 1000, 0, 10000);
211 fDCAXYQA =
new TH1F(
"fDCAXYQA",
"fDCAXYQA", 1000, -5, 5);
213 fDCAZQA =
new TH1F(
"fDCAZQA",
"fDCAZQA", 1000, -5, 5);
216 fMultCorAfterCuts =
new TH2F(
"fMultCorAfterCuts",
"TPC vs Global multiplicity (After cuts); Global multiplicity; TPC multiplicity", 100, 0, 3000, 100, 0, 3000);
218 fMultvsCentr =
new TH2F(
"fMultvsCentr",
"Multiplicity vs centrality; centrality; Multiplicity", 9, -0.5, 100.5, 101, 0, 3000);
223 fDCAAll =
new TH2F(
"fDCAAll",
"fDCAAll", 1000, 0, 10, 1000, -5, 5);
225 fDCAPrim =
new TH2F(
"fDCAprim",
"fDCAprim", 1000, 0, 10, 1000, -5, 5);
229 fDCAMaterial =
new TH2F(
"fDCAMaterial",
"fDCAMaterial", 1000, 0, 10, 1000, -5, 5);
233 fSubEventDPhiv2 =
new TProfile(
"fSubEventDPhiv2",
"fSubEventDPhiv2", 5, 0, 5);
237 fSubEventDPhiv2->GetXaxis()->SetBinLabel(4,
"#sqrt{#frac{<#Psi_{a} - #Psi_{b}><#Psi_{a} - #Psi_{c}>}{<#Psi_{b} - #Psi_{c}>}}");
238 fSubEventDPhiv2->GetXaxis()->SetBinLabel(5,
"#sqrt{#frac{<#Psi_{a} - #Psi_{c}><#Psi_{b} - #Psi_{c}>}{<#Psi_{a} - #Psi_{b}>}}");
240 const char* V0[] = {
"V0A",
"V0C"};
242 for(
Int_t iV0(0); iV0 < 2; iV0++) {
243 fV0Data[ptbin][iV0] =
new TProfile(Form(
"%s v2 %4.2f < p_{T} < %4.2f GeV", V0[iV0],
fPtBins[ptbin],
fPtBins[ptbin+1]), Form(
"%s v2 %4.2f < p_{T} < %4.2f GeV", V0[iV0],
fPtBins[ptbin],
fPtBins[ptbin+1]),
fMassBins,
fMinMass,
fMaxMass);
252 if(
fDebug > 0) cout <<
" *** UserCreateOutputObjects() *** " << endl;
258 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
264 if(t < 0.1) AliFatal(
"No valid PID procedure recognized -- terminating analysis !!!");
265 if(
fNPtBins > 18) AliFatal(
"Invalid number of pt bins initialied ( > 18 ) -- terminating analysis !!!");
276 AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());
277 if (inputHandler)
fPIDResponse = inputHandler->GetPIDResponse();
297 if(
fDebug > 0) cout <<
" *** InitializeEventMixing() *** " << endl;
299 for(
Int_t i(0); i < 19; i++) {
303 for(
Int_t i(0); i < 19; i++) {
307 if(
fDebug > 0 ) cout << Form(
" --> found %d centrality bins for mixing, %d vertex bins for mixing", _c, _v) << endl;
318 if(
fDebug > 1) cout <<
" *** InvariantMass() *** " << endl;
319 if ((!track2) || (!track1))
return 0.;
320 Double_t masss = TMath::Power(4.93676999999999977e-01, 2);
321 Double_t pxs = TMath::Power((track1->Px() + track2->Px()), 2);
322 Double_t pys = TMath::Power((track1->Py() + track2->Py()), 2);
323 Double_t pzs = TMath::Power((track1->Pz() + track2->Pz()), 2);
324 Double_t e1 = TMath::Sqrt(track1->P() * track1->P() + masss);
325 Double_t e2 = TMath::Sqrt(track2->P() * track2->P() + masss);
326 Double_t es = TMath::Power((e1 + e2), 2);
327 if ((es - (pxs + pys + pzs)) < 0)
return 0.;
328 return TMath::Sqrt((es - (pxs + pys + pzs)));
352 if(
fDebug > 1) cout <<
" *** CheckCandidateEtaPtCut() *** " << endl;
354 TVector3 a(track1->Px(), track1->Py(), track1->Pz());
355 TVector3 b(track2->Px(), track2->Py(), track2->Pz());
364 if(
fDebug > 0) cout <<
" *** EventCut() *** " << endl;
365 if (!event)
return kFALSE;
376 if(
fDebug > 1) cout <<
" *** PlotMultiplcities() *** " << endl;
377 fVZEROA->Fill(event->GetVZEROData()->GetMTotV0A());
378 fVZEROC->Fill(event->GetVZEROData()->GetMTotV0C());
379 fTPCM->Fill(event->GetNumberOfTracks());
385 if(
fDebug > 0) cout <<
" *** CheckVertex() *** " << endl;
386 if (!event->GetPrimaryVertex())
return 0x0;
387 fVertex =
event->GetPrimaryVertex()->GetZ();
395 if(
fDebug > 0) cout <<
" *** CheckCentrality() *** " << endl;
401 AliMultSelection *multSelection = 0x0;
402 multSelection =
static_cast<AliMultSelection*
>(
event->FindListObject(
"MultSelection"));
404 fCentrality = multSelection->GetMultiplicityPercentile(
"V0M");
418 if (TMath::Abs(
fCentrality-cenB) > 5 || cenB >= 80 || cenB < 0 || fCentrality <= fCentralityMin || fCentrality >
fCentralityMax) {
422 const Int_t nGoodTracks =
event->GetNumberOfTracks();
426 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
427 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
428 if(!trackAOD) AliFatal(
"Not a standard AOD");
429 if (!trackAOD)
continue;
430 if (!(trackAOD->TestFilterBit(1)))
continue;
431 if ((trackAOD->Pt() < .2) || (trackAOD->Pt() > 5.0) || (TMath::Abs(trackAOD->Eta()) > .8) || (trackAOD->GetTPCNcls() < 70) || (trackAOD->GetDetPid()->GetTPCsignal() < 10.0) || (trackAOD->Chi2perNDF() < 0.2))
continue;
434 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
435 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
436 if(!trackAOD) AliFatal(
"Not a standard AOD");
437 if (!trackAOD)
continue;
438 if (!(trackAOD->TestFilterBit(16)))
continue;
439 if ((trackAOD->Pt() < .2) || (trackAOD->Pt() > 5.0) || (TMath::Abs(trackAOD->Eta()) > .8) || (trackAOD->GetTPCNcls() < 70) || (trackAOD->GetDetPid()->GetTPCsignal() < 10.0) || (trackAOD->Chi2perNDF() < 0.1))
continue;
441 Double_t bCov[3] = {-99., -99., -99.};
442 AliAODTrack copy(*trackAOD);
443 if (!(copy.PropagateToDCA(event->GetPrimaryVertex(),
event->GetMagneticField(), 100., b, bCov)))
continue;
444 if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3))
continue;
448 if(! (multTPC > (-40.3+1.22*multGlob) && multTPC < (32.1+1.59*multGlob)))
return kFALSE;
458 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
459 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
460 if(!trackAOD) AliFatal(
"Not a standard AOD");
461 if (!trackAOD)
continue;
462 if (!(trackAOD->TestFilterBit(1)))
continue;
463 if ((trackAOD->Pt() < .2) || (trackAOD->Pt() > 5.0) || (TMath::Abs(trackAOD->Eta()) > .8) || (trackAOD->GetTPCNcls() < 70) || (trackAOD->GetDetPid()->GetTPCsignal() < 10.0) || (trackAOD->Chi2perNDF() < 0.2))
continue;
466 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
467 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
468 if(!trackAOD) AliFatal(
"Not a standard AOD");
469 if (!trackAOD)
continue;
470 if (!(trackAOD->TestFilterBit(16)))
continue;
471 if ((trackAOD->Pt() < .2) || (trackAOD->Pt() > 5.0) || (TMath::Abs(trackAOD->Eta()) > .8) || (trackAOD->GetTPCNcls() < 70) || (trackAOD->GetDetPid()->GetTPCsignal() < 10.0) || (trackAOD->Chi2perNDF() < 0.1))
continue;
473 Double_t bCov[3] = {-99., -99., -99.};
474 AliAODTrack copy(*trackAOD);
475 if (!(copy.PropagateToDCA(event->GetPrimaryVertex(),
event->GetMagneticField(), 100., b, bCov)))
continue;
476 if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3))
continue;
480 if(! (multTPC > (-36.73 + 1.48*multGlob) && multTPC < (62.87 + 1.78*multGlob)))
return kFALSE;
494 if(
fDebug > 0) cout <<
" *** InitializeBayesianPID() *** " << endl;
501 if(
fDebug > 1) cout <<
" *** PassesTPCbayesianCut() *** " << endl;
506 if(
fQA) {
fPhi->Fill(track->Phi());
fPt->Fill(track->Pt());
fEta->Fill(track->Eta());}
519 if(
fDebug > 1) cout <<
" *** PassesDCACut() *** " << endl;
520 if(
fIsMC)
return kTRUE;
521 AliAODTrack copy(*track);
525 Double_t bCov[3] = { -99., -99., -99.};
526 if(copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov)) {
535 Double_t bCov[3] = { -99., -99., -99.};
536 if(!copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov))
return kFALSE;
540 if(
fDCAConfig[4] < TMath::Abs(b[1]))
return kFALSE;
542 if( denom < 0.0000001 )
return kFALSE;
556 if(
fDebug > 1) cout <<
" *** IsKaon() *** " << endl;
604 Float_t length = track->GetIntegratedLength();
605 Float_t time = track->GetTOFsignal();
608 if((length > 0) && (time > 0)) beta = length / 2.99792458e-2 / time;
610 fNOPID->Fill(track->P(), track->GetTPCsignal());
622 if(track->Pt() > .4) {
623 nSigmaK = TMath::Sqrt(nSigKTPC*nSigKTPC+nSigKTOF*nSigKTOF);
625 if(track->GetTPCsignal() > 110) nSigmaK = TMath::Abs(nSigKTPC);
633 if(track->Pt() > .4) {
634 nSigmaPi = TMath::Sqrt(nSigPiTPC*nSigPiTPC+nSigPiTOF*nSigPiTOF);
636 if(track->GetTPCsignal() < 60) nSigmaPi = TMath::Abs(nSigPiTPC);
645 if(track->Pt() > .4) {
646 nSigmaP = TMath::Sqrt(nSigPTPC*nSigPTPC+nSigPTOF*nSigPTOF);
648 if(track->GetTPCsignal() > 110) nSigmaP = TMath::Abs(nSigPTPC);
655 if(minSigma == 0)
return kFALSE;
656 if((nSigmaK == nSigmaPi) && ( nSigmaK == nSigmaP))
return kFALSE;
661 Float_t length = track->GetIntegratedLength();
662 Float_t time = track->GetTOFsignal();
665 if((length > 0) && (time > 0)) beta = length / 2.99792458e-2 / time;
668 if(beta < 0.4)
return kFALSE;
670 fPIDk->Fill(track->P(), track->GetTPCsignal());
671 if(track->Pt() > .4)
fPIDTOF->Fill(track->P(), beta);
684 TVector3 a(track1->Px(), track1->Py(), track1->Pz());
685 TVector3 b(track2->Px(), track2->Py(), track2->Pz());
694 if (tracktype == 0) {
702 if (tracktype == 1) {
709 if (tracktype == 2) {
721 if(!track)
return kFALSE;
728 if (
fDebug > 0) cout <<
" *** SetNullCuts() *** " <<
fCutsRP << endl;
739 if (
fDebug > 0 ) cout <<
" *** PrepareFlowEvent() *** " << endl;
749 if(
fDebug > 0) cout <<
" ** VZEROSubEventAnalysis() *** " << endl;
751 if(
fDebug > 0 ) cout <<
"Fatal error: unable to retrieve VZERO task output !!! Exiting ..." << endl;
756 for(
Int_t i(0); i < 3; i++)
if(abcPsi2[i] == 0) {
757 if(
fDebug > 0) cout <<
" Warning: I've encountered 0 in one of the symmetry panes (TPC, VZERO) - skipping event !" << endl;
761 Float_t qaqb = TMath::Cos(2.*(abcPsi2[0]-abcPsi2[1]));
762 Float_t qaqc = TMath::Cos(2.*(abcPsi2[0]-abcPsi2[2]));
763 Float_t qbqc = TMath::Cos(2.*(abcPsi2[1]-abcPsi2[2]));
770 for(
Int_t mb(0); mb < 31; mb++) minv[mb] = 0.99 + mb * 0.0034;
773 if(k==0) occurence[i][j] = 0;
778 if(
fDebug > 1) cout <<
" --> dynamic_cast returned null-pointer, skipping candidate <-- " << endl;
781 for(
Int_t mb(0); mb < 30; mb++) {
782 if(track->
Mass() <= minv[mb] || track->
Mass() > minv[mb+1])
continue;
785 _dphi[mb][ptbin][0]+=TMath::Cos(2.*(track->
Phi() - abcPsi2[0]));
786 _dphi[mb][ptbin][1]+=TMath::Cos(2.*(track->
Phi() - abcPsi2[2]));
787 occurence[mb][ptbin]+=1;
790 for(
Int_t mb(0); mb < 30; mb++)
792 if(occurence[mb][ptbin]==0)
continue;
793 fV0Data[ptbin][0]->Fill(mb*0.0034+0.99+0.0017, _dphi[mb][ptbin][0]/(
Float_t)occurence[mb][ptbin]);
794 fV0Data[ptbin][1]->Fill(mb*0.0034+0.99+0.0017, _dphi[mb][ptbin][1]/(
Float_t)occurence[mb][ptbin]);
802 if(
fDebug > 0 ) cout <<
" *** UserExec() *** " << endl;
806 MixingCandidates->SetOwner(kTRUE);
809 if(
fDebug > 0 ) cout <<
" Could not get PID response " << endl;
828 if (((AliAODHeader*)
fAOD->GetHeader())->GetRefMultiplicityComb08() < 0)
842 AliAODVertex* vtTrc =
fAOD->GetPrimaryVertex();
843 AliAODVertex* vtSPD =
fAOD->GetPrimaryVertexSPD();
844 if (vtTrc->GetNContributors()<2 || vtSPD->GetNContributors()<1)
return;
845 double covTrc[6],covSPD[6];
846 vtTrc->GetCovarianceMatrix(covTrc);
847 vtSPD->GetCovarianceMatrix(covSPD);
848 double dz = vtTrc->GetZ()-vtSPD->GetZ();
849 double errTot = TMath::Sqrt(covTrc[5]+covSPD[5]);
850 double errTrc = TMath::Sqrt(covTrc[5]);
851 double nsigTot = TMath::Abs(dz)/errTot, nsigTrc = TMath::Abs(dz)/errTrc;
852 if (TMath::Abs(dz)>0.2 || nsigTot>10 || nsigTrc>20)
return;
859 if (
fAOD->IsIncompleteDAQ())
869 Int_t unTracks =
fAOD->GetNumberOfTracks();
870 AliAODTrack* un[unTracks];
871 AliAODTrack* up[unTracks];
874 if(
fDebug > 1) cout <<
" started with " << unTracks <<
" of tracks "<< endl;
875 for (
Int_t iTracks = 0; iTracks < unTracks; iTracks++) {
876 AliAODTrack* track =
dynamic_cast<AliAODTrack*
>(
fAOD->GetTrack(iTracks));
877 if(!track) AliFatal(
"Not a standard AOD");
880 if(track->Charge() > 0) {
fEventStats->Fill(1);
fPtP->Fill(track->Pt());}
881 if(track->Charge() < 0) {
fEventStats->Fill(2);
fPtN->Fill(track->Pt());}
885 track->Px(), track->Py(), track->Pz(),
886 track->Pt(), track->Charge()));
887 if (track->Charge() > 0) {
892 else if (track->Charge() < 0) {
899 for (
Int_t pTracks = 0; pTracks < unp ; pTracks++) {
900 for (
Int_t nTracks = 0; nTracks < unn ; nTracks++) {
906 TVector3 a(up[pTracks]->Px(), up[pTracks]->Py(), up[pTracks]->Pz());
907 TVector3 b(un[nTracks]->Px(), un[nTracks]->Py(), up[pTracks]->Pz());
911 Double_t p = TMath::Sqrt(c.Px()*c.Px()+c.Py()*c.Py()+c.Pz()*c.Pz());
913 nIDs[0] = up[pTracks]->GetID();
914 nIDs[1] = un[nTracks]->GetID();
915 MakeTrack(mass, pt, phi, eta, 2, nIDs, p, c.Pz());
919 if (
fDebug > 0) printf(
"I received %d candidates\n",
fCandidates->GetEntriesFast());
920 for (
int iCand = 0; iCand !=
fCandidates->GetEntriesFast(); ++iCand) {
923 if (
fDebug > 1) printf(
" --> Checking at candidate %d with %d daughters: mass %f\n", iCand, cand->
GetNDaughters(), cand->
Mass());
931 if (
fDebug > 1) printf(
" was in RP set");
936 if (
fDebug > 1) printf(
"\n");
943 for (
Int_t pTracks = 0; pTracks < unp ; pTracks++) {
944 for (
Int_t nTracks = pTracks + 1; nTracks < unp ; nTracks++) {
950 for (
Int_t nTracks = 0; nTracks < unn ; nTracks++) {
951 for (
Int_t pTracks = nTracks + 1; pTracks < unn ; pTracks++) {
969 else AliAnalysisTaskSE::Exec(c);
975 if(
fDebug > 0) cout <<
" *** ReconstructionWithEventMixing() *** " << endl;
977 if(!pool) AliFatal(Form(
"No pool found for centrality = %f, zVtx = %f",
fCentrality,
fVertex));
980 if(
fDebug > 0) cout <<
" --> " << nEvents <<
" events in mixing buffer ... " << endl;
982 TObjArray* mixed_candidates = pool->GetEvent(iEvent);
983 if(!mixed_candidates)
continue;
984 Int_t bufferTracks = mixed_candidates->GetEntriesFast();
985 Int_t candidates = MixingCandidates->GetEntriesFast();
986 if(
fDebug > 0) cout << Form(
" - mixing %d tracks with %d buffered tracks from event %d ... ", candidates, bufferTracks, iEvent) << endl;
995 for (
Int_t iTracks = 0; iTracks < candidates; iTracks++) {
998 if (track->
Charge() > 0) {
999 mix_up[mix_unp] = track;
1002 else if (track->
Charge() < 0 ) {
1003 mix_un[mix_unn] = track;
1007 for (
Int_t iTracks = 0; iTracks < bufferTracks; iTracks++) {
1009 if(!track)
continue;
1010 if (track->
Charge() > 0) {
1011 buffer_up[buffer_unp] = track;
1014 else if (track->
Charge() < 0 ) {
1015 buffer_un[buffer_unn] = track;
1019 for (
Int_t pMix = 0; pMix < mix_unp; pMix++) {
1020 if(
fDebug > 1 ) cout << Form(
"mixing current k+ track %d with", pMix);
1022 for(
Int_t pBuf = 0; pBuf < buffer_unp; pBuf++) {
1023 if(
fDebug > 1 ) cout << Form(
" buffered k+ track %d", pBuf) << endl;
1026 PtSelector(1, mix_up[pMix], buffer_up[pBuf]);
1030 for(
Int_t nBuf = 0; nBuf < buffer_unn; nBuf++) {
1031 if(
fDebug > 1 ) cout << Form(
" buffered k- track %d", nBuf) << endl;
1034 PtSelector(2, mix_up[pMix], buffer_un[nBuf]);
1038 for (
Int_t nMix = 0; nMix < mix_unn; nMix++) {
1039 if(
fDebug > 1 ) cout << Form(
"mixing current k- track %d with", nMix);
1041 for(
Int_t nBuf = 0; nBuf < buffer_unn; nBuf++) {
1042 if(
fDebug > 1 ) cout << Form(
" buffered k- track %d", nBuf) << endl;
1045 PtSelector(2, mix_un[nMix], buffer_un[nBuf]);
1049 for(
Int_t pBuf = 0; pBuf < buffer_unp; pBuf++) {
1050 if(
fDebug > 1 ) cout << Form(
" buffered k+ track %d", pBuf) << endl;
1053 PtSelector(1, mix_un[nMix], buffer_up[pBuf]);
1059 pool->UpdatePool(MixingCandidates);
1060 if(
fDebug > 0 ) pool->PrintInfo();
1066 if(
fDebug > 0) cout <<
" *** Terminate() *** " << endl;
1072 if(
fDebug > 1 ) cout <<
" *** MakeTrack() *** " << endl;
1075 Double_t y = 0.5*TMath::Log((TMath::Sqrt(mass*mass+p*p)+pz)/(TMath::Sqrt(mass*mass+p*p)-pz));
1078 Bool_t overwrite = kTRUE;
1100 TClonesArray *arrayMC = 0;
1101 if(
fDebug > 0) cout <<
" -> Switching to MC mode <- " << endl;
1103 arrayMC = (TClonesArray*)
fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1104 if (!arrayMC) AliFatal(
"Error: MC particles branch not found!\n");
1105 for (
Int_t iTracks = 0; iTracks <
fAOD->GetNumberOfTracks(); iTracks++) {
1106 AliAODTrack* track =
dynamic_cast<AliAODTrack*
>(
fAOD->GetTrack(iTracks));
1107 if(!track) AliFatal(
"Not a standard AOD");
1109 if(
fDebug>1) cout <<
" Rejected track" << endl;
1112 if (
fDebug>1) cout <<
" Received MC kaon " << endl;
1114 Double_t bCov[3] = { -99., -99., -99.};
1115 AliAODTrack copy(*track);
1116 if(!copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov))
return;
1118 AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(TMath::Abs(track->GetLabel()));
1120 if(
fDebug > 1) cout <<
"Cannot get MC particle" << endl;
1124 Bool_t isPrimary = partMC->IsPhysicalPrimary();
1125 Bool_t isSecondaryMaterial = kFALSE;
1126 Bool_t isSecondaryWeak = kFALSE;
1128 Int_t mfl = -999, codemoth = -999;
1129 Int_t indexMoth = partMC->GetMother();
1130 if (indexMoth >= 0) {
1131 AliAODMCParticle* moth = (AliAODMCParticle*) arrayMC->At(indexMoth);
1132 codemoth = TMath::Abs(moth->GetPdgCode());
1133 mfl =
Int_t(codemoth / TMath::Power(10,
Int_t(TMath::Log10(codemoth))));
1135 if (mfl == 3) isSecondaryWeak = kTRUE;
1136 else isSecondaryMaterial = kTRUE;
1144 if (isSecondaryMaterial)
fDCAMaterial->Fill(track->Pt(), b[0]);
1156 printf(
"One of vertices is not valid\n");
1159 static TMatrixDSym vVb(3);
1161 double dx = v0->GetX()-v1->GetX();
1162 double dy = v0->GetY()-v1->GetY();
1163 double dz = v0->GetZ()-v1->GetZ();
1164 double cov0[6],cov1[6];
1165 v0->GetCovarianceMatrix(cov0);
1166 v1->GetCovarianceMatrix(cov1);
1176 vVb(1,1) = cov0[2]+cov1[2];
1177 vVb(2,2) = cov0[5]+cov1[5];
1178 vVb(1,0) = vVb(0,1) = cov0[1]+cov1[1];
1179 vVb(0,2) = vVb(1,2) = vVb(2,0) = vVb(2,1) = 0.;
1181 if (!vVb.IsValid()) {printf(
"Singular Matrix\n");
return dist;}
1182 dist = vVb(0,0)*dx*dx + vVb(1,1)*dy*dy + vVb(2,2)*dz*dz
1183 + 2*vVb(0,1)*dx*dy + 2*vVb(0,2)*dx*dz + 2*vVb(1,2)*dy*dz;
1184 return dist>0 ? TMath::Sqrt(dist) : -1;
1196 const int kMinPlpContrib = 5;
1197 const double kMaxPlpChi2 = 5.0;
1198 const double kMinWDist = 15;
1200 const AliVVertex* vtPrm = 0;
1201 const AliVVertex* vtPlp = 0;
1204 if ( !(nPlp=aod->GetNumberOfPileupVerticesTracks()) )
return kFALSE;
1205 vtPrm = aod->GetPrimaryVertex();
1206 if (vtPrm == aod->GetPrimaryVertexSPD())
return kTRUE;
1210 for (
int ipl=0;ipl<nPlp;ipl++) {
1211 vtPlp = (
const AliVVertex*)aod->GetPileupVertexTracks(ipl);
1213 if (vtPlp->GetNContributors() < kMinPlpContrib)
continue;
1214 if (vtPlp->GetChi2perNDF() > kMaxPlpChi2)
continue;
1218 double wDst =
GetWDist(vtPrm,vtPlp);
1219 if (wDst<kMinWDist)
continue;
1235 if((nSk == nSpi) && (nSk == nSp))
1237 if((nSk < nSpi) && (nSk < nSp) && (nSk <
fPIDConfig[0]))
1240 if((nSpi < nSk) && (nSpi < nSp) && (nSpi <
fPIDConfig[0]))
1243 if((nSp < nSk) && (nSp < nSpi) && (nSp <
fPIDConfig[0]))
void SetMassMin(Double_t i)
Bool_t plpMV(const AliAODEvent *aod)
Bool_t PassesTPCbayesianCut(T *track) const
virtual ~AliAnalysisTaskPhiFlow()
TProfile * fV0Data[18][2]
subevent resolution info for v2
Double_t fCentralityMin
QA profile of centralty vs multiplicity.
Bool_t CheckVertex(const T *event)
void SetEta(Double_t eta)
TH2F * fDCASecondaryWeak
dca of primaries (mc) or kaons (data)
TH1F * fPtKP
QA histogram of p_t distribution of negative particles.
AliFlowEvent * fFlowEvent
pid response object
Bool_t fCandidateEtaPtCut
void ReconstructionWithEventMixing(TObjArray *MixingCandidates) const
Double_t PhiPt(const T *track_1, const T *track_2) const
Int_t GetNumberOfRPs() const
TH2F * fPIDk
QA histogram of TPC response of all charged particles.
void SetNbinsPhi(Int_t i)
void AddPhiIdentificationOutputObjects()
Int_t fVertexMixingBins[20]
void SetPhiMin(Double_t i)
TH1F * fPtKN
QA histogram of p_t distribution of positive kaons.
TH2F * fDCAPrim
qa plot of dca z
void AddDaughter(Int_t value)
void PlotMultiplcities(const T *event) const
TH2F * fDCAMaterial
dca of weak (mc)
void ComputeProb(const AliESDtrack *t, Float_t)
virtual void UserCreateOutputObjects()
TH1F * fPtSpectra[18]
like-sign kaon pairs
void SetMass(Double_t mass)
TH1F * fVZEROC
QA plot vzeroa multiplicity (all tracks in event)
Double_t InvariantMass(const T *track1, const T *track2) const
void SetEtaMax(Double_t i)
virtual Bool_t IsSelected(TObject *obj, Int_t id=-666)
void SetParamType(trackParameterType paramType)
void SetDetResponse(AliESDEvent *esd, Float_t centrality=-1.0, EStartTimeType_t flagStart=AliESDpid::kTOF_T0, Bool_t=kFALSE)
TH2F * fPIDTOF
QA histo of TOF repsonse charged particles.
void SetReferenceMultiplicity(Int_t m)
static Float_t GetPsi2TPC()
AliESDv0 * fV0
placeholder for the current kink
Bool_t EventCut(T *event)
Double_t GetWDist(const AliVVertex *v0, const AliVVertex *v1)
Bool_t InRPSelection() const
AliFlowBayesianPID * fBayesianResponse
AliFlowTrack * GetTrack(Int_t i)
UShort_t T(UShort_t m, UShort_t t)
Bool_t fSkipEventSelection
profiles for vzero vn(minv)
AliFlowTrackCuts * fCutsRP
Int_t fCentralityMixingBins[20]
void SetForRPSelection(Bool_t b=kTRUE)
TH1F * fPt
QA plot of azimuthal distribution of tracks used for event plane estimation.
void SetPtRange(Float_t r1, Float_t r2)
Int_t GetNDaughters(void) const
virtual void Exec(Option_t *)
void SetNumberOfRPs(Int_t nr)
void Fill(AliFlowTrackCuts *rpCuts, AliFlowTrackCuts *poiCuts)
const char * fkCentralityMethodA
Bool_t PassesDCACut(AliAODTrack *track) const
void PrepareFlowEvent(Int_t iMulti)
Bool_t GetCurrentMask(Int_t idet) const
void SetNbinsEta(Int_t i)
const char * fkCentralityMethodB
TH1F * fVZEROA
QA plot of eta distribution of tracks used for event plane estimation.
void SetNbinsMult(Int_t i)
Int_t fMixingParameters[3]
void SetMassMax(Double_t i)
static AliFlowCommonConstants * GetMaster()
TH2F * fMultvsCentr
QA profile global and tpc multiplicity after outlier cut.
static Float_t GetPsi2V0C()
TH1F * fEta
QA plot of p_t sectrum of tracks used for event plane estimation.
Double_t fCandidateMaxEta
void SetNbinsMass(Int_t i)
static Float_t GetPsi2V0A()
TH1F * fInvMNN[18]
unlike sign kaon pairs
AliEventPoolManager * InitializeEventMixing()
AliPIDResponse * fPIDResponse
Bool_t PhiTrack(T *track) const
void VZEROSubEventAnalysis()
Bool_t fCentralityCut2011
AliPIDResponse * fPIDResponse
void SetPhi(Double_t phi)
AliFlowTrackCuts * fNullCuts
TH2F * fMultCorAfterCuts
QA histogram of p_t distribution of negative kaons.
void DefineDeadZone(Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax)
void SetMultMax(Double_t i)
Double_t fCandidateMinEta
TH1F * fDCAZQA
qa plot of dca xz
Int_t GetIDDaughter(Int_t value) const
TObjArray * fCandidates
PID response object.
AliFlowTrackCuts * fPOICuts
QA profile of centralty vs multiplicity.
ClassImp(AliAnalysisTaskPhiFlow) ClassImp(AliPhiMesonHelperTrack) AliAnalysisTaskPhiFlow
void SetPtMax(Double_t i)
TH1F * fInvMNP[18]
QA histo of TOF response kaons.
Bool_t CheckCandidateEtaPtCut(const T *track1, const T *track2) const
Bool_t CheckCentrality(T *event)
void SetEvent(AliVEvent *event, AliMCEvent *mcEvent=NULL)
void InitializeBayesianPID(AliAODEvent *event)
TH1F * fPtN
QA histogram of p_t distribution of positive particles.
TH1F * BookHistogram(const char *name)
AliFlowBayesianPID * fBayesianResponse
flow events (one for each inv mass band)
Bool_t GetDoubleCountingK(Double_t nSk, Short_t minNSigma) const
void SetPhiMax(Double_t i)
void SetEtaMin(Double_t i)
void SetNewTrackParam(Bool_t flag=kTRUE)
AliPIDCombined * fPIDCombined
TH1F * InitPtSpectraHistograms(Float_t nmin, Float_t nmax)
void SetForPOISelection(Bool_t b=kTRUE)
TH1F * fDCAXYQA
qa dca of all charged particles
virtual Int_t Charge() const
TH2F * fNOPIDTOF
QA histogram of TPC response of kaons.
void SetMultMin(Double_t i)
Bool_t IsKaon(AliAODTrack *track) const
static Bool_t IsPsiComputed()
TH2F * fDCAAll
QA plot TPC multiplicity (tracks used for event plane estimation)
TList * fOutputList
event pool manager
virtual void Terminate(Option_t *)
TProfile * fSubEventDPhiv2
dca material (mc) all (data)
void SetPtMin(Double_t i)
TH1F * BookPtHistogram(const char *name)
TH1F * fTPCM
QA plot vzeroc multiplicity (all tracks in event)
Short_t FindMinNSigma(Double_t nSpi, Double_t nSk, Double_t nSp) const
TH2F * BookPIDHistogram(const char *name, Bool_t TPC)
virtual void UserExec(Option_t *option)
Bool_t fCentralityCut2010
void InsertTrack(AliFlowTrack *)
AliEventPoolManager * fPoolManager
AOD oject.
TH1F * fInvMPP[18]
like-sign kaon pairs
void PtSelector(Int_t _track_type, const T *track_1, const T *track_2) const
TH2F * fNOPID
QA histogram of events that do not pass centrality cut.
void MakeTrack(Double_t, Double_t, Double_t, Double_t, Int_t, Int_t[], Double_t p=0., Double_t pz=0.) const
void SetEtaRange(Float_t r1, Float_t r2)
Int_t NumberOfTracks() const