29 #include <THnSparse.h>
31 #include <TClonesArray.h>
32 #include <TDatabasePDG.h>
33 #include <TParticle.h>
35 #include "AliAODEvent.h"
36 #include "AliESDEvent.h"
37 #include "AliMCEvent.h"
39 #include "AliVVertex.h"
42 #include "AliAODTrack.h"
43 #include "AliESDtrack.h"
45 #include "AliMCParticle.h"
46 #include "AliAODMCParticle.h"
47 #include "AliHeader.h"
48 #include "AliGenDPMjetEventHeader.h"
49 #include "AliV0vertexer.h"
50 #include "AliAnalysisUtils.h"
51 #include "AliInputEventHandler.h"
52 #include "AliCentrality.h"
53 #include "AliPIDResponse.h"
81 fIsRefitV0sESD(kFALSE),
82 fIsSkipFastOnly(kFALSE),
85 fCutMinEventVtxContr(0),
86 fCutMaxEventVzAbs(0.),
98 fCutMinDauDCAtoPV(0.),
99 fCutMinDauXrowsTPC(0.),
100 fCutMinDauXrowsOverFindableClusTPC(0.),
101 fCutMaxKshortSigmaTPC(0.),
102 fCutMinKshortCosPA(0.),
103 fCutMaxKshortCtau(0.),
104 fCutMaxKshortArmFrac(0.),
105 fCutMinKshortDeltaM(0.),
106 fCutMaxLambdaSigmaTPC(0.),
107 fCutMinLambdaCosPA(0.),
108 fCutMaxLambdaCtau(0.),
109 fCutMaxLambdaArmFrac(0.),
110 fCutMinLambdaDeletaM(0.),
119 for (
Int_t i=3; i--;) fPrimaryVtx[i] = 0.;
135 fIsRefitV0sESD(kFALSE),
136 fIsSkipFastOnly(kFALSE),
139 fCutMinEventVtxContr(2),
140 fCutMaxEventVzAbs(10.),
149 fCutMinV0Radius(0.3),
150 fCutMaxV0Radius(200.),
152 fCutMinDauDCAtoPV(0.05),
153 fCutMinDauXrowsTPC(70.),
154 fCutMinDauXrowsOverFindableClusTPC(0.8),
155 fCutMaxKshortSigmaTPC(-1.),
156 fCutMinKshortCosPA(0.95),
157 fCutMaxKshortCtau(30.),
158 fCutMaxKshortArmFrac(-1.),
159 fCutMinKshortDeltaM(0.003),
160 fCutMaxLambdaSigmaTPC(7.),
161 fCutMinLambdaCosPA(0.993),
162 fCutMaxLambdaCtau(40.),
163 fCutMaxLambdaArmFrac(-1.),
164 fCutMinLambdaDeletaM(-1.),
175 DefineOutput(1, TList::Class());
251 if (!(InputEvent()->FindListObject(
"PicoV0s"))) InputEvent()->AddObject(
fPicoV0sClArr);
294 AliAODv0 *pV0AOD = 0;
295 AliESDv0 *pV0ESD = 0;
311 for (
Int_t iV0=0; iV0<nV0s; iV0++) {
314 pV0AOD =
fEventAOD->GetV0(iV0);
if (!pV0AOD)
continue;
324 pV0ESD =
fEventESD->GetV0(iV0);
if (!pV0ESD)
continue;
338 delete pV0RD; pV0RD=0;
346 delete pV0MC; pV0MC=0;
349 if (pV0AOD) pV0AOD=0;
350 if (pV0ESD) pV0ESD=0;
363 if (pV0->GetOnFlyStatus())
return 0x0;
372 Double_t dV0Vtx[3]; pV0->GetXYZ(dV0Vtx);
373 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
381 AliAODTrack *pDauPos = (AliAODTrack*)pV0->GetDaughter(0);
if (!pDauPos)
return 0x0;
382 AliAODTrack *pDauNeg = (AliAODTrack*)pV0->GetDaughter(1);
if (!pDauNeg)
return 0x0;
384 if (!(pDauPos->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
385 if (!(pDauNeg->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
387 if ((pDauPos->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return 0x0;
388 if ((pDauNeg->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return 0x0;
390 Float_t dPosXrowsTPC = pDauPos->GetTPCClusterInfo(2,1);
391 Float_t dNegXrowsTPC = pDauNeg->GetTPCClusterInfo(2,1);
392 Float_t dDauXrowsTPC = dPosXrowsTPC;
if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
395 UShort_t wPosTPCNClsF = pDauPos->GetTPCNclsF();
if (wPosTPCNClsF<=0)
return 0x0;
396 UShort_t wNegTPCNClsF = pDauNeg->GetTPCNclsF();
if (wNegTPCNClsF<=0)
return 0x0;
400 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
401 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
405 Short_t nPosCharge = pDauPos->Charge();
406 Short_t nNegCharge = pDauNeg->Charge();
407 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return 0x0;
409 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
410 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
411 if ((nPosCharge<0) && (nNegCharge>0)) {
412 pDauPos = (AliAODTrack*)pV0->GetDaughter(1);
413 pDauNeg = (AliAODTrack*)pV0->GetDaughter(0);
415 dPosPxPyPz[0] = pV0->MomNegX(); dPosPxPyPz[1] = pV0->MomNegY(); dPosPxPyPz[2] = pV0->MomNegZ();
416 dNegPxPyPz[0] = pV0->MomPosX(); dNegPxPyPz[1] = pV0->MomPosY(); dNegPxPyPz[2] = pV0->MomPosZ();
418 dPosPxPyPz[0] = pV0->MomPosX(); dPosPxPyPz[1] = pV0->MomPosY(); dPosPxPyPz[2] = pV0->MomPosZ();
419 dNegPxPyPz[0] = pV0->MomNegX(); dNegPxPyPz[1] = pV0->MomNegY(); dNegPxPyPz[2] = pV0->MomNegZ();
422 TVector3 v3Pos(dPosPxPyPz);
423 TVector3 v3Neg(dNegPxPyPz);
430 Bool_t bIsKshort = kFALSE;
431 Bool_t bIsLambda = kFALSE;
432 Bool_t bIsAntiLa = kFALSE;
434 Float_t dPosPionSigmaTPC =
fRespoPID->NumberOfSigmasTPC(pDauPos,AliPID::kPion);
435 Float_t dNegPionSigmaTPC =
fRespoPID->NumberOfSigmasTPC(pDauNeg,AliPID::kPion);
458 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
472 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
477 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0->P()+1e-10);
488 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
491 Double_t dV0ArmFrac = pV0->PtArmV0() / (TMath::Abs(pV0->AlphaV0())+1e-12);
502 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
505 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
506 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
508 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
509 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
511 TLorentzVector vKshort = vPosPion + vNegPion;
512 TLorentzVector vLamvda = vPosProton + vNegPion;
513 TLorentzVector vAntiLa = vNegProton + vPosPion;
520 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
521 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
523 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper)) bIsKshort = kFALSE;
526 if (bIsLambda || bIsAntiLa) {
527 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
528 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
530 if (bIsLambda)
if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) bIsLambda = kFALSE;
531 if (bIsAntiLa)
if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) bIsAntiLa = kFALSE;
534 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
549 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
582 dDauXrowsOverFindableClusTPC,
583 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
584 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
586 dPosPionSigmaTPC, dPosProtonSigmaTPC,
587 dNegPionSigmaTPC, dNegProtonSigmaTPC);
599 if (pV0->GetOnFlyStatus())
return 0x0;
608 Double_t dV0Vtx[3]; pV0->GetXYZ(dV0Vtx[0], dV0Vtx[1], dV0Vtx[2]);
609 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
615 Int_t nPosIndex = pV0->GetPindex();
if (nPosIndex<0)
return 0x0;
616 Int_t nNegIndex = pV0->GetNindex();
if (nNegIndex<0)
return 0x0;
618 AliESDtrack *pDauPos =
fEventESD->GetTrack(nPosIndex);
if (!pDauPos)
return 0x0;
619 AliESDtrack *pDauNeg =
fEventESD->GetTrack(nNegIndex);
if (!pDauNeg)
return 0x0;
626 if (!(pDauPos->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
627 if (!(pDauNeg->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
628 if ((pDauPos->GetKinkIndex(0)>0) || (pDauNeg->GetKinkIndex(0)>0))
return 0x0;
630 Float_t dPosXrowsTPC = pDauPos->GetTPCClusterInfo(2,1);
631 Float_t dNegXrowsTPC = pDauNeg->GetTPCClusterInfo(2,1);
632 Float_t dDauXrowsTPC = dPosXrowsTPC;
if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
635 UShort_t wPosTPCNClsF = pDauPos->GetTPCNclsF();
if (wPosTPCNClsF<=0)
return 0x0;
636 UShort_t wNegTPCNClsF = pDauNeg->GetTPCNclsF();
if (wNegTPCNClsF<=0)
return 0x0;
640 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
641 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
645 Short_t nPosCharge = pDauPos->Charge();
646 Short_t nNegCharge = pDauNeg->Charge();
647 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return 0x0;
649 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
650 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
651 if ((nPosCharge<0) && (nNegCharge>0)) {
652 pDauPos =
fEventESD->GetTrack(nNegIndex);
653 pDauNeg =
fEventESD->GetTrack(nPosIndex);
655 pV0->GetNPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
656 pV0->GetPPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
658 pV0->GetPPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
659 pV0->GetNPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
662 TVector3 v3Pos(dPosPxPyPz);
663 TVector3 v3Neg(dNegPxPyPz);
670 Bool_t bIsKshort = kFALSE;
671 Bool_t bIsLambda = kFALSE;
672 Bool_t bIsAntiLa = kFALSE;
674 Float_t dPosPionSigmaTPC =
fRespoPID->NumberOfSigmasTPC(pDauPos,AliPID::kPion);
675 Float_t dNegPionSigmaTPC =
fRespoPID->NumberOfSigmasTPC(pDauNeg,AliPID::kPion);
698 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
712 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
717 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0->P()+1e-10);
728 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
731 Double_t dV0ArmFrac = pV0->PtArmV0() / (TMath::Abs(pV0->AlphaV0())+1e-12);
742 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
745 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
746 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
748 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
749 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
751 TLorentzVector vKshort = vPosPion + vNegPion;
752 TLorentzVector vLamvda = vPosProton + vNegPion;
753 TLorentzVector vAntiLa = vNegProton + vPosPion;
760 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
761 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
763 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper)) bIsKshort = kFALSE;
766 if (bIsLambda || bIsAntiLa) {
767 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
768 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
770 if (bIsLambda)
if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) bIsLambda = kFALSE;
771 if (bIsAntiLa)
if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) bIsAntiLa = kFALSE;
774 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
791 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
809 dDauXrowsOverFindableClusTPC,
810 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
811 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
813 dPosPionSigmaTPC, dPosProtonSigmaTPC,
814 dNegPionSigmaTPC, dNegProtonSigmaTPC);
826 if (pV0RD->GetOnFlyStatus())
return 0x0;
832 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx);
833 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
841 AliAODTrack *pDauPosRD = (AliAODTrack*)pV0RD->GetDaughter(0);
if (!pDauPosRD)
return 0x0;
842 AliAODTrack *pDauNegRD = (AliAODTrack*)pV0RD->GetDaughter(1);
if (!pDauNegRD)
return 0x0;
844 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
845 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
847 if ((pDauPosRD->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return 0x0;
848 if ((pDauNegRD->GetProdVertex()->GetType())==((
Char_t)AliAODVertex::kKink))
return 0x0;
850 Float_t dPosXrowsTPC = pDauPosRD->GetTPCClusterInfo(2,1);
851 Float_t dNegXrowsTPC = pDauNegRD->GetTPCClusterInfo(2,1);
852 Float_t dDauXrowsTPC = dPosXrowsTPC;
if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
855 UShort_t wPosTPCNClsF = pDauPosRD->GetTPCNclsF();
if (wPosTPCNClsF<=0)
return 0x0;
856 UShort_t wNegTPCNClsF = pDauNegRD->GetTPCNclsF();
if (wNegTPCNClsF<=0)
return 0x0;
860 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
861 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
865 Short_t nPosCharge = pDauPosRD->Charge();
866 Short_t nNegCharge = pDauNegRD->Charge();
867 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return 0x0;
869 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
870 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
871 if ((nPosCharge<0) && (nNegCharge>0)) {
872 pDauPosRD = (AliAODTrack*)pV0RD->GetDaughter(1);
873 pDauNegRD = (AliAODTrack*)pV0RD->GetDaughter(0);
875 dPosPxPyPz[0] = pV0RD->MomNegX(); dPosPxPyPz[1] = pV0RD->MomNegY(); dPosPxPyPz[2] = pV0RD->MomNegZ();
876 dNegPxPyPz[0] = pV0RD->MomPosX(); dNegPxPyPz[1] = pV0RD->MomPosY(); dNegPxPyPz[2] = pV0RD->MomPosZ();
878 dPosPxPyPz[0] = pV0RD->MomPosX(); dPosPxPyPz[1] = pV0RD->MomPosY(); dPosPxPyPz[2] = pV0RD->MomPosZ();
879 dNegPxPyPz[0] = pV0RD->MomNegX(); dNegPxPyPz[1] = pV0RD->MomNegY(); dNegPxPyPz[2] = pV0RD->MomNegZ();
882 TVector3 v3Pos(dPosPxPyPz);
883 TVector3 v3Neg(dNegPxPyPz);
890 Int_t inp = TMath::Abs(pDauPosRD->GetLabel());
if (inp<0)
return 0x0;
891 Int_t inn = TMath::Abs(pDauNegRD->GetLabel());
if (inn<0)
return 0x0;
892 AliAODMCParticle *pDauPosMC = (AliAODMCParticle*)MCEvent()->GetTrack(inp);
if (!pDauPosMC)
return 0x0;
893 AliAODMCParticle *pDauNegMC = (AliAODMCParticle*)MCEvent()->GetTrack(inn);
if (!pDauNegMC)
return 0x0;
895 Int_t imp = pDauPosMC->GetMother();
if (imp<0)
return 0x0;
896 Int_t imn = pDauNegMC->GetMother();
if (imn<0)
return 0x0;
897 if (imp != imn)
return 0x0;
899 AliAODMCParticle *pV0MC = (AliAODMCParticle*)MCEvent()->GetTrack(imp);
if (!pV0MC)
return 0x0;
902 Int_t idvMC = pV0MC->GetPdgCode();
903 Int_t idp = pDauPosMC->GetPdgCode();
904 Int_t idn = pDauNegMC->GetPdgCode();
905 Bool_t bIsKshort = ((idp==211) && (idn==-211) && (idvMC== 310));
906 Bool_t bIsLambda = ((idp==2212) && (idn==-211) && (idvMC== 3122));
907 Bool_t bIsAntiLa = ((idp==211) && (idn==-2212) && (idvMC==-3122));
908 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
922 if (bIsLambda || bIsAntiLa) {
923 Int_t imv = pV0MC->GetMother();
if (imv>=0) {
924 AliAODMCParticle *pMother = (AliAODMCParticle*)MCEvent()->GetTrack(imv);
927 idmMC = pMother->GetPdgCode();
928 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
929 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
930 dMotherPt = pMother->Pt();
931 dMotherEta = pMother->Eta();
932 dMotherRap = pMother->Y();
955 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
960 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10);
971 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
974 Double_t dV0ArmFrac = pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12);
985 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
990 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
991 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
992 TLorentzVector vKshort = vPosPion + vNegPion;
995 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
996 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
997 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper))
return 0x0;
1000 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
1001 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
1003 TLorentzVector vLamvda = vPosProton + vNegPion;
1004 TLorentzVector vAntiLa = vNegProton + vPosPion;
1006 Double_t dLambdaInvM = vLamvda.M();
1007 Double_t dAntiLaInvM = vAntiLa.M();
1016 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
1017 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
1018 TLorentzVector vLamvda = vPosProton + vNegPion;
1020 Double_t dLambdaInvM = vLamvda.M();
1021 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
1022 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
1023 if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper))
return 0x0;
1026 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
1027 TLorentzVector vKshort = vPosPion + vNegPion;
1029 Double_t dKshortInvM = vKshort.M();
1037 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
1038 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
1039 TLorentzVector vAntiLa = vNegProton + vPosPion;
1041 Double_t dAntiLaInvM = vAntiLa.M();
1042 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
1043 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
1044 if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper))
return 0x0;
1047 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
1048 TLorentzVector vKshort = vPosPion + vNegPion;
1050 Double_t dKshortInvM = vKshort.M();
1058 Bool_t bPosInJC = kFALSE;
1059 Bool_t bNegInJC = kFALSE;
1068 dDauXrowsOverFindableClusTPC,
1069 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
1070 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
1072 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->E(),
1073 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap);
1086 AliStack *pStack = MCEvent()->Stack();
if (!pStack)
return 0x0;
1087 Int_t nPrimary = pStack->GetNprimary();
1090 if (pV0RD->GetOnFlyStatus())
return 0x0;
1096 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx[0], dV0Vtx[1], dV0Vtx[2]);
1097 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
1103 Int_t nPosIndex = TMath::Abs(pV0RD->GetPindex());
if (nPosIndex<0)
return 0x0;
1104 Int_t nNegIndex = TMath::Abs(pV0RD->GetNindex());
if (nNegIndex<0)
return 0x0;
1106 AliESDtrack *pDauPosRD =
fEventESD->GetTrack(nPosIndex);
if (!pDauPosRD)
return 0x0;
1107 AliESDtrack *pDauNegRD =
fEventESD->GetTrack(nNegIndex);
if (!pDauNegRD)
return 0x0;
1114 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
1115 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit))
return 0x0;
1116 if ((pDauPosRD->GetKinkIndex(0)>0) || (pDauNegRD->GetKinkIndex(0)>0))
return 0x0;
1118 Float_t dPosXrowsTPC = pDauPosRD->GetTPCClusterInfo(2,1);
1119 Float_t dNegXrowsTPC = pDauNegRD->GetTPCClusterInfo(2,1);
1120 Float_t dDauXrowsTPC = dPosXrowsTPC;
if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
1123 UShort_t wPosTPCNClsF = pDauPosRD->GetTPCNclsF();
if (wPosTPCNClsF<=0)
return 0x0;
1124 UShort_t wNegTPCNClsF = pDauNegRD->GetTPCNclsF();
if (wNegTPCNClsF<=0)
return 0x0;
1128 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
1129 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
1133 Short_t nPosCharge = pDauPosRD->Charge();
1134 Short_t nNegCharge = pDauNegRD->Charge();
1135 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge))
return 0x0;
1137 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
1138 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
1139 if ((nPosCharge<0) && (nNegCharge>0)) {
1140 pDauPosRD =
fEventESD->GetTrack(nNegIndex);
1141 pDauNegRD =
fEventESD->GetTrack(nPosIndex);
1143 pV0RD->GetNPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
1144 pV0RD->GetPPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
1146 pV0RD->GetPPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
1147 pV0RD->GetNPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
1150 TVector3 v3Pos(dPosPxPyPz);
1151 TVector3 v3Neg(dNegPxPyPz);
1158 Int_t inp = TMath::Abs(pDauPosRD->GetLabel());
if (inp<0)
return 0x0;
1159 Int_t inn = TMath::Abs(pDauNegRD->GetLabel());
if (inn<0)
return 0x0;
1160 TParticle *pDauPosMC = ((AliMCParticle*)MCEvent()->GetTrack(inp))->Particle();
if (!pDauPosMC)
return 0x0;
1161 TParticle *pDauNegMC = ((AliMCParticle*)MCEvent()->GetTrack(inn))->Particle();
if (!pDauNegMC)
return 0x0;
1163 Int_t imp = pDauPosMC->GetFirstMother();
if (imp<0)
return 0x0;
1164 Int_t imn = pDauNegMC->GetFirstMother();
if (imn<0)
return 0x0;
1165 if (imp != imn)
return 0x0;
1167 TParticle *pV0MC = ((AliMCParticle*)MCEvent()->GetTrack(imp))->Particle();
if (!pV0MC)
return 0x0;
1170 Int_t idvMC = pV0MC->GetPdgCode();
1171 Int_t idp = pDauPosMC->GetPdgCode();
1172 Int_t idn = pDauNegMC->GetPdgCode();
1173 Bool_t bIsKshort = ((idp==211) && (idn==-211) && (idvMC== 310));
1174 Bool_t bIsLambda = ((idp==2212) && (idn==-211) && (idvMC== 3122));
1175 Bool_t bIsAntiLa = ((idp==211) && (idn==-2212) && (idvMC==-3122));
1176 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
1190 if (bIsLambda || bIsAntiLa) {
1191 Int_t imv = pV0MC->GetFirstMother();
if (imv>=0) {
1192 TParticle *pMother = ((AliMCParticle*)MCEvent()->GetTrack(imv))->Particle();
1195 idmMC = pMother->GetPdgCode();
1196 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
1197 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
1198 dMotherPt = pMother->Pt();
1199 dMotherEta = pMother->Eta();
1200 dMotherRap = pMother->Y();
1223 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
1228 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10);
1239 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
1242 Double_t dV0ArmFrac = pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12);
1253 if (!(bIsKshort || bIsLambda || bIsAntiLa))
return 0x0;
1259 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
1260 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
1261 TLorentzVector vKshort = vPosPion + vNegPion;
1263 Double_t dKshortInvM = vKshort.M();
1264 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
1265 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
1266 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper))
return 0x0;
1269 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
1270 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
1272 TLorentzVector vLamvda = vPosProton + vNegPion;
1273 TLorentzVector vAntiLa = vNegProton + vPosPion;
1275 Double_t dLambdaInvM = vLamvda.M();
1276 Double_t dAntiLaInvM = vAntiLa.M();
1285 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos,
fgkMassProton);
1286 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
1287 TLorentzVector vLamvda = vPosProton + vNegPion;
1289 Double_t dLambdaInvM = vLamvda.M();
1290 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
1291 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
1292 if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper))
return 0x0;
1295 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
1296 TLorentzVector vKshort = vPosPion + vNegPion;
1298 Double_t dKshortInvM = vKshort.M();
1306 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg,
fgkMassProton);
1307 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos,
fgkMassPion);
1308 TLorentzVector vAntiLa = vNegProton + vPosPion;
1310 Double_t dAntiLaInvM = vAntiLa.M();
1311 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
1312 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
1313 if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper))
return 0x0;
1316 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg,
fgkMassPion);
1317 TLorentzVector vKshort = vPosPion + vNegPion;
1319 Double_t dKshortInvM = vKshort.M();
1327 Bool_t bPosInJC = kFALSE;
1328 Bool_t bNegInJC = kFALSE;
1337 dDauXrowsOverFindableClusTPC,
1338 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
1339 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
1341 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->Energy(),
1342 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap);
1360 fCentInfo = InputEvent()->GetCentrality();
1368 fRespoPID = fInputHandler->GetPIDResponse();
1373 if (MCEvent()->GetNumberOfTracks()<=0)
return (
fEventAcptMask==0);
1376 AliHeader *pHeader = MCEvent()->Header();
if (!pHeader)
return (
fEventAcptMask==0);
1379 AliGenDPMjetEventHeader *pDPMjetH =
dynamic_cast<AliGenDPMjetEventHeader*
>(pHeader->GenEventHeader());
1382 Int_t nd0=0, nd1=0, nd2=0; pDPMjetH->GetNDiffractive(nd1, nd2, nd0);
1383 if ((nd1+nd2) != (pDPMjetH->ProjectileParticipants() + pDPMjetH->TargetParticipants()))
return (
fEventAcptMask==0);
1401 UInt_t wMask = fInputHandler->IsEventSelected();
1408 const AliVVertex *pVertex = InputEvent()->GetPrimaryVertex();
if (!pVertex)
return (
fEventAcptMask==0);
1448 if ((!(pVtxPri->GetStatus())) && (!(pVtxSPD->GetStatus())) && (!(pVtxTrk->GetStatus())))
return (
fEventAcptMask==0);
1474 AliV0vertexer aV0vtxer;
1475 aV0vtxer.SetDefaultCuts(dCuts);
1569 AliStack *pStack = 0;
1572 pStack = MCEvent()->Stack();
if (!pStack)
return;
1573 nPrimary = pStack->GetNprimary();
1585 THnSparseD *hsV0 =
dynamic_cast<THnSparseD*
>(
fOutputListMC->FindObject(
"hsV0"));
1586 THnSparseD *hsXi =
dynamic_cast<THnSparseD*
>(
fOutputListMC->FindObject(
"hsXi"));
1588 if (hsV0 == 0 || hsXi == 0) {
1589 AliFatal(
"Cannot find hsV0 or hsXi; should not happen");
1594 TParticle *pESD = 0;
1595 AliAODMCParticle *pAOD = 0;
1596 for (
Int_t i=0; i<MCEvent()->GetNumberOfTracks(); i++) {
1597 if (
fEventAOD) { pAOD = (AliAODMCParticle*)MCEvent()->GetTrack(i);
if (!pAOD)
continue; }
1598 if (
fEventESD) { pESD = ((AliMCParticle*)MCEvent()->GetTrack(i))->Particle();
if (!pESD)
continue; }
1601 if (pAOD) bPri = pAOD->IsPrimary();
1602 if (pESD) bPri = (i<nPrimary);
1605 if (pAOD) bPhy = pAOD->IsPhysicalPrimary();
1606 if (pESD) bPhy = pStack->IsPhysicalPrimary(i);
1607 if ((!bPri) && (!bPhy)) { pAOD=0; pESD=0;
continue; }
1610 if (pAOD)
id = pAOD->GetPdgCode();
1611 if (pESD)
id = pESD->GetPdgCode();
1613 Bool_t bXi = (bPri && ((
id==3312) || (
id==-3312)));
1614 Bool_t bV0 = (bPhy && ((
id==3122) || (
id==-3122) || (
id==310)));
1615 if (!(bXi || bV0)) { pAOD=0; pESD=0;
continue; }
1618 if (pAOD) dEta = pAOD->Eta();
1619 if (pESD) dEta = pESD->Eta();
1620 if ((dEta<-5.) || (dEta>=5.)) { pAOD=0; pESD=0;
continue; }
1623 if (pAOD) dRapLab = pAOD->Y();
1624 if (pESD) dRapLab = pESD->Y();
1625 if ((dRapLab<-5.) || (dRapLab>=5.)) { pAOD=0; pESD=0;
continue; }
1628 if ((dRapCMS<-5.) || (dRapCMS>=5.)) { pAOD=0; pESD=0;
continue; }
1631 if (pAOD) dVar[9] = pAOD->Pt();
1632 if (pESD) dVar[9] = pESD->Pt();
1644 if (
id== 3312) dVar[0] = -0.5;
1645 if (
id==-3312) dVar[0] = 0.5;
1650 if (
id== 310 ) dVar[0] = 0.;
1651 if (
id== 3122) dVar[0] = 1.;
1652 if (
id==-3122) dVar[0] = 2.;
1670 Bool_t bStatusTmpH = TH1::AddDirectoryStatus();
1671 TH1::AddDirectory(kFALSE);
1675 h1 =
new TH1D(
"hEventAccCheck_V0M",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1676 h1 =
new TH1D(
"hEventAccCheck_V0A",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1677 h1 =
new TH1D(
"hEventAccCheck_CL1",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1678 h1 =
new TH1D(
"hEventAccCheck_ZNA",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1680 h1 =
new TH1D(
"hEventAccMult_V0M",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1681 h1 =
new TH1D(
"hEventAccMult_V0A",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1682 h1 =
new TH1D(
"hEventAccMult_CL1",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1683 h1 =
new TH1D(
"hEventAccMult_ZNA",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1685 h1 =
new TH1D(
"hEventAccTrigger_V0M",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1686 h1 =
new TH1D(
"hEventAccTrigger_V0A",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1687 h1 =
new TH1D(
"hEventAccTrigger_CL1",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1688 h1 =
new TH1D(
"hEventAccTrigger_ZNA",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1690 h1 =
new TH1D(
"hEventAccVertex_V0M",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1691 h1 =
new TH1D(
"hEventAccVertex_V0A",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1692 h1 =
new TH1D(
"hEventAccVertex_CL1",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1693 h1 =
new TH1D(
"hEventAccVertex_ZNA",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1695 h1 =
new TH1D(
"hEventAccPileup_V0M",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1696 h1 =
new TH1D(
"hEventAccPileup_V0A",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1697 h1 =
new TH1D(
"hEventAccPileup_CL1",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1698 h1 =
new TH1D(
"hEventAccPileup_ZNA",
"", 210, -10., 200.); h1->Sumw2();
fOutputListEH->Add(h1);
1711 TH1::AddDirectory(bStatusTmpH);
1724 Bool_t bStatusTmpH = TH1::AddDirectoryStatus();
1725 TH1::AddDirectory(kFALSE);
1727 const Int_t nV0 = 10;
1742 const Int_t nV0Bin[nV0] = { 3, 2, 210, 210, 210, 210, 100, 100, 100, 1000 };
1743 const Double_t dV0Min[nV0] = { -0.5, -1., -10., -10., -10., -10., -5., -5., -5., 0. };
1744 const Double_t dV0Max[nV0] = { 2.5, 1., 200., 200., 200., 200., 5., 5., 5., 100. };
1745 THnSparseD *hsV0 =
new THnSparseD(
"hsV0",
"", nV0, nV0Bin, dV0Min, dV0Max);
fOutputListMC->Add(hsV0);
1748 const Int_t nXi = 10;
1762 const Int_t nXiBin[nV0] = { 2, 2, 210, 210, 210, 210, 100, 100, 100, 1000 };
1763 const Double_t dXiMin[nV0] = { -1., -1., -10., -10., -10., -10., -5., -5., -5., 0. };
1764 const Double_t dXiMax[nV0] = { 1., 1., 200., 200., 200., 200., 5., 5., 5., 100. };
1765 THnSparseD *hsXi =
new THnSparseD(
"hsXi",
"", nXi, nXiBin, dXiMin, dXiMax);
fOutputListMC->Add(hsXi);
1767 TH1::AddDirectory(bStatusTmpH);
Double_t fCutMinLambdaDeletaM
Int_t fCutMinEventVtxContr
Double_t fCutMaxLambdaCtau
AliPIDResponse * fRespoPID
Double_t fCutMinDauXrowsOverFindableClusTPC
void CreateHistogramsMC()
void FillAntiLaPtInvM(TH2D *h)
void CreateHistogramsEH()
Double_t fCutMaxLambdaArmFrac
Double_t fCutMinLambdaCosPA
virtual void UserCreateOutputObjects()
Double_t fCutMinDauDCAtoPV
AliCentrality * fCentInfo
Double_t fCutMaxKshortCtau
Float_t fCutMaxKshortSigmaTPC
AliAnalysisUtils * fAnaUtils
static const Double_t fgkMassPion
virtual void Terminate(Option_t *opt)
Double_t fCutMinKshortDeltaM
AliPicoV0MC * SelectV0CandidateMC(AliAODv0 const *pV0)
virtual void UserExec(Option_t *opt)
Float_t fCutMaxEventVzAbs
Double_t fCutMinKshortCosPA
Float_t fCutMaxLambdaSigmaTPC
TClonesArray * fPicoV0sClArr
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void FillLambdaPtInvM(TH2D *h)
virtual ~AliAnalysisTaskSEPicoV0Maker()
static const Double_t fgkMassKshort
static const Double_t fgkMassProton
void FillKshortPtInvM(TH2D *h)
static const Double_t fgkMassLambda
AliAnalysisTaskSEPicoV0Maker()
AliPicoV0RD * SelectV0CandidateRD(AliAODv0 const *pV0)
Float_t fCutMinDauXrowsTPC
Double_t fCutMaxKshortArmFrac