Skip to content

Commit 1720f18

Browse files
Nils314Nils Konert
andauthored
[PWGCF] Added function for KStar-K0S selection (#14536)
Co-authored-by: Nils Konert <ge87lel@nidoking.ktas.ph.tum.de>
1 parent 3426721 commit 1720f18

File tree

1 file changed

+202
-1
lines changed

1 file changed

+202
-1
lines changed

PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

Lines changed: 202 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ struct FemtoDreamProducerTaskForSpecificAnalysis {
855855

856856
bool v0ChildFulfillsPID = !confCheckV0PIDcutLegacy ||
857857
((femtoParticle.pidcut() & confV0ParticleType1TPCBitLegacy) == confV0ParticleType1TPCBitLegacy) ||
858-
((femtoParticle.pidcut() & confV0ParticleType1TPCBitLegacy) == confV0ParticleType1TPCBitLegacy);
858+
((femtoParticle.pidcut() & confV0ParticleType2TPCBitLegacy) == confV0ParticleType2TPCBitLegacy);
859859

860860
if ((aod::femtodreamparticle::ParticleType::kV0Child == femtoParticle.partType()) && v0ChildFulfillsPID) {
861861
std::vector<int> childIDs;
@@ -907,6 +907,207 @@ struct FemtoDreamProducerTaskForSpecificAnalysis {
907907
createSpecifiedDerivedDataK0ShortKStarLegacy<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
908908
}
909909
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStarLegacy, "Enable producing data with pp collisions for data K0Short-KStar with kV0Child/KResoChild daughter types", false);
910+
911+
template <bool isMC, typename PartitionType, typename PartType>
912+
void createSpecifiedDerivedDataK0ShortKStarFromMothers(const o2::aod::FDCollision& col, PartitionType groupSelectedV0s, PartitionType groupSelectedResos, PartType parts)
913+
{
914+
// check v0's
915+
int v0Count = 0;
916+
int antiV0Count = 0;
917+
int resoCount = 0; // no antiparticles
918+
919+
for (const auto& V0 : groupSelectedV0s) {
920+
if ((V0.mLambda() > confMinInvMassV0) && (V0.mLambda() < confMaxInvMassV0)) {
921+
if (confRequireBitmask) {
922+
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
923+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
924+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
925+
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
926+
(posChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0 &&
927+
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
928+
(negChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0)) {
929+
v0Count++;
930+
}
931+
}
932+
} else {
933+
v0Count++;
934+
}
935+
} else if ((V0.mAntiLambda() > confMinInvMassAntiV0) && (V0.mAntiLambda() < confMaxInvMassAntiV0)) {
936+
if (confRequireBitmask) {
937+
if (ncheckbit(V0.cut(), confCutV0SameForAntipart)) {
938+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
939+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
940+
if (((posChild.cut() & confChildPosCutV0) == confChildPosCutV0 &&
941+
(posChild.pidcut() & confChildNegTPCBitV0) == confChildNegTPCBitV0 && // exchanged values because checking antiparticle daughters and pid of particles exchange
942+
(negChild.cut() & confChildNegCutV0) == confChildNegCutV0 &&
943+
(negChild.pidcut() & confChildPosTPCBitV0) == confChildPosTPCBitV0)) { // exchanged values because checking antiparticle daughters and pid of particles exchange
944+
antiV0Count++;
945+
}
946+
}
947+
} else {
948+
antiV0Count++;
949+
}
950+
}
951+
}
952+
953+
for (const auto& reso : groupSelectedResos) {
954+
if (confRequireBitmask) {
955+
956+
const auto& posresoChild = parts.iteratorAt(reso.index() - 2);
957+
const auto& negresoChild = parts.iteratorAt(reso.index() - 1);
958+
959+
if (((posresoChild.cut() & Reso.daughPosCutBit) == Reso.daughPosCutBit) &&
960+
((negresoChild.cut() & Reso.daughNegCutBit) == Reso.daughNegCutBit)) {
961+
962+
resoCount++;
963+
}
964+
} else {
965+
resoCount++;
966+
}
967+
}
968+
969+
std::vector<int> tmpIDtrack;
970+
971+
if ((v0Count >= confNumberOfV0 && resoCount >= confNumberOfReso) || (antiV0Count >= confNumberOfV0 && resoCount >= confNumberOfReso)) {
972+
eventRegistry.fill(HIST("hStatistiscs"), 1);
973+
outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField());
974+
975+
for (const auto& femtoParticle : parts) {
976+
977+
if ((femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTPC)) ||
978+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTPC_NegdaughTOF)) ||
979+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTPC)) ||
980+
(femtoParticle.partType() == uint8_t(aod::femtodreamparticle::kResoKStarPosdaughTOF_NegdaughTOF))) {
981+
982+
const auto& posresoChild = parts.iteratorAt(femtoParticle.index() - 2);
983+
const auto& negresoChild = parts.iteratorAt(femtoParticle.index() - 1);
984+
985+
// fill positive child
986+
std::vector<int> childIDsPos;
987+
const auto& childrenPos = posresoChild.childrenIds();
988+
childIDsPos.push_back(childrenPos[0]);
989+
childIDsPos.push_back(childrenPos[1]);
990+
outputParts(outputCollision.lastIndex(),
991+
posresoChild.pt(),
992+
posresoChild.eta(),
993+
posresoChild.phi(),
994+
posresoChild.partType(),
995+
posresoChild.cut(),
996+
posresoChild.pidcut(),
997+
posresoChild.tempFitVar(),
998+
childIDsPos,
999+
posresoChild.mLambda(),
1000+
posresoChild.mAntiLambda());
1001+
1002+
// fill negative child
1003+
std::vector<int> childIDsNeg;
1004+
const auto& childrenNeg = negresoChild.childrenIds();
1005+
childIDsNeg.push_back(childrenNeg[0]);
1006+
childIDsNeg.push_back(childrenNeg[1]);
1007+
outputParts(outputCollision.lastIndex(),
1008+
negresoChild.pt(),
1009+
negresoChild.eta(),
1010+
negresoChild.phi(),
1011+
negresoChild.partType(),
1012+
negresoChild.cut(),
1013+
negresoChild.pidcut(),
1014+
negresoChild.tempFitVar(),
1015+
childIDsNeg,
1016+
negresoChild.mLambda(),
1017+
negresoChild.mAntiLambda());
1018+
1019+
// fill mother
1020+
std::vector<int> childIDs;
1021+
const auto& children = femtoParticle.childrenIds();
1022+
childIDs.push_back(children[0]);
1023+
childIDs.push_back(children[1]);
1024+
outputParts(outputCollision.lastIndex(),
1025+
femtoParticle.pt(),
1026+
femtoParticle.eta(),
1027+
femtoParticle.phi(),
1028+
femtoParticle.partType(),
1029+
femtoParticle.cut(),
1030+
femtoParticle.pidcut(),
1031+
femtoParticle.tempFitVar(),
1032+
childIDs,
1033+
femtoParticle.mLambda(),
1034+
femtoParticle.mAntiLambda());
1035+
}
1036+
1037+
if (aod::femtodreamparticle::ParticleType::kV0K0Short == femtoParticle.partType()) {
1038+
1039+
const auto& posV0Child = parts.iteratorAt(femtoParticle.index() - 2);
1040+
const auto& negV0Child = parts.iteratorAt(femtoParticle.index() - 1);
1041+
1042+
// fill positive child
1043+
std::vector<int> childIDsPos;
1044+
const auto& childrenPos = posV0Child.childrenIds();
1045+
childIDsPos.push_back(childrenPos[0]);
1046+
childIDsPos.push_back(childrenPos[1]);
1047+
1048+
outputParts(outputCollision.lastIndex(),
1049+
posV0Child.pt(),
1050+
posV0Child.eta(),
1051+
posV0Child.phi(),
1052+
posV0Child.partType(),
1053+
posV0Child.cut(),
1054+
posV0Child.pidcut(),
1055+
posV0Child.tempFitVar(),
1056+
childIDsPos,
1057+
posV0Child.mLambda(),
1058+
posV0Child.mAntiLambda());
1059+
1060+
// fill negative child
1061+
std::vector<int> childIDsNeg;
1062+
const auto& childrenNeg = negV0Child.childrenIds();
1063+
childIDsNeg.push_back(childrenNeg[0]);
1064+
childIDsNeg.push_back(childrenNeg[1]);
1065+
1066+
outputParts(outputCollision.lastIndex(),
1067+
negV0Child.pt(),
1068+
negV0Child.eta(),
1069+
negV0Child.phi(),
1070+
negV0Child.partType(),
1071+
negV0Child.cut(),
1072+
negV0Child.pidcut(),
1073+
negV0Child.tempFitVar(),
1074+
childIDsNeg,
1075+
negV0Child.mLambda(),
1076+
negV0Child.mAntiLambda());
1077+
1078+
// fill mother
1079+
std::vector<int> childIDs;
1080+
const auto& children = femtoParticle.childrenIds();
1081+
childIDs.push_back(children[0]);
1082+
childIDs.push_back(children[1]);
1083+
outputParts(outputCollision.lastIndex(),
1084+
femtoParticle.pt(),
1085+
femtoParticle.eta(),
1086+
femtoParticle.phi(),
1087+
femtoParticle.partType(),
1088+
femtoParticle.cut(),
1089+
femtoParticle.pidcut(),
1090+
femtoParticle.tempFitVar(),
1091+
childIDs,
1092+
femtoParticle.mLambda(),
1093+
femtoParticle.mAntiLambda());
1094+
}
1095+
}
1096+
} else {
1097+
eventRegistry.fill(HIST("hStatistiscs"), 2);
1098+
}
1099+
}
1100+
1101+
void createSpecifiedDerivedDataNK0ShortNKStarFromMothers(const o2::aod::FDCollision& col,
1102+
const o2::aod::FDParticles& parts)
1103+
{
1104+
eventRegistry.fill(HIST("hStatistiscs"), 0);
1105+
auto thegroupSelectedResos = selectedKStar->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
1106+
auto thegroupSelectedV0s = selectedK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache);
1107+
1108+
createSpecifiedDerivedDataK0ShortKStarFromMothers<false>(col, thegroupSelectedV0s, thegroupSelectedResos, parts);
1109+
}
1110+
PROCESS_SWITCH(FemtoDreamProducerTaskForSpecificAnalysis, createSpecifiedDerivedDataNK0ShortNKStarFromMothers, "Enable producing data with pp collisions for data K0Short-KStar just from mother particle types", false);
9101111
};
9111112

9121113
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)