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 "AliAODMCParticle.h"
49 #include "AliEventPoolManager.h"
50 #include "AliMultSelection.h"
61 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)
64 for(
Int_t i(0); i < 7; i++) fPIDConfig[i] = 0.;
65 for(
Int_t i(0); i < 5; i++) fDCAConfig[i] = 0.;
66 for(
Int_t i(0); i < 20; i++) {
67 fVertexMixingBins[i] = 0;
68 fCentralityMixingBins[i] = 0;
70 fMixingParameters[0] = 1000; fMixingParameters[1] = 50000; fMixingParameters[2] = 5;
71 for(
Int_t i(0); i < 18; i++) {
72 for(
Int_t j(0); j < 2; j++) fV0Data[i][j] = 0;
73 fInvMNP[i] = 0; fInvMNN[i] = 0; fInvMPP[i] = 0; fPtSpectra[i] = 0; fPtBins[i] = 0.;
78 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)
83 for(
Int_t i(0); i < 20; i++) {
88 for(
Int_t i(0); i < 18; i++) {
92 DefineInput(0, TChain::Class());
93 DefineOutput(1, TList::Class());
94 DefineOutput(2, AliFlowEventSimple::Class());
95 if(
fDebug > 0) cout <<
" === Created instance of AliAnaysisTaskPhiFlow === " << endl;
108 if (
fDebug > 0) cout <<
" === Deleted instance of AliAnalysisTaskPhiFlow === " << endl;
114 if(
fDebug > 0) cout <<
" *** BookHistogram() *** " << name << endl;
115 TH1F *hist =
new TH1F(name, Form(
"M_{INV} (%s)", name), 60, .99, 1.092);
116 hist->GetXaxis()->SetTitle(
"M_{INV} (GeV / c^{2})");
117 hist->GetYaxis()->SetTitle(
"No. of pairs");
118 hist->SetMarkerStyle(kFullCircle);
127 if(
fDebug > 0) cout <<
" *** BookPIDHisotgram() *** " << endl;
130 hist =
new TH2F(name, Form(
"PID (%s)", name), 100, 0, 5, 100, 0, 1000);
131 hist->GetYaxis()->SetTitle(
"dE/dx (a.u.)");
134 hist =
new TH2F(name, Form(
"PID (%s)", name), 100, 0, 5, 100, 0, 1.5);
135 hist->GetYaxis()->SetTitle(
"#beta");
137 hist->GetXaxis()->SetTitle(
"P (GeV / c)");
145 if(
fDebug > 0) cout <<
" *** InitPtSpectraHistograms() *** " << endl;
146 TH1F* hist =
new TH1F(Form(
"%4.2f p_{t} %4.2f", nmin, nmax), Form(
"%f p_{t} %f", nmin, nmax), 60, nmin, nmax);
147 hist->GetXaxis()->SetTitle(
"p_{T} GeV / c");
155 if(
fDebug > 0) cout <<
" *** BookPtHistogram() *** " << endl;
156 TH1F* ratio =
new TH1F(name, name, 100, 0, 7);
157 ratio->GetXaxis()->SetTitle(
"p_{T} ( GeV / c^{2} )");
158 ratio->GetYaxis()->SetTitle(
"No. of events");
167 if(
fDebug > 0) cout <<
" ** AddPhiIdentificationOutputObjects() *** " << endl;
169 fEventStats =
new TH1F(
"fHistStats",
"Event Statistics", 18, -.25, 4.25);
170 fEventStats->GetXaxis()->SetTitle(
"No. of events");
174 fCentralityPass =
new TH1F(
"fCentralityPass",
"Centrality Pass", 101, -1, 100);
177 fCentralityNoPass =
new TH1F(
"fCentralityNoPass",
"Centrality No Pass", 101, -1, 100);
195 fPhi =
new TH1F(
"fPhi",
"#phi distribution", 100, -.5, 7);
197 fPt =
new TH1F(
"fPt",
"p_{T}", 100, 0, 5.5);
199 fEta =
new TH1F(
"fEta",
"#eta distribution", 100, -1.1, 1.1);
201 fVZEROA =
new TH1F(
"fVZEROA",
"VZERO A Multiplicity", 1000, 0, 10000);
203 fVZEROC =
new TH1F(
"fVZEROC",
"VZERO C Multiplicity", 1000, 0, 10000);
205 fTPCM =
new TH1F(
"fTPCM",
"TPC multiplicity", 1000, 0, 10000);
207 fDCAXYQA =
new TH1F(
"fDCAXYQA",
"fDCAXYQA", 1000, -5, 5);
209 fDCAZQA =
new TH1F(
"fDCAZQA",
"fDCAZQA", 1000, -5, 5);
212 fMultCorAfterCuts =
new TH2F(
"fMultCorAfterCuts",
"TPC vs Global multiplicity (After cuts); Global multiplicity; TPC multiplicity", 100, 0, 3000, 100, 0, 3000);
214 fMultvsCentr =
new TH2F(
"fMultvsCentr",
"Multiplicity vs centrality; centrality; Multiplicity", 9, -0.5, 100.5, 101, 0, 3000);
219 fDCAAll =
new TH2F(
"fDCAAll",
"fDCAAll", 1000, 0, 10, 1000, -5, 5);
221 fDCAPrim =
new TH2F(
"fDCAprim",
"fDCAprim", 1000, 0, 10, 1000, -5, 5);
225 fDCAMaterial =
new TH2F(
"fDCAMaterial",
"fDCAMaterial", 1000, 0, 10, 1000, -5, 5);
229 fSubEventDPhiv2 =
new TProfile(
"fSubEventDPhiv2",
"fSubEventDPhiv2", 5, 0, 5);
233 fSubEventDPhiv2->GetXaxis()->SetBinLabel(4,
"#sqrt{#frac{<#Psi_{a} - #Psi_{b}><#Psi_{a} - #Psi_{c}>}{<#Psi_{b} - #Psi_{c}>}}");
234 fSubEventDPhiv2->GetXaxis()->SetBinLabel(5,
"#sqrt{#frac{<#Psi_{a} - #Psi_{c}><#Psi_{b} - #Psi_{c}>}{<#Psi_{a} - #Psi_{b}>}}");
236 const char* V0[] = {
"V0A",
"V0C"};
238 for(
Int_t iV0(0); iV0 < 2; iV0++) {
239 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);
248 if(
fDebug > 0) cout <<
" *** UserCreateOutputObjects() *** " << endl;
254 fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC|AliPIDResponse::kDetTOF);
260 if(t < 0.1) AliFatal(
"No valid PID procedure recognized -- terminating analysis !!!");
261 if(
fNPtBins > 18) AliFatal(
"Invalid number of pt bins initialied ( > 18 ) -- terminating analysis !!!");
272 AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());
273 if (inputHandler)
fPIDResponse = inputHandler->GetPIDResponse();
293 if(
fDebug > 0) cout <<
" *** InitializeEventMixing() *** " << endl;
295 for(
Int_t i(0); i < 19; i++) {
299 for(
Int_t i(0); i < 19; i++) {
303 if(
fDebug > 0 ) cout << Form(
" --> found %d centrality bins for mixing, %d vertex bins for mixing", _c, _v) << endl;
314 if(
fDebug > 1) cout <<
" *** InvariantMass() *** " << endl;
315 if ((!track2) || (!track1))
return 0.;
316 Double_t masss = TMath::Power(4.93676999999999977e-01, 2);
317 Double_t pxs = TMath::Power((track1->Px() + track2->Px()), 2);
318 Double_t pys = TMath::Power((track1->Py() + track2->Py()), 2);
319 Double_t pzs = TMath::Power((track1->Pz() + track2->Pz()), 2);
320 Double_t e1 = TMath::Sqrt(track1->P() * track1->P() + masss);
321 Double_t e2 = TMath::Sqrt(track2->P() * track2->P() + masss);
322 Double_t es = TMath::Power((e1 + e2), 2);
323 if ((es - (pxs + pys + pzs)) < 0)
return 0.;
324 return TMath::Sqrt((es - (pxs + pys + pzs)));
348 if(
fDebug > 1) cout <<
" *** CheckCandidateEtaPtCut() *** " << endl;
350 TVector3 a(track1->Px(), track1->Py(), track1->Pz());
351 TVector3 b(track2->Px(), track2->Py(), track2->Pz());
360 if(
fDebug > 0) cout <<
" *** EventCut() *** " << endl;
361 if (!event)
return kFALSE;
372 if(
fDebug > 1) cout <<
" *** PlotMultiplcities() *** " << endl;
373 fVZEROA->Fill(event->GetVZEROData()->GetMTotV0A());
374 fVZEROC->Fill(event->GetVZEROData()->GetMTotV0C());
375 fTPCM->Fill(event->GetNumberOfTracks());
381 if(
fDebug > 0) cout <<
" *** CheckVertex() *** " << endl;
382 if (!event->GetPrimaryVertex())
return 0x0;
383 fVertex =
event->GetPrimaryVertex()->GetZ();
391 if(
fDebug > 0) cout <<
" *** CheckCentrality() *** " << endl;
397 AliMultSelection *multSelection = 0x0;
398 multSelection =
static_cast<AliMultSelection*
>(
event->FindListObject(
"MultSelection"));
399 if(multSelection)
fCentrality = multSelection->GetMultiplicityPercentile(
"V0M");
404 if (TMath::Abs(
fCentrality-cenB) > 5 || cenB >= 80 || cenB < 0 || fCentrality <= fCentralityMin || fCentrality >
fCentralityMax) {
408 const Int_t nGoodTracks =
event->GetNumberOfTracks();
412 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
413 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
414 if(!trackAOD) AliFatal(
"Not a standard AOD");
415 if (!trackAOD)
continue;
416 if (!(trackAOD->TestFilterBit(1)))
continue;
417 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;
420 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
421 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
422 if(!trackAOD) AliFatal(
"Not a standard AOD");
423 if (!trackAOD)
continue;
424 if (!(trackAOD->TestFilterBit(16)))
continue;
425 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;
427 Double_t bCov[3] = {-99., -99., -99.};
428 AliAODTrack copy(*trackAOD);
429 if (!(copy.PropagateToDCA(event->GetPrimaryVertex(),
event->GetMagneticField(), 100., b, bCov)))
continue;
430 if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3))
continue;
434 if(! (multTPC > (-40.3+1.22*multGlob) && multTPC < (32.1+1.59*multGlob)))
return kFALSE;
444 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
445 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
446 if(!trackAOD) AliFatal(
"Not a standard AOD");
447 if (!trackAOD)
continue;
448 if (!(trackAOD->TestFilterBit(1)))
continue;
449 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;
452 for(
Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
453 AliAODTrack* trackAOD =
dynamic_cast<AliAODTrack*
>(
event->GetTrack(iTracks));
454 if(!trackAOD) AliFatal(
"Not a standard AOD");
455 if (!trackAOD)
continue;
456 if (!(trackAOD->TestFilterBit(16)))
continue;
457 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;
459 Double_t bCov[3] = {-99., -99., -99.};
460 AliAODTrack copy(*trackAOD);
461 if (!(copy.PropagateToDCA(event->GetPrimaryVertex(),
event->GetMagneticField(), 100., b, bCov)))
continue;
462 if ((TMath::Abs(b[0]) > 0.3) || (TMath::Abs(b[1]) > 0.3))
continue;
466 if(! (multTPC > (-36.73 + 1.48*multGlob) && multTPC < (62.87 + 1.78*multGlob)))
return kFALSE;
480 if(
fDebug > 0) cout <<
" *** InitializeBayesianPID() *** " << endl;
487 if(
fDebug > 1) cout <<
" *** PassesTPCbayesianCut() *** " << endl;
492 if(
fQA) {
fPhi->Fill(track->Phi());
fPt->Fill(track->Pt());
fEta->Fill(track->Eta());}
505 if(
fDebug > 1) cout <<
" *** PassesDCACut() *** " << endl;
506 if(
fIsMC)
return kTRUE;
507 AliAODTrack copy(*track);
511 Double_t bCov[3] = { -99., -99., -99.};
512 if(copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov)) {
521 Double_t bCov[3] = { -99., -99., -99.};
522 if(!copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov))
return kFALSE;
526 if(
fDCAConfig[4] < TMath::Abs(b[1]))
return kFALSE;
528 if( denom < 0.0000001 )
return kFALSE;
542 if(
fDebug > 1) cout <<
" *** IsKaon() *** " << endl;
544 Double_t prob[10] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
549 if(
fQA) {
fNOPID->Fill(track->P(), track->GetTPCsignal());
fNOPIDTOF->Fill(track->P(), track->GetTOFsignal());}
551 if(
fDebug>1) cout <<
" ITS received track with p_t " << track->Pt() << endl;
559 else if (TMath::Abs(
fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion)) <
fPIDConfig[3])
return kFALSE;
561 if(
fQA) {
fPIDk->Fill(track->P(), track->GetTPCsignal());
fPIDTOF->Fill(track->P(), track->GetTOFsignal());}
567 if(
fDebug>1) cout <<
" TPC received track with p_t " << track->Pt() << endl;
575 else if (TMath::Abs(
fPIDResponse->NumberOfSigmasITS(track, AliPID::kPion)) <
fPIDConfig[0])
return kFALSE;
577 if(
fQA) {
fPIDk->Fill(track->P(), track->GetTPCsignal());
fPIDTOF->Fill(track->P(), track->GetTOFsignal());}
582 if(
fDebug>1) cout <<
" Bayesian method received track with p_t " << track->Pt() << endl;
585 if(
fQA) {
fPIDk->Fill(track->P(), track->GetTPCsignal());
fPIDTOF->Fill(track->P(), track->GetTOFsignal());}
594 TVector3 a(track1->Px(), track1->Py(), track1->Pz());
595 TVector3 b(track2->Px(), track2->Py(), track2->Pz());
604 if (tracktype == 0) {
612 if (tracktype == 1) {
619 if (tracktype == 2) {
631 if(!track)
return kFALSE;
638 if (
fDebug > 0) cout <<
" *** SetNullCuts() *** " <<
fCutsRP << endl;
649 if (
fDebug > 0 ) cout <<
" *** PrepareFlowEvent() *** " << endl;
659 if(
fDebug > 0) cout <<
" ** VZEROSubEventAnalysis() *** " << endl;
661 if(
fDebug > 0 ) cout <<
"Fatal error: unable to retrieve VZERO task output !!! Exiting ..." << endl;
666 for(
Int_t i(0); i < 3; i++)
if(abcPsi2[i] == 0) {
667 if(
fDebug > 0) cout <<
" Warning: I've encountered 0 in one of the symmetry panes (TPC, VZERO) - skipping event !" << endl;
671 Float_t qaqb = TMath::Cos(2.*(abcPsi2[0]-abcPsi2[1]));
672 Float_t qaqc = TMath::Cos(2.*(abcPsi2[0]-abcPsi2[2]));
673 Float_t qbqc = TMath::Cos(2.*(abcPsi2[1]-abcPsi2[2]));
680 for(
Int_t mb(0); mb < 31; mb++) minv[mb] = 0.99 + mb * 0.0034;
683 if(k==0) occurence[i][j] = 0;
688 if(
fDebug > 1) cout <<
" --> dynamic_cast returned null-pointer, skipping candidate <-- " << endl;
691 for(
Int_t mb(0); mb < 30; mb++) {
692 if(track->
Mass() <= minv[mb] || track->
Mass() > minv[mb+1])
continue;
695 _dphi[mb][ptbin][0]+=TMath::Cos(2.*(track->
Phi() - abcPsi2[0]));
696 _dphi[mb][ptbin][1]+=TMath::Cos(2.*(track->
Phi() - abcPsi2[2]));
697 occurence[mb][ptbin]+=1;
700 for(
Int_t mb(0); mb < 30; mb++)
702 if(occurence[mb][ptbin]==0)
continue;
703 fV0Data[ptbin][0]->Fill(mb*0.0034+0.99+0.0017, _dphi[mb][ptbin][0]/(
Float_t)occurence[mb][ptbin]);
704 fV0Data[ptbin][1]->Fill(mb*0.0034+0.99+0.0017, _dphi[mb][ptbin][1]/(
Float_t)occurence[mb][ptbin]);
712 if(
fDebug > 0 ) cout <<
" *** UserExec() *** " << endl;
716 MixingCandidates->SetOwner(kTRUE);
719 if(
fDebug > 0 ) cout <<
" Could not get PID response " << endl;
731 Int_t unTracks =
fAOD->GetNumberOfTracks();
732 AliAODTrack* un[unTracks];
733 AliAODTrack* up[unTracks];
736 for (
Int_t iTracks = 0; iTracks < unTracks; iTracks++) {
737 AliAODTrack* track =
dynamic_cast<AliAODTrack*
>(
fAOD->GetTrack(iTracks));
738 if(!track) AliFatal(
"Not a standard AOD");
741 if(track->Charge() > 0) {
fEventStats->Fill(1);
fPtP->Fill(track->Pt());}
742 if(track->Charge() < 0) {
fEventStats->Fill(2);
fPtN->Fill(track->Pt());}
746 track->Px(), track->Py(), track->Pz(),
747 track->Pt(), track->Charge()));
748 if (track->Charge() > 0) {
753 else if (track->Charge() < 0) {
760 for (
Int_t pTracks = 0; pTracks < unp ; pTracks++) {
761 for (
Int_t nTracks = 0; nTracks < unn ; nTracks++) {
767 TVector3 a(up[pTracks]->Px(), up[pTracks]->Py(), up[pTracks]->Pz());
768 TVector3 b(un[nTracks]->Px(), un[nTracks]->Py(), up[pTracks]->Pz());
772 Double_t p = TMath::Sqrt(c.Px()*c.Px()+c.Py()*c.Py()+c.Pz()*c.Pz());
774 nIDs[0] = up[pTracks]->GetID();
775 nIDs[1] = un[nTracks]->GetID();
776 MakeTrack(mass, pt, phi, eta, 2, nIDs, p, c.Pz());
780 if (
fDebug > 0) printf(
"I received %d candidates\n",
fCandidates->GetEntriesFast());
781 for (
int iCand = 0; iCand !=
fCandidates->GetEntriesFast(); ++iCand) {
784 if (
fDebug > 1) printf(
" --> Checking at candidate %d with %d daughters: mass %f\n", iCand, cand->
GetNDaughters(), cand->
Mass());
792 if (
fDebug > 1) printf(
" was in RP set");
797 if (
fDebug > 1) printf(
"\n");
804 for (
Int_t pTracks = 0; pTracks < unp ; pTracks++) {
805 for (
Int_t nTracks = pTracks + 1; nTracks < unp ; nTracks++) {
811 for (
Int_t nTracks = 0; nTracks < unn ; nTracks++) {
812 for (
Int_t pTracks = nTracks + 1; pTracks < unn ; pTracks++) {
830 else AliAnalysisTaskSE::Exec(c);
836 if(
fDebug > 0) cout <<
" *** ReconstructionWithEventMixing() *** " << endl;
838 if(!pool) AliFatal(Form(
"No pool found for centrality = %f, zVtx = %f",
fCentrality,
fVertex));
841 if(
fDebug > 0) cout <<
" --> " << nEvents <<
" events in mixing buffer ... " << endl;
843 TObjArray* mixed_candidates = pool->GetEvent(iEvent);
844 if(!mixed_candidates)
continue;
845 Int_t bufferTracks = mixed_candidates->GetEntriesFast();
846 Int_t candidates = MixingCandidates->GetEntriesFast();
847 if(
fDebug > 0) cout << Form(
" - mixing %d tracks with %d buffered tracks from event %d ... ", candidates, bufferTracks, iEvent) << endl;
856 for (
Int_t iTracks = 0; iTracks < candidates; iTracks++) {
859 if (track->
Charge() > 0) {
860 mix_up[mix_unp] = track;
863 else if (track->
Charge() < 0 ) {
864 mix_un[mix_unn] = track;
868 for (
Int_t iTracks = 0; iTracks < bufferTracks; iTracks++) {
871 if (track->
Charge() > 0) {
872 buffer_up[buffer_unp] = track;
875 else if (track->
Charge() < 0 ) {
876 buffer_un[buffer_unn] = track;
880 for (
Int_t pMix = 0; pMix < mix_unp; pMix++) {
881 if(
fDebug > 1 ) cout << Form(
"mixing current k+ track %d with", pMix);
883 for(
Int_t pBuf = 0; pBuf < buffer_unp; pBuf++) {
884 if(
fDebug > 1 ) cout << Form(
" buffered k+ track %d", pBuf) << endl;
891 for(
Int_t nBuf = 0; nBuf < buffer_unn; nBuf++) {
892 if(
fDebug > 1 ) cout << Form(
" buffered k- track %d", nBuf) << endl;
899 for (
Int_t nMix = 0; nMix < mix_unn; nMix++) {
900 if(
fDebug > 1 ) cout << Form(
"mixing current k- track %d with", nMix);
902 for(
Int_t nBuf = 0; nBuf < buffer_unn; nBuf++) {
903 if(
fDebug > 1 ) cout << Form(
" buffered k- track %d", nBuf) << endl;
910 for(
Int_t pBuf = 0; pBuf < buffer_unp; pBuf++) {
911 if(
fDebug > 1 ) cout << Form(
" buffered k+ track %d", pBuf) << endl;
920 pool->UpdatePool(MixingCandidates);
921 if(
fDebug > 0 ) pool->PrintInfo();
927 if(
fDebug > 0) cout <<
" *** Terminate() *** " << endl;
933 if(
fDebug > 1 ) cout <<
" *** MakeTrack() *** " << endl;
936 Double_t y = 0.5*TMath::Log((TMath::Sqrt(mass*mass+p*p)+pz)/(TMath::Sqrt(mass*mass+p*p)-pz));
961 TClonesArray *arrayMC = 0;
962 if(
fDebug > 0) cout <<
" -> Switching to MC mode <- " << endl;
964 arrayMC = (TClonesArray*)
fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName());
965 if (!arrayMC) AliFatal(
"Error: MC particles branch not found!\n");
966 for (
Int_t iTracks = 0; iTracks <
fAOD->GetNumberOfTracks(); iTracks++) {
967 AliAODTrack* track =
dynamic_cast<AliAODTrack*
>(
fAOD->GetTrack(iTracks));
968 if(!track) AliFatal(
"Not a standard AOD");
970 if(
fDebug>1) cout <<
" Rejected track" << endl;
973 if (
fDebug>1) cout <<
" Received MC kaon " << endl;
975 Double_t bCov[3] = { -99., -99., -99.};
976 AliAODTrack copy(*track);
977 if(!copy.PropagateToDCA(
fAOD->GetPrimaryVertex(),
fAOD->GetMagneticField(), 100., b, bCov))
return;
979 AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(TMath::Abs(track->GetLabel()));
981 if(
fDebug > 1) cout <<
"Cannot get MC particle" << endl;
985 Bool_t isPrimary = partMC->IsPhysicalPrimary();
986 Bool_t isSecondaryMaterial = kFALSE;
987 Bool_t isSecondaryWeak = kFALSE;
989 Int_t mfl = -999, codemoth = -999;
990 Int_t indexMoth = partMC->GetMother();
991 if (indexMoth >= 0) {
992 AliAODMCParticle* moth = (AliAODMCParticle*) arrayMC->At(indexMoth);
993 codemoth = TMath::Abs(moth->GetPdgCode());
994 mfl =
Int_t(codemoth / TMath::Power(10,
Int_t(TMath::Log10(codemoth))));
996 if (mfl == 3) isSecondaryWeak = kTRUE;
997 else isSecondaryMaterial = kTRUE;
1005 if (isSecondaryMaterial)
fDCAMaterial->Fill(track->Pt(), b[0]);
void SetMassMin(Double_t i)
Bool_t PassesTPCbayesianCut(T *track) const
virtual ~AliAnalysisTaskPhiFlow()
TProfile * fV0Data[18][2]
subevent resolution info for v2
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)
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
Bool_t fUsePidResponse
profiles for vzero vn(minv)
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)
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)
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