Skip to content

Commit e8e958d

Browse files
authored
[PWGCF] FemtoUniverse: Add pair fractions for V0V0 pairs (#10720)
1 parent 458b27e commit e8e958d

File tree

1 file changed

+88
-21
lines changed

1 file changed

+88
-21
lines changed

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx

Lines changed: 88 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "Framework/O2DatabasePDGPlugin.h"
3232
#include <TFile.h>
3333
#include <TH1.h>
34+
#include <TPDGCode.h>
3435

3536
using namespace o2;
3637
using namespace o2::soa;
@@ -503,7 +504,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
503504
/// Histogramming same event
504505
for (const auto& part : groupPartsTwo) {
505506
int pdgCode = static_cast<int>(part.pidCut());
506-
if ((confV0Type1 == 0 && pdgCode != 3122) || (confV0Type1 == 1 && pdgCode != -3122))
507+
if ((confV0Type1 == 0 && pdgCode != kLambda0) || (confV0Type1 == 1 && pdgCode != kLambda0Bar))
507508
continue;
508509
trackHistoPartTwo.fillQA<false, true>(part);
509510
}
@@ -529,7 +530,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
529530
if (static_cast<int>(p1.pidCut()) != confTrkPDGCodePartOne)
530531
continue;
531532
int pdgCode2 = static_cast<int>(p2.pidCut());
532-
if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122))
533+
if ((confV0Type1 == 0 && pdgCode2 != kLambda0) || (confV0Type1 == 1 && pdgCode2 != kLambda0Bar))
533534
continue;
534535
// track cleaning
535536
if (confIsCPR.value) {
@@ -556,14 +557,14 @@ struct FemtoUniversePairTaskTrackV0Extended {
556557
const auto& posChild = parts.iteratorAt(part.index() - 2);
557558
const auto& negChild = parts.iteratorAt(part.index() - 1);
558559
int pdgCode = static_cast<int>(part.pidCut());
559-
if ((confV0Type1 == 0 && pdgCode == 3122) || (confV0Type1 == 1 && pdgCode == -3122)) {
560+
if ((confV0Type1 == 0 && pdgCode == kLambda0) || (confV0Type1 == 1 && pdgCode == kLambda0Bar)) {
560561
trackHistoV0Type1.fillQABase<false, true>(part, HIST("V0Type1"));
561562
posChildV0Type1.fillQABase<false, true>(posChild, HIST("posChildV0Type1"));
562563
negChildV0Type1.fillQABase<false, true>(negChild, HIST("negChildV0Type1"));
563564
qaRegistry.fill(HIST("V0Type1/hInvMassLambdaVsCent"), multCol, part.mLambda());
564565
qaRegistry.fill(HIST("V0Type1/hInvMassAntiLambdaVsCent"), multCol, part.mAntiLambda());
565566
}
566-
if ((confV0Type2 == 0 && pdgCode == 3122) || (confV0Type2 == 1 && pdgCode == -3122)) {
567+
if ((confV0Type2 == 0 && pdgCode == kLambda0) || (confV0Type2 == 1 && pdgCode == kLambda0Bar)) {
567568
trackHistoV0Type2.fillQABase<false, true>(part, HIST("V0Type2"));
568569
posChildV0Type2.fillQABase<false, true>(posChild, HIST("posChildV0Type2"));
569570
negChildV0Type2.fillQABase<false, true>(negChild, HIST("negChildV0Type2"));
@@ -574,10 +575,10 @@ struct FemtoUniversePairTaskTrackV0Extended {
574575

575576
auto pairProcessFunc = [&](auto& p1, auto& p2) -> void {
576577
int pdgCode1 = static_cast<int>(p1.pidCut());
577-
if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122))
578+
if ((confV0Type1 == 0 && pdgCode1 != kLambda0) || (confV0Type1 == 1 && pdgCode1 != kLambda0Bar))
578579
return;
579580
int pdgCode2 = static_cast<int>(p2.pidCut());
580-
if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122))
581+
if ((confV0Type2 == 0 && pdgCode2 != kLambda0) || (confV0Type2 == 1 && pdgCode2 != kLambda0Bar))
581582
return;
582583
sameEventCont.setPair<false>(p1, p2, multCol, confUse3D);
583584
};
@@ -782,7 +783,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
782783
if (static_cast<int>(p1.pidCut()) != confTrkPDGCodePartOne)
783784
continue;
784785
int pdgCode2 = static_cast<int>(p2.pidCut());
785-
if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122))
786+
if ((confV0Type1 == 0 && pdgCode2 != kLambda0) || (confV0Type1 == 1 && pdgCode2 != kLambda0Bar))
786787
continue;
787788
if (confIsCPR.value) {
788789
if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femto_universe_container::EventType::mixed)) {
@@ -822,10 +823,10 @@ struct FemtoUniversePairTaskTrackV0Extended {
822823

823824
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
824825
int pdgCode1 = static_cast<int>(p1.pidCut());
825-
if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122))
826+
if ((confV0Type1 == 0 && pdgCode1 != kLambda0) || (confV0Type1 == 1 && pdgCode1 != kLambda0Bar))
826827
continue;
827828
int pdgCode2 = static_cast<int>(p2.pidCut());
828-
if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122))
829+
if ((confV0Type2 == 0 && pdgCode2 != kLambda0) || (confV0Type2 == 1 && pdgCode2 != kLambda0Bar))
829830
continue;
830831
mixedEventCont.setPair<false>(p1, p2, multCol, confUse3D);
831832
}
@@ -845,6 +846,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
845846
}
846847

847848
PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCMixedEventV0, "Enable processing mixed events for MC truth V0 - V0", false);
849+
848850
///--------------------------------------------MC-------------------------------------------------///
849851

850852
/// This function fills MC truth particles from derived MC table
@@ -860,34 +862,34 @@ struct FemtoUniversePairTaskTrackV0Extended {
860862
continue;
861863
}
862864

863-
if (pdgCode == 3122) {
865+
if (pdgCode == kLambda0) {
864866
registryMCtruth.fill(HIST("plus/MCtruthLambda"), part.pt(), part.eta());
865867
continue;
866-
} else if (pdgCode == -3122) {
868+
} else if (pdgCode == kLambda0Bar) {
867869
registryMCtruth.fill(HIST("minus/MCtruthLambda"), part.pt(), part.eta());
868870
continue;
869871
}
870872

871873
if (pdgParticle->Charge() > 0.0) {
872874
registryMCtruth.fill(HIST("plus/MCtruthAllPt"), part.pt());
873875
}
874-
if (pdgCode == 211) {
876+
if (pdgCode == kPiPlus) {
875877
registryMCtruth.fill(HIST("plus/MCtruthPi"), part.pt(), part.eta());
876878
registryMCtruth.fill(HIST("plus/MCtruthPiPt"), part.pt());
877879
}
878-
if (pdgCode == 2212) {
880+
if (pdgCode == kProton) {
879881
registryMCtruth.fill(HIST("plus/MCtruthPr"), part.pt(), part.eta());
880882
registryMCtruth.fill(HIST("plus/MCtruthPrPt"), part.pt());
881883
}
882884

883885
if (pdgParticle->Charge() < 0.0) {
884886
registryMCtruth.fill(HIST("minus/MCtruthAllPt"), part.pt());
885887
}
886-
if (pdgCode == -211) {
888+
if (pdgCode == kPiMinus) {
887889
registryMCtruth.fill(HIST("minus/MCtruthPi"), part.pt(), part.eta());
888890
registryMCtruth.fill(HIST("minus/MCtruthPiPt"), part.pt());
889891
}
890-
if (pdgCode == -2212) {
892+
if (pdgCode == kProtonBar) {
891893
registryMCtruth.fill(HIST("minus/MCtruthPr"), part.pt(), part.eta());
892894
registryMCtruth.fill(HIST("minus/MCtruthPrPt"), part.pt());
893895
}
@@ -946,6 +948,71 @@ struct FemtoUniversePairTaskTrackV0Extended {
946948
}
947949
PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processPairFractions, "Process MC data to obtain pair fractions", false);
948950

951+
void processPairFractionsV0(FilteredFDCollisions const& cols, FemtoRecoParticles const& parts)
952+
{
953+
954+
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultNtr> colBinningMult{{confVtxBins, confMultBins}, true};
955+
ColumnBinningPolicy<aod::collision::PosZ, aod::femtouniversecollision::MultV0M> colBinningCent{{confVtxBins, confMultBins}, true};
956+
957+
auto mixedCollProcessFunc = [&](auto& collision1, auto& collision2) -> void {
958+
auto groupPartsOne = partsTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache);
959+
auto groupPartsTwo = partsTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache);
960+
961+
const auto& magFieldTesla1 = collision1.magField();
962+
const auto& magFieldTesla2 = collision2.magField();
963+
964+
if (magFieldTesla1 != magFieldTesla2) {
965+
return;
966+
}
967+
968+
for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) {
969+
// Lambda invariant mass cut for p1
970+
if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) {
971+
continue;
972+
}
973+
// Lambda invariant mass cut for p2
974+
if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) {
975+
continue;
976+
}
977+
978+
const auto& posChild1 = parts.iteratorAt(p1.globalIndex() - 2);
979+
const auto& negChild1 = parts.iteratorAt(p1.globalIndex() - 1);
980+
/// Daughters that do not pass this condition are not selected
981+
if (!isParticleTPC(posChild1, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild1, V0ChildTable[confV0Type1][1]))
982+
continue;
983+
984+
const auto& posChild2 = parts.iteratorAt(p2.globalIndex() - 2);
985+
const auto& negChild2 = parts.iteratorAt(p2.globalIndex() - 1);
986+
/// Daughters that do not pass this condition are not selected
987+
if (!isParticleTPC(posChild2, V0ChildTable[confV0Type2][0]) || !isParticleTPC(negChild2, V0ChildTable[confV0Type2][1]))
988+
continue;
989+
990+
// track cleaning
991+
if (!pairCleanerV0.isCleanPair(p1, p2, parts)) {
992+
continue;
993+
}
994+
if (confIsCPR.value) {
995+
if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla1, femto_universe_container::EventType::mixed)) {
996+
continue;
997+
}
998+
}
999+
1000+
registryMCreco.fill(HIST("motherParticle"), p1.motherPDG(), p2.motherPDG());
1001+
}
1002+
};
1003+
1004+
if (confUseCent) {
1005+
for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) {
1006+
mixedCollProcessFunc(collision1, collision2);
1007+
}
1008+
} else {
1009+
for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, confNEventsMix, -1, cols, cols)) {
1010+
mixedCollProcessFunc(collision1, collision2);
1011+
}
1012+
}
1013+
}
1014+
PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processPairFractionsV0, "Process MC data to obtain pair fractions for V0V0 pairs", false);
1015+
9491016
void processMCReco(FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts)
9501017
{
9511018
for (const auto& part : parts) {
@@ -955,7 +1022,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
9551022
const auto& mcpart = mcparts.iteratorAt(mcPartId);
9561023
//
9571024
if (part.partType() == aod::femtouniverseparticle::ParticleType::kV0) {
958-
if (mcpart.pdgMCTruth() == 3122) {
1025+
if (mcpart.pdgMCTruth() == kLambda0) {
9591026
const auto& posChild = parts.iteratorAt(part.globalIndex() - 2);
9601027
const auto& negChild = parts.iteratorAt(part.globalIndex() - 1);
9611028
/// Daughters that do not pass this condition are not selected
@@ -970,7 +1037,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
9701037
registryMCreco.fill(HIST("plus/MCrecoLambdaChildPi"), mcpartChild.pt(), mcpartChild.eta()); // lambda pion child
9711038
}
9721039
}
973-
} else if (mcpart.pdgMCTruth() == -3122) {
1040+
} else if (mcpart.pdgMCTruth() == kLambda0Bar) {
9741041
const auto& posChild = parts.iteratorAt(part.globalIndex() - 2);
9751042
const auto& negChild = parts.iteratorAt(part.globalIndex() - 1);
9761043
/// Daughters that do not pass this condition are not selected
@@ -989,21 +1056,21 @@ struct FemtoUniversePairTaskTrackV0Extended {
9891056
} else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) {
9901057
if (part.sign() > 0) {
9911058
registryMCreco.fill(HIST("plus/MCrecoAllPt"), mcpart.pt());
992-
if (mcpart.pdgMCTruth() == 211 && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePi()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePi()))) {
1059+
if (mcpart.pdgMCTruth() == kPiPlus && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePi()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePi()))) {
9931060
registryMCreco.fill(HIST("plus/MCrecoPi"), mcpart.pt(), mcpart.eta());
9941061
registryMCreco.fill(HIST("plus/MCrecoPiPt"), mcpart.pt());
995-
} else if (mcpart.pdgMCTruth() == 2212 && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr()))) {
1062+
} else if (mcpart.pdgMCTruth() == kProton && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr()))) {
9961063
registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta());
9971064
registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt());
9981065
}
9991066
}
10001067

10011068
if (part.sign() < 0) {
10021069
registryMCreco.fill(HIST("minus/MCrecoAllPt"), mcpart.pt());
1003-
if (mcpart.pdgMCTruth() == -211 && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePi()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePi()))) {
1070+
if (mcpart.pdgMCTruth() == kPiMinus && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePi()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePi()))) {
10041071
registryMCreco.fill(HIST("minus/MCrecoPi"), mcpart.pt(), mcpart.eta());
10051072
registryMCreco.fill(HIST("minus/MCrecoPiPt"), mcpart.pt());
1006-
} else if (mcpart.pdgMCTruth() == -2212 && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr()))) {
1073+
} else if (mcpart.pdgMCTruth() == kProtonBar && isNSigmaCombined(part.p(), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr()))) {
10071074
registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta());
10081075
registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt());
10091076
}

0 commit comments

Comments
 (0)