26 #include <THnSparse.h> 27 #include <TClonesArray.h> 28 #include <TParticle.h> 31 #include "AliESDEvent.h" 32 #include "AliAODEvent.h" 33 #include "AliMCEvent.h" 35 #include "AliHeader.h" 36 #include "AliInputEventHandler.h" 37 #include "AliGenDPMjetEventHeader.h" 41 #include "AliV0vertexer.h" 43 #include "AliESDtrack.h" 44 #include "AliAODTrack.h" 45 #include "AliMCParticle.h" 46 #include "AliAODMCParticle.h" 48 #include "AliPIDResponse.h" 49 #include "AliAnalysisUtils.h" 51 #include "AliCentrality.h" 52 #include "AliMultSelection.h" 71 fIsSkipFastOnly(kFALSE),
72 fIsRefitV0sESD(kFALSE),
88 fCutMinDauDCAtoPV(0.),
89 fCutMinDauXrowsTPC(0.),
90 fCutMinDauXrowsOverFindableClusTPC(0.),
91 fCutMaxKshortSigmaTPC(0.),
92 fCutMinKshortCosPA(0.),
93 fCutMaxKshortCtau(0.),
94 fCutMaxKshortArmFrac(0.),
95 fCutMinKshortDeltaM(0.),
96 fCutMaxLambdaSigmaTPC(0.),
97 fCutMinLambdaCosPA(0.),
98 fCutMaxLambdaCtau(0.),
99 fCutMaxLambdaArmFrac(0.),
100 fCutMinLambdaDeletaM(0.),
106 fPicoV0sClArr(
nullptr),
107 fOutputListEH(
nullptr),
108 fOutputListMC(
nullptr)
114 for (
auto &d : fPrimaryVtx) d = -999.;
120 fTriggerMask(AliVEvent::kAny),
125 fUseAnaUtils(kFALSE),
126 fIsSkipFastOnly(kTRUE),
127 fIsRefitV0sESD(kFALSE),
130 fCutMinMult(-99999.),
131 fCutMaxMult(999999.),
140 fCutMinV0Radius(0.3),
141 fCutMaxV0Radius(200.),
143 fCutMinDauDCAtoPV(0.05),
144 fCutMinDauXrowsTPC(70.),
145 fCutMinDauXrowsOverFindableClusTPC(0.8),
146 fCutMaxKshortSigmaTPC(-1.),
147 fCutMinKshortCosPA(0.95),
148 fCutMaxKshortCtau(30.),
149 fCutMaxKshortArmFrac(-1.),
150 fCutMinKshortDeltaM(0.003),
151 fCutMaxLambdaSigmaTPC(7.),
152 fCutMinLambdaCosPA(0.993),
153 fCutMaxLambdaCtau(40.),
154 fCutMaxLambdaArmFrac(-1.),
155 fCutMinLambdaDeletaM(-1.),
171 DefineOutput(1, TList::Class());
262 if (!(InputEvent()->FindListObject(
"PicoV0s"))) InputEvent()->AddObject(
fPicoV0sClArr);
314 auto hKshortPtInvM(static_cast<TH2D*>(
fOutputListEH->FindObject(
"hKshortPtInvM")));
315 auto hLambdaPtInvM(static_cast<TH2D*>(
fOutputListEH->FindObject(
"hLambdaPtInvM")));
316 auto hAntiLaPtInvM(static_cast<TH2D*>(
fOutputListEH->FindObject(
"hAntiLaPtInvM")));
319 for (
auto iV0=0; iV0<nV0s; ++iV0) {
351 delete pV0RD; pV0RD=
nullptr;
359 delete pV0MC; pV0MC=
nullptr;
374 if (pV0->GetOnFlyStatus())
return nullptr;
383 Double_t dV0Vtx[3]; pV0->GetXYZ(dV0Vtx);
384 const auto dV0Radius(TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]));
387 const auto dDausDCA(pV0->DcaV0Daughters());
if (dDausDCA>
fCutMaxDausDCA)
return nullptr;
388 const auto dPosDCAtoPV(pV0->DcaPosToPrimVertex());
if (dPosDCAtoPV<
fCutMinDauDCAtoPV)
return nullptr;
389 const auto dNegDCAtoPV(pV0->DcaNegToPrimVertex());
if (dNegDCAtoPV<
fCutMinDauDCAtoPV)
return nullptr;
392 auto pDauPos(static_cast<AliAODTrack*>(pV0->GetDaughter(0)));
if (!pDauPos)
return nullptr;
393 auto pDauNeg(static_cast<AliAODTrack*>(pV0->GetDaughter(1)));
if (!pDauNeg)
return nullptr;
395 if (!(pDauPos->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
396 if (!(pDauNeg->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
398 if ((pDauPos->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return nullptr;
399 if ((pDauNeg->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return nullptr;
401 const auto dPosXrowsTPC(pDauPos->GetTPCClusterInfo(2,1));
402 const auto dNegXrowsTPC(pDauNeg->GetTPCClusterInfo(2,1));
403 const auto dDauXrowsTPC((dPosXrowsTPC<dNegXrowsTPC) ? dPosXrowsTPC : dNegXrowsTPC);
406 const auto wPosTPCNClsF(pDauPos->GetTPCNclsF());
if (wPosTPCNClsF<=0)
return nullptr;
407 const auto wNegTPCNClsF(pDauNeg->GetTPCNclsF());
if (wNegTPCNClsF<=0)
return nullptr;
408 const auto dPosXrowsOverFindableClusTPC( ((
Double_t)dPosXrowsTPC) / ((
Double_t)wPosTPCNClsF) );
409 const auto dNegXrowsOverFindableClusTPC( ((
Double_t)dNegXrowsTPC) / ((
Double_t)wNegTPCNClsF) );
411 const auto dDauXrowsOverFindableClusTPC((dPosXrowsOverFindableClusTPC<dNegXrowsOverFindableClusTPC) ?
412 dPosXrowsOverFindableClusTPC :
413 dNegXrowsOverFindableClusTPC);
417 const auto nPosCharge(pDauPos->Charge());
418 const auto nNegCharge(pDauNeg->Charge());
419 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return nullptr;
421 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
422 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
423 if ((nPosCharge<0) && (nNegCharge>0)) {
424 pDauPos = (AliAODTrack*)pV0->GetDaughter(1);
425 pDauNeg = (AliAODTrack*)pV0->GetDaughter(0);
427 dPosPxPyPz[0] = pV0->MomNegX(); dPosPxPyPz[1] = pV0->MomNegY(); dPosPxPyPz[2] = pV0->MomNegZ();
428 dNegPxPyPz[0] = pV0->MomPosX(); dNegPxPyPz[1] = pV0->MomPosY(); dNegPxPyPz[2] = pV0->MomPosZ();
430 dPosPxPyPz[0] = pV0->MomPosX(); dPosPxPyPz[1] = pV0->MomPosY(); dPosPxPyPz[2] = pV0->MomPosZ();
431 dNegPxPyPz[0] = pV0->MomNegX(); dNegPxPyPz[1] = pV0->MomNegY(); dNegPxPyPz[2] = pV0->MomNegZ();
434 const TVector3 v3Pos(dPosPxPyPz);
435 const TVector3 v3Neg(dNegPxPyPz);
441 auto bIsKshort(kTRUE);
442 auto bIsLambda(kTRUE);
443 auto bIsAntiLa(kTRUE);
444 const auto dPosPionSigmaTPC(
fRespoPID->NumberOfSigmasTPC(pDauPos,AliPID::kPion));
445 const auto dNegPionSigmaTPC(
fRespoPID->NumberOfSigmasTPC(pDauNeg,AliPID::kPion));
463 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
466 const auto dV0CosPA(pV0->CosPointingAngle(
fPrimaryVtx));
477 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
480 auto dV0DistToPV(0.);
482 const auto dV0DistToPVoverP(TMath::Sqrt(dV0DistToPV) / (pV0->P()+1e-10));
493 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
496 const auto dV0ArmFrac(pV0->PtArmV0() / (TMath::Abs(pV0->AlphaV0())+1e-12));
506 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
515 const auto dKshortInvM((vPosPion +vNegPion).M());
516 const auto dLambdaInvM((vPosProton+vNegPion).M());
517 const auto dAntiLaInvM((vNegProton+vPosPion).M());
518 if (bIsKshort)
if ((dKshortInvM<(0.430006 - 0.0110029*dV0Pt)) ||
519 (dKshortInvM>(0.563707 + 0.0114979*dV0Pt))) bIsKshort = kFALSE;
521 if (bIsLambda || bIsAntiLa) {
522 const auto dLower(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt));
523 const auto dUpper(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt));
524 if (bIsLambda)
if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) bIsLambda = kFALSE;
525 if (bIsAntiLa)
if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) bIsAntiLa = kFALSE;
528 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
543 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
552 auto bPosInJC(kFALSE);
553 auto bNegInJC(kFALSE);
562 dDauXrowsOverFindableClusTPC,
563 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
564 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
566 dPosPionSigmaTPC, dPosProtonSigmaTPC,
567 dNegPionSigmaTPC, dNegProtonSigmaTPC));
577 if (pV0->GetOnFlyStatus())
return nullptr;
586 Double_t dV0Vtx[3]; pV0->GetXYZ(dV0Vtx[0], dV0Vtx[1], dV0Vtx[2]);
587 const auto dV0Radius(TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]));
590 const auto dDausDCA(pV0->GetDcaV0Daughters());
if (dDausDCA>
fCutMaxDausDCA)
return nullptr;
593 const auto nPosIndex(pV0->GetPindex());
if (nPosIndex<0)
return nullptr;
594 const auto nNegIndex(pV0->GetNindex());
if (nNegIndex<0)
return nullptr;
596 auto pDauPos(
fEventESD->GetTrack(nPosIndex));
if (!pDauPos)
return nullptr;
597 auto pDauNeg(
fEventESD->GetTrack(nNegIndex));
if (!pDauNeg)
return nullptr;
599 const auto dMegField(
fEventESD->GetMagneticField());
607 if (!(pDauPos->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
608 if (!(pDauNeg->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
609 if ((pDauPos->GetKinkIndex(0)>0) || (pDauNeg->GetKinkIndex(0)>0))
return nullptr;
611 const auto dPosXrowsTPC(pDauPos->GetTPCClusterInfo(2,1));
612 const auto dNegXrowsTPC(pDauNeg->GetTPCClusterInfo(2,1));
613 const auto dDauXrowsTPC((dPosXrowsTPC<dNegXrowsTPC) ? dPosXrowsTPC : dNegXrowsTPC);
616 const auto wPosTPCNClsF(pDauPos->GetTPCNclsF());
if (wPosTPCNClsF<=0)
return nullptr;
617 const auto wNegTPCNClsF(pDauNeg->GetTPCNclsF());
if (wNegTPCNClsF<=0)
return nullptr;
618 const auto dPosXrowsOverFindableClusTPC( ((
Double_t)dPosXrowsTPC) / ((
Double_t)wPosTPCNClsF) );
619 const auto dNegXrowsOverFindableClusTPC( ((
Double_t)dNegXrowsTPC) / ((
Double_t)wNegTPCNClsF) );
621 const auto dDauXrowsOverFindableClusTPC((dPosXrowsOverFindableClusTPC<dNegXrowsOverFindableClusTPC) ?
622 dPosXrowsOverFindableClusTPC :
623 dNegXrowsOverFindableClusTPC);
627 const auto nPosCharge(pDauPos->Charge());
628 const auto nNegCharge(pDauNeg->Charge());
629 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return nullptr;
631 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
632 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
633 if ((nPosCharge<0) && (nNegCharge>0)) {
634 pDauPos =
fEventESD->GetTrack(nNegIndex);
635 pDauNeg =
fEventESD->GetTrack(nPosIndex);
637 pV0->GetNPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
638 pV0->GetPPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
640 pV0->GetPPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
641 pV0->GetNPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
644 const TVector3 v3Pos(dPosPxPyPz);
645 const TVector3 v3Neg(dNegPxPyPz);
651 auto bIsKshort(kTRUE);
652 auto bIsLambda(kTRUE);
653 auto bIsAntiLa(kTRUE);
654 const auto dPosPionSigmaTPC(
fRespoPID->NumberOfSigmasTPC(pDauPos,AliPID::kPion));
655 const auto dNegPionSigmaTPC(
fRespoPID->NumberOfSigmasTPC(pDauNeg,AliPID::kPion));
673 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
687 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
690 auto dV0DistToPV(0.);
692 const auto dV0DistToPVoverP(TMath::Sqrt(dV0DistToPV) / (pV0->P()+1e-10));
703 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
706 const auto dV0ArmFrac(pV0->PtArmV0() / (TMath::Abs(pV0->AlphaV0())+1e-12));
716 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
725 const auto dKshortInvM((vPosPion +vNegPion).M());
726 const auto dLambdaInvM((vPosProton+vNegPion).M());
727 const auto dAntiLaInvM((vNegProton+vPosPion).M());
728 if (bIsKshort)
if ((dKshortInvM<(0.430006 - 0.0110029*dV0Pt)) ||
729 (dKshortInvM>(0.563707 + 0.0114979*dV0Pt))) bIsKshort = kFALSE;
731 if (bIsLambda || bIsAntiLa) {
732 const auto dLower(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt));
733 const auto dUpper(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt));
734 if (bIsLambda)
if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) bIsLambda = kFALSE;
735 if (bIsAntiLa)
if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) bIsAntiLa = kFALSE;
738 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
755 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
764 auto bPosInJC(kFALSE);
765 auto bNegInJC(kFALSE);
788 dDauXrowsOverFindableClusTPC,
789 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
790 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
792 dPosPionSigmaTPC, dPosProtonSigmaTPC,
793 dNegPionSigmaTPC, dNegProtonSigmaTPC));
803 if (pV0RD->GetOnFlyStatus())
return nullptr;
809 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx);
810 const auto dV0Radius(TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]));
813 const auto dDausDCA(pV0RD->DcaV0Daughters());
if (dDausDCA>
fCutMaxDausDCA)
return nullptr;
814 const auto dPosDCAtoPV(pV0RD->DcaPosToPrimVertex());
if (dPosDCAtoPV<
fCutMinDauDCAtoPV)
return nullptr;
815 const auto dNegDCAtoPV(pV0RD->DcaNegToPrimVertex());
if (dNegDCAtoPV<
fCutMinDauDCAtoPV)
return nullptr;
818 auto pDauPosRD(static_cast<AliAODTrack*>(pV0RD->GetDaughter(0)));
if (!pDauPosRD)
return nullptr;
819 auto pDauNegRD(static_cast<AliAODTrack*>(pV0RD->GetDaughter(1)));
if (!pDauNegRD)
return nullptr;
821 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
822 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
824 if ((pDauPosRD->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return nullptr;
825 if ((pDauNegRD->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return nullptr;
827 const auto dPosXrowsTPC(pDauPosRD->GetTPCClusterInfo(2,1));
828 const auto dNegXrowsTPC(pDauNegRD->GetTPCClusterInfo(2,1));
829 const auto dDauXrowsTPC(dPosXrowsTPC<dNegXrowsTPC ? dPosXrowsTPC : dNegXrowsTPC);
832 const auto wPosTPCNClsF(pDauPosRD->GetTPCNclsF());
if (wPosTPCNClsF<=0)
return nullptr;
833 const auto wNegTPCNClsF(pDauNegRD->GetTPCNclsF());
if (wNegTPCNClsF<=0)
return nullptr;
834 const auto dPosXrowsOverFindableClusTPC( ((
Double_t)dPosXrowsTPC) / ((
Double_t)wPosTPCNClsF) );
835 const auto dNegXrowsOverFindableClusTPC( ((
Double_t)dNegXrowsTPC) / ((
Double_t)wNegTPCNClsF) );
837 const auto dDauXrowsOverFindableClusTPC(dPosXrowsOverFindableClusTPC<dNegXrowsOverFindableClusTPC ?
838 dPosXrowsOverFindableClusTPC :
839 dNegXrowsOverFindableClusTPC);
843 const auto nPosCharge(pDauPosRD->Charge());
844 const auto nNegCharge(pDauNegRD->Charge());
845 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return nullptr;
847 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
848 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
849 if ((nPosCharge<0) && (nNegCharge>0)) {
850 pDauPosRD = (AliAODTrack*)pV0RD->GetDaughter(1);
851 pDauNegRD = (AliAODTrack*)pV0RD->GetDaughter(0);
853 dPosPxPyPz[0] = pV0RD->MomNegX(); dPosPxPyPz[1] = pV0RD->MomNegY(); dPosPxPyPz[2] = pV0RD->MomNegZ();
854 dNegPxPyPz[0] = pV0RD->MomPosX(); dNegPxPyPz[1] = pV0RD->MomPosY(); dNegPxPyPz[2] = pV0RD->MomPosZ();
856 dPosPxPyPz[0] = pV0RD->MomPosX(); dPosPxPyPz[1] = pV0RD->MomPosY(); dPosPxPyPz[2] = pV0RD->MomPosZ();
857 dNegPxPyPz[0] = pV0RD->MomNegX(); dNegPxPyPz[1] = pV0RD->MomNegY(); dNegPxPyPz[2] = pV0RD->MomNegZ();
860 const TVector3 v3Pos(dPosPxPyPz);
861 const TVector3 v3Neg(dNegPxPyPz);
867 const auto inp(TMath::Abs(pDauPosRD->GetLabel()));
if (inp<0)
return nullptr;
868 auto pDauPosMC(static_cast<AliAODMCParticle*>(MCEvent()->GetTrack(inp)));
if (!pDauPosMC)
return nullptr;
869 const auto imp(pDauPosMC->GetMother());
if (imp<0)
return nullptr;
871 const auto inn(TMath::Abs(pDauNegRD->GetLabel()));
if (inn<0)
return nullptr;
872 const auto pDauNegMC(static_cast<AliAODMCParticle*>(MCEvent()->GetTrack(inn)));
if (!pDauNegMC)
return nullptr;
873 const auto imn(pDauNegMC->GetMother());
if (imn<0)
return nullptr;
875 if (imp != imn)
return nullptr;
876 const auto pV0MC(static_cast<AliAODMCParticle*>(MCEvent()->GetTrack(imp)));
if (!pV0MC)
return nullptr;
879 const auto idvMC(pV0MC->GetPdgCode());
880 const auto idp(pDauPosMC->GetPdgCode());
881 const auto idn(pDauNegMC->GetPdgCode());
882 auto bIsKshort((idp==211) && (idn==-211) && (idvMC== 310));
883 auto bIsLambda((idp==2212) && (idn==-211) && (idvMC== 3122));
884 auto bIsAntiLa((idp==211) && (idn==-2212) && (idvMC==-3122));
885 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
899 if (bIsLambda || bIsAntiLa) {
900 const auto imv(pV0MC->GetMother());
903 const auto pMother(static_cast<AliAODMCParticle*>(MCEvent()->GetTrack(imv)));
906 idmMC = pMother->GetPdgCode();
907 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
908 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
909 dMotherPt = pMother->Pt();
910 dMotherEta = pMother->Eta();
911 dMotherRap = pMother->Y();
923 const auto dV0CosPA(pV0RD->CosPointingAngle(
fPrimaryVtx));
934 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
937 auto dV0DistToPV(0.);
939 const auto dV0DistToPVoverP(TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10));
950 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
953 const auto dV0ArmFrac(pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12));
964 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
972 const auto dKshortInvM((vPosPion+vNegPion).M());
973 if ((dKshortInvM<(0.430006-0.0110029*dV0Pt)) ||
974 (dKshortInvM>(0.563707+0.0114979*dV0Pt)))
return nullptr;
990 const auto dLambdaInvM((vPosProton+vNegPion).M());
991 if ((dLambdaInvM<(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt))) ||
992 (dLambdaInvM>(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt))))
return nullptr;
1006 const auto dAntiLaInvM((vNegProton+vPosPion).M());
1007 if ((dAntiLaInvM<(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt))) ||
1008 (dAntiLaInvM>(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt))))
return nullptr;
1019 auto bPosInJC(kFALSE);
1020 auto bNegInJC(kFALSE);
1029 dDauXrowsOverFindableClusTPC,
1030 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
1031 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
1033 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->E(),
1034 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap));
1044 const auto pStack(MCEvent()->Stack());
if (!pStack)
return nullptr;
1047 if (pV0RD->GetOnFlyStatus())
return nullptr;
1053 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx[0], dV0Vtx[1], dV0Vtx[2]);
1054 const auto dV0Radius(TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]));
1057 const auto dDausDCA(pV0RD->GetDcaV0Daughters());
if (dDausDCA>
fCutMaxDausDCA)
return nullptr;
1060 const auto nPosIndex(TMath::Abs(pV0RD->GetPindex()));
if (nPosIndex<0)
return nullptr;
1061 const auto nNegIndex(TMath::Abs(pV0RD->GetNindex()));
if (nNegIndex<0)
return nullptr;
1063 auto pDauPosRD(
fEventESD->GetTrack(nPosIndex));
if (!pDauPosRD)
return nullptr;
1064 auto pDauNegRD(
fEventESD->GetTrack(nNegIndex));
if (!pDauNegRD)
return nullptr;
1066 const auto dMegField(
fEventESD->GetMagneticField());
1074 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
1075 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit))
return nullptr;
1076 if ((pDauPosRD->GetKinkIndex(0)>0) || (pDauNegRD->GetKinkIndex(0)>0))
return nullptr;
1078 const auto dPosXrowsTPC(pDauPosRD->GetTPCClusterInfo(2,1));
1079 const auto dNegXrowsTPC(pDauNegRD->GetTPCClusterInfo(2,1));
1080 const auto dDauXrowsTPC((dPosXrowsTPC<dNegXrowsTPC) ? dPosXrowsTPC : dNegXrowsTPC);
1083 const auto wPosTPCNClsF(pDauPosRD->GetTPCNclsF());
if (wPosTPCNClsF<=0)
return nullptr;
1084 const auto wNegTPCNClsF(pDauNegRD->GetTPCNclsF());
if (wNegTPCNClsF<=0)
return nullptr;
1085 const auto dPosXrowsOverFindableClusTPC( ((
Double_t)dPosXrowsTPC) / ((
Double_t)wPosTPCNClsF) );
1086 const auto dNegXrowsOverFindableClusTPC( ((
Double_t)dNegXrowsTPC) / ((
Double_t)wNegTPCNClsF) );
1088 const auto dDauXrowsOverFindableClusTPC((dPosXrowsOverFindableClusTPC<dNegXrowsOverFindableClusTPC) ?
1089 dPosXrowsOverFindableClusTPC :
1090 dNegXrowsOverFindableClusTPC);
1094 const auto nPosCharge(pDauPosRD->Charge());
1095 const auto nNegCharge(pDauNegRD->Charge());
1096 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return nullptr;
1098 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
1099 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
1100 if ((nPosCharge<0) && (nNegCharge>0)) {
1101 pDauPosRD =
fEventESD->GetTrack(nNegIndex);
1102 pDauNegRD =
fEventESD->GetTrack(nPosIndex);
1104 pV0RD->GetNPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
1105 pV0RD->GetPPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
1107 pV0RD->GetPPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
1108 pV0RD->GetNPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
1111 const TVector3 v3Pos(dPosPxPyPz);
1112 const TVector3 v3Neg(dNegPxPyPz);
1118 AliMCParticle *pDauTmpMC(
nullptr);
1119 const auto inp(TMath::Abs(pDauPosRD->GetLabel()));
if (inp<0)
return nullptr;
1120 pDauTmpMC =
static_cast<AliMCParticle*
>(MCEvent()->GetTrack(inp));
if (!pDauTmpMC)
return nullptr;
1121 const auto pDauPosMC(pDauTmpMC->Particle());
if (!pDauPosMC)
return nullptr;
1122 const auto imp(pDauPosMC->GetFirstMother());
if (imp<0)
return nullptr;
1124 const auto inn(TMath::Abs(pDauNegRD->GetLabel()));
if (inn<0)
return nullptr;
1125 pDauTmpMC =
static_cast<AliMCParticle*
>(MCEvent()->GetTrack(inn));
if (!pDauTmpMC)
return nullptr;
1126 const auto pDauNegMC(pDauTmpMC->Particle());
if (!pDauNegMC)
return nullptr;
1127 const auto imn(pDauNegMC->GetFirstMother());
if (imn<0)
return nullptr;
1129 if (imp != imn)
return nullptr;
1130 pDauTmpMC =
static_cast<AliMCParticle*
>(MCEvent()->GetTrack(imp));
if (!pDauTmpMC)
return nullptr;
1131 const auto pV0MC(pDauTmpMC->Particle());
if (!pV0MC)
return nullptr;
1134 const auto idvMC(pV0MC->GetPdgCode());
1135 const auto idp(pDauPosMC->GetPdgCode());
1136 const auto idn(pDauNegMC->GetPdgCode());
1137 auto bIsKshort((idp==211) && (idn==-211) && (idvMC== 310));
1138 auto bIsLambda((idp==2212) && (idn==-211) && (idvMC== 3122));
1139 auto bIsAntiLa((idp==211) && (idn==-2212) && (idvMC==-3122));
1140 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
1152 auto dMotherEta(0.);
1153 auto dMotherRap(0.);
1154 if (bIsLambda || bIsAntiLa) {
1155 const auto imv(pV0MC->GetFirstMother());
1158 pDauTmpMC =
static_cast<AliMCParticle*
>(MCEvent()->GetTrack(imv));
1161 auto pMother(pDauTmpMC->Particle());
1164 idmMC = pMother->GetPdgCode();
1165 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
1166 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
1167 dMotherPt = pMother->Pt();
1168 dMotherEta = pMother->Eta();
1169 dMotherRap = pMother->Y();
1193 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
1196 auto dV0DistToPV(0.);
1198 const auto dV0DistToPVoverP(TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10));
1209 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
1212 const auto dV0ArmFrac(pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12));
1223 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return nullptr;
1231 const auto dKshortInvM((vPosPion+vNegPion).M());
1232 if ((dKshortInvM<(0.430006 - 0.0110029*dV0Pt)) ||
1233 (dKshortInvM>(0.563707 + 0.0114979*dV0Pt)))
return nullptr;
1249 const auto dLambdaInvM((vPosProton+vNegPion).M());
1250 if ((dLambdaInvM<(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt))) ||
1251 (dLambdaInvM>(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt))))
return nullptr;
1265 const auto dAntiLaInvM((vNegProton+vPosPion).M());
1266 if ((dAntiLaInvM<(1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt))) ||
1267 (dAntiLaInvM>(1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt))))
return nullptr;
1278 auto bPosInJC(kFALSE);
1279 auto bNegInJC(kFALSE);
1288 dDauXrowsOverFindableClusTPC,
1289 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
1290 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
1292 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->Energy(),
1293 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap));
1304 if (!InputEvent())
return kTRUE;
1305 if (!fInputHandler)
return kTRUE;
1312 fRespoPID = fInputHandler->GetPIDResponse();
1318 if (MCEvent()->GetNumberOfTracks()<=0)
return kTRUE;
1323 const auto pHeader(MCEvent()->Header());
if (!pHeader)
return kTRUE;
1326 const auto pDPMjetH(dynamic_cast<AliGenDPMjetEventHeader*>(pHeader->GenEventHeader()));
1329 auto nd0(0), nd1(0), nd2(0);
1330 pDPMjetH->GetNDiffractive(nd1, nd2, nd0);
1331 if ((nd1+nd2) != (pDPMjetH->ProjectileParticipants() + pDPMjetH->TargetParticipants()))
return kTRUE;
1343 auto pCentSel(InputEvent()->GetCentrality());
1345 if (pCentSel->GetQuality()!=0)
return kFALSE;
1348 TObjString *ps(
nullptr);
1349 const auto next(
fMultEsti.MakeIterator());
1350 while ((ps = static_cast<TObjString*>((*next)()))) {
1351 const auto s(ps->String());
1353 if (p) p->SetVal(pCentSel->GetCentralityPercentile(s.Data()));
1359 auto pMultSel(static_cast<AliMultSelection*>(InputEvent()->FindListObject(
"MultSelection")));
1363 TObjString *ps(
nullptr);
1364 const auto next(
fMultEsti.MakeIterator());
1365 while (((ps = static_cast<TObjString*>((*next)())))) {
1366 const auto s(ps->String());
1368 if (p) p->SetVal(pMultSel->GetMultiplicityPercentile(s.Data()));
1381 const UInt_t wMask(fInputHandler->IsEventSelected());
1383 if (
fIsSkipFastOnly)
if ((wMask & AliVEvent::kFastOnly) == AliVEvent::kFastOnly)
return kFALSE;
1388 const auto pVertex(InputEvent()->GetPrimaryVertex());
1389 if (!pVertex)
return kFALSE;
1393 auto pUtils(
new AliAnalysisUtils());
1394 if (!pUtils->IsVertexSelected2013pA(InputEvent()))
return kFALSE;
1395 if (pUtils->IsSPDClusterVsTrackletBG(InputEvent()))
return kFALSE;
1396 if (pUtils->IsPileUpEvent(InputEvent()))
return kFALSE;
1400 if (pUtils->IsFirstEventInChunk(InputEvent()))
return kFALSE;
1456 AliV0vertexer aV0vtxer;
1457 aV0vtxer.SetDefaultCuts(dCuts);
1499 const auto h(static_cast<TH1D*>(
fOutputListEH->FindObject(
"hEventCheck")));
1518 AliStack *pStack(
nullptr);
1521 pStack = MCEvent()->Stack();
if (!pStack)
return;
1522 nPrimary = pStack->GetNprimary();
1528 auto hsV0(static_cast<THnSparseD*>(
fOutputListMC->FindObject(
"hsV0")));
1529 auto hsXi(static_cast<THnSparseD*>(
fOutputListMC->FindObject(
"hsXi")));
1531 if (!(hsV0 && hsXi)) {
1532 AliFatal(
"Cannot find hsV0 or hsXi; should not happen");
1537 for (
auto i=0; i<MCEvent()->GetNumberOfTracks(); ++i) {
1538 TParticle *pESD(
nullptr);
1539 AliAODMCParticle *pAOD(
nullptr);
1542 pAOD =
static_cast<AliAODMCParticle*
>(MCEvent()->GetTrack(i));
1543 if (!pAOD)
continue;
1547 const auto pMC(static_cast<AliMCParticle*>(MCEvent()->GetTrack(i)));
if (!pMC)
continue;
1548 pESD = pMC->Particle();
if (!pESD)
continue;
1552 const auto bPri(pAOD ? pAOD->IsPrimary() : (i<nPrimary));
1553 const auto bPhy(pAOD ? pAOD->IsPhysicalPrimary() : pStack->IsPhysicalPrimary(i));
1554 if (!(bPri || bPhy))
continue;
1557 const auto id(pAOD ? pAOD->GetPdgCode() : pESD->GetPdgCode());
1559 const auto bXi(bPri && ((
id==3312) || (
id==-3312)));
1560 const auto bV0(bPhy && ((
id==3122) || (
id==-3122) || (
id==310)));
1561 if (!(bXi || bV0))
continue;
1564 const auto dEta(pAOD ? pAOD->Eta() : pESD->Eta());
1565 if ((dEta<-5.) || (dEta>=5.))
continue;
1567 const auto dRapLab(pAOD ? pAOD->Y() : pESD->Y());
1568 if ((dRapLab<-5.) || (dRapLab>=5.))
continue;
1571 if ((dRapCMS<-5.) || (dRapCMS>=5.))
continue;
1575 dVar[0] = (pAOD ? pAOD->Pt() : pESD->Pt());
1583 TObjString *ps(
nullptr);
1584 const auto next(
fMultEsti.MakeIterator());
1585 while ((ps = static_cast<TObjString*>((*next)()))) {
1586 const auto s(ps->String());
1588 if (p) dVar[l++] = p->GetVal();
1592 if (
id== 310 ) dVar[5] = 0.;
1593 if (
id== 3122) dVar[5] = 1.;
1594 if (
id==-3122) dVar[5] = 2.;
1599 if (
id== 3312) dVar[5] = 0.;
1600 if (
id==-3312) dVar[5] = 1.;
1616 const auto b(TH1::AddDirectoryStatus());
1617 TH1::AddDirectory(kFALSE);
1632 while ((h = static_cast<TH1*>(next()))) h->Sumw2();
1634 TH1::AddDirectory(b);
1645 const auto b(TH1::AddDirectoryStatus());
1646 TH1::AddDirectory(kFALSE);
1664 const Int_t nBin[nr] = { 1000, 100, 100, 100, 2 };
1665 const Double_t dMin[nr] = { 0., -5., -5., -5., 0. };
1666 const Double_t dMax[nr] = { 100., 5., 5., 5., 2. };
1667 const auto ns(1 + nr +
fMultEsti.GetEntries());
1670 Int_t nV0Bin[ns], nXiBin[ns];
1674 for (
auto i=0; i<ns; ++i) {
1676 nV0Bin[i] = nXiBin[i] = nBin[i];
1677 dV0Min[i] = dXiMin[i] = dMin[i];
1678 dV0Max[i] = dXiMax[i] = dMax[i];
1682 nV0Bin[i] = 3; dV0Min[i] = -0.5; dV0Max[i] = 2.5;
1683 nXiBin[i] = 2; dXiMin[i] = -0.5; dXiMax[i] = 1.5;
1687 nV0Bin[i] = nXiBin[i] = 110;
1688 dV0Min[i] = dXiMin[i] = -5.;
1689 dV0Max[i] = dXiMax[i] = 105.;
1694 const TString sa[nr+1] {
"pT",
"eta",
"y_lab",
"y_cms",
"evt_t",
"par_t" };
1695 fOutputListMC->Add(
new THnSparseD(
"hsV0",
"", ns, nV0Bin, dV0Min, dV0Max));
1696 fOutputListMC->Add(
new THnSparseD(
"hsXi",
"", ns, nXiBin, dXiMin, dXiMax));
1698 TObjString *ps(
nullptr);
1699 THnSparseD *hs(
nullptr);
1701 const auto pn(
fMultEsti.MakeIterator());
1702 while ((hs = static_cast<THnSparseD*>(next()))) {
1703 for (
auto i=0; i<nr; ++i) hs->GetAxis(i)->SetName(sa[i].
Data());
1706 while ((ps = static_cast<TObjString*>((*pn)()))) {
1707 const auto s(ps->String());
1708 const auto p(hs->GetAxis(l++));
1709 if (p) p->SetName(s.Data());
1714 TH1::AddDirectory(b);
Double_t fCutMinLambdaDeletaM
void FillLambdaPtInvM(TH2D *const h, Double_t const *dCuts=nullptr) const
Double_t fCutMaxLambdaCtau
AliPIDResponse * fRespoPID
Double_t fCutMinDauXrowsOverFindableClusTPC
void CreateHistogramsMC()
void FillKshortPtInvM(TH2D *const h, Double_t const *dCuts=nullptr) const
void CreateHistogramsEH()
Double_t fCutMaxLambdaArmFrac
Double_t fCutMinLambdaCosPA
virtual void UserCreateOutputObjects()
Double_t fCutMinDauDCAtoPV
Double_t fCutMaxKshortCtau
Float_t fCutMaxKshortSigmaTPC
virtual void Terminate(Option_t *opt)
void FillAntiLaPtInvM(TH2D *const h, Double_t const *dCuts=nullptr) const
Double_t fCutMinKshortDeltaM
AliPicoV0MC * SelectV0CandidateMC(AliAODv0 const *pV0)
virtual void UserExec(Option_t *opt)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Double_t fCutMinKshortCosPA
Float_t fCutMaxLambdaSigmaTPC
TClonesArray * fPicoV0sClArr
virtual ~AliAnalysisTaskSEPicoV0Maker()
AliAnalysisTaskSEPicoV0Maker()
AliPicoV0RD * SelectV0CandidateRD(AliAODv0 const *pV0)
Float_t fCutMinDauXrowsTPC
Double_t fCutMaxKshortArmFrac